How to switch peripherals for the same pins in run-time (dynamically)?
I have a board that has a connector. Another board is mounted on top of it. This additional board may require either GPIO, or UART, or SPI on the same signals. But I need to change peripherals and work with pins without recompiling the code, without changing the firmware. It is required to do this at run-time (dynamically). The question is how to achieve this using STM32CubeMX and HAL/LL code? Are there any AppNotes? (I can achieve this by programming registers, no problem, I'm interested in how this is done within the framework of the CubeMx / HAL / LL paradigm).
