Today when I was debugging a program, I found that when a function return value was assigned to a variable, the variable value always displayed "not in scope" and I could not see the value assigned to the variable.
The reason for this is that the local variable is not allocated to memory, or the variable is optimized by the compiler.
When the compiler optimization level is high, the compiler may not assemble the code we want to execute for optimization.
Solution: Reduce Keil's compilation optimization options, as shown in the figure below, and change the optimization level to 0 (the default is 3).
Previous article:Keil accurately measures code execution time
Next article:The meaning of RO-data, RW-data, and ZI-data in Keil
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Friends who are familiar with the MSP430 series of microcontrollers, please take a look (Beijing)
- How many of you guys are engaged in the FPGA industry?
- Implementation of Embedded RTOS on MSP430 MCU
- ADC parameter group delay time
- 【Beetle ESP32-C3】IX. OLED clock and weather assistant logic description (Arduino)
- 【ST NUCLEO-H743ZI Review】USB MSC Function Test
- WiFi indoor positioning technology and its evolution that has triggered the Internet of Things application
- Help: Does anyone have a power supply design that complies with industry design standards IEC61010, IEC60950?
- [Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] + Development Board Firmware Upgrade
- Assembly Language (4th Edition)