Getting started with Generic Node Sensor Edition, a multi-use case LoRaWAN® device

TheThings Network

The Things Network Global Team

Posted on 23-05-2022

Generic Node Sensor Edition is a hardware platform that simplifies building LoRaWAN® end-devices for various use cases. It provides a fast development lifecycle from concept to production with its reference hardware design files and source-available firmware.

STM32WL, a dual-core system-on-a-chip (SoC) is at the heart of the Generic Node Sensor Edition. Read the article 'What is Generic Node? Breaking down a multiple-use case LoRaWAN device' for an overview of Generic Node Sensor Edition hardware, its peripherals, and use cases.

The application development environment for Generic Node Sensor Edition can be set up on an operating system like MAC OS, Linux, or Windows. The application development process includes coding, building, flashing, and debugging that can be carried out using an integrated development environment (STM32CubeIDE) or a series of software tools such as VScode and CLI.

Generic Node Sensor Edition GitHub repository includes many resources that help you to get started with Generic Node. First, clone the repository to download its local copy on your computer. Once downloaded the repository you will have the following group of files:

  • Hardware - includes hardware design files such as schematics and PCB layouts. These design files can be explored using KiCAD or FreeCAD which are available free for downloading.
  • Software - includes software libraries, low-level target files, and sample applications that can be used as it is or customized to serve a specific use case.
  • Docs - includes Doxygen config files and generation guidelines.

You can write an application from scratch or use the app template provided in the repository. The app template provides a bloat-free template for starting with application development by customizing it and adding source files and building configurations according to your needs. The repository also includes some excellent application examples that are ready to build and flash to your Generic Node with a minimum configuration. We recommend you get started with the Sensor Edition: basic example because it will provide you with a better understanding of how the onboard sensors, RGB LED, piezo speaker, secure elements, and external flash memory work.

You can use any text editor of your choice to write your code. However, software like STM32CubeIDE and Visual Studio Code provides integrated editors for writing code with powerful editing features like IntelliSense.

Once you finish writing the code, build it using Command Line tools, Docker, STM32CubeIDE, or Visual Studio Code. The instructions for setting up the development environment and building instructions with each software can be found on the Sensor Edition Software Setup page. During the building process, the cross-compiler produces a binary code that will run on the generic node’s SoC.

To flash the binary code onto Generic Node’s SoC you need an ST-LINK or a similar SWD capable probe. There are multiple versions of this probe, but most of them have a similar pin-out and functionality. The instructions for wiring between Generic Node and the ST-LINK/V3 can be found on the Programming Software page. Another option to flash the device is to use the serial bootloader. To enable the bootloader user needs to short the BOOT jumper pins and reset or power-cycle the board. After that any 3.3V capable USB-to-TTL module could be used to transfer the firmware.

After wiring the board to the ST-Link, insert two AA batteries into the battery compartment of the device e and connect the ST-LINK probe to your computer using a micro USB cable. Then flash the binary executable file to Generic Node you need STM32CubeProgrammer, STM32CubeIDE, or OpenOCD (you can also use OpenOCD in combination with Visual Studio Code). ST-LINK also supports flashing binary executables to Generic Node by drag-and-drop through USB mounting. STM32CubeIDE supports debugging your application for bug fixing so you can execute your code line-by-line on Generic Node. The full instructions on flashing binary executables with each software can be found on the ST-LINK Programming Methods page.

Check out the video guide by firmware and hardware developers from The Things Industries for detailed instructions on how to use Generic Node for application development:

Generic Node was created in cooperation with our partners: STMicroelectronics, Sensirion, Bopla, Seeed, Cetecom, Ignion, Ricoh, Microchip, Irnas, and Comtac.

Get Generic Node Sensor Edition

LoRaWAN® is a mark used under license from the LoRa Alliance®.