Hi All,
Are there any plans to provide support for STM32U0xx series ?. A number of Nucleo boards are now available for this part.
Support for STM32U0xx series
Re: Support for STM32U0xx series
It will probably added. Any contribution are welcome.
-
- Posts: 142
- Joined: Mon May 06, 2024 1:46 pm
- Location: Germany
Re: Support for STM32U0xx series
The biggest problem is missing knowledge!
One topic from a different chip as example:
For a board with STM32G0B1CBT6 I'm using PA0/PA1 as TX/RX interface to Serial Monitor of ArduinoIDE and it works.
Until now I thought, that it is UART1.
But in datasheet I can see, it is USART4_TX and USART4_RX.
Does it has something to do with these lines in variant_generic.h?
Code: Select all
#ifndef SERIAL_UART_INSTANCE
#define SERIAL_UART_INSTANCE 4
#endif
I don't know. And those pin definitions are only a small part of setup for a new MCU

So I'm afraid, you are the only one to do this job ...
Re: Support for STM32U0xx series
Hi @STM32ardui
With this username I though you well know the porting
About STM32G0B1, you are right not link to this topic... Anyway why you thought it was USART1 ? Why not USART6 or other....
The variant is here to define the pins mapping and ressources (I2C, SPI, USART,....).
For generic, as they are automatically generated, the rule is simple the first USARTx found in the uart lists is used as default one for Serial. Lists are the one in PeripheralPins.c.
Then user is responsible to check which ressource ares used per default and can redefine it.
About adding a new series, contributor already add a full series: MP1.
Script exists to ease the new series introduction. Other PR introducing new series can be used to see what is required...
With this username I though you well know the porting

About STM32G0B1, you are right not link to this topic... Anyway why you thought it was USART1 ? Why not USART6 or other....
The variant is here to define the pins mapping and ressources (I2C, SPI, USART,....).
For generic, as they are automatically generated, the rule is simple the first USARTx found in the uart lists is used as default one for Serial. Lists are the one in PeripheralPins.c.
Then user is responsible to check which ressource ares used per default and can redefine it.
About adding a new series, contributor already add a full series: MP1.
Script exists to ease the new series introduction. Other PR introducing new series can be used to see what is required...
-
- Posts: 142
- Joined: Mon May 06, 2024 1:46 pm
- Location: Germany
Re: Support for STM32U0xx series
Well ... in this case I would have choosen STM32porti as usernamefpiSTM wrote: Tue Jul 23, 2024 1:14 pm Hi @STM32ardui
With this username I though you well know the porting![]()

Good question. May be because other non-STM32 boards only have one or two USART?fpiSTM wrote: Tue Jul 23, 2024 1:14 pm Anyway why you thought it was USART1 ? Why not USART6 or other....
Thank's for that info.fpiSTM wrote: Tue Jul 23, 2024 1:14 pm
For generic, as they are automatically generated, the rule is simple the first USARTx found in the uart lists is used as default one for Serial.
Re: Support for STM32U0xx series
for me my own preference/style is I'd try 'generic' or preferably some board that has it set up with the same HSE frequency.
Then if things goes goof, didn't work etc, I'd start copying out a variant file(s) and start making my own (requires editing boards.txt, normally it is copy / paste and edit)
in this way it is easier to identify issues / tweak codes for a better fit etc, and in a way if I goofed, I can switch back to 'standard' variants to see which edits I made mistakes
it seemed true that SERIAL_UART_INSTANCE defines the default uart instance, didn't know that too
Then if things goes goof, didn't work etc, I'd start copying out a variant file(s) and start making my own (requires editing boards.txt, normally it is copy / paste and edit)
in this way it is easier to identify issues / tweak codes for a better fit etc, and in a way if I goofed, I can switch back to 'standard' variants to see which edits I made mistakes

it seemed true that SERIAL_UART_INSTANCE defines the default uart instance, didn't know that too

-
- Posts: 142
- Joined: Mon May 06, 2024 1:46 pm
- Location: Germany
Re: Support for STM32U0xx series
When I scroll down inside PeripheralPins.c, I see this:
So one time SPI1 is the first and should be default, two times it is SPI2 ???
Code: Select all
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MOSI[] = {
{PA_2, SPI1, ...
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MISO[] = {
{PA_3, SPI2, ...
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SCLK[] = {
{PA_0, SPI2, ...
Re: Support for STM32U0xx series
Seriously? When a first pin is selected, linked peripheral is get then we search the first pin in other array with the same peripheral....