2020-09-11 04:39 AM
I am working on a project using STMCubeMX and an STM32G4 i would like to remap the MISO and MOSI pins, if I were to remap PB4 -> SPI_1_MISO to SPI_1_MOSI and viceversa with PB5 -> SPI_1_MOSI to SPI_1_MISO.
I have a Custom PCB with two STM32G4 communicating over SPI, by mistake I have connected PB4 coming from the master device to PB5 on the slave device , and now I am just wondering if it is possible to remap those two pins, according to the datasheet it does not look promising.
As shown here: PB4 has to be SPI_MISO and PB5 has to be SPI_MOSI.
Does anyone know about a workaround for this ?
Thanks
2020-09-11 05:10 AM
No, unfortunately no chance to exchange the pins internally.
BTW: when looking for a possible solution, it is always a good idea to include the necessary details, in this case e.g. that you are talking about an STM32G431.
Good luck with rewiring the pins externally!
/Peter
2020-09-11 05:12 AM
If speed allows, use bitbanging SPI.
2020-09-11 05:32 AM
I think this is going to be my only alternative, since it is not possible to exchange the pins internally, do you know where I could find some examples of bitbanging SPI ?
What do you mean by " if speed allows ?" is it the speed at which the CPU is runnning or the specific GPIOs ?
Thank you for your time.
2020-09-11 05:34 AM
Bitbanging either hogs the CPU or is slow. So speed may be an issue.
2020-09-11 05:36 AM
is it feasible to use bitbanging in this particular case instead of having to rewire the pins externally ?
Thank you for your time.
2020-09-11 06:07 AM
You can use BIDIMODE, although it's quite a PITA... :)
JW