Problem:
When adding some code in the program, it becomes impossible to debug or error occurs in debug.
Solution:
You have to add flash configuration field in your program as follows. Otherwise, the MCU become secured and the debug functionality is disabled.
/* Flash Configuration Field */
const unsigned bytes flashconfig[16] __attribute__((section(".ARM.__at_0x400"))) =
{ 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFE,0x3D,0xFF,0xFF };
Hope this is helpful. Enjoy debugging!
When adding some code in the program, it becomes impossible to debug or error occurs in debug.
Solution:
You have to add flash configuration field in your program as follows. Otherwise, the MCU become secured and the debug functionality is disabled.
/* Flash Configuration Field */
const unsigned bytes flashconfig[16] __attribute__((section(".ARM.__at_0x400"))) =
{ 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFE,0x3D,0xFF,0xFF };
Hope this is helpful. Enjoy debugging!