2019-06-27 01:39 PM
Solved! Go to Solution.
2019-06-28 01:46 AM
Hello ,
You can create your own linker file (user.ld) and use __attribute__
__attribute__ ((section (".codeinram"))) void gotoStandbyMode(void) {
WKUP.WISR.R = 0x00000008; //Clear interrupt flag
if ((ME.GS.B.S_CURRENTMODE < SPC5_RUNMODE_RUN3)
|| (ME.GS.B.S_CURRENTMODE > SPC5_RUNMODE_RUN0)) {
if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}
}
__attribute__ ((section (".codeinram"))) void gotoRunMode(void)
{
if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}
Best Regards
Erwan
2019-06-27 04:49 PM
That's usually the function of the LINKER
A Linker Script would define memory regions and names of sections
The compiler would use attribute or #pragma to flag to the linker the section names the user has provided.
Where the tools lack I've built linkers and object file manipulation/translation apps.
2019-06-28 01:46 AM
Hello ,
You can create your own linker file (user.ld) and use __attribute__
__attribute__ ((section (".codeinram"))) void gotoStandbyMode(void) {
WKUP.WISR.R = 0x00000008; //Clear interrupt flag
if ((ME.GS.B.S_CURRENTMODE < SPC5_RUNMODE_RUN3)
|| (ME.GS.B.S_CURRENTMODE > SPC5_RUNMODE_RUN0)) {
if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}
}
__attribute__ ((section (".codeinram"))) void gotoRunMode(void)
{
if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}
Best Regards
Erwan