Semihosted behavior when no jtag

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

Semihosted behavior when no jtag

1,433件の閲覧回数
simonfourquier
Contributor I

Hi

I use semihosted (on lpcxpresso1769) for do a log of my application in a file.

That work fine when i run from mcuxpresso.

But if i reset me board I want me aplication continue to work witouth log. But my application do a hardFault in fopen()

is possible to test if we are connected in jtag or not? 

ラベル(1)
タグ(1)
0 件の賞賛
返信
3 返答(返信)

1,292件の閲覧回数
simonfourquier
Contributor I

Thanks you 

if ((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk)==CoreDebug_DHCSR_C_DEBUGEN_Msk) {
work fine
0 件の賞賛
返信

1,292件の閲覧回数
BlackNight
NXP Employee
NXP Employee

You could use a modification of the hard fault handler.

Have a look at

mcuoneclipse/McuHardFault.c at master · ErichStyger/mcuoneclipse · GitHub 

and for McuHardFault_CONFIG_SETTING_SEMIHOSTING.

It basically continues in case you get a hard fault because no debugger is attached.

For background on the handler see Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse 

As for detecting if a debugger is attached: I think there is a bit in the ARM DWT (see Cycle Counting on ARM Cortex-M with DWT | MCU on Eclipse ), but I would have to check.

I hope this helps,

Erich

0 件の賞賛
返信

1,292件の閲覧回数
converse
Senior Contributor V

This thread should help you

https://community.nxp.com/thread/424925 

0 件の賞賛
返信