S32K312 freertos hardfault

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

S32K312 freertos hardfault

Jump to solution
14,159 Views
wswsw111
Contributor I

c64ee7f826907a79b76be8befe03c9d.pngc64ee7f826907a79b76be8befe03c9d.png

我的工程用了freertos,如果我单独开了can的使用并不会跑到这个地址,但是如果开了pwm或adc就会进入这个地址然后直接hardfault,但是如果不调试只是烧录,功能却是正常的,请问一下这个是为什么呢

0 Kudos
Reply
1 Solution
13,958 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Another issue is that there is no definition of HEAP in the generated ICF file, but it is in the LD file. If possible, could you please teach me how to modify HEAP in the IAR environment

Unfortunately, I cannot as I do not have knowledge on IAR compiler. Please refer to its documentation..

could you please help me check my code.

I can check it with GCC, but that works as you express.

Also I cannot generate/compile your program without knowledge on which exact versions of plugins was used for it.

I also did not find any output file in the project you shared with me. No elf nor s3 record.

only map file.

Best regards,

Peter

View solution in original post

0 Kudos
Reply
8 Replies
14,036 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

unfortunately I am not able to identify the issue from the provided information.

Could you follow guide for hard fault debug to see the origin of the issue?

https://community.nxp.com/t5/S32K-Knowledge-Base/How-To-Debug-A-Fault-Exception-On-ARM-Cortex-M-V7M-...

could you also use English on the forum, as the translation by google is not very accurate.

best regards,

Peter

0 Kudos
Reply
14,004 Views
wswsw111
Contributor I

Thank you for your reply. I have analyzed the issue based on the document, but I have been trying for a long time without finding a conclusion. Using the iar toolchain will cause problems, but using GCC will not. If possible, could you please help me check my code.

Another issue is that there is no definition of HEAP in the generated ICF file, but it is in the LD file. If possible, could you please teach me how to modify HEAP in the IAR environment
 

IAR :9.50.2

Thank you for your reply.

 

 

0 Kudos
Reply
13,959 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Another issue is that there is no definition of HEAP in the generated ICF file, but it is in the LD file. If possible, could you please teach me how to modify HEAP in the IAR environment

Unfortunately, I cannot as I do not have knowledge on IAR compiler. Please refer to its documentation..

could you please help me check my code.

I can check it with GCC, but that works as you express.

Also I cannot generate/compile your program without knowledge on which exact versions of plugins was used for it.

I also did not find any output file in the project you shared with me. No elf nor s3 record.

only map file.

Best regards,

Peter

0 Kudos
Reply
13,935 Views
wswsw111
Contributor I

Change OPTIMZATION LEVEL Solved this problem,Thank you for your reply

 
 
0 Kudos
Reply
13,936 Views
wswsw111
Contributor I

I found that even when compiling with GCC, there are errors at the beginning:Break at address "0x0" with no debug information available, or outside of program code.

But we will soon jump into main().The same code using IAR will enter bus_fault() and cannot provide an accurate fault.

Make OPTIMZATION LEVEL = O3,my GCC project also encountered the same situation as the IAR project, but O0 did not。

Can you give me some direction on this。
Thank you for your reply。
 
 
 
 
 

 

0 Kudos
Reply
14,119 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Google translate:

My project uses freertos. If I open the can function alone, it will not go to this address. However, if I open pwm or adc, it will enter this address and hardfault directly. However, if I do not debug but just burn, the function is normal. Why is this?

Seems to my like some synchronization issue. Do you use watchdog, etc...? Is this and example project or your custom one?

To debug hardfault please follow:

https://community.nxp.com/t5/S32K-Knowledge-Base/How-To-Debug-A-Fault-Exception-On-ARM-Cortex-M-V7M-...

and you can also use:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

Best regards,

Peter

0 Kudos
Reply
14,072 Views
wswsw111
Contributor I

我尝试将同样的配置和代码挪回S32DS中开发,虽然一开始也会蹦到0x0地址但是马上又会回到main中,可以继续使用。

0 Kudos
Reply
14,070 Views
wswsw111
Contributor I

关于IMPRECISERR的具体定位还有更多吗,调试过程中也会偶尔出现IACCVIOL,并没有开启看门狗功能,是我的自定义功能,例程参考了ADC+DMA+PIT和can过滤器设置的demo,感谢您的回复。

0 Kudos
Reply