Solution to the problem of displaying "not in scope" when debugging local variables in Keil

Publisher:科技先锋Latest update time:2019-04-18 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    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).


Reference address:Solution to the problem of displaying "not in scope" when debugging local variables in Keil

Previous article:Keil accurately measures code execution time
Next article:The meaning of RO-data, RW-data, and ZI-data in Keil

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号