S32KOS sample "S32K_AUTOSAR_OS_4_0_98_RTM_1_0_0" shutdown

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32KOS sample "S32K_AUTOSAR_OS_4_0_98_RTM_1_0_0" shutdown

Jump to solution
892 Views
decoski
Contributor II

Hello:

I am using an example of s32k autosar SDK "\AUTOSAR\AAS32K_AUTOSAR_OS_4_0_98_RTM_1_0_0\sample\standard\sc1" ,

All files have been generated and compiled.

development environment: S32DS 3.5

startup file :startup_S32K144.S 

linker file: S32K144_64_flash.ld. 

I use this. s and. ld(not changed) because the relevant files in the SDK(startup_gcc.s,vector_gcc.ssample1_fls.gld) cannot be compiled to generate a normal size .elf.

Clock initialization has been performed :

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

Then routine always jump to OSShutdownOS afterwards,Prompt for stack overflow. shown below:acv.png

May I ask where the question is? Thank you for answering.

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
706 Views
nxf78987
NXP Employee
NXP Employee

Hi @decoski,

I imported your project into S32DS v3.4 and I saw errors as you said.

I modified your project as below and it ran OK.

1. In the OSInterruptDispatcher (void) function: change " ldr r0, [r13,#0x24] \n\r" to " ldr r0, [r13,#0x20] \n\r"

2. Modify compiler properties as below images:

nxf78987_0-1683804233979.pngnxf78987_1-1683804284536.pngnxf78987_2-1683804309714.png

nxf78987_3-1683804385666.png

I attached this modified example.

Best regards,

Dan

View solution in original post

0 Kudos
4 Replies
821 Views
nxf78987
NXP Employee
NXP Employee

Hi @decoski,

Could you send me your example?

Best regards,

Dan

0 Kudos
750 Views
decoski
Contributor II

Thank you for your reply. These days I adjusted my program and modified the interrupt vector table so that interrupts can run normally to OSInterruptDispatcher1, but eventually they will enter HardFaultException as shown in the figure:屏幕截图 2023-05-10 205501.png

My Partial interrupt vector:

 

屏幕截图 2023-05-10 211204.png屏幕截图 2023-05-10 211358.png

I checked the MSP stack and couldn't find any errors. I need your help.The attachment has been uploaded. Please refer to and assist in resolving my issue.Thank you! @nxf78987 

0 Kudos
745 Views
decoski
Contributor II

I also made one modification, which was xpsr. I observed that he saved the PC value instead of xpsr, so I changed its direction(#0x24), as shown in the figure. I don't know if it is correct, because the final result of the program is HardFaultException.These contents are all in the attachment I uploaded, please correct them,Thank you for your help!屏幕截图 2023-05-10 213829.png

0 Kudos
707 Views
nxf78987
NXP Employee
NXP Employee

Hi @decoski,

I imported your project into S32DS v3.4 and I saw errors as you said.

I modified your project as below and it ran OK.

1. In the OSInterruptDispatcher (void) function: change " ldr r0, [r13,#0x24] \n\r" to " ldr r0, [r13,#0x20] \n\r"

2. Modify compiler properties as below images:

nxf78987_0-1683804233979.pngnxf78987_1-1683804284536.pngnxf78987_2-1683804309714.png

nxf78987_3-1683804385666.png

I attached this modified example.

Best regards,

Dan

0 Kudos