Developing for the RAK3172 chipset in platformIO using Arduino

Hi,

I’m interested in developing code for a weather station to run on the STM32W inside the RAK3172-T hardware. I built the PCB for this project without realizing that the code runs on top of the RUI interface. Since I’m using a custom LoRa implementation (FANET – protocol documentation), I need direct access to the radio.

Has anyone got tips for doing this within PlatformIO using the Arduino framework?

Many thanks,
Mike

RUI3 is not supported by PlatformIO.
But you can use Visual Studio Code with Arduino Extension.

Thank you, BeeGee, for your fast reply! My understanding is that I can’t use the RUI3 firmware because I need direct access to the LoRa chip, must develop directly for the STM32W? I’m taking a look at the Meshtastic implementation, as they seem to have solved this, although it’s not straightforward.

Afaik Meshtastic has no official support for the STM32LWE5.
I see it in their repo, but it is not officially released.
You might want to talk with them directly.

For STM32CubeIDE, it is possible to use. See our RAK3172 WisDuo LPWAN Module Low Level Development Reference

Thank you for your reply.

I’ve made some progress with my project, but I’m running into an issue with the LoRa signal strength. Even across a small room, the signal is exceptionally weak. I suspect the problem might be with the RF switch configuration, as changing its settings doesn’t seem to affect the signal strength at all.

I’d like to confirm that the two GPIO pins used for RF switching are PB8 and PC13. For reference, here’s the current code I’m using to define the RF switch:

cpp

CopyEdit

// RF switch configuration
// static const uint32_t rfswitch_pins[5] = {PA4, PA5, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
static const uint32_t rfswitch_pins[5] = {PB8, PC13, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};

static const Module::RfSwitchMode_t rfswitch_table[] = {
    {STM32WLx::MODE_IDLE,  {LOW, LOW}},
    {STM32WLx::MODE_RX,    {HIGH, LOW}},
    {STM32WLx::MODE_TX_LP, {LOW, HIGH}},
    {STM32WLx::MODE_TX_HP, {LOW, HIGH}},
    END_OF_MODE_TABLE
};

Does this configuration look correct? I’ve compared the LOW/HIGH logic to the STM32Cube examples and tried to match them accordingly.

Any help or confirmation would be appreciated.

Best regards,
Mike

PB8 and PC13 are correct, but I am not sure about the RfSwitchMode table.
This is handled inside RUI3.
RAK3112 uses only the RFO_HP pin, the RFI_LP pin is not connected, so MODE_TX_LP does not exist.