Recover dead RAK3172

Hi,
I am using a RAK3172 custom board. I am using the Arduinoc core
“RAKwireless RUI STM32 Boards 4.2.1”

The board was working fine. I was able to program a sketch using Arduino IDE and arduino-cli, and I was able to read console output of my sketch via from the Serial Console

Suddenly, the board seems to be dead. This is what I am currently seeing:

  • No program output on the Serial Monitor
  • Not able to program the device with Arduino IDE. I get the error “Detect baudrate fail, can not get the baudrate”

What I have tried, with no sucess:

  • Spamming AT+BOOT on the serial port to try and get the device in bootloader mode
  • Double clicking the RESET button to try and get the board into bootloader mode

My boar has a SWD header so I could try and program it via SWD, or do chip erase + full factory reset. I have a JLink programmer. But I am unsure about what firmware I should upload in order for the board to work again with Arduino.

What firmware is the Arduino core expecting?
Where can it be downloaded?

@beegee I see you are quite knowledgeable in the matter. Would you be able to provide some guidance please?

Welcome back to RAK forum @asl07 ,

The FW can be found on the RAK3172 documentation. You can upload the hex file.

1 Like

Hello,
I was able to program RAK3172-E_latest_final.hex using JLinkExe. For reference, here is the sequence of commands used:

J-Link>connect
Device "STM32WLE5CC" selected.


Connecting to target via SWD
ConfigTargetSettings() start
J-Link script: ConfigTargetSettings()
ConfigTargetSettings() end - Took 19us
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
DAP initialized successfully.
InitTarget() end - Took 11.4ms
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
AP[1]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
[0][0]: E000E000 CID B105E00D PID 000BB000 SCS
[0][1]: E0001000 CID B105E00D PID 003BB002 DWT
[0][2]: E0002000 CID B105E00D PID 002BB003 FPB
[0][3]: E0000000 CID B105E00D PID 003BB001 ITM
[0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
[0][6]: E0043000 CID B105900D PID 005BB906 CTI
Memory zones:
  Zone: "Default" Description: Default access mode
Cortex-M4 identified.
J-Link>ls
Unknown command. '?' for help.
J-Link>loadfile /home/.../Downloads/RAK3172-E_latest_final.hex
'loadfile': Performing implicit reset & halt of MCU.
Reset type: NORMAL (https://kb.segger.com/J-Link_Reset_Strategies)
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading file [/home/.../Downloads/RAK3172-E_latest_final.hex]...
J-Link: Flash download: Bank 0 @ 0x08000000: 2 ranges affected (190464 bytes)
J-Link: Flash download: Total: 9.253s (Prepare: 0.146s, Compare: 3.005s, Erase: 2.070s, Program: 2.570s, Verify: 1.362s, Restore: 0.098s)
J-Link: Flash download: Program speed: 72 KB/s
O.K.

I can verify that the device is connecting OK with JTAG. The device responds correctly to halt or reboot commands.
But I see not RTT logs output when using JLinkRTTClient. I also don’t see any log output when connecting to the Arduino serial console. The device also doesn’t seem to connect to the Lora network.

What could I do to troubleshoot further? Would you expect to see any RTT logs or Serial port logs using the default firmware?

1 Like

Hi @asl07 ,
I had some issues as well, please, check my post here

https://forum.rakwireless.com/t/rak3172-serial-uart2-dying-after-prolonged-use/8436/12?u=igtti

I guess there is a problem in the bootloader. When flashing an old firmware via STM32CubeProgrammer, seems the bootloader is recovered…

Hi @asl07 ,

I haven’t tried Jlink RTT Logs. However, after successful upload of the hex file, the AT commands should work on UART2.

@IGtti Thanks — your comment pointed me in the right direction. UART2 started working again after flashing RUI_4.1.1_RAK3172-E_bl.hex and RUI_4.1.1_RAK3172-E.hex. It seems that all 4.2.x firmware releases are broken. I tested them all, and the board doesn’t appear to boot the app or bootloader correctly — no UART activity and no way to enter BOOT mode from the Arduino IDE.

@carlrowan, here’s a detailed summary you can share with the engineering team:

I was previously using the Arduino core rak_rui:[email protected], which points to RUI_4.2.1_RAK3172-E in its BSP. I’m not sure what firmware/bootloader my board originally had, as I hadn’t flashed it before. It had been working fine for a while, but at some point, UART activity stopped, and I couldn’t program it via UART using Arduino. The app also wasn’t running (no LoRa join), suggesting possible flash corruption — though I can’t confirm that. The fact it was working and it suddenly stopped without any apparent change is very strange.
I then reflashed the latest firmware using J-Link as suggested, but the issue persisted (still no UART output).

@IGtti mentioned a similar issue that was fixed by flashing RUI_3.5.4. I tried that, and UART came back. Testing further, the last version that works correctly is RUI_4.1.1 — any 4.2.x release results in no UART output and no sign of the firmware running.

I also noticed that the Arduino core RAKWireless RUI STM32 Boards v4.2.1 doesn’t seem compatible with the RUI_4.1.1 bootloader/firmware. After flashing 4.1.1, I can upload a sketch built for 4.2.1 only once, but it doesn’t run (no UART output), and subsequent uploads fail. Downgrading the Arduino core to RAKWireless RUI STM32 Boards v4.1.1 fixes this — I can upload repeatedly, and UART works as expected.

As a temporary workaround, I’ll port my app to 4.1.1, but it would be great to get more insight into what’s happening with the 4.2.x builds.

Here’s the J-Link flashing log for reference:

JLinkExe
SEGGER J-Link Commander V8.84 (Compiled Nov  5 2025 18:42:50)
DLL version V8.84, compiled Nov  5 2025 18:41:46

Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Oct 15 2025 17:02:50
Hardware version: V1.00
J-Link uptime (since boot): 0d 00h 00m 22s
S/N: 801031308
License(s): FlashBP, GDB
USB speed mode: Full speed (12 MBit/s)
VTref=3.296V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: STM32WLE5CC
Type '?' for selection dialog
Device>
Please specify target interface:
  J) JTAG (Default)
  S) SWD
  T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "STM32WLE5CC" selected.


Connecting to target via SWD
ConfigTargetSettings() start
J-Link script: ConfigTargetSettings()
ConfigTargetSettings() end - Took 16us
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
DAP initialized successfully.
InitTarget() end - Took 12.0ms
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
AP[1]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
[0][0]: E000E000 CID B105E00D PID 000BB000 SCS
[0][1]: E0001000 CID B105E00D PID 003BB002 DWT
[0][2]: E0002000 CID B105E00D PID 002BB003 FPB
[0][3]: E0000000 CID B105E00D PID 003BB001 ITM
[0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
[0][6]: E0043000 CID B105900D PID 005BB906 CTI
Memory zones:
  Zone: "Default" Description: Default access mode
Cortex-M4 identified.
J-Link>loadfile /home/.../Downloads/rui/RUI_4.1.1_282_release_firmware/Firmware/RAK3172-E/RUI_4.1.1_RAK3172-E_bl.hex
'loadfile': Performing implicit reset & halt of MCU.
Reset type: NORMAL (https://kb.segger.com/J-Link_Reset_Strategies)
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading file [/home/.../Downloads/rui/RUI_4.1.1_282_release_firmware/Firmware/RAK3172-E/RUI_4.1.1_RAK3172-E_bl.hex]...
J-Link: Flash download: Bank 0 @ 0x08000000: Skipped. Contents already match
O.K.
J-Link>loadfile /home/.../Downloads/rui/RUI_4.1.1_282_release_firmware/Firmware/RAK3172-E/RUI_4.1.1_RAK3172-E.hex
'loadfile': Performing implicit reset & halt of MCU.
Reset type: NORMAL (https://kb.segger.com/J-Link_Reset_Strategies)
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading file [/home/.../Downloads/rui/RUI_4.1.1_282_release_firmware/Firmware/RAK3172-E/RUI_4.1.1_RAK3172-E.hex]...
J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (180224 bytes)
J-Link: Flash download: Total: 8.487s (Prepare: 0.131s, Compare: 2.592s, Erase: 1.949s, Program: 2.429s, Verify: 1.284s, Restore: 0.098s)
J-Link: Flash download: Program speed: 72 KB/s
O.K.
J-Link>reboot
OnDisconnectTarget() start
OnDisconnectTarget() end - Took 1.68ms
Waiting for probe to reboot (timeout: 5000ms)... Rebooted successfully.
J-Link uptime (since boot): 0d 00h 00m 00s

After rebooting, I see the expected RAKwireless RAK3172-E Example banner on UART, and AT commands work normally. When usign any 4.2 release, I don’t see the banner in the UART and AT commands don’t work.

Thanks for your help investigating this

1 Like