Good morning, I have a strange problem with debugging in the following configuration:
VisualStudio 2017, ARM toolchain 9.3.1/9.2.0/r2, Segger J-Link 4.2, NXP S32k148
When I start debugger first time, it flash the compiled code and stop at a breakpoint at the first line of main function (or even at start-up code – simply do not execute any instruction of my code). Then I stop debugger.
When I try to start debugger second time, the progress bar shoving flashing seems to be blocked after Compare and the Erase do not start. After few seconds a message announce me that:
“The memory loacation … used for stack is not writable…”.
The memory at the specified address should be writable according to microcontroller datasheet.
There is a GDB log for first start and the second start attached. I do not see nothing interesting in it.
After the second attempt to start debugger, I need to use J-Flash (flashing SW from Segger) to chip erase. Then I can start debugging from Visual Studio again (but only once).
It is quite interesting that the project was working up to now. When I slightly modify (comment 2 lines) one function (FLASH_DRV_CommandSequence from S32K SDK which is executed from RAM), the compiled code is few bytes shorter and there is no problem with starting debugging. I remind that no instruction of the code is executed, the debugger halt execution at the first line of main or even at start-up. The GDB log for modified code is also attached.
When I use the SDK flash driver (using the function FLASH_DRV_CommandSequence) in different (smaller) project it works properly.
Any ideas are very welcomed.
-
This topic was modified 4 years, 3 months ago by Waszniowski.
Attachments:
You must be
logged in to view attached files.