janjongboom / sam-lorawan-mbedos5

Mbed OS 5 LoRaWAN stack running on SAML21 and SAMR34 Xplained Pro
Apache License 2.0
6 stars 1 forks source link

Mbed OS 5 LoRaWAN stack on SAML21 / SAMR34 Xplained Pro boards

Based on this pull request to add SAML21 support to Mbed OS 5.

Requirements

Getting started (SAML21)

  1. Make sure you run the latest interface firmware on the SAML21 Xplained Pro board. The board should mount as USB drive (named XPLAINED). If this does not happen, start Atmel Studio and it should prompt you to update.

  2. Attach SX1276 click module to SAML21 Xplained Pro board on extension 1.

  3. Import this project through Mbed CLI:

    $ mbed import https://github.com/janjongboom/sam-lorawan-mbedos5
  4. Open main.cpp and set your OTAA keys.

  5. Open mbed_app.json and set your frequency plan.

    • Note: if you're using US915 you might also need to set your frequency sub-band. See this document.
  6. Build and flash this project:

    $ mbed compile -m SAML21J18A -t GCC_ARM -f
  7. Attach a serial monitor on baud rate 115,200 to see debug and trace messages.

This runs on both SAML21J18A and SAML21J18B MCUs, just compile for SAML21J18A target.

Getting started (SAMR34)

  1. Flash the JLINK interface firmware on the SAMR34 XPLAINED PRO board: instructions.

  2. Import this project through Mbed CLI:

    $ mbed import https://github.com/janjongboom/sam-lorawan-mbedos5
  3. Open main.cpp and set your OTAA keys.

  4. Open mbed_app.json and set your frequency plan.

    • Note: if you're using US915 you might also need to set your frequency sub-band. See this document.
  5. Build this project:

    $ mbed compile -m SAMR34_XPLAINED_PRO -t GCC_ARM
  6. Flash this project:

    $ JLinkExe -device ATSAML21J18 -if SWD -speed 4000 -autoconnect 1 -CommanderScript ./flash-jlink.txt
  7. Attach a serial monitor on baud rate 115,200 to see debug and trace messages.