cancel
Showing results for 
Search instead for 
Did you mean: 

Change peripheral on running

MBosc.2
Associate II

HI,

I am looking for an easy way to be able to change the pin use destination of the micro while running. I give an example for a project that I have to do. On some pins of the micro brought to a connector I have an SPI peripheral, on this connector I want to be able to put other things that need to change the operation in generic GPIOs, or in other peripherals. I've been looking for a way I haven't found how to do it, can the Cube help me? Otherwise there are too many registers to change and you risk making mistakes. I made this example but the combinations could be various. This request is because I can have "accessories" that I can put and I don't want to make a dedicated firmware, but to act as an instrument display. One thing I've tried doing the various configurations with the Cube and then doing a merge of the differences, but I don't know if that's the right way. thanks

2 REPLIES 2

Which STM32?

Unless it's 'F1, look at Alternate function mapping table in Datasheet, and read the GPIO chapter in RM.

JW

MBosc.2
Associate II

Yes, I know the functions that each pin can do. What I would like to do is change the function while I'm running.