Skip to content

Applications on LoRa-E5 mini/ LoRa-E5 Development Kit with v1.1.0 STM32Cube MCU Package for STM32WL series(SDK)

Notifications You must be signed in to change notification settings

Seeed-Studio/LoRaWan-E5-Node

Repository files navigation

LoRa-E5-LoRaWAN-End-Node

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.

Before starting

connection

GPIO Configuration Overview

  • As the hardware design of LoRa-E5 series is a bit different with NUCLEO-WL55JC, the official STM32WL55JC development board from ST, developers need to reconfigure some gpios, to adapt the SDK example to LoRa-E5 series. We have already reconfigured gpios in this example, but we think it is nessary to point out the difference.
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)

Getting Started

1. Build the LoRaWAN End Node Example

  • Step 1. Click here to visit Seeed-Studio/LoRaWan-E5-Node repository and download it as a ZIP file

pir

  • 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

pir

  • Step 5. Navigate to C/C++ Build > Settings > MCU Post build outputs, tick Convert to Intel Hex file (-O ihex) and click Apply and Close

pir

  • Step 6. Click Build 'Debug', and it should compile without any errors

build

pir

Now we will modify our Device EUI, Application EUI, Application KEY and LoRawan Region

  • Step 7. Please follow the guide here to setup your TTN application, get your Application EUI and copy it to the macro definition 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 }
  • Step 8. Also, you can modify your Device EUI and Application Key, by setting the macro definition 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

pir

  • Step 9. The default LoRaWAN Region is 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

pir

  • Step 10. After the above modifications, rebuild the example and program to your LoRa-E5. Open STM32CubeProgrammer, connect ST-LINK to your PC, hold RESET Button of your Device, then click Connect and release RESET Button:

pir

  • Step 11. Make sure the Read Out Protection is AA, if it is shown as BB, select AA and click Apply:

pir

  • Step 12. Now, go to the 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!

pir

You will see the message Download verified successfully, once programming is finished.

  • Step 13. If your LoRaWAN Gateway and TTN are setup, LoRa-E5 will join successfully after reset! A confirm LoRaWAN package will be sent to TTN every 30 seconds. The following log will be printed on the serial monitor (Arduino Serial Monitor is used here) if the join is successful:

pir

  • Cheers! Now you have connected LoRa-E5 to LoRaWAN Network! You can now proceed to develop more exciting LoRaWAN End Node applications!

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

About

Applications on LoRa-E5 mini/ LoRa-E5 Development Kit with v1.1.0 STM32Cube MCU Package for STM32WL series(SDK)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published