Cannot flash from GDB debugger second time.

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Cannot flash from GDB debugger second time.

      Good morning, I have a strange problem with flashing/debugging in the following configuration:

      VisualStudio 2017, Visual GDB, 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 anything interesting in it.



      After the second attempt to start debugger, I need to use J-Flash 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.
      Images
      • msg.PNG

        52.93 kB, 535×390, viewed 26 times
      Files
    • Hi,
      Thank you for your inquiry.
      We are sorry for the delay in response. We have been very busy with some pressing projects for the last weeks.

      There is no issue known to us regarding J-Link GDB Server and the S32K device family.

      Could you please send us J-Link log files of both sessions? How to enable:
      wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File
      Do you use custom hardware or an evaluation board? In the latter case which one?
      If custom hardware, do you experience the same problem on an evaluation board?

      Best regards,
      Fabian
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/


      Or you can contact us via e-mail.