"FATAL ERROR: command exited with status 2" when attempting to flash Feather nrf52840 Express board, latest SDK

Hi all,

I've got an Adafruit nRF52840 Express board (https://www.adafruit.com/product/4062) and I would like to program it using nRF Connect and a Segger J-Link Ultra+.

I created a new project based on the Blinky example, and I selected "Adafruit Feather nRF52840 Express" as my board.

I am using nRF Connect, SDK/toolchain v2.5.2.

My project - which is just the blinky code - builds fine. My J-Link is detected and shows the correct serial # under the "Connected Devices" section in the left pane. It also shows, if I expand under the J-Link serial there, the target it is connected to: "NRF52840_xxAA_REV2".  So far, so good, right?

If I hit "Flash" here's what I get in the terminal:

Flashing build to 504500724
west flash -d c:\gitRepos\GRBlinkyTest\build --skip-rebuild -i 504500724 --erase

-- west flash: using runner jlink
-- runners.jlink: mass erase requested
-- runners.jlink: JLink version: 7.94j
-- runners.jlink: Flashing file: c:\gitRepos\GRBlinkyTest\build\zephyr\zephyr.hex
FATAL ERROR: command exited with status 2: 'C:\Program Files\Microsoft\jdk-17.0.4.101-hotspot\bin\jlink.exe' -USB 504500724 -nogui 1 -if swd -speed 4000 -device nRF52840_xxAA -CommanderScript 'C:\Users\scase\AppData\Local\Temp\tmpkajeev6djlink\runner.jlink' -nogui 1

* The terminal process terminated with exit code: 2.
* Terminal will be reused by tasks, press any key to close it.

If I open an older project which uses SDK 1.7.1, it still builds and flashes fine. I was also able to right-click on the target device in my side pane and have it erase the device. It seemed to be successful at that.

I downloaded the latest J-Link software and updated my existing installation. It is version 7.94j, as stated in the error message above.

VS Code is version 1.86.2 and says there are no further updates available.

Any ideas about what could be going on here?

Thanks!

Scott

Parents
  • I think I figured this out. The problem was that there was another executable in the path called "jlink." It's part of Java. So somehow, this Java executable was getting called when I went to flash the target, instead of the Segger one.  I removed the Java folder from my system path (no telling what that will break, but I'll worry about that later) and I added the path to the Segger jlink.exe. After that I had to close VSCode and re-open it, and now it's able to flash.

Reply
  • I think I figured this out. The problem was that there was another executable in the path called "jlink." It's part of Java. So somehow, this Java executable was getting called when I went to flash the target, instead of the Segger one.  I removed the Java folder from my system path (no telling what that will break, but I'll worry about that later) and I added the path to the Segger jlink.exe. After that I had to close VSCode and re-open it, and now it's able to flash.

Children
No Data
Related