Quick Start Guide: STM32Cube Expansion for IOTA DLT (X-CUBE-IOTA1)
Version 1.0 (December, 2019)
Hardware Overview: NUCLEO-F746ZG
The STM32 Nucleo-144 board provides an affordable and flexible platform for users to explore new concepts and build prototypes. It features an STM32 microcontroller and offers various combinations of performance and power consumption features.
Key Features:
- STM32 microcontroller in LQFP144 package
- 3 user LEDs
- 2 user and reset push-buttons
- 32.768 kHz crystal oscillator
- Board connectors: SWD, Arduino™ Uno V3, ST morpho
- Flexible power-supply options: ST-LINK, USB VBUS, or external sources
- On-board ST-LINK debugger/programmer with USB re-enumeration capability (mass storage, Virtual COM port, debug port)
- Comprehensive free software libraries and examples available with the STM32Cube MCU Package
- Support for Integrated Development Environments (IDEs) like IAR™, Keil®, and GCC-based IDEs
- External or internal SMPS for Vcore logic supply
- Ethernet compliant with IEEE-802.3-2002
Board Description: The NUCLEO-F746ZG board is depicted, showing its layout with the STM32 microcontroller, various connectors including the Arduino UNO R3 connector and Ethernet RJ45 connector. Latest information is available at www.st.com/NUCLEO-F746ZG.
Software Overview: X-CUBE-IOTA1
The X-CUBE-IOTA1 expansion software package for STM32Cube runs on the STM32 and includes middleware to enable IOTA Distributed Ledger Technology (DLT) functions. IOTA DLT is a transaction settlement and data transfer layer for the Internet of Things (IoT), allowing peer-to-peer and machine-to-machine transactions without fees in a trustless, permissionless, and decentralized environment, enabling micro-payments.
The expansion leverages STM32Cube software technology for easy portability across different STM32 microcontrollers. It includes sample implementations for the IOTA middleware on NUCLEO-F429ZI or NUCLEO-F746ZG development boards.
Key Features:
- Complete middleware to build IOTA DLT applications for STM32-based boards.
- Easy portability across different MCU families via STM32Cube.
- Examples to guide IOTA DLT application development.
- Includes STM32CubeMX project file (.ioc) for graphical visualization of microcontroller pins, peripherals, and middleware configuration.
- Free, user-friendly license terms.
Overall Software Architecture: The architecture is presented in layers: Application, Middleware (IOTA, Keccak, FreeRTOS, LwIP), Hardware Abstraction Layer (STM32Cube HAL), and Hardware (STM32 Nucleo expansion boards).
Setup & Demo Examples
Hardware Prerequisites:
- 1 x STM32 Nucleo-144 development board (NUCLEO-F746ZG/NUCLEO-F429ZI) with STM32F746ZG/STM32F429ZI MCU.
- 1 x USB type A to Mini-B USB cable.
- 1 x Ethernet cable.
Hardware Components: Images show a Mini USB cable, an Ethernet cable, and the NUCLEO-F746ZG development board.
Software Prerequisites:
- STSW-LINK009: ST-LINK/V2-1 USB driver.
- STSW-LINK007: ST-LINK/V2-1 firmware upgrade.
- X-CUBE-IOTA1 package: Copy the .zip file content into a folder on your PC. The package includes source code examples compatible with NUCLEO-F746ZG (or NUCLEO-F429ZI) for Keil, IAR EWARM, and System Workbench for STM32.
- Serial line monitor (e.g., Tera Term).
Setup Overview
The setup process involves the following steps:
- Go to www.st.com.
- Find X-CUBE-IOTA1.
- Download and unpack the software package.
- The software structure includes folders for
_htmresc
,Docs
(BSP, HAL, drivers),Drivers
,Middlewares
(IOTA, Keccak, LwIP, FreeRTOS Libs),Projects
,readme.txt
, andRelease_Notes.html
. - Connect the STM32 Nucleo board to your PC and drag-and-drop the *.bin file from the Binary folder onto the STM32 Nucleo drive.
- Build/Flash and Run the project.
- Evaluate using a serial line monitor (e.g., Tera Term).
Terminal Output Example: A Tera Term terminal window shows the process of obtaining an IP address and setting up an IOTA account, including a default SEED. The Tera Term serial port setup window is also shown, detailing configuration options like Port (COM14), Baud rate (115200), Data bits (8), Parity (none), Stop bits (1), and Flow control (none).
IOTA Transfer Process
The guide details how to perform IOTA transactions using the X-CUBE-IOTA1 package.
Setting Light Node Account:
After pressing the RESET button on the STM32 board, the initialization phase (IP address setting) is displayed. Users are prompted to enter a new seed (wallet password), which must be 81 characters long.
Main Menu:
Once the seed is created, the screen refreshes with the main functionalities: 1. Check balance, 2. Create 0-value transaction, 3. Create transfer, 4. Other functions, 0. Exit.
Check Balance:
Selecting option 1 displays the total amount of IOTAs (wallet balance) and balances for each security level, as returned by the Full Node. The implementation generates 50 addresses per security level.
0-Value Transaction:
Option 2 allows creating a 0-value transaction. This involves choosing an address, entering a message, and deciding whether to execute local/remote Proof of Work (PoW), broadcast the transaction, or reattach it.
The process includes transaction recap with signature, message, tag, PoW details, and broadcast status.
IOTA Transfer:
Option 3 facilitates IOTA transfers. Steps include:
- Choosing the number of receivers.
- Entering the receiver address.
- Choosing the amount of IOTA to transfer.
- Selecting the security level (set of addresses) with sufficient balance.
- Typing a message for the output transaction.
- Typing a Tag for the output transaction.
- Typing a Tag for the input transaction.
- Choosing PoW execution and broadcast options.
- Checking transaction finalization (input and output).
The process involves building the transaction, performing PoW, attaching to the Tangle, and broadcasting. Users can check the transaction status on the Tangle Explorer website.
Transaction Status: Transactions may initially be in a pending status. The Tangle explorer allows promoting or reattaching pending transactions. A popup confirms the success of reattaching.
Confirmed Transaction: The final step shows the reattached transaction being confirmed.
Other Functions
Option 4 from the main menu provides access to auxiliary functions:
- getNodeInfo: Retrieves information about the full node, including app name/version, JVM details, latest milestone, snapshot information, neighbors, queue sizes, features, and coordinator address.
- getBalances: Allows users to retrieve confirmed balances for addresses. Users specify whether they want to check a single address or multiple addresses, the security level, and the number of addresses (up to 50). The output shows addresses and their corresponding balances.
Documents & Related Resources
All related documents are available in the DESIGN tab of the related products webpage.
For NUCLEO-F746ZG/NUCLEO-F429ZI:
- Gerber files, BOM, and schematics.
- DB3171: STM32 Nucleo-144 boards – Data brief.
- UM1727: Getting started with STM32 Nucleo board software development tools – User Manual.
- UM1974: STM32 Nucleo-144 boards – User Manual.
For X-CUBE-IOTA1:
- DB3959: IOTA Distributed Ledger Technology software expansion for STM32Cube – Data brief.
- UM2606: Getting started with the IOTA Distributed Ledger Technology software expansion for STM32Cube – User Manual.
- AN5359: How to enable security features when using X-CUBE-IOTA1 – Application Note.
Consult www.st.com for the complete list.
STM32 Open Development Environment (ODE)
The STM32 ODE is an open, flexible, easy, and affordable way to develop innovative devices and applications based on the STM32 32-bit microcontroller family. It integrates state-of-the-art ST components via expansion boards, enabling fast prototyping with leading-edge components that can be transformed into final designs.
The ODE ecosystem includes:
- STM32Cube development software
- STM32 Nucleo development boards
- STM32 Nucleo expansion boards (X-NUCLEO)
- STM32Cube expansion software (X-CUBE)
- Function Packs (FP)
For further information, please visit www.st.com/stm32ode.