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,117件の閲覧回数
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,045件の閲覧回数
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,096件の閲覧回数
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,091件の閲覧回数
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,077件の閲覧回数
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,073件の閲覧回数
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,064件の閲覧回数
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,061件の閲覧回数
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,046件の閲覧回数
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,038件の閲覧回数
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.