2011-05-06 04:18 AM
How to store large constant arrays in flash not in RAM
2011-05-17 06:12 AM
2011-05-17 06:12 AM
Thanks for the quick reply!
Do you know will it work for Raisonance (I've already this toolchain installed at home). There are defines in stm8s.h (from Standard Periph Library) where they redefine const to CONST for different compilers. Is this the same? Another question -- how to check that data goes to flash and not in RAM -- check .lst file?2011-05-17 06:12 AM
It seems I figured it out:
for Raisonance:Memory space modifiers
.
A specific memory space can be specified for each variable using RCSTM8-specific keywords such as bit, code, data, page0, eeprom, fcode, and fdata. Hardware Registers can be accessed through more specific keywords such as hbit, hreg and hreg16.2011-05-17 06:12 AM
Thank you all for the quick and accurate responses! It work for me!
2011-05-17 06:12 AM
On Raisonance, adding the ''code'' memory space qualifier will do it:
code char BigBuf[1024] = ''This is a very large buffer stored in Flash'';
You can have further detail in the application note AN55 from Raisonance from
.2011-05-17 06:12 AM
Hi
1/ For check the placement for variables or functions you need to read the .map file generated by linker. 2/ For a placement in FLASH with Raisonance compiler you need to use the word ''code''. In fact with Raisonance compiler the keyword ''const'' is for a write protection for datas but not the placement in specific area. 3/ The best way is to use the define word ''__CONST'', in this case you use the correct words without builder dependency. Best regards Phil