I'm writing code for an ATSAM
device using MPLAB X
and XC32
compiler. This device has 1Mbytes of flash memory and I need to put 200kBytes apart to be a placeholder for a configuration script (the main code will execute this script).
I'm trying to do this without messing with linker. This is what I'm doing:
#pragma region name="plan_mem" origin=0xce000 size=0x32000
typedef struct {
uint16_t version;
//.... very long structure....
} Plan;
const Plan plan __attribute__((region("plan_mem"))) = {
0x1, //....
};
While the code still works, I do have this warning from the compiler: warning: 'region' attribute directive ignored [-Wattributes]
and the final address is indeed ignored.
Why is it ignored since that came from the XC32 manual?
There is any other way to achieve the same?