2022-08-18 11:30 PM
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
Solved! Go to Solution.
2022-08-19 12:05 AM
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
2022-08-19 12:05 AM
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
2022-08-19 12:39 AM
>> 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
2022-08-19 01:25 AM
Got me - you're right. :beaming_face_with_smiling_eyes:
2022-08-19 03:13 AM
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.