Question
Error when using __attribute__((at(address))) for data definition
Posted on May 16, 2016 at 21:37
Hi.
I tried to use __attribute__((at(address))) to define a global variable at certain address and Keil returned error L6971E, which is described herehttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0496c/CJAIGFIC.html
I don't really understand what is wrong, because if I use address at the beginning of RAM (let say 0x20000020) the error occurs, but if I use higher address (let say 0x20002000), the error doesn't occur.Could anyone please explain what is wrong here and is it just OK if I define higher address, which is not causing an error?Secondly, do I have to be aware of data alignment when using __attribute__((at(address)))?I mean, do I have to use only 0x.......0, 0x.......4, 0x.......8, ... addresses for integers, only 0x.......0, 0x.......2, 0x.......4, 0x.......6, 0x.......8, ... addresses for half-word and any kind of address for bytes?Thanks a lot.