RAK3172 - becoming unresponsive after MCU reset (ATZ) command

Hi,

I noticed a problem with RAK3172 module sometimes becoming unresponsive after MCU reset (ATZ\r\n) command. I can reproduce this behavior with a following loop on MCU attached to RAK3172:

  • restart MCU
  • configure UART
  • restart RAK3172
  • factory reset RAK3172
  • read RUI3 version and RAK serial number
  • delay few seconds
  • restart MCU
  • configure UART
  • restart RAK3172
  • read RUI3 version and RAK serial number
  • configure RAK (no auto join, OTAA join, class A, band, TX power, device EUIs, RX windows delays, no ADR, DR, low power enabled, Stop2 sleep level)
  • delay few seconds
  • back to first step

In the loop above this situation happens after around 30-40 iterations.

I noticed that, in successful cases, NRST pin drops to below 1V around 1ms after ATZ\r\n, and then goes back to 3.3V in ~15ms.


BOOT pin is always at 0V.
In cases where RAK becomes unresponsive, NRST is constantly on 3.3V. When reset “fails” RAK can be used only after full power cycle of whole PCB, though very rarely it responds with AT_COMMAND_NOT_FOUND.

I checked RAK RX line with logic analyzer and scope and I did not find any noise/spurious transmission from MCU. Is there a way to get some logs from RAK itself to determine its state and/or why it is not responding to any AT commands?

My setup:

  • custom PCB with application running on ESP32-C3 module and RAK3172 used as LoRa modem (in LoRaWAN mode)
  • connections between ESP32 and RAK:
    • ESP32 UART1 TX → RAK 1/RX2
    • ESP32 UART1 RX ← RAK 2/TX2
    • RAK 22/NRST pulled to 3.3V with 10k Ohm, 1uF cap to GND
    • RAK 21/BOOT pulled to GND with 10k Ohm
    • other RAK pins (apart from GND/VDD) are not used/connected
  • RUI: RUI_4.1.0_RAK3172-E and RUI_4.0.5_RAK3172-E

Example log from MCU:

