cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple on-the-fly changeable pinout configurations for single periphery

s54mtb
Associate II

Hi. Is it possible to generate code with CubeMX for multiple configurations, which can be initialized on-the-fly?

Example:

I have only one UART available, e.g. UART1, which can be connecrted directly via RS232 voltage translator, or when USB VBUS voltage is detected, I would like to route UART1 to (external) USB/UART bridge. To spare glue logic I would like to use different pin mapping. Within CubeMX I can configure only one pinout for UART1. Is there any option to configure single periphery (UART1) to more than one pinout configuration?

Thanks.

Marko

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Yes, of course. CubeMX can't do that because it can't cover special cases that occur later in the application. But you can change the configuration at any time in the running programme if the respective STM32 offers the possibility to route UART1 to other GPIOs.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

Yes, of course. CubeMX can't do that because it can't cover special cases that occur later in the application. But you can change the configuration at any time in the running programme if the respective STM32 offers the possibility to route UART1 to other GPIOs.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

>> Is it possible to generate code with CubeMX

> Yes, of course. CubeMX can't do that

Isn't this the classic case of "Not, of course", then? 😉

JW

Got me - you're right. 😁

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
s54mtb
Associate II

Thanks.

Usually, I only include HAL/LL library and initialize periphery manually. Now I am preparing some small hands-on for local school and just checking if there is some "automation" for such cases.