RAK4631 not booting Meshtastic (after flashing OpenThread CLI)

Hi,

I recently flashed ot-cli-ftd.uf2 built from GitHub - openthread/ot-nrf528xx: OpenThread on Nordic nRF528xx examples. on a RAK4631 (Meshtastic starter kit). Everything worked fine.

Now I tried to revert back to Meshtastic by flashing different firmware versions like firmware-rak4631-2.5.15.79da236.uf2.
As soon as the firmware transfer is complete, the green flickers quickly (almost staying on permanently) and the blue led lights up very dimly approx twice per second.
No ACM UART device / serial interface appears.

I also tried to flash a simple test sketch built with the Arduino IDE, but same result.

When I press the reset button once (not twice), the block device for flashing the firmware appears:

$ cat INFO_UF2.TXT 
UF2 Bootloader 0.4.3
Model: WisBlock RAK4631 Board
Board-ID: WisBlock-RAK4631-Board
Date: May 20 2023
Ver: 0.4.3
SoftDevice: not found

When reflashing ot-cli-ftd.uf2, the RAK4631 boots up and I can connect via the USB UART / serial interface as expected.
So I assume the hardware is ok.

Did I break the bootloader? and thus the compatibility with firmwares built with the Arduino toolchain?

Thank you!

Edit: I tried erasing the flash memory by flashing Meshtastic’s nrf_erase2.uf2, but same result as described above for the Meshtastic firmware.

Edit 2: Tried to flash WB_HW_Test_V1.1.8.uf2 from Boot Looping? RAK19007 & RAK19003 - #2 by beegee. But same result as described above. No serial device appears.
In case I broke the bootloader, can I reflash it somehow via USB without a programmer?

There are three software parts on a nRF52:

Bootloader
Softdevice
Application

Here it says that there is no Softdevice, so it cannot boot.
image

Try to flash the complete Bootloader/Softdevice with wiscore_rak4631_board_bootloader-0.4.3_s140_6.1.1.uf2

Thank you. Unfortunately, no change: Green LED flickers and blue LED lights up dimly approx twice per second. Still “SoftDevice: not found”.

I am not sure how you messed up bootloader and softdevice, but it looks like the only chance is to use a DAPLink or a JLink to recover the device.

Details are in our RAKDAP1 Quickstart Guide.

Install pyocd as shown in the guide.

  1. Install the correct package for nRF52:
pyocd pack --i nrf52840
  1. (optional, but in your case might be required) do a chip erase
pyocd erase -t nrf52840 --chip
  1. Flash the bootloader and softdevice. I am not sure if the HEX file in the Github repo includes both bootloader and softdevice. Usually they are flashed together using the UF2 tool. I attached a full nRF52 flash backup from one of my devices.
pyocd flash -t nrf52840 WisBlock-Backup.hex

WisBlock-Backup.zip (742.0 KB)

I do not own a programmer. Instead I tried to use openocd with interface/raspberrypi-native.cfg after connecting SWDIO, SWDCLK & ground to a raspberry pi zero but failed with:

Error: Error connecting DP: cannot read IDR

I’ll continue using that RAK4631 with non-arduino firmware (maybe some zephyr experiments).
Interestingly, flashing openthread/ot-nrf528xx’s ot-cli-ftd (built with -DOT_BOOTLOADER=USB) works.

Thank you!

I don’t know if a Raspberry Pi can replace a DAPlink device.

I am using Jlink or (rarely) our RAKDAP1 to flash device and was able to recover them always.

Thanks for all the information!

I just tested using the nrf connect toolchain (zephyr) instead of arduino and so far everything I tested (including bluetooth low energy) works fine

So I can workaround my broken softdevice for now (except from using Meshtastic).
Maybe I can retry in the future when I get my hands on a jlink or daplink.
Thank you!