Skip to content


Repository files navigation

Example LoRaWAN application with the ATECC608A-MAHTN-T

This is an Mbed OS LoRaWAN example application that uses the Microchip ATECC608A-MAHTN-T secure element for all cryptographic operations. The ATECC608A-MAHTN-T contains a secure identity, root keys compatible with LoRaWan 1.0.x and 1.1, and a crypto accelerator.

With the ATECC608A-MAHTN-T, you'll receive a file from Microchip. This file contains the unique identifiers for the ATECC608As and is cryptographically signed. Upload this file to the The Things Industries Join Server to claim the devices.

More information can be found in this blog post: Introducing hardware crypto for LoRaWAN.


You'll need the following hardware:

Connect the CryptoAuthentication UDFN Socket Kit to the I2C_SDA and I2C_SCL pins on your development board. Connect the LoRa radio shield to the main SPI bus. If you use different pins, update mbed_app.json with the right configuration.

On the SAML21 Xplained Pro development board, connect the LoRa radio to EXT1, and the CryptoAuthentication UDFN Socket Kit to EXT3.

SAML21 Xplained Pro with LoRa radio and secure element

Getting started

This application can be built using Mbed CLI or the Mbed Online Compiler.

Importing the project

Mbed CLI

  1. Connect your development board to your computer.

  2. Import the application:

    $ mbed import

Online Compiler

  1. Connect your development board to your computer.
  2. Open the Online Compiler.
  3. Click Import > Import from URL.
  4. Enter

Setting credentials

You need to set your application EUI if you're using LoRaWAN 1.0.x. To set this EUIs, open main.cpp, and look for APP_EUI.

Setting the channel plan

This application is configured to use the EU868 channel plan. To override this, see Selecting a PHY in the official LoRaWAN example application.

Note that if you're using an 8-channel gateway in the US, you also need to set your frequency sub band. For instance, for The Things Network public network in the US, add:

            "lora.fsb-mask": "{0xFF00, 0x0000, 0x0000, 0x0000, 0x0002}",

Setting the LoRaWAN version

This application works with LoRaWAN 1.0.2, 1.0.3 and 1.1.1. To set the version, open mbed_app.json and override lora.version. The values supported are:

  • 0 - LoRaWAN 1.0.2
  • 1 - LoRaWAN 1.0.3
  • 10 - LoRaWAN 1.1.1


You're now ready to compile and flash the application.

Mbed CLI

  1. Compile and flash the application:

    $ mbed compile -m auto -t GCC_ARM -f

Online Compiler

  1. Click Compile.
  2. A file downloads, drag-and-drop this file to your development board (it mounts as a USB mass storage device).

Seeing debug information

Attach a serial monitor on baud rate 115,200 to see debug information. For more information see Serial communication in the Mbed OS documentation.


Full documentation of the application can be found in the offical Mbed OS LoRaWAN example and in the Mbed OS documentation, under LoRaWAN APIs and LoRaWAN architecture.


LoRaWAN example application for Mbed OS using the ATECC608A-MAHTN-T secure element







No releases published


No packages published