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

Absolute variable location

On my program for the LPC2129 using the RealView toolchain, For this line of code:
unsigned int StandardFilter[2] _at_ 0xE0038000;

I get the following error:
CAN_RX.C(31): error: #65: expected a ";"

Now i understand from http://www.keil.com/forum/docs/thread8677.asp that this can be removed by including the absacc.h but i am NOT able to find the header in C:\Keil\ARM\RV30\INC Where can i get this header?

Parents Reply Children
  • with the risk of invoking the fury of others here, I ask you again, as is often done on this forum: as a user of a tool-chain, why don't you bother to read its documentation if you need to know something?

    here is an excerpt from the linker and utilities guide, page 158 of revision 3.1 of the document:

    Placing a key in flash memory Some flash devices require a key to be written to an address to activate certain features. An __at section provides a simple method of writing a value to a specific address.
    Assuming a device has flash memory from 0x8000 to 0x10000 and a key is required in address 0x9000. To do this with an __at section, you must define a section
    .ARM.__at_0x9000 that contains the value of the key. For example:
    
    int key __attribute__((__at(0x9000))) = 10;
    ...
    

    Well?

  • have you looked inside the file 'absacc.h', located at rv31/inc? I bet you did not.

    #ifndef __at
    #define __at(_addr) __attribute__ ((at(_addr)))
    

  • Tamir,
    The last thing that i need is attitude.I tried my best to look through the documentation AND previous related posts and posted my problem only because i was not able to rectify it. The idea of a forum is to help others who are stuck up and not offer admonishing remarks.The whole process is voluntary and you do not have to reply if you don't want to.It is not any fun for me either to sit with this problem for 48 hours without being able to sort it out.If my incompetence is bothering you, i apologize.

    As for your helping comments, i REPEAT what i stated in my first post:i am NOT able to find the 'absacc.h' header in the INC folder.

    And your first syntax

    unsigned int StandardFilter[2] __attribute__ (at(0xA0000000) ) ;
    


    throws the follwing error:

    CAN_RX.C(32): error:  #125: expected a "("
    

    Glad to notice that you corrected the syntax in

    int key __attribute__((__at(0x9000))) = 10;
    

    which again throws the following warning:

    CAN_RX.C(31): warning:  #1207-D: attribute "__at" ignored
    

    as previously stated (and hence my doubt whether my doubt whether the variable is mapped to the address or not)

  • any reason why you are not using the latest tool chain updates? at least, that how it looks like (I would expect a BIN31 folder rather than BIN30).

  • Well, i guess the eval IDE that i got from the vendor along with my ARM board is an old version.On that angle may be i should try it out with the uclibc library(which i have too).....

  • But is it possible to check at what address the variable is mapped to even though i get the warning

    warning:  #1207-D: attribute "__at" ignored