2024-03-23 11:16:02.777: (1070) RAK3172: Modes:
2024-03-23 11:16:02.777: (1070) RAK3172:      [x] LoRaWAN
2024-03-23 11:16:02.777: (1070) RAK3172:      [ ] P2P
2024-03-23 11:16:02.778: (1070) RAK3172: Reset:
2024-03-23 11:16:02.778: (1080) RAK3172:      [ ] Hardware reset
2024-03-23 11:16:02.793: (1080) RAK3172:      [x] Software reset
2024-03-23 11:16:02.794: (1080) RAK3172: UART config:
2024-03-23 11:16:02.794: (1090) RAK3172:      Interface: 1
2024-03-23 11:16:02.794: (1090) RAK3172:      Buffer size: 512
2024-03-23 11:16:02.809: (1090) RAK3172:      Stack size: 4096
2024-03-23 11:16:02.809: (1090) RAK3172:      Queue length: 8
2024-03-23 11:16:02.809: (1100) RAK3172:      Rx: 18
2024-03-23 11:16:02.809: (1100) RAK3172:      Tx: 19
2024-03-23 11:16:02.809: (1100) RAK3172:      Baudrate: 115200
2024-03-23 11:16:02.825: (1120) RAK3172: Perform software reset...
2024-03-23 11:16:02.858: (1160) RAK3172: Response:
2024-03-23 11:16:03.049: (1340) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:03.049: (1350) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:03.065: (1350) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:03.065: (1350) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:03.066: (1360) RAK3172:      Successful!
2024-03-23 11:16:03.561: (1870) RAK3172: Perform factory reset...
2024-03-23 11:16:03.721: (2020) RAK3172: Response:
2024-03-23 11:16:03.913: (2210) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:03.914: (2210) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:03.929: (2220) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:03.930: (2220) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:03.930: (2220) RAK3172:      Successful!
2024-03-23 11:16:03.930: (2230) RAK3172: Transmit command: AT
2024-03-23 11:16:03.945: (2230) RAK3172:      Status: OK
2024-03-23 11:16:03.945: (2230) RAK3172: Transmit command: AT+NWM=?
2024-03-23 11:16:03.945: (2240) RAK3172:      Value: 1
2024-03-23 11:16:03.945: (2240) RAK3172:      Status: OK
2024-03-23 11:16:03.945: (2250) ESP32: RAK3172 init ok
2024-03-23 11:16:03.961: (2250) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:03.962: (2250) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:03.962: (2250) RAK3172:      Status: OK
2024-03-23 11:16:03.977: (2260) ESP32: Received 19 bytes. RAK version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:03.977: (2260) ESP32:     RAK3172 detected!
2024-03-23 11:16:03.977: (2270) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:03.978: (2280) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:03.993: (2280) RAK3172:      Status: OK
2024-03-23 11:16:03.993: (2280) RAK3172: Transmit command: AT+SN=?
2024-03-23 11:16:03.993: (2290) RAK3172:      Value: AC1F09FFFE1176D5
2024-03-23 11:16:03.994: (2290) RAK3172:      Status: OK
2024-03-23 11:16:03.995: (2290) ESP32: Reboot
2024-03-23 11:16:18.726: (1980) LoRaWAN: Initialize LoRaWAN interface...
2024-03-23 11:16:18.726: (1980) RAK3172: Use library version: 4.2.0
2024-03-23 11:16:18.726: (1980) RAK3172: Modes:
2024-03-23 11:16:18.726: (1990) RAK3172:      [x] LoRaWAN
2024-03-23 11:16:18.742: (1990) RAK3172:      [ ] P2P
2024-03-23 11:16:18.742: (1990) RAK3172: Reset:
2024-03-23 11:16:18.742: (1990) RAK3172:      [ ] Hardware reset
2024-03-23 11:16:18.742: (2000) RAK3172:      [x] Software reset
2024-03-23 11:16:18.742: (2000) RAK3172: UART config:
2024-03-23 11:16:18.758: (2010) RAK3172:      Interface: 1
2024-03-23 11:16:18.759: (2020) RAK3172:      Buffer size: 512
2024-03-23 11:16:18.759: (2020) RAK3172:      Stack size: 4096
2024-03-23 11:16:18.759: (2020) RAK3172:      Queue length: 8
2024-03-23 11:16:18.774: (2030) RAK3172:      Rx: 18
2024-03-23 11:16:18.774: (2030) RAK3172:      Tx: 19
2024-03-23 11:16:18.774: (2030) RAK3172:      Baudrate: 115200
2024-03-23 11:16:18.774: (2040) RAK3172: Perform software reset...
2024-03-23 11:16:18.822: (2080) RAK3172: Response:
2024-03-23 11:16:18.999: (2270) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:19.014: (2270) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:19.015: (2270) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:19.030: (2280) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:19.030: (2280) RAK3172:      Successful!
2024-03-23 11:16:19.526: (2790) RAK3172: Perform factory reset...
2024-03-23 11:16:19.686: (2940) RAK3172: Response:
2024-03-23 11:16:19.863: (3130) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:19.878: (3130) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:19.878: (3140) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:19.894: (3140) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:19.894: (3140) RAK3172:      Successful!
2024-03-23 11:16:19.894: (3150) RAK3172: Transmit command: AT
2024-03-23 11:16:19.894: (3150) RAK3172:      Status: OK
2024-03-23 11:16:19.895: (3150) RAK3172: Transmit command: AT+NWM=?
2024-03-23 11:16:19.910: (3160) RAK3172:      Value: 1
2024-03-23 11:16:19.910: (3160) RAK3172:      Status: OK
2024-03-23 11:16:19.910: (3170) LoRaWAN: DevEUI
2024-03-23 11:16:19.911: (3170) LoRaWAN: 00 00 00 00 00 00 00 00
2024-03-23 11:16:19.911: (3170) LoRaWAN: AppEUI
2024-03-23 11:16:19.926: (3170) LoRaWAN: 00 00 00 00 00 00 00 00
2024-03-23 11:16:19.926: (3180) LoRaWAN: AppKEY
2024-03-23 11:16:19.926: (3180) LoRaWAN: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2024-03-23 11:16:19.926: (3180) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:19.942: (3200) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:19.943: (3200) RAK3172:      Status: OK
2024-03-23 11:16:19.943: (3200) LoRaWAN:      Using RAK3172 library version: 4.2.0
2024-03-23 11:16:19.958: (3200) LoRaWAN:      Using RAK3172 firmware version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:19.958: (3210) RAK3172: Transmit command: AT+JOIN=0:0:7:0
2024-03-23 11:16:20.006: (3260) RAK3172:      Status: OK
2024-03-23 11:16:20.006: (3260) RAK3172: Transmit command: AT+NJS=?
2024-03-23 11:16:20.006: (3260) RAK3172:      Value: 0
2024-03-23 11:16:20.006: (3260) RAK3172:      Status: OK
2024-03-23 11:16:20.006: (3270) RAK3172: Transmit command: AT+CLASS=A
2024-03-23 11:16:20.022: (3270) RAK3172:      Status: OK
2024-03-23 11:16:20.022: (3270) RAK3172: Transmit command: AT+ADR=0
2024-03-23 11:16:20.070: (3330) RAK3172:      Status: OK
2024-03-23 11:16:20.070: (3330) RAK3172: Transmit command: AT+BAND=4
2024-03-23 11:16:20.070: (3330) RAK3172:      Status: OK
2024-03-23 11:16:20.086: (3330) RAK3172: Transmit command: AT+BAND=?
2024-03-23 11:16:20.086: (3340) RAK3172:      Value: 4
2024-03-23 11:16:20.086: (3340) RAK3172:      Status: OK
2024-03-23 11:16:20.086: (3350) RAK3172: Transmit command: AT+TXP=0
2024-03-23 11:16:20.086: (3350) RAK3172:      Status: OK
2024-03-23 11:16:20.102: (3350) RAK3172: Transmit command: AT+NJM=1
2024-03-23 11:16:20.103: (3350) RAK3172:      Status: OK
2024-03-23 11:16:20.103: (3360) RAK3172: Transmit command: AT+DEVEUI=0000000000000000
2024-03-23 11:16:20.150: (3410) RAK3172:      Status: OK
2024-03-23 11:16:20.151: (3410) RAK3172: Transmit command: AT+APPEUI=0000000000000000
2024-03-23 11:16:20.198: (3460) RAK3172:      Status: OK
2024-03-23 11:16:20.199: (3460) RAK3172: Transmit command: AT+APPKEY=00000000000000000000000000000000
2024-03-23 11:16:20.247: (3510) RAK3172:      Status: OK
2024-03-23 11:16:20.247: (3510) RAK3172: Transmit command: AT+LPM=1
2024-03-23 11:16:20.294: (3560) RAK3172:      Status: OK
2024-03-23 11:16:20.294: (3560) RAK3172: Transmit command: AT+LPMLVL=2
2024-03-23 11:16:20.358: (3620) RAK3172:      Status: OK
2024-03-23 11:16:20.358: (3620) RAK3172: Transmit command: AT+RX1DL=1
2024-03-23 11:16:20.374: (3630) RAK3172:      Status: OK
2024-03-23 11:16:20.374: (3630) RAK3172: Transmit command: AT+RX2DL=2
2024-03-23 11:16:20.390: (3650) RAK3172:      Status: OK
2024-03-23 11:16:20.390: (3650) RAK3172: Transmit command: AT+ADR=0
2024-03-23 11:16:20.406: (3660) RAK3172:      Status: OK
2024-03-23 11:16:20.406: (3660) RAK3172: Transmit command: AT+DR=0
2024-03-23 11:16:20.422: (3680) RAK3172:      Status: OK
2024-03-23 11:16:22.439: (5700) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:22.439: (5710) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:22.454: (5710) RAK3172:      Status: OK
2024-03-23 11:16:22.454: (5710) RAK3172: Transmit command: AT+SN=?
2024-03-23 11:16:22.454: (5720) RAK3172:      Value: AC1F09FFFE1176D5
2024-03-23 11:16:22.473: (5720) RAK3172:      Status: OK
2024-03-23 11:16:22.548: (5740) ESP32: Reboot
2024-03-23 11:16:25.634: (1070) RAK3172: Use library version: 4.2.0
2024-03-23 11:16:25.650: (1070) RAK3172: Modes:
2024-03-23 11:16:25.650: (1070) RAK3172:      [x] LoRaWAN
2024-03-23 11:16:25.650: (1070) RAK3172:      [ ] P2P
2024-03-23 11:16:25.650: (1070) RAK3172: Reset:
2024-03-23 11:16:25.650: (1080) RAK3172:      [ ] Hardware reset
2024-03-23 11:16:25.666: (1080) RAK3172:      [x] Software reset
2024-03-23 11:16:25.666: (1080) RAK3172: UART config:
2024-03-23 11:16:25.666: (1090) RAK3172:      Interface: 1
2024-03-23 11:16:25.666: (1090) RAK3172:      Buffer size: 512
2024-03-23 11:16:25.682: (1090) RAK3172:      Stack size: 4096
2024-03-23 11:16:25.682: (1090) RAK3172:      Queue length: 8
2024-03-23 11:16:25.682: (1100) RAK3172:      Rx: 18
2024-03-23 11:16:25.682: (1100) RAK3172:      Tx: 19
2024-03-23 11:16:25.682: (1100) RAK3172:      Baudrate: 115200
2024-03-23 11:16:25.698: (1120) RAK3172: Perform software reset...
2024-03-23 11:16:25.730: (1160) RAK3172: Response:
2024-03-23 11:16:25.922: (1340) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:25.923: (1350) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:25.938: (1350) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:25.938: (1350) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:25.938: (1360) RAK3172:      Successful!
2024-03-23 11:16:26.434: (1870) RAK3172: Perform factory reset...
2024-03-23 11:16:26.594: (2020) RAK3172: Response:
2024-03-23 11:16:26.786: (2210) RAK3172: Response: RAKwireless RAK3172
2024-03-23 11:16:26.786: (2210) RAK3172: Response: ------------------------------------------------------
2024-03-23 11:16:26.802: (2220) RAK3172: Response: Version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:26.802: (2220) RAK3172: Response: Current Work Mode: LoRaWAN.
2024-03-23 11:16:26.802: (2220) RAK3172:      Successful!
2024-03-23 11:16:26.802: (2230) RAK3172: Transmit command: AT
2024-03-23 11:16:26.818: (2230) RAK3172:      Status: OK
2024-03-23 11:16:26.818: (2230) RAK3172: Transmit command: AT+NWM=?
2024-03-23 11:16:26.818: (2240) RAK3172:      Value: 1
2024-03-23 11:16:26.818: (2240) RAK3172:      Status: OK
2024-03-23 11:16:26.818: (2250) ESP32: RAK3172 init ok
2024-03-23 11:16:26.834: (2250) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:26.834: (2250) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:26.834: (2250) RAK3172:      Status: OK
2024-03-23 11:16:26.850: (2260) ESP32: Received 19 bytes. RAK version: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:26.850: (2260) ESP32:     RAK3172 detected!
2024-03-23 11:16:26.850: (2270) RAK3172: Transmit command: AT+VER=?
2024-03-23 11:16:26.850: (2280) RAK3172:      Value: RUI_4.1.0_RAK3172-E
2024-03-23 11:16:26.866: (2280) RAK3172:      Status: OK
2024-03-23 11:16:26.866: (2280) RAK3172: Transmit command: AT+SN=?
2024-03-23 11:16:26.866: (2290) RAK3172:      Value: AC1F09FFFE1176D5
2024-03-23 11:16:26.866: (2290) RAK3172:      Status: OK
2024-03-23 11:16:39.585: (15010) ESP32: Reboot
2024-03-23 11:16:41.599: (1980) LoRaWAN: Initialize LoRaWAN interface...
2024-03-23 11:16:41.599: (1980) RAK3172: Use library version: 4.2.0
2024-03-23 11:16:41.599: (1980) RAK3172: Modes:
2024-03-23 11:16:41.599: (1990) RAK3172:      [x] LoRaWAN
2024-03-23 11:16:41.615: (1990) RAK3172:      [ ] P2P
2024-03-23 11:16:41.615: (1990) RAK3172: Reset:
2024-03-23 11:16:41.615: (1990) RAK3172:      [ ] Hardware reset
2024-03-23 11:16:41.615: (2000) RAK3172:      [x] Software reset
2024-03-23 11:16:41.631: (2000) RAK3172: UART config:
2024-03-23 11:16:41.631: (2000) RAK3172:      Interface: 1
2024-03-23 11:16:41.631: (2020) RAK3172:      Buffer size: 512
2024-03-23 11:16:41.631: (2020) RAK3172:      Stack size: 4096
2024-03-23 11:16:41.631: (2020) RAK3172:      Queue length: 8
2024-03-23 11:16:41.647: (2030) RAK3172:      Rx: 18
2024-03-23 11:16:41.647: (2030) RAK3172:      Tx: 19
2024-03-23 11:16:41.647: (2030) RAK3172:      Baudrate: 115200
2024-03-23 11:16:41.663: (2040) RAK3172: Perform software reset...
2024-03-23 11:16:51.647: (12040) RAK3172:      Timeout!
2024-03-23 11:16:51.647: (12040) RAK3172: Error check failed in (RAK3172_SoftReset) at line (812): 0xA005
2024-03-23 11:16:51.663: (12040) RAK3172: Error check failed in (RAK3172_Init) at line (615): 0xA005
2024-03-23 11:16:51.663: (12040) LoRaWAN: Cannot initialize RAK3172! Error: 0xA005