Skip to content

cpu/stm32: add initial STM32U3 and nucleo-u385rg-q support#22175

Open
itsadarshnair wants to merge 40 commits into
RIOT-OS:masterfrom
itsadarshnair:stm32u385-port
Open

cpu/stm32: add initial STM32U3 and nucleo-u385rg-q support#22175
itsadarshnair wants to merge 40 commits into
RIOT-OS:masterfrom
itsadarshnair:stm32u385-port

Conversation

@itsadarshnair
Copy link
Copy Markdown

@itsadarshnair itsadarshnair commented Apr 5, 2026

Contribution description

This PR adds initial support for the STM32U3 family and the NUCLEO-U385RG-Q board.

It includes:

  • initial STM32U3 CPU family support under cpu/stm32
  • board support for boards/nucleo-u385rg-q
  • basic clock and peripheral configuration required for bring-up

At the moment, this is an initial bring-up PR. The board boots and the LED blinking example was verified on hardware. Other peripherals and features may still be incomplete or untested.

At this stage, OpenOCD flashing support is not yet available. The board was programmed using STM32CubeProgrammer.

Testing procedure

The changes were tested with the examples/basic/blinky application on the nucleo-u385rg-q board.

Build:
bash
make -C examples/basic/blinky BOARD=nucleo-u385rg-q

Issues/PRs references

Progress for Tracking Issue #19264.

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • ChatGPT for understanding the porting process, code generation/suggestions, with user review
  • Gemini for understanding the porting process and code suggestions, with user review

@github-actions github-actions Bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: doc Area: Documentation Area: build system Area: Build system Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Apr 5, 2026
@crasbe crasbe added Type: new feature The issue requests / The PR implemements a new feature for RIOT State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary labels Apr 5, 2026
Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for creating the Pull Request with the STM32U3 support.

This is the first review round that is has mostly style related comments. I will do a second round once everything style-wise is in order.

There are merge conflicts that have to be resolved before this can be merged.

Comment thread features.yaml Outdated
Comment thread cpu/stm32/stm32_mem_lengths.mk Outdated
Comment thread cpu/stm32/stm32_info.mk Outdated
Comment thread cpu/stm32/kconfigs/u3/Kconfig Outdated
Comment thread boards/nucleo-u385rg-q/include/periph_conf.h
Comment thread cpu/stm32/include/periph/cpu_common.h Outdated
Comment thread cpu/stm32/include/periph/cpu_common.h
Comment thread cpu/stm32/periph/pm.c Outdated
Comment thread cpu/stm32/Makefile.cmsis Outdated
Comment thread cpu/stm32/Makefile.features Outdated
Comment thread boards/nucleo-u385rg-q/include/periph_conf.h Outdated
@crasbe crasbe added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary labels Apr 6, 2026
@riot-ci
Copy link
Copy Markdown

riot-ci commented Apr 6, 2026

Murdock results

✔️ PASSED

e119e6a Fix uart issue

Success Failures Total Runtime
11108 0 11108 11m:49s

Artifacts

@crasbe crasbe self-assigned this Apr 8, 2026
Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . nucleo-u385rg-q on your local computer. There are still a lot of compilation errors from missing definitions. Unfortunately that does not show in our CI because the newly added board is not in the quickbuild list.

Comment thread cpu/stm32/stmclk/stmclk_u3.c Outdated
Comment thread cpu/stm32/stmclk/stmclk_u3.c Outdated
Comment thread cpu/stm32/stmclk/stmclk_u3.c
Comment thread cpu/stm32/kconfigs/u3/Kconfig.lines
Adarsh Nair Mullachery added 27 commits May 21, 2026 17:07
- Implemented dynamic SYSCLK selection based on board configuration
  macros (HSI, MSI, HSE) instead of hardcoding HSI16.
- Removed dead PLL configuration logic, as STM32U3 natively reaches
  high frequencies via the MSI oscillator.
- Connected the FLASH_WAITSTATES macro to the ACR register to
  prevent HardFaults at higher frequencies.
- Removed initial bring-up notes and professionalized comments
  to meet upstream production standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants