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

how to set fixed address for variables/functions  at compiling stage in ADS?

Note: This was originally posted on 18th September 2009 at http://forums.arm.com

in ads 1.2, I set fixed address for a variable like this:

int    file_len  __attribute__((_at_(0x16000))) = 0;  

but compile error, how can i do?

thank you very much!
Parents
  • Note: This was originally posted on 18th September 2009 at http://forums.arm.com

    in ads 1.2, I set fixed address for a variable like this:

    int    file_len  __attribute__((_at_(0x16000))) = 0;  

    but compile error, how can i do?

    thank you very much!


    You can use this but you have to set the initial value manually...

    #define file_len   (*(int *)(0x00016000))

    On second thought, this address is most likely in the on-chip NV (flash) memory region...
    So , you can NOT have a variable at this particular address. Maybe the compiler was
    trying to tell you this simple fact :-) What error does compiler give you anyway ?
Reply
  • Note: This was originally posted on 18th September 2009 at http://forums.arm.com

    in ads 1.2, I set fixed address for a variable like this:

    int    file_len  __attribute__((_at_(0x16000))) = 0;  

    but compile error, how can i do?

    thank you very much!


    You can use this but you have to set the initial value manually...

    #define file_len   (*(int *)(0x00016000))

    On second thought, this address is most likely in the on-chip NV (flash) memory region...
    So , you can NOT have a variable at this particular address. Maybe the compiler was
    trying to tell you this simple fact :-) What error does compiler give you anyway ?
Children
No data