nRF Connect for VS Code refuses to start debug on my custom board

Hi,

Working on a new project, custom board, using an nRF52840. Wrote my own DTS and all that. Program works as intended, but the nRF Connect for VS Code plugin refuses to start debugging.

Error-message is:

Unknown device type "nrf52840". Only Nordic devices are supported.

I can start ozone manually and load the .elf, but doing this from vscode would be.. nice?

Is this not supported on a custom (Nordic SOC-based) board, or is there something missing in my custom board definition, or project setup? How does the vscode plugin determine the device type?

Thanks,

Parents
  • Ok, I think we found the issue. For the Thingy91x, there is a bug in the board files. Please look at the file:

    v2.9.0\nrf\boards\nordic\thingy91x\board.cmake.

    Line 8 and 11 are saying:

    elseif(BOARD_THINGY91X_NRF5340_CPUAPP OR BOARD_THINGY91X_NRF5340_CPUAPP_NS)
    elseif(BOARD_THINGY91X_NRF5340_CPUNET)

    they are missing "CONFIG_" before "BOARD". Please correct them to:

    elseif(CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP OR CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS)
    elseif(CONFIG_BOARD_THINGY91X_NRF5340_CPUNET)

    Note that there are two corrections on the first line.

    This was causing the build folder to miss these last two lines in the file build\<app_name>\zephyr\runners.yaml:

      jlink:
        - --dt-flash=y
        - --device=nrf5340_xxaa_app
        - --speed=4000
    

    Try rebuilding after fixing the board.cmake file (you may need to delete the build folder, and create the build configuration again).

    After the fix, make sure that the runners.yaml file contains those last lines, and try debugging again.

    For the custom board, make sure that you have the corresponding lines in the custom board's board.cmake file.

    I have reported the bug in the thingy91x file internally, so it will hopefully be patched within the next release.

    Best regards,

    Edvin

  • Thanks Edvin. The solution works well.
    Since it always complaint about UICR (Debug always tries to flash and never succeeds. Even doing "Erase and flash to board" right before debug.), I also added "--erase" to board_runner_args(nrfutil ...).

Reply Children
No Data
Related