HardFault_Handler() at exceptions.c using greenhills compiler plugin with mcal in s32k324

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HardFault_Handler() at exceptions.c using greenhills compiler plugin with mcal in s32k324

跳至解决方案
4,144 次查看
xflong
Contributor III

hi,

   when i using greenhills compiler plugin compile the s32k324 mcal program port from s32ds v3.4's example application(Platform_Multicore_SingleElf_S32K324). it compile succeful,but can't run.

when i debug use pe, core0 main enter a hardfault.

who can help me? thanks.

zhangbo1_0-1659433720802.png

 

标记 (1)
0 项奖励
回复
1 解答
4,072 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hi xflongzhang,

I compared your system.c file and this file in the RTD example.  I saw that in your system.c file, the code (in the #ifdef MPU_ENABLE... #endif) didn't execute. I think that you can try to define the MPU_ENABLE in your .mak files (or remove the #ifdef MPU_ENABLE... #endif in your system.c file) and rebuild and test again.

If your program still occur error, you should try to replace your system.c file by this file in the RTD example.

Best regards,

Dan

 

在原帖中查看解决方案

8 回复数
4,123 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hello xflongzhang,

Could you send me your project (including configuration files and code files)?

And what is the package's name you are using?

Best regards,

Dan

0 项奖励
回复
4,118 次查看
xflong
Contributor III

it's a multicore single elf project.sdk version (S32DS\software\PlatformSDK_S32K3_2022_03\SW32K3_RTD_4_4_2_0_0_D2203).ghs compiler version 2020.1.4. i change some compiler options,it still doesn't work.

thank you.

0 项奖励
回复
4,104 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hello xflongzhang,

I tested your project and I didn't get your error.

nxf78987_0-1660129969503.png

nxf78987_1-1660130035975.png

Are you using the board (which loaded HSE firmware)?

And which is the board and chip you are testing?

Best regards,

Dan

0 项奖励
回复
4,100 次查看
xflong
Contributor III

I am using S32K3X4EVB-Q257 ,the chip on the board is S32K344,but it was decoupled,so it is really a S32K324. It has no HSE firmware,I tested the demo "Platform_Multicore_SingleElf_S32K324" from S32DS  v3.4 ,it can work.
Maybe I uploaded the wrong project.But the two cores don't work correct.The correct is two red leds blink.

xflongzhang_0-1660132626679.pngxflongzhang_1-1660132675242.png

 

4,091 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hello xflongzhang,

I got your error. I saw that this interrupt is PIT_0_ISR after I check the below registers.

nxf78987_0-1660198846323.png

I didn't why the PIT_0_ISR function didn't install after calling the Platform_Init(NULL_PTR); in the main_core0() function.

I have a solution: you can add the statement calling Platform_InstallIrqHandler function as the below image. After that, rebuild and test again.

nxf78987_1-1660199364540.png

Best regards,

Dan

0 项奖励
回复
4,088 次查看
xflong
Contributor III

Hello,Dan,

Thank you very much for your advice. But I still encountered the same problem. Is there anything else wrong?

0 项奖励
回复
4,073 次查看
DanNguyenDuy
NXP Employee
NXP Employee

Hi xflongzhang,

I compared your system.c file and this file in the RTD example.  I saw that in your system.c file, the code (in the #ifdef MPU_ENABLE... #endif) didn't execute. I think that you can try to define the MPU_ENABLE in your .mak files (or remove the #ifdef MPU_ENABLE... #endif in your system.c file) and rebuild and test again.

If your program still occur error, you should try to replace your system.c file by this file in the RTD example.

Best regards,

Dan

 

4,065 次查看
xflong
Contributor III

Hi Dan,

I added MPU_ENABLE to the compiler options, rebuild the program and find that the program can run correctly. It is surprising that the code generated by the same RTD version is different from the example. But the problem was solved.

Thank you.