Based on this pull request to add SAML21 support to Mbed OS 5.
JLinkExe
is 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.cpp
and set your OTAA keys.
Open mbed_app.json
and set your frequency plan.
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.cpp
and set your OTAA keys.
Open mbed_app.json
and set your frequency plan.
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.