RAK3172 Boot mode / Flash issue

Hi,

Got a RAK3172 breakout board and I am having problem flashing it.
I am unable to get the device into boot mode, or have been able to do it once or twice, as I got some program running on it, but…

Also a bit confused about AT commands that should be supported and versions.
I have a RAK3172 breakout board with RAK3171 module (metal case),

Have tested with Arduino, RAK_Device_Firmware_Upgrade_Tool_v1.4, but unable to flash.
I can see output on serial console and when pulling RST low, I can see the device restart.
Also ATZ restarts the device.

AT+VER=?
Response: AT+VER=RUI_4.0.5_RAK3172-E
What I can see, this is the latest, correct? (so AT+VERSION does not work)

AT+DEVEUI=? works…

AT+BOOT
Hangs the device, I read that is should output “Entering boot mode” or something similar…

Have also tested BOOT0 high or low, and RST twice, but nothing seem to have effect.

Having the BOOT0 pulled high a moment when flashing in arduino give log:

Device is not in boot mode
Detecting baudrate.
Entering boot mode
Device is not in boot mode
Device do not enter boot mode

So, it seem to be in boot mode a short moment…
Leaving BOOT0 pulled high dont help…

Do I have old firmware?
Is there a newer version of bootloader or something?
Any suggestion what I can test to figure this out?

Cheers
-Anders

Welcome to RAK forum @carlberg ,

Few ideas:

  1. 4.0.6 is the latest firmware.
  2. RAK DFU Tool v1.4 should work if you are in bootloader mode.
  3. Bootloader mode should be automatically activated by the Arduino IDE, RAK DFU tool or WisToolbox (whichever you use). If you want to manually go to boot mode, you should use AT+BOOT which you already did. Once you input AT+BOOT, close the Serial/UART terminal software you use then upload the firmware using RAK DFU Tool or WisToolBox (either should work).
  4. There will be no Entering boot mode reply/note in the latest firmware.
  5. You will only need to use BOOT0 (pullup to 3.3v) if you want to use the built-in bootloader of the STM32WL. You need to use STM32CubeProgrammer here. RAK DFU Tool and WisToolBox will not work.
  6. When uploading Arduino code, you should keep BOOT0 floating or keep it to ground. If it is failing to upload the code, manually force bootloader mode using AT+BOOT.
  7. Please ensure that all terminal software is close and the port selected is free whenever you upload firmware.

Thanks for replying carlrowan…

If I enter AT+BOOT in Arduino terminal, then I get AT_COMMAND_NOT_FOUND.
If I enter at+boot, then the device seem to go into boot mode. (it stops writing on the terminal).
So, I closed the terminal and try flashing from Arduino…
Output:

Sketch uses 146544 bytes (73%) of program storage space. Maximum is 200704 bytes.
Global variables use 27936 bytes (57%) of dynamic memory, leaving 20704 bytes for local variables. Maximum is 48640 bytes.
Forcing reset using 1200bps open/close on port COM12
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
PORTS {COM12, } / {COM12, } => {}
Uploading using selected port: COM12
C:\Users\acg\AppData\Local\Arduino15\packages\rak_rui\tools\uploader_ymodem\1.0.0/uploader_ymodem.exe -f C:\Users\acg\AppData\Local\Temp\arduino_build_397885/Blink.ino.bin -p COM12
Device is not in boot mode
Detecting baudrate…
Detect baudrate fail, can not get the baudrate

I installed STM32CubeProgrammer and tested connecting using UART and pulling BOOT0 high… and I am able to connect.
But I did not flash anything… dont know what to flash…
Can I use the https://downloads.rakwireless.com/RUI/RUI3/Image/RAK3172-E_latest.bin ? Or you have some .bin I can flash using STM32CubeProgrammer to maybe fix my issue?

Cheers
-Anders

Hi @carlberg ,

You can confirm if you are in bootloader mode by checking the version using AT+VER=? or at+ver=?. This is the same command for the RUI3 firmware.

image

With regards to STM32CubeProgrammer, you must upload the .hex file and not the .bin file.

The HEX file contains both application code and bootloader.

Here’s the hex - https://downloads.rakwireless.com/RUI/RUI3/Image/RAK3172-E_latest_final.hex

Hi @carlrowan
Here are the results of the commands.

at+ver=?
AT+VER=RUI_4.0.5_RAK3172-E
at+boot
Hangs the device or at least stops the program running. No more output after that.

Should I try flashing it using STM32CubeProgrammer and the hex file?

After at+boot, you can send at+ver=? to see the bootloader version. But if there is no respond. It is a good idea to update the firmware. I recommend to erase memory first before uploading the latest firmware (both to be done on STM32CubeProgrammer).

Thank you!

I flashed using STM32CubeProgrammer and finally I can flash using arduino and the device behave as expected.

Now I get these results. :slight_smile:
at+ver=?
AT+VER=RUI_4.0.6_RAK3172-E
at+boot
<BOOT MODE>

Cheers
-Anders