microsoft / microsoft/vscode-cpptools

[J-Link] Debug session doesn't stop in breakpoint after flash is erased

Open
#10,819 2 comments 0 reactions 1 assignee View on GitHub

@benmcmorran is already working on this.

Since May 1, 2023.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Windows, Linux
  • VS Code: 1.77
  • C/C++ extension: v1.14.5
  • OS and version of remote machine (if applicable): N/A
  • GDB version: any
Bug Summary and Steps to Reproduce

Bug Summary:
[J-Link] Debug session doesn't stop in breakpoint after flash is erased.

Steps to reproduce:

  1. Connect a Segger J-Link Probe to a NXP LPCXPRESSO55S69 board.
  2. Open a terminal in the project folder and erase the flash by issuing the following command:
    "C:\Program Files\SEGGER\JLink\JLink.exe" -if SWD -speed auto -commanderscript script.jlink -device LPC55S69_M33_0
  3. Debug the attached project from VS Code.

Result: Target doesn't stop at main. From the logs, it seems that the target actually stops, but cppdbg tells it to continue execution. If the debug session is done without erasing the flash first it stops at main as expected.

Debugger Configurations
launch.json:
{
  "configurations": [
    {
      "type": "cppdbg",
      "name": "Debug project configuration",
      "request": "launch",
      "cwd": "c:\\Bug\\lpcxpresso55s69_hello_world",
      "MIMode": "gdb",
      "program": "c:\\Bug\\lpcxpresso55s69_hello_world\\armgcc\\debug\\hello_world.elf",
      "miDebuggerPath": "c:\\gdb\\bin\\arm-none-eabi-gdb.exe",
      "debugServerPath": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe",
      "miDebuggerServerAddress": "localhost:2330",
      "postRemoteConnectCommands": [
        {
          "text": "monitor reset"
        },
        {
          "text": "load"
        },
        {
          "text": "tbreak main"
        },
        {
          "text": "monitor semihosting enable"
        },
        {
          "text": "monitor exec SetRestartOnClose=1"
        },
        {
          "text": "monitor reset"
        }
      ],
      "debugServerArgs": "-nosilent -swoport 2331 -telnetport 2332 -singlerun -endian little -noir -speed auto -port 2330 -vd -device LPC55S69_M33_0 -if SWD -halt -reportuseraction",
      "serverStarted": "Connected to target",
      "unknownBreakpointHandling": "stop"
    }
  ]
}
Debugger Logs

Debug log attached.
debug.log

Other Extensions

No response

Additional Information

lpcxpresso55s69_hello_world.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.