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

Declaring a nonvolatile variable in flash memory using _at_ keyword

Hello,

I am using nuvoton N79E715AT28 mcu for some project in which I need to store some integer values in some non volatile memory space. So that it does not get deleted even after power goes off.

The above mcu provides a user configurable flash memory shared with programe memory(APROM). After configuration the APROM memory address are (0x0000 - 0x3EFF) and the flash memory address are (0x3F00 - 0x3FFF).

I have used the command (unsigned int idata value1 _at_ 0x3F00;), but it gives the error c274: 'value1' : absolute specifier illegal.

Parents
  • There is definitely no address 0x3f00 in idata.  That'll have to be xdata.  It may not even make sense to model this requirement as a variable, because that would mean the code would just write to it any time you change that variable.  Write access to data flash generally has to be controlled more strictly to avoid wear.

Reply
  • There is definitely no address 0x3f00 in idata.  That'll have to be xdata.  It may not even make sense to model this requirement as a variable, because that would mean the code would just write to it any time you change that variable.  Write access to data flash generally has to be controlled more strictly to avoid wear.

Children