Flashing a hex file (peripheral_lbs example built with vscode using NRF connect SDK) works when flashed with NRF Connect Desktop Programmer, but does not work when flashed with vscode directly.

Setup:

  • Connect SDK Version 2.4.1
  • Extension version: v2023.7.129
  • Hardware: NRF52840 dongle (PCA10059)
  • Tested on both Windows and Linux.

Steps to replicate the issue:

  • Run nrfjprog --recover and nrfjprog --eraseall.
  • Flash the built hex file using Flash button on the extension in VScode and JLink SWD debugger.
  • The board will not boot into the application.

Workaround:

  • Flash the original bootloader.
  • Open NRF connect Programmer and flash the hex file that was built by vscode.
  • The board will reset automatically and application will load.

From reading the forums, I know that I am missing something with bootloaders not being correctly merged with zephyr.hex that I build. I cannot figure out how exactly I can change peripheral_lbs so that I can flash with jlink debugger and make it boot. I also tried building the mcuboot example, but that did not boot either.

What I want to do is to not use USB at all for debugging and programming. I only would like to use the JLink debugger to flash the application and the bootloader.

Parents Reply
  • Hi Dejans, I can run the peripheral_lbs sample on the dongle without any modifications if I flash using NRF Connect Programmer. I just gave an example. Even the hello world program has the same issue. I think my question wasn't clear. I was able to flash a program with NRF Connect Programer, but not with the jlink debugger and vscode. 

    Anyway, I solved it by making the following changes:

    1.  Added CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n to prj.conf file

    2.  Changed #include "fstab-stock.dts" to  #include "fstab-debugger.dts" on boards\arm\nrf52840dongle_nrf52840\nrf52840dongle_nrf52840.dts file

Children
No Data
Related