AnsweredAssumed Answered

assembler code se_ with syntax error

Question asked by Lingyun Han on Mar 20, 2019

Dear NXP support,

 

I tried to compile FreeRTOS in S32 DS with GHS compiler.

 

As "kregs" is a special VLE constraint and GHS compiler cannot be aware of it. So I changed  "=kregs" (ulCriticalNesting) to  "=e" (ulCriticalNesting) and enable enable option "-gnu_asm_se_vle_register".

 

/* Increment critical nesting count */
__asm__ volatile
(
"mfsprg %0, 1 \n\t" // get critical nesting count from SPRG1
"se_addi %0, 1 \n\t" // increment
"mtsprg 1, %0 \n\t" // store to SPRG1
// "=kregs" (ulCriticalNesting)
: "=e" (ulCriticalNesting)
);
}

static portFORCE_INLINE UBaseType_t portDECREMENT_CRITICAL_NESTING( void )
{
UBaseType_t ulCriticalNesting;

/* Decrement critical nesting count */
__asm__ volatile
(
"mfsprg %0, 1 \n\t" // get critical nesting count from SPRG1
"se_subi %0, 1 \n\t" // decrement
"mtsprg 1, %0 \n\t" // store to SPRG1
//: "=kregs" (ulCriticalNesting)
: "=e" (ulCriticalNesting)
);

 

 

But then all VLE half-word instructions (the ones that begin with se_) are considered as "syntax error".

 

How to fix this error? Attached is this project. 

 

 

 

 

All options as below:

-preprocess_assembly_files --gnu_asm -G -O0 -DSTART_FROM_FLASH -DTURN_ON_CPU0 -DDISABLE_SWT0 -DSEMIHOSTING -DCPU_MPC5744P -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317/Generated_Code" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317\SDK\rtos\FreeRTOS_C55" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317\SDK\rtos\FreeRTOS_C55\Source\portable\GCC\PowerPC_Z4" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317\SDK\rtos\FreeRTOS_C55\Source\portable\MemMang" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317\SDK\rtos\FreeRTOS_C55\Source\portable\GCC\PowerPC_Z4\hw" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317\SDK\rtos\FreeRTOS_C55\Source\include" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317/include" -I"C:\Users\Administrator\workspaceS32DS.Power.2017.R1\MPC5744P_GHS_SDK_20190317/Sources" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5741P/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5747C/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744P/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5748G/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746G/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/common" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5745B/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5748G/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744C/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5741P/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746B/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5748C/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5743P/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5747G/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5745C/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746C/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744P/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746B/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5742P/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5745C/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744B/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5747G/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744B/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5748C/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5747C/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5742P/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5744C/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5745B/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5743P/include" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746C/startup" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/drivers/inc" -I"C:\NXP\S32DS_Power_v2017.R1\eclipse\../S32DS/S32_SDK_MPC574xx_EAR_0.8.2/platform/devices/MPC5746G/include" -gnu_asm_se_vle_registers -cpu=ppc5744pz425 -vle

Outcomes