Forum : ST7/STM8
Post Information | Post |
---|---|
April 9, 2009 - 3:08am
|
I've got a curly eeprom issue porting from the Cosmic Compiler to Raisonance... I have an array of char defined within the eeprom to hold the parameter data, it is currenly using the following COSMIC expression #pragma section @near [eeprom_var] //const {eeprom_var} Within the linker file the section eeprom_var is overlayed on top of the eeprom address space 0x1000. Now unless I miss my guess using the Raisonance compiler I should be able to change the above to unsigned char eeprom eeprom_variable[125]; Letting the compiler and linker take care of the rest. So far so good. Now I can write parameters to this array setting the relevant bits in EECSR first like so void E2_ResetEEPROM(void) However if I try to use an regular expression for the array address then the compliler baulks e.g. void E2_WriteMem(u8 addr, u8 dt) EEP_Wait_Finished(); *** FATAL ERROR C041 IN LINE 94 OF eeprom.c : (null) (00,00,00,00,00,00,90) So I'm at a loss why the compiler balks. For the interim I've defined the array like so; at 0x1000 data unsigned char ee_eeprom_variable[125]; /* HACK */ Which effectively does the same thing but I now have to allocate the address of each eeprom variable to prevent over runs etc... Cludgy hack but it works. It would be an advantage to get the linker to do this for me... So am I missing something or have I barked up the wrong tree ? Regards /M. |
Hi M.,
Thanks for your report, we reproduced the problem in our labs.
It will be fixed in the next release (around mid-June) of the RKit-STM8.
What you can do to workaround the issue is to declare you arrray as a RAM glbal variable, located absolutely at the EEPROM address you want:
Instead of writing:
unsigned char eeprom eeprom_variable[125];
Replace by (as you know EEPROM is at address 0x1000 on ST7DALI):
at 0x1000 unsigned char data eeprom_variable[125];
Let us know if you still have any problems.
Regards,
Bruno