Guide to write custom firmware for RAK3172

A tutorial how to write a custom firmware for the RAK3172: RAK3172 Module Low Level Development Reference | RAKwireless Documentation Center


I have followed the step as per guide you mentioned, but seems like guide is missing some steps ie. Commenting “USE_BSP_DRIVER” macro(from figure 25,28), etc.
After flashing my firmware I could not see any debug MSG from the uart2…

Can you kindly provide basic working stand for RAK3172?, So that I can speedup my activities.

HI @Subramanya , our guide is for LoRaWAN Middleware V1.0.0.

If you want a template for V1.1.0 middleware, you can try this repo from one of our users GitHub - danak6jq/RAK3172: Port of STM32WLxx example for RAK3172.

I’ve tried it and it works. I haven’t done deeper evaluation though. You can checkout the project and run/import it directly via the .ioc file. It should work directly without doing any radio source files modification. Just make sure you are using the latest STM32CubeIDE v1.8.0 on this with the updated STM32CubeMX.

However, this repo will only work on STLINK V2. Still got issues on the STM32CubeProgrammer tool for the UART bootloader.

I’m using CubeIDE ver 1.8.0, able to build the firmware but no data printing on uart2. Seems like firmware not print data over uart2 or firmware not booting. Same setup is working for Rak firmware v1.0.3.

Do we get data in uart2 ?

Hi @Subramanya ,

Are you following our low-level development guide with IDE 1.8.0? How did you upload the generated firmware? via STM32CubeProgrammer?

There must be a serial logs on uart2.

Yes, i followed all steps, I was not getting any data in uart2. Even I compiled GitHub - danak6jq/RAK3172: Port of STM32WLxx example for RAK3172 4 with no modified, observed same behaviour.

I used STM32CubeProgrammer.

If you are using our low level development guide, can you use CubeIDE 1.7.0 and LoRaWAN middleware 1.0.0. You can download them directly from ST site. The CubeIDE 1.8.0 must be uninstalled first.

The github repo I shared won’t work on STM32CubeProgammer as I mentioned above only via STLINK V2 directly connected to CubeIDE.

Can I get Rak3172 firmware v1.0.3 repo, since it is working with STM32CubeProgrammer, so that I can use it directly.
I have ST-Link V2, but I wand to know what is different between both? Both flash same firmware right then it should work with STM32CubeProgrammer also. Kindly provide your valuable feedback.

RAK3172 FW is not opensource so I can’t share the repo.

There is an issue on the STM32CubeProgrammers uploading the FW via the UART bootloader but it is working on STLINK V2 integrated to CubeIDE 1.8.0. You can follow the issue discussion here RAK3172 Low-Level Development patches ST firmware release · Issue #54 · RAKWireless/rakwireless-docs · GitHub.

For all RAKstars looking how to create custom firmware for RAK3172.

We just released support of RUI3 to RAK3172 :rocket:

Very useful articles:
What is RAKwireless Unified Interface V3 (RUI3)
How to get started with RUI3 APIs

Things to do:
Update your RAK3172 Firmware to support RUI3 using this guide:

Start exploring RUI3 on RAK3172 via Arduino IDE using this guide:

Explore demo:
The BSP has some examples included. You can find two more examples on @beegee 's github repo :rocket:

GitHub - beegee-tokyo/RUI3-Sensor-Node-Environment: RAK3172 RUI3 example code for environment sensors (RAK1901, RAK1902, RAK1903, RAK1906,RAK12002, RAK12010)

GitHub - beegee-tokyo/RUI3-Sensor-Node-Air-Quality: RAK3172 RUI3 example code for air quality sensors (RAK1906, RAK12047 stc, RAK12037 stc) (stc = soon to come)