Home

STM32CubeMX

STM32CubeMX is a graphical configuration tool from STMicroelectronics for the STM32 microcontroller family. It is part of the STM32Cube ecosystem and serves as the primary interface for configuring MCU peripherals, clocks, pin assignments, and middleware, and for generating initialization code. CubeMX focuses on creating projects that use either the HAL (Hardware Abstraction Layer) or LL (Low-Layer) drivers, and it can export ready-to-build code for multiple IDEs and toolchains.

Key features include a pinout view that maps peripheral functions to physical pins, a clock configuration tab

Workflow and usage: users select the target STM32 device, configure the pinout, set clock options, enable and

Relationship and history: STM32CubeMX is designed to streamline initial project setup and ensure consistent use of

that
builds
the
MCU's
clock
tree,
and
per-peripheral
configuration
for
timers,
ADCs,
communication
interfaces,
and
other
resources.
Middleware
options
such
as
FreeRTOS,
USB
stacks,
and
networking
stacks
can
be
included
as
part
of
the
generated
project.
The
tool
also
offers
code
generation
for
initialization
routines,
including
SystemClock_Config,
MX_<Peripheral>_Init,
and
HAL_MspInit,
along
with
MSP
(MCU
Support
Package)
code.
configure
peripherals,
add
middleware,
and
then
generate
a
project.
CubeMX
produces
a
configuration
file
(*.ioc)
and
a
complete
initialization
framework,
and
it
exports
projects
for
STM32CubeIDE,
Keil
MDK-Arm,
IAR
EWARM,
or
GCC-based
toolchains.
The
generated
code
provides
starter
files
such
as
main.c,
stm32xxxx_hal_m.c,
and
peripheral
init
functions.
ST’s
libraries.
It
can
be
run
as
a
standalone
application
or
integrated
into
STM32CubeIDE.
Introduced
with
the
STM32Cube
initiative
in
the
mid-2010s,
it
remains
a
central
part
of
ST’s
development
workflow.