Debug -> Trace function that generate the error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Debug -> Trace function that generate the error

ソリューションへジャンプ
3,270件の閲覧回数
ypkdani
Contributor III

Hello i have the MCUXpresso 10.0.2 and i have to trace the function that generate the hard fault but using my segger j-link i can see only the last 4 functions called:

pastedImage_2.png

how i can increase the tree for see the function at lower level?

0 件の賞賛
返信
1 解決策
2,981件の閲覧回数
ypkdani
Contributor III

Solved, 

i didn't free memory after a malloc.

元の投稿で解決策を見る

4 返答(返信)
2,982件の閲覧回数
ypkdani
Contributor III

Solved, 

i didn't free memory after a malloc.

2,981件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Your stack trace might not necessarily show the truth, as the hard fault could be caused by some stack corruption too.

It seems that your hard fault was caused during a context switch in FreeRTOS.

I would set a breakpoint in xPortStartScheduler() and step through the code to see what is happening. It could be that your stack runs into FLASH/ROM code?

If you want to see if other theads/tasks are running, have a  read at Troubleshooting Tips for FreeRTOS Thread Aware Debugging in Eclipse | MCU on Eclipse  which provides some checkpoints.

As for the hardfault itself, you could install a custom handler which reports you the last PC/access point (see that interrrupt handler at the end of Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse ).

I hope this helps,

Erich

0 件の賞賛
返信
2,981件の閲覧回数
ypkdani
Contributor III

Hello,

i have already tryed but the Thread Aware crash when i stop the debugger with this error, it say Ignoring Packet Error, continue...

I have update the segger driver but nothing.

I can debug without the Thread Aware enable but i can only see this

pastedImage_1.png

pastedImage_2.png

Thanks

0 件の賞賛
返信
2,981件の閲覧回数
ypkdani
Contributor III

I have tried to understand watching the CFSR register. It has the value 0x400 so i have an INVPC error.
What can generate this error in the code?

Thanks

0 件の賞賛
返信