Hi, I am a new user of Keil C compiler. During debug, I am trying to watch struct data members. But all of them show 0x0000. And they are not updated. With other variables it's just working fine. Any suggestions? Thanks, Titu
Maybe this is a bug in your code - are you sure that the structure members are actually being updated by your code? Have you tried stepping through a bit of code that ought to update (part of) the structure, and seeing what happens? "I am a new user of Keil C compiler." Did you start by reading the uVision Getting Started Guide, and working through the example projects in it? This would give you a proper introduction to the tools, how they work, and how to use them. (The uVision Getting Started Guide is available on the 'Books' tab in the 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS51.PDF in your Keil folder)
thank you for your kind response. I have skimmed through the GS51.PDF document. Still failed to find out a proper solution. The problems in detail: I declared and defined some structures in 3 header files and included them in other C files. structs are declared as static. The struct members are initialized by an initialization function. (I tried with defining the structs in header files and declaring them in one of the C files and then using 'extern' in other C files; but that does not work as well.) Now, I am trying to update those struct data from all the C files, in some cases using ISRs. The struct members are not updated while viewing in the watch window. As a solution, I tried with using only one header file and one C file those cover all the codes. This time, it updates the values for struct members. So, what was the problem with earlier version? Thanks a lot and happy new year.
"I have skimmed through the GS51.PDF document." I said you need to read the uVision Getting Started Guide, and work through the example projects in it - ie, study it thoroughly. You will not gain a proper understanding of anything by just skimming! You are probably still shooting in the dark.
View all questions in Keil forum