Debug works at first, but fails after a few debug cycles

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

Debug works at first, but fails after a few debug cycles

ソリューションへジャンプ
799件の閲覧回数
deniscollis
Contributor V

Setup:

  • MCUXpresso IDE v11.7.1 [Build 9221] [2023-03-28]
  • Custom Kinetis K82 board
  • Segger J-Link Base

Debug works after freshly powering up my workstation and board, connecting the debug probe, launching MCUXpresso with my project, and hitting 'Debug' in the Quickstart panel.

However, the debug environment fails after a few debug cycles. (Powering everything down and starting up again fixes it.)

Symptom 1:  Breakpoints are no longer honored, including the auto-breakpoint at the first executable statement in main().

Symptom 2: Some unnamed thread is running, and file 'startup_mk82f25615.c' pops into focus, positioned at function RsetISR()

deniscollis_0-1683309811585.png

Symptom 3: The application is not running (Its blinking LED remains off). If terminate the debug session the application remains stalled. But if I reset the board the application runs normally.

I normally have Semihosting active, but deactivating it does not fix the issue.

Can anyone cast some light onto this?

Denis

0 件の賞賛
返信
1 解決策
778件の閲覧回数
deniscollis
Contributor V

Resetting the board and clicking on [Clean Up Debug] after each debug cycle seems to work, but see the Deeper Dive below for the real reason.

deniscollis_1-1683563889454.png

 

Edit: Deeper dive.

This device has a PN5190 NFC that uses PTA4 NMI for its IRQ.  However, this pin's state is integral to the default system reset and startup, as defined in the Flash Config in startup_mk82F25615.c. 

Startup execution after reset fails because of misconfigured FOPT config in the Flash Config. The SDK's template startup_mk82f25615.c Flash Config FOPT config has 'NMI reset enabled', and 'boot source ROM'.  Change this to 'NMI reset blocked' and 'boot source internal flash' will return the board to a stable, debuggable state.  

The reason it works after a POR reset is that at POR the FOPT to 0xFFFF, before the is has been set by the Flash Config in the startup code.

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
779件の閲覧回数
deniscollis
Contributor V

Resetting the board and clicking on [Clean Up Debug] after each debug cycle seems to work, but see the Deeper Dive below for the real reason.

deniscollis_1-1683563889454.png

 

Edit: Deeper dive.

This device has a PN5190 NFC that uses PTA4 NMI for its IRQ.  However, this pin's state is integral to the default system reset and startup, as defined in the Flash Config in startup_mk82F25615.c. 

Startup execution after reset fails because of misconfigured FOPT config in the Flash Config. The SDK's template startup_mk82f25615.c Flash Config FOPT config has 'NMI reset enabled', and 'boot source ROM'.  Change this to 'NMI reset blocked' and 'boot source internal flash' will return the board to a stable, debuggable state.  

The reason it works after a POR reset is that at POR the FOPT to 0xFFFF, before the is has been set by the Flash Config in the startup code.

 

 

0 件の賞賛
返信