Hi,
here is an example:
In linker file:
MEMORY
{
…
my_flash: org = 0x003C0000, len = 0x00040000
…
}
SECTIONS
{
…
.__my_flash LOAD (0x003C0000): {} > my_flash
…
}
In *.c file:
#pragma push
#pragma section const_type ".__my_flash" ".__my_flash "
uint32_t a;
uint32_t b;
uint32_t c[10];
……
#pragma pop
Notice that you can use const_type or sconst_type or all_types in “#pragma section”. Here is the description from CodeWarrior:
- code_type - executable object code
- data_type - non-constant data of a size greater than the size specified in the small data threshold option in the EPPC Target settings panel
- sdata_type - non-constant data of a size less than or equal to the size specified in the small data threshold option in the EPPC Target settings panel
- const_type - constant data of a size greater than the size specified in the small const data threshold option in the EPPC Target settings panel
- sconst_type - constant data of a size less than or equal to the size specified in the small const data threshold option in the EPPC Target settings panel
- all_types - all code and data
Regards,
Lukas