Skip to content

MBane04/STM32H5_Secure_Sensor_Node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Secure IoT Sensor Node with STM32H573I-DK

Overview

A secure environmental sensor node built around the STM32H5 microcontroller platform. This project implements hardware-based security features to collect, authenticate, and log sensor data, serving as a reference design for embedded security applications in IoT and industrial systems.

Features

  • Multi-Sensor Environmental Monitoring: Temperature, humidity, and barometric pressure sensing via Bosch BME280.
  • Hardware Security Implementation: Utilizes STM32H5 TrustZone and Secure Manager for cryptographic operations.
  • Secure Data Logging: Signed data storage to microSD card with integrity verification.
  • Dual Connectivity: Wi-Fi and Ethernet interfaces for flexible deployment.
  • Development-Friendly: Full STM32CubeIDE project with configuration tools.

Bill of Materials (BOM)

This project requires the following hardware components:

Component Model / Specification Purpose / Notes
Main Controller STM32H573I-DK Discovery Kit (STM32H573IIK3Q MCU) Core development board with Arm® Cortex®-M33, TrustZone®, touchscreen, Wi-Fi, and microSD slot.
Environmental Sensor Bosch BME280 Breakout Module (I2C/SPI) Measures temperature, humidity, and barometric pressure.
Power/Programming USB 2.0 Type-C to Type-A Cable Provides power and the debug/programming connection.
I2C Pull-up Resistors 2 x 4.7 kΩ Resistors Required for reliable I2C communication on the SDA and SCL lines.
Data Storage microSD Card (≥ 8 GB recommended) For secure logging of sensor data using a filesystem (e.g., FATFS).
Prototyping Breadboard & Jumper Wires For easy integration of pull-up resistors and other peripheral connections.

Hardware Setup & Pin Configuration

The primary sensor connection is made via the board's Arduino-compatible header (CN7).

Signal STM32H573I-DK Pin (CN7) BME280 Pin Notes
I2C1_SDA (Data) PB9 SDA Requires a 4.7 kΩ pull-up resistor to 3.3V.
I2C1_SCL (Clock) PB8 SCL Requires a 4.7 kΩ pull-up resistor to 3.3V.
3.3V Power 3.3V output VCC / VIN Must use 3.3V. Do not connect to 5V.
Ground GND GND Common ground reference.

Software Architecture

The firmware is structured to leverage the STM32Cube ecosystem:

  • Hardware Abstraction Layer (HAL): STM32CubeH5 drivers for peripheral management.
  • Security Layer: STM32Trust TEE Secure Manager with TrustZone isolation for critical operations.
  • Sensor Layer: Dedicated driver for the BME280 sensor.
  • Storage Layer: FATFS middleware for file operations on the microSD card.
  • Application Layer: Main control logic integrating sensing, security, and logging.

Getting Started

Prerequisites

  • IDE: STM32CubeIDE (v1.14.0+)
  • Firmware Package: STM32CubeH5 MCU Package.
  • Terminal Emulator: (e.g., PuTTY, Tera Term, screen) for serial debug output.

Building and Flashing

  1. Clone & Import:
    git clone https://github.com/yourusername/secure-iot-sensor-h573.git
    Open STM32CubeIDE and import the project from the firmware/ directory.
  2. Build the Project: Use the Project → Build All command (or Ctrl+B).
  3. Connect Hardware: Power the board via USB-C and ensure the ST-LINK debugger is recognized.
  4. Flash the MCU: Use the Run → Debug command to program the board. Press 'Resume' to start execution.

Initial Operation

  1. Open your serial terminal software and connect to the board's Virtual COM Port.
  2. Configure the terminal for 115200 baud, 8 data bits, no parity, 1 stop bit (8N1).
  3. On startup, the system will output initialization status and begin printing sensor readings.
  4. Follow the serial menu prompts to configure network credentials if using Wi-Fi/Ethernet transmission.

Security Implementation

This project demonstrates key hardware security features of the STM32H5:

  • Secure Boot: Established via the immutable root-of-trust (ST-iROT).
  • TrustZone®: Isolates cryptographic key handling and signing operations in the Secure World.
  • Cryptographic Acceleration: Leverages hardware accelerators for AES, HASH, and random number generation (RNG).
  • Secure Storage: Protects cryptographic keys within dedicated, hardware-isolated areas.

Project Structure

STM32H5_Secure_Sensor_Node/
├── firmware/ # Source code and IDE project
│ ├── Core/
│ │ ├── Inc/ # Application header files
│ │ ├── Src/ # Application source files
│ │ └── Secure/ # TrustZone Secure World code
│ ├── Drivers/
│ │ ├── STM32H5xx_HAL_Driver/ # HAL drivers
│ │ └── BME280/ # Sensor driver
│ ├── Middlewares/ST/ # FATFS middleware (for microSD)
│ └── STM32CubeIDE/ # IDE-specific project files
├── hardware/
│ ├── datasheets/ # Component datasheets
│ └── schematics/ # Connection diagrams
├── docs/ # Additional documentation
└── README.md # This file

Documentation & References

License

This project is published under the MIT License. See the LICENSE file in the repository for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors