Setup:
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()
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
已解决! 转到解答。
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.
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.
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.
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.