Low Level Development Reference
Overview
RAK811 module comes with a standard version of firmware that allows you to configure its functionality via AT commands. This simplicity helps you develop LoRa(P2P) and LoRaWAN projects quickly.
Further customization of the firmware can be done through the RUI (RAKwireless Unified Interface) Online compiler. RAK's LoRaWAN node modules support not only out-of-the-box integration via AT commands but also allow you to customize RAK811 firmware and access other functionalities of the internal MCU using RUI API. More so, you can adapt and extend the logic in the firmware to meet your requirements.
Additionally, RAK offers a third alternative for advanced customers who need to have deeper integration of their solutions with these modules. In this alternative, you could develop your own version of STM32 firmware that runs inside of the RAK811 module.
How to Implement Your Own Firmware on RAK811 Module
Schematic
One of the essential aspects that allow customers to develop their own version of firmware is the RAK811 Hardware Schematic. This allows the customers to understand the module’s pinout and the connections between the internal STM32 MCU and the LoRa transceiver. Other important details can be found on RAK811 Datasheet.
There are two versions of the RAK811 module: the high-frequency bands RAK811(H) used on EU868, US915, AU915, KR920, AS923, and IN865, and the low-frequency bands RAK811(L) used on EU433 and CN470. These two modules have few differences in their schematic diagram that you should be aware of when you develop your own firmware.
Porting Lora Protocol Stack
When implementing the LoRa protocol stack, special attention must be given to the SPI connections since the LoRa transceivers are controlled by the MCU through an SPI interface. Hence, the following are the important pins: SPI1_MISO, SPI1_MOSI, SPI_NSS, SPI_CLK.
Additionally, the DIO pins and RF signal paths are significant as well to have functional LoRa communication. Another important thing to consider is the RF switch logic table. The complete details of pin connections can be found on the RAK811 Datasheet.
After that, the Real-Time Clock (RTC) must be properly configured in the MCU to ensure accurate timing of the protocol stack during the runtime. Finally, the protocol stack code can be added after configuring the other pins.
Application
Once the porting of the protocol stack is ready, you can focus on the development of their applications. There are two options you can choose with:
a. Develop your own bootloader.
b. Use RAK bootloader and the upgrade the custom firmware by using RAK Device Firmware Upgrade (DFU) Tool.
If you want to fully develop your own, you can refer to the schematic diagram and the datasheet of the MCU to implement the code. But if you want to use the RAK bootloader, continue reading the next section.