Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Oliver Sedlacek
12/11/14 05:50
Read: 897 times

#190396 - Using SDCC...
Responding to: Kiran V. Sutar's previous message
Placing a variable at a fixed location is best done with the relevant toolchain C language extension. In SDCC you can use the following:

__code __at (0x0ff0) unsigned char ID = MY_CODE_IDENT;

As others have posted, you cannot write to code ROM in your application, you can only set the ROM at compile time. If you really want to write a value that persists through a power cycle, you will need to store it in EEPROM, not code ROM (the clue is in the name).

List of 8 messages in thread
How to init a variable in ROM      Kiran V. Sutar      11/19/14 21:39      
   You can NOT write to ROM      David Prentice      11/20/14 04:35      
   Hex file      Daniel Contarino      11/20/14 15:18      
   Initialize code      Daniel Contarino      11/20/14 15:27      
   toolchain?      Maarten Brock      11/29/14 01:36      
   Using SDCC...      Oliver Sedlacek      12/11/14 05:50      
   that chip does not have any ROM      Erik Malund      12/12/14 08:50      
   Here is the solution I was looking for      Kiran V. Sutar      12/19/14 08:33      

Back to Subject List