Harrie van de Berg

Debugging stops unexpectedly

Discussion created by Harrie van de Berg on Nov 8, 2017
Latest reply on Dec 22, 2017 by Harrie van de Berg
Debugging the project has always worked without any problems with LPCexpresso.
After some time I had to debug the project again, and used the new LPCexpresso version.
But now the debugger stops after a certain line of code.
Upgraded LPCexpresso to MCUXpresso IDE v10.0.2 (created new project).
Debugger still stops after the same line of code.
Using Red Probe + debugger, also used LPC-Link 1 and LPC-Link 2.
Using Microcontroller LPC1822

Line of code, after which the debugger stops:
#define     __IO    volatile             /*!< defines 'read / write' permissions              */
#define TFT_ADR_DAT    0x1D000040
#define _TFTwrDat( dat ) do { *(__IO u16 *) (TFT_ADR_DAT)= dat; } while(0)
_TFTwrDat(0);

The following error is given when a step over is done at the above line code:
Target reported errors
Reason:
15: Target error from Read Memory
Details:
15: Target error from Read Memory
15: Target error from Read Memory
Debug port inaccessible after access at location 0x00000000
15: Target error from Remove break/watch
Wire ACK Fault in DAP access
When te project is just "run", so no stepping, then the board does not work as expected.
When stopping debugging it gives the following error:
Failed to execute MI command:
-interpreter-exec console kill
Error message from debugger back end:
Can't kill process
Error reported by target
Target reported errors
Reason:
19: Could not stop execution from running
19: Could not stop execution from running
Cannot halt processor.

When optimization level is set to "Optimize (-O1)" the board works correctly and debugging can be paused, stepped over, etc.
But because of optimization not all lines can be debugged correctly.
Any suggestions to solve this problem?

Outcomes