Low-Power Easy LoRa Node with STM32L0 and LoRa SX1278
- Hardware is Dragino LSN50 v1.0: https://wiki.dragino.com/index.php?title=Lora_Sensor_Node-LSN50
- Internal LoRaST module: https://wiki.dragino.com/index.php?title=LoRa_ST
STM32DUINO liraries
- Code is written in Arduino style from stm32duino https://github.com/stm32duino/Arduino_Core_STM32
- Other stm32duino libraries: https://www.arduinolibraries.info/authors/stm32duino
- Noted issue with stm32duino and SPI LoRa: stm32duino/Arduino_Core_STM32#279
- Updated 2020-06-12: Can add STM32 via Board Manager and use B-L072Z-LRWAN1 directly https://github.com/stm32duino/Arduino_Core_STM32#getting-started
- Release note: https://github.com/stm32duino/Arduino_Core_STM32/releases
Referenced B-L072Z-LRWAN1: It is actually STM32L072CZT6
- I-CUBE-LRWAN: https://www.st.com/en/embedded-software/i-cube-lrwan.html
- Specs: https://www.st.com/resource/en/data_brief/b-l072z-lrwan1.pdf
Original at https://github.com/dragino/Lora/blob/master/LoRaST/v1.0/LoRa%20ST%20v1.0_Sch.pdf
Driver is at https://www.st.com/en/development-tools/st-link-v2.html#tools-software
- LSN50 -> STLink v2
- PA14 -> SWCLK
- PA13 -> SWDIO. NOTE: NEXT TO PA13 is PB14. WE NEED PA14!!!
- VCC -> 3.3+
- GND -> GND
Switch of LSN50 is ISP to upload code. It's recommended to remove UART TTL USB before uploading code via STLink
STLink v2 will show up in USB Device, not Ports (COM & LPT)
- LSN50 -> CP1202 USB TTL
- GND -> GND
- PA2 -> RX
- PA3 -> TX
Additional Boards Manager URLs: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
- Updated 2020-06-12: Can add STM32 via Board Manager and use B-L072Z-LRWAN1 directly https://github.com/stm32duino/Arduino_Core_STM32#getting-started
Outdated steps
- Instruction to add variants https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board)
- STM32 Source file location: https://github.com/stm32duino/wiki/wiki/Where-are-sources#stm32-core-sources-files-location
- Genpinmap for STM32L072CZT6 (used by LSN50) https://github.com/stm32duino/Arduino_Tools/tree/master/src/genpinmap/Arduino/STM32L072C(B-Z)Tx
- QUICK START - Custom variant for LSN50 by EASY LORA team) Copy and modify these file in C:\Users\(USERNAME)\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0 https://github.com/IoTThinks/EasyLoRaNode_LowPower/tree/master/stm32duino
Port COM4 in the picture is for UART. This is for debugging purpose.
The port is blank when we use STLink to upload code and UART USB is not plugged in
- User manual for v1.0 LSN50_LoRa_Sensor_Node_UserManual_v1.0.pdf
- AT Manual for stock firmware DRAGINO_STM_AT_Commands_v1.3.pdf
- SHT1x library https://github.com/practicalarduino/SHT1x
- Arduino LoRa STM32 https://github.com/armtronix/arduino-LoRa-STM32
- I2C for STM32 and Arduino https://circuitdigest.com/microcontroller-projects/stm32-stm32f103c8-i2c-communication-tutorial