“STM32 + LoRa” Preparation & Config Parameters¶
LoRa Node 151 is based on STM32L151CCU6, Turtle Board is based on STM32L432KC, Our company is gradually replacing the IDE to STM32CubeIDE, which is the STMicroelectronics official just launched development tools for their own MCUs. Based on Eclipse, include code tracking, code completion, compilation, download, single-step debugging, and integrated with CubdeMX.
No matter what LoRa management platform is used, DevEui, AppKey, etc. parameters are must needed. And ensure that it is consistent with the relevant settings on the server.
- The following parameters are essential for OTAA mode:
- DevEui – Mote device IEEE EUI (big endian), 8 bytes;
- AppEui – Application IEEE EUI (big endian), 8 bytes;
- AppKey – AES encryption/decryption cipher application key, 16 bytes;
- The following parameters are essential for ABP mode:
- NwkSKey – AES encryption/decryption cipher network session key, 16 bytes;
- AppSKey – AES encryption/decryption cipher application session key, 16 bytes;
- DevAddr – Device address on the network (big endian), uint32_t;
- Install STM32CubeIDE and STM32CubeProgrammer correctly.
- A standard LoRaWAN gateway with at least 8 channels (based on SX1301/8 base band chip will be OK), and make sure your gateway had already connected to a LoRa server.
- A STM32 LoRa node( LoRa Node 151 , Turtle Board), a high quality USB cable and an ST-LINK.
The LoRaWAN example code of LoRa Node is a STM32CubeIDE project, here is the basic config steps.
- Download and install
- Double click
.projectdocument, open project
The first time you run, may have the following dialog box will, click Yes and then OK.
Commissioning.hfile according to your needs
- Note this macro definition:
- OVER_THE_AIR_ACTIVATION – 1：OTAA mode
- OVER_THE_AIR_ACTIVATION – 0：ABP mode
- Set the working bands in the macro definition.(Right-click the project to open
The content in the red box can only be one of the following bands:
- Ensure that the listening frequency of the gateway is the same as the transmitting frequency of the node
The code for the node transmit frequency is in the
Now, if download the program into your board, if everything is normal, it should be able to run.