AnsweredAssumed Answered

Code port to S32K controller

Question asked by Ambarish Hundekar on Dec 12, 2017
Latest reply on Dec 14, 2017 by stanish



I need to port the code from Renesas to NXP (IAR compiler used for renesas development ).


the code has some compiler oriented directives , I am not getting how to change those directives to S32 design studio (gcc compiler)  support format.


Problem 1:

#pragma segment="bl_fsl_codearea_RAM"

#pragma segment="bl_blc_globaldata_RAM" __far


T_U32 __far *u32SegmentStartAddress;

T_U32 __far *u32SegmentEndAddress;

volatile T_BOOL boolInterruptFlagValue;


/* Clear BL_FSL_CODE_RAM */

u32SegmentStartAddress = __segment_begin("bl_fsl_codearea_RAM");

u32SegmentEndAddress = __segment_end("bl_fsl_codearea_RAM");

while (u32SegmentStartAddress < u32SegmentEndAddress)


*u32SegmentStartAddress = 0x00U;




Problem 2 :

#pragma dataseg="m_bl_std_faiRecdata_RAM"

__no_init StdFailurRecord_t gStdFailureRecord;

#pragma dataseg=default


the above code can be replace with  

__attribute__((section("m_bl_std_faiRecdata_RAM"))) StdFailurRecord_t gStdFailureRecord;


is this correct?




Problem 3:

#pragma constseg="m_blc_Configdata_start"      // IAR code

__root const ConfigData_t gConfigData =

const ConfigData_t gConfigData __attribute__((used)) =


   { 0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU}


#pragma dataseg=default;



I have replaced the code with

#pragma constseg="m_blc_Configdata_start"      // GCC code

const ConfigData_t gConfigData __attribute__((used)) =


   { 0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU,0xFFU}


#pragma dataseg=default;

is it correct?



Problem 4:

what can I replace far and near of  IAR in GCC compiler supportable format?


T_U32 __far *u32SegmentStartAddress; (IAR format).



I have gone through the gcc compiler reference manual and solved some of the compiler oriented directives errors,

the above directives are not getting how to solve.

kindly need your help in this.


Thanks in advance.