Debugging not possible! Visual Studio Code exception occurred: System.Collections.Generic.KeyNotFoundException: The given key '3' was not present in the dictionary. ...

Using the nRF52833 chip, I CAN build and flash the device using a J-Link Segger debug probe (Version v12.00). However, suddenly (I did not have this issue a couple of months ago), I am not able to debug anymore.

I was using the toolchain nRF v2.2.0. I tried updating to v2.5.1, but did not help at all.

The J-link probe  firmware is up to date.

The complete error message is the following when I click on the "Debug" button (attemping to start the debugger):

I get pretty desperate with this IDE and tool in general. So any help is VERY appreciated.

Thanks in advance!

Parents
  • Hi Elfving,

    I have opened a sample project on my DevKit BL653, and there, there is no problem. I can debug.

    I have attached the automatically generated support information that you asked. Let me know if you find anything...

    Best regards,

    Ion

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Pro",
        "osKernel": "10.0.22621",
        "vscode": "1.85.2",
        "electron": "25.9.7",
        "node": "v18.15.0"
      },
      "system": {
        "date": "2024-01-24T14:30:41.694Z",
        "vscodeRoot": "c:\\Users\\ionsu\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "122:40:05",
        "osUptime": "170:57:20",
        "cpu": "AMD Ryzen 7 5800H with Radeon Graphics"
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1696237434421",
        "folders": [
          "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral"
        ]
      },
      "sdks": [
        {
          "version": "v2.5.1",
          "path": "c:\\ncs\\v2.5.1"
        },
        {
          "version": "v2.2.0",
          "path": "c:\\ncs\\v2.2.0"
        }
      ],
      "activeBuild": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral\\build",
      "apps": [
        {
          "workspace": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral",
          "uri": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral\\bootloader\\bootloader",
          "buildConfigurations": [
            {
              "id": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral\\bootloader\\bootloader\\build",
              "name": "build",
              "boardId": "bl653_dvk",
              "type": "Zephyr",
              "isChild": false,
              "isStale": true,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        },
        {
          "workspace": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral",
          "uri": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral",
          "buildConfigurations": [
            {
              "id": "c:\\WORK\\mps-firmware\\FW\\FW_BL653u\\peripheral\\build",
              "name": "build",
              "boardId": "bl653_dvk",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "c:\\ncs\\v2.2.0",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.5.1",
          "path": "c:\\ncs\\toolchains\\c57af46cb7"
        },
        {
          "version": "2.2.0",
          "path": "c:\\ncs\\toolchains\\v2.2.0"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "000052002086",
          "boardVersion": null,
          "deviceFamily": "NRF52_FAMILY",
          "deviceVersion": "NRF52833_xxAA_REV1",
          "jlinkObFirmwareVersion": "J-Link V12 compiled Nov 22 2023 09:48:58"
        }
      ],
      "deviceProvider": "nrfutil",
      "tools": {
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.1",
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.92q",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.18.1",
        "nrfutil": "Not found",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\cmake.exe": "3.20.5",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts\\west.exe": "1.1.0",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\python.exe": "3.8.2",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\ninja.exe": "1.9.0",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gperf.exe": "3.1",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\dtc.exe": "1.4.7",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gn.exe": "2122",
        "C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
        "gdbPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.1",
          "binPath": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\ionsu",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\ionsu",
          "PATH": "C:\\ncs\\toolchains\\c57af46cb7;C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin;C:\\ncs\\toolchains\\c57af46cb7\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\c57af46cb7\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\CMake\\bin;C:\\ninja-win;C:\\msys64\\ucrt64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Programs\\GNU Octave\\Octave-8.3.0;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git;C:\\Program Files (x86)\\GitExtensions\\;C:\\Ruby31-x64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\ionsu\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "c:\\ncs\\v2.2.0\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk",
          "PYTHONPATH": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib\\site-packages"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\ionsu",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\ionsu",
          "Path": "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\CMake\\bin;C:\\ninja-win;C:\\msys64\\ucrt64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Programs\\GNU Octave\\Octave-8.3.0;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git;C:\\Program Files (x86)\\GitExtensions\\;C:\\Ruby31-x64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\ionsu\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "PATH": "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\CMake\\bin;C:\\ninja-win;C:\\msys64\\ucrt64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Programs\\GNU Octave\\Octave-8.3.0;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git;C:\\Program Files (x86)\\GitExtensions\\;C:\\Ruby31-x64\\bin;C:\\Users\\ionsu\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\ionsu\\AppData\\Local\\Programs\\Microsoft VS Code\\bin"
        },
        "toolchainPath": "c:\\ncs\\toolchains\\c57af46cb7",
        "toolchainBinPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.5.1"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.2.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.5.1}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}\\bootloader\\bootloader"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "taskBindings": {},
          "debugging": {
            "flash": true,
            "bindings": {
              "${workspaceFolder}/build": "Launch peripheral\\build"
            },
            "justMyCode": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": false,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask",
          "welcome": {
            "showOnStartup": true
          }
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2023.11.301",
            "path": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2023.10.17",
            "path": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2023.10.17",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2023.11.120",
            "path": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2023.11.120",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2023.11.64",
            "path": "c:\\Users\\ionsu\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2023.11.64",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.18.5",
          "ms-vscode.js-debug": "1.85.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.8",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0"
        }
      }
    }
    
    

  • IonS said:

    I have opened a sample project on my DevKit BL653, and there, there is no problem. I can debug.

    Great. And you tried this with the J-Link Segger debug probe, which worked. Then I think the IDE etc. is okay.

    On the failing board, it doesn't matter what you've flashed to the SoC right?

    I'm thinking there is something odd with the other board in which you have the nRF52833, that doesn't allow you to debug. I assume this is a custom board? Do you have another one of them that you can try, just to check if something happened to malfunction on the one you are currently using. 

    Regards,

    Elfving

  • Hello Elfving,

    I did NOT try the DevKit with my J-Link-Segger debugger, but with the built in debugger of the DevKit... I currently dont have the JTAG connector soldered to the DevKit.

    We did triy to debug another board (of our product), with another J-Link-Segger debugger, and we have exactly the same problem/error shown in my first post. So, I guess it is pretty unlikely that there is something wrong with our board/hardware.

    But despite all that, we could debug with this same debugger and board 2 to 3 months ago. So, my guess is, that something has changed in the IDE or nRF plugin (some version update or so) that prevents us from debugging.

    Looking forward to any suggestions.

    Regards,

    Ion

  • IonS said:
    I did NOT try the DevKit with my J-Link-Segger debugger, but with the built in debugger of the DevKit.
    IonS said:
    We did triy to debug another board (of our product), with another J-Link-Segger debugger, and we have exactly the same problem/error shown in my first post. So, I guess it is pretty unlikely that there is something wrong with our board/hardware.

    Ah I see, sorry about that assumption.

    Then debugging generally works for you. But debugging using the J-Link-Segger debugger does not. Since you have tried two of them I assume there isn't anything wrong with the debugger per se, but maybe how it is connected/used? 

    In order to test that it would be great if you could use it for debugging something.

    IonS said:
    I currently dont have the JTAG connector soldered to the DevKit.

    I assume you don't have one for external debugging either?

    I find it strange in case there was something with the extension that would make only external debuggers fail. I just tried this myself with a DK and the newest version of NCS and the extension, and that seems to work fine.

    Regards,

    Elfving

  • Hello, 

    Just wanted to let you know that if this is something you are still struggeling with, I just had another case in which a customer was facing potentially the same issue. Have a look at his solution if you want.

    Regards,

    Elfving

Reply Children
No Data
Related