helium / longfi-arduino

Apache License 2.0
63 stars 48 forks source link

Add Sketch for Helium DevKit using CayenneLPP #12

Closed kent-williams closed 4 years ago

illperipherals commented 4 years ago

If we make just a couple changes here, we can compile in both Arduino IDE and Platformio without issue. I pulled this into my Platformio workspace and imported the libs. This works great for a "core" devkit main. Do we want to add a hardware "send" interrupt here as well rather than making that a completely different "sketch"? Oh, one note, I have the board I am using with platformio in jtag mode... thoughts there?

platformio.ini:

[env:disco_l072cz_lrwan1]
platform = ststm32
board = disco_l072cz_lrwan1
framework = arduino

upload_protocol = jlink
#upload_port = COM[6]

lib_deps =
     STM32duino X-NUCLEO-IKS01A3
     STM32duino LSM6DSO
     STM32duino LIS2DW12
     STM32duino STTS751
     STM32duino LIS2MDL
     STM32duino LPS22HH
     STM32duino HTS221
     MCCI LoRaWAN LMIC library
     CayenneLPP
     ArduinoJson
     CheckSum
     SPI
     Wire
kent-williams commented 4 years ago

If we make just a couple changes here, we can compile in both Arduino IDE and Platformio without issue. I pulled this into my Platformio workspace and imported the libs. This works great for a "core" devkit main. Do we want to add a hardware "send" interrupt here as well rather than making that a completely different "sketch"? Oh, one note, I have the board I am using with platformio in jtag mode... thoughts there?

platformio.ini:

[env:disco_l072cz_lrwan1]
platform = ststm32
board = disco_l072cz_lrwan1
framework = arduino

upload_protocol = jlink
#upload_port = COM[6]

lib_deps =
     STM32duino X-NUCLEO-IKS01A3
     STM32duino LSM6DSO
     STM32duino LIS2DW12
     STM32duino STTS751
     STM32duino LIS2MDL
     STM32duino LPS22HH
     STM32duino HTS221
     MCCI LoRaWAN LMIC library
     CayenneLPP
     ArduinoJson
     CheckSum
     SPI
     Wire

I have added a section to the readme including the required platformio.ini config.

We should try to use the default uploader/debugger utility, stlink, instead of jlink, specially since you need to reflash the on board debugger to even use jlink.

The current PlatformIO board config file found here is using the incorrect openocd script, but you can still get it to work by holding the reset right up until it initiates its routine, which I've added a note about. I'll be putting up a PR to request that fix.

illperipherals commented 4 years ago

Yep. I have a mix of boards some on ST-Link, some on segger. Thanks for the catch.