@ctpearson If you haven’t tried putting your J-Link into CMSIS-DAP mode yet, try it.
Putting this up for everyone’s reference. I’ve also included info for those with the nRF52840-DK dev board.
I had the same issue - hang during erase step - with an nRF52840-DK, in both Mbed Studio 1.4.1 and mbed-tools CLI v2. Because I primarily use SEGGER Embedded Studio, the onboard J-Link was running stock J-Link firmware.
mbed-tools, hence Mbed Studio, require the J-Link to be running CMSIS-DAP firmware. They won’t work in “J-Link mode.”
I don’t own a standalone J-Link, but it appears you can switch it into CMSIS-DAP mode as follows:
For those with the Nordic dev board: the nRF52840-DK has an onboard J-Link OB, which is a cost-reduced version. It must be flashed manually between J-Link and CMSIS-DAP modes. Note that it is possible to flash it back into J-Link mode, but the link for the .bin file is not in a proper download gallery, rather an attachment on Nordic’s forums. Knowing how links may go bad, make sure you have that .bin file before trying this, so you can always reflash back. That said, here’s how to convert your Nordic dev board; I tested it and can now flash from Mbed’s toolchain:
Download the CMSIS-DAP firmware for the nRF52840-DK’s onboard J-Link OB here.
- Switch off the nRF52840-DK. While holding down the IF BOOT/RESET pushbutton, turn on the board. Release the button.
- The board’s J-Link OB will boot into bootloader mode and should mount a drive on your computer. Drag the firmware .bin file onto this drive and allow it to flash (approx 5 seconds). LED5 will begin blinking when complete.
- Switch the board off, then back on. It’s now in CMSIS-DAP mode.
It’s possible to reflash the board back to J-Link mode, so you can play with Mbed and go back to your regular development tools like SEGGER Embedded Studio:
- Download the Nordic J-Link OB firmware .bin from this thread
- Download SEGGER’s Software and Documentation pack using the top link for v7.5.0; not strictly needed, just for updating to the latest version of J-Link firmware.
- Put the board into bootloader mode as above, by holdig the BOOT pushbutton during power-on. Drag the OB firmware .bin onto the mounted drive, let it flash (LED5 will begin blinking when done, as described above) and then power-cycle the board.
- Note this posted firmware file is several years old. To update, run J-Link Configurator, select the checkbox next to your J-Link in the list, then click “Update firmware of selected probes and programmers.”
Note that CMSIS-DAP / DAPLink programmers can be purchased very cheaply online for USD 10-15. You may want to purchase a separate CMSIS-DAP programmer for use with Mbed, and leave your J-Link as a… J-Link.
A thought for starving hackers: if you have the NRF52840-DONGLE, purchasing a CMSIS-DAP programmer for use with Mbed would get you a very economical little nRF + Mbed development environment. You would not be dependent on the Nordic bootloader anymore, and could program “bare metal,” at least with Mbed and other toolchains that support CMSIS-DAP programmers.