This guide is for LoRa-E5 mini/ LoRa-E5 Development Kit aiming at building several applications with STM32Cube MCU Package for STM32WL series(SDK).
Note: We have now updated the library to support v1.1.0 which is the latest version of STM32Cube MCU Package for STM32WL series.
Please read Erase Factory AT Firmware section first, as if we need to erase the Factory AT Firmware before we program with SDK
Install STM32CubeIDE(to compilation and debug) and STM32CubeProgrammer(to program STM32 devices), also download and extract STM32Cube MCU Package for STM32WL series(SDK)
LoRaWAN Gateway connected to LoRaWAN Network Server(e.g. TTN)
Prepare an USB TypeC cable and a ST-LINK. Connect the TypeC cable to the TypeC port for power and serial communication, connect the ST-LINK to the SWD pins like this:
SDK Example Label | GPIO of NUCLEO-WL55JC | GPIO of LoRa-E5 Mini and LoRa-E5 Dev Board |
---|---|---|
RF_CTRL1 | PC4 | PA4 |
RF_CTRL2 | PC5 | PA5 |
RF_CTRL3 | PC3 | None |
BUT1 | PA0 | PB13 (Boot Button) |
BUT2 | PA1 | None |
BUT3 | PC6 | None |
LED1 | PB15 | None |
LED2 | PB9 | PB5 |
LED3 | PB11 | None |
DBG1 | PB12 | PA0 (D0 Button) |
DBG2 | PB13 | PB10 |
DBG3 | PB14 | PB3 |
DBG4 | PB10 | PB4 |
Usart | Usart2(PA2/PA3) | Usart1(PB6/PB7) |
Step 2. Extract the ZIP file and navigate to LoRaWan-E5-Node > Projects > Applications > LoRaWAN > LoRaWAN_End_Node > STM32CubeIDE
Step 3. Double click the .project file
Step 4. Right click on the project and click Properties
C/C++ Build > Settings > MCU Post build outputs
, tick Convert to Intel Hex file (-O ihex) and click Apply and CloseNow we will modify our Device EUI, Application EUI, Application KEY and LoRawan Region
LORAWAN_JOIN_EUI
in LoRaWAN/App/se-identity.h
, for example, the Application EUI here is 80 00 00 00 00 00 00 0x07
:// LoRaWAN/App/se-identity.h
/*!
* App/Join server IEEE EUI (big endian)
*/
#define LORAWAN_JOIN_EUI { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 }
LORAWAN_DEVICE_EUI
and LORAWAN_NWK_KEY
in LoRaWAN/App/se-identity.h
. Make sure LORAWAN_DEVICE_EUI
and LORAWAN_NWK_KEY
are the same as the Device EUI
and App Key
in TTN console.// LoRaWAN/App/se-identity.h
/*!
* end-device IEEE EUI (big endian)
*/
#define LORAWAN_DEVICE_EUI { 0x2C, 0xF7, 0xF1, 0x20, 0x24, 0x90, 0x03, 0x63 }
/*!
* Network root key
*/
#define LORAWAN_NWK_KEY 2B,7E,15,16,28,AE,D2,A6,AB,F7,15,88,09,CF,4F,3C
EU868
, you can modify it, by setting the macro definition ACTIVE_REGION
in LoRaWAN/App/lora_app.h
// LoRaWAN/App/lora_app.h
/* LoraWAN application configuration (Mw is configured by lorawan_conf.h) */
/* Available: LORAMAC_REGION_AS923, LORAMAC_REGION_AU915, LORAMAC_REGION_EU868, LORAMAC_REGION_KR920, LORAMAC_REGION_IN865, LORAMAC_REGION_US915, LORAMAC_REGION_RU864 */
#define ACTIVE_REGION LORAMAC_REGION_US915
STM32CubeProgrammer
, connect ST-LINK to your PC, hold RESET Button
of your Device, then click Connect
and release RESET Button
:AA
, if it is shown as BB
, select AA
and click Apply
:Erasing & Programming
page, select your hex file path(for example: C:\Users\user\Downloads\LoRaWan-E5-Node\Projects\Applications\LoRaWAN\LoRaWAN_End_Node\STM32CubeIDE\Debug\LoRaWAN_End_Node.hex
), select the programming options as the following picture, then click Start Programming
! You will see the message Download verified successfully, once programming is finished.
Note: LoRa-E5 only supports high power output mode, so you can't use these macro definitions in radio_board_if.h
:
#define RBI_CONF_RFO RBI_CONF_RFO_LP_HP
// or
#define RBI_CONF_RFO RBI_CONF_RFO_LP
Eventhough RBI_CONF_RFO is defined as RBI_CONF_RFO_LP_HP in radio_board_if.h
, it will not be used because USE_BSP_DRIVER is defined and BSP_RADIO_GetTxConfig() function returns RADIO_CONF_RFO_HP