View previous topic :: View next topic |
Author |
Message |
championx
Joined: 28 Feb 2006 Posts: 151
|
#ROM statement and BOOTLOADER |
Posted: Mon Nov 03, 2014 7:53 am |
|
|
Hi all! im using the bootloader provided by CCS on one project, but im trying to load some values on the eeprom with the #ROM statement.
The code is simple. I just use:
#ROM getenv("EEPROM_ADDRESS") = {0x0102}
This code is on the loaded program, and NOT on the bootloader. When i load the program (using the bootloader), then i check the 0 address of the eeprom and i get 0xFF 0xFF.
How can i load this values to the eeprom on the code, but without using the write_eeprom function?
COMPILER VERSION 4.120 ,pic18F252.
thanks! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Nov 03, 2014 8:17 am |
|
|
That is down to the design of the bootloader.
It needs to accept addresses in the EEPROM range, and allow these to be programmed. The CCS bootloader will only accept lines whose addresses are less than the size of the program memory. It would need extra lines added to also accept lines in the EEPROM area. The code would then need to adjust the EEPGD bit to allow access to this area. Most bootloader don't program this area. Generally you want to keep parameters stored here, and the extra code to access the EEPROM area is not worthwhile. |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Mon Nov 03, 2014 8:31 am |
|
|
Thanks Ttelmah, then i will use a function to store those bytes on the eeprom using the serial port.
I need to free some space on the code and i have some CGRAM characters defined on the program, but if i store them on the eeprom and read them later i could save some space.
thanks again. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Nov 03, 2014 8:47 am |
|
|
If they are constant, like CGRAM data, then include this with the bootloader. |
|
|
|