This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

View vaiables

Well, this is really for Cortex-M0. I using uVision 5 and JLink to trouble shoot.
When I try to view the value of some variables, I got cannot evaluate. All of
the variables are global and they are defined like this:

typedef struct
{
  __IO uint16_t DATA[16];
} CH4_DATA_TypeDef;

#define P9235_RAM_BASE       (0x20000000UL)

#define CH4_DATA_BASE   (M0_RAM_BASE + 0x06C0)  //32 byte max

#define ADC_DATA  ((CH4_DATA_TypeDef *)  CH4_DATA_BASE )

Does any one know why I can not view the value of DATA[16] by just put it in waatch window?

Thanks.

Parents Reply Children
  • space in data memory is assigned to this label
    No, it's not. You're just pointing to that space, but you're not reserving it for that use in any way. That method provides no information to the linker that this memory is occupied by this data.

    Nor is there really any "label". That's a preprocessor macro you've defined, nothing more.

    If you want it to be treatable as a variable, you'll have to actually define one. Either an actual varable, or a cont pointer, i.e.:

    some_type actual_variable;
    some_type * const const_pointer = (some_type *) ADDRESS;
    

    You wouldn't be an assembler programmer who only recently started to convert to C, would you?