cpu/stm32: add initial STM32U3 and nucleo-u385rg-q support#22175
cpu/stm32: add initial STM32U3 and nucleo-u385rg-q support#22175itsadarshnair wants to merge 48 commits into
Conversation
crasbe
left a comment
There was a problem hiding this comment.
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.
4072c14 to
ca4fb00
Compare
crasbe
left a comment
There was a problem hiding this comment.
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.
…nd 'FLASH_CR_PNB' compilation errors.
- 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.
11f37e6 to
5e144f7
Compare
crasbe
left a comment
There was a problem hiding this comment.
The tests/periph/vbat does not show the correct voltage. It should show 3.3V
main(): This is RIOT! (Version: 2026.07-devel-306-ge119e-stm32u385-port)
RIOT backup battery monitoring test
This test will sample the backup battery once a second
VBAT: 2823[mV]
VBAT: 2830[mV]
VBAT: 2833[mV]
VBAT: 2833[mV]
VBAT: 2830[mV]
VBAT: 2830[mV]
VBAT: 2830[mV]
VBAT: 2833[mV]
VBAT: 2830[mV]
VBAT: 2830[mV]
...
The tests/periph/i2c test hangs when trying to access the bus:
main(): This is RIOT! (Version: 2026.07-devel-306-ge119e-stm32u385-port)<\n>
Start: Test for the low-level I2C driver<\n>
> i2c_scan 0<\r><\n>
Scanning I2C device 0...<\n>
addr not ack'ed = "-", addr ack'ed = "X", addr reserved = "R", error = "E"<\n>
0 1 2 3 4 5 6 7 8 9 a b c d e f<\n>
0x00 R R R R R R R R
I used the tests/drivers/mcp23x17 test to test the SPI bus and it does not seem to work. Did you test the SPI bus?
The tests/periph/flashpage does not work:
main(): This is RIOT! (Version: 2026.07-devel-306-ge119e-stm32u385-port)
ROM flash read write test
Please refer to the README.md for further information
Flash start addr: 0x08000000
Page size: 4096
Number of pages: 256
> test 0
error verifying the content of page 0
>
The tests/periph/rtc test appears to work.
The tests/periph/hwrng test appears to work.
The tests/periph/pm test appears to work.
| { .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 5 }, /* A0 ADC1_IN5 */ | ||
| { .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 6 }, /* A1 ADC1_IN6 */ | ||
| { .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 9 }, /* A2 ADC1_IN9 */ | ||
| { .pin = GPIO_PIN(PORT_B, 0), .dev = 0, .chan = 15 }, /* A3 ADC1_IN15 */ |
There was a problem hiding this comment.
These channels do not appear to work. Briding the A0-A3 channels to 3.3V does not change the reading from tests/periph/adc.
| /** @} */ | ||
|
|
||
| /** | ||
| * @name USB device (USB DRD FS) configuration |
There was a problem hiding this comment.
Did you test the USB peripheral?
Contribution description
This PR adds initial support for the STM32U3 family and the NUCLEO-U385RG-Q board.
It includes:
cpu/stm32boards/nucleo-u385rg-qAt 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/blinkyapplication on thenucleo-u385rg-qboard.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: