Based on this pull request to add SAML21 support to Mbed OS 5.
- Either one of:
- A SAMR34 XPLAINED PRO board.
- A SAML21 XPLAINED PRO board with an external SX1276 LoRa radio.
- Mbed CLI with its dependencies.
- GNU ARM Embedded Toolchain 6.
- On the SAMR34: J-Link Software and Documentation pack. Make sure
JLinkExeis in your PATH.
-
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. -
Attach SX1276 click module to SAML21 Xplained Pro board on extension 1.
-
Import this project through Mbed CLI:
$ mbed import https://github.com/janjongboom/sam-lorawan-mbedos5 -
Open
main.cppand set your OTAA keys. -
Open
mbed_app.jsonand set your frequency plan.- Note: if you're using US915 you might also need to set your frequency sub-band. See this document.
-
Build and flash this project:
$ mbed compile -m SAML21J18A -t GCC_ARM -f -
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.
-
Flash the JLINK interface firmware on the SAMR34 XPLAINED PRO board: instructions.
-
Import this project through Mbed CLI:
$ mbed import https://github.com/janjongboom/sam-lorawan-mbedos5 -
Open
main.cppand set your OTAA keys. -
Open
mbed_app.jsonand set your frequency plan.- Note: if you're using US915 you might also need to set your frequency sub-band. See this document.
-
Build this project:
$ mbed compile -m SAMR34_XPLAINED_PRO -t GCC_ARM -
Flash this project:
$ JLinkExe -device ATSAML21J18 -if SWD -speed 4000 -autoconnect 1 -CommanderScript ./flash-jlink.txt -
Attach a serial monitor on baud rate 115,200 to see debug and trace messages.