STM32CubeMX Sensor Configuration

This page documents the current STM32CubeMX configuration for the Sensor Board firmware and explains how to extend it for sensor interfaces (UART/I2C/SPI/ADC) in a way that is safe for code generation.

Current CubeMX Snapshot

Item

Value

MCU

STM32H753ZIT6 (NUCLEO-H753ZI)

CubeMX Version

6.15.0

STM32Cube FW Package

STM32Cube FW_H7 v1.12.1

Toolchain

Makefile + GCC

Post-generation Script

../../../scripts/post_code_generation.bash

Enabled CubeMX Components

Clock and Core Setup

Clock Configuration (from IOC)

Parameter

Value

Clock Source

HSE 8 MHz -> PLL

SYSCLK

72 MHz

APB1

36 MHz (DIV2)

APB2/APB3/APB4

72 MHz

TIM1 Clock

72 MHz

Cortex-M7 / MPU

Pinout and Peripheral Mapping

Ethernet (RMII)

Signal

Pin

ETH_REF_CLK

PA1

ETH_MDIO

PA2

ETH_CRS_DV

PA7

ETH_MDC

PC1

ETH_RXD0

PC4

ETH_RXD1

PC5

ETH_TX_EN

PG11

ETH_TXD0

PG13

ETH_TXD1

PB13

Serial / COM

Signal

Pin

Note

USART1_TX

PA9

Configured in generated

MX_GPIO_Init()

USART1_RX

PA10

Configured in generated

MX_GPIO_Init()

USART3_TX

PD8

Used by NUCLEO COM path (

MX_USART3_Init

in app init)

USART3_RX

PD9

Used by NUCLEO COM path (

MX_USART3_Init

in app init)

Board IO / Misc

Pin

Mode

Typical Use

PC13

GPIO Input

User button

PB0

GPIO Output

Board output line

PB7

GPIO Output

Board output line

PB14

GPIO Output

Board output line

PH0 / PH1

HSE oscillator

System clock source

PC14 / PC15

LSE oscillator

Low-speed oscillator

Timer, RTOS, and Interrupts

TIM1 Base Timer

htim1.Init.Prescaler = 6400 - 1;
htim1.Init.Period = 10000;

With a 72 MHz timer clock, this gives an update period near 0.89 s.

Interrupt Priorities (Key Entries)

IRQ

Priority

Notes

ETH_IRQn

15

Ethernet/LwIP path

TIM1_UP_IRQn

12

TIM1 update interrupt

TIM2_IRQn

7

HAL tick time base

EXTI15_10_IRQn

6

External interrupt group

Sensor Interface Status

What Is Already Configured in CubeMX

What Is Not Yet Fully Modeled in CubeMX (TO-DO ONCE sensors retrieved and assembled)

Important: Current sensor drivers include placeholders for hardware access in multiple modules. When bringing up physical sensors, add the corresponding CubeMX peripherals first, then update the sensor drivers to use generated handles.

  1. Open components/sensor_board/firmware/firmware.ioc in STM32CubeMX.
  2. Add required peripherals for the target sensor like this:
GPS        -> USARTx (baud/parity/stop bits to match module)
IMU        -> I2Cx or SPIx (+ optional DRDY INT GPIO)
pH         -> ADCx channel (sampling time, resolution)
Load Cell  -> ADCx channel(s) or external ADC interface
Pressure   -> ADCx or I2Cx/SPIx (depends on sensor part)
  1. Assign and lock pins in Pinout view; avoid overlap with RMII and COM pins.
  2. Configure clocks for new peripherals in Clock Configuration.
  3. Set NVIC priorities for new ISR sources so Ethernet/RTOS timing remains stable.
  4. Generate code with Keep User Code enabled.
  5. Rebuild using PlatformIO and validate startup + sensor polling.

Conflict To Look Out for Before Saving .ioc file


Revision #1
Created 2026-04-18 12:23:40 UTC by Shishir Nambiar
Updated 2026-04-18 12:30:43 UTC by Shishir Nambiar