Hi All,
I have a problem with a custom board (STM32F103C8) but also tested on a keil development kit MCBSTM32C (STM32F107VC). I'm trying to use the FlashFS with SD card in SPI mode using the SPI1 with remapped pins (PB3, PB4, PB5) but I can't.
I have done hundred test and the FlshFS works ok on any SPI including the SPI1 but when remaped to PB3... the SPI don't generate any signal. The STM32F uses the same pins for JTAG and of course I disabled this function.
To see if the problem is in the initialization or in the hardware I have tested it with simple SPI send function and the SPI1 with remapped pins works ok and generate all the signals, but, when initialize the FlashFS (of course I have the RTE_Device.h well configured with SPI1 remapped) the port SCK and MOSI are at "1" and nothing occurs.
Any ideas?..
Thanks
Make sure AFIO peripheral clock is enabled prior to remapping.
PB3 is used as part of SWD connectivity too, make sure get the right SWD/JTAG remapping, I think there are 3-4 settings. Check reference manual for explicit table.
Hi,
AFIO is clocked and JTAG disabled. Is an error from the SPI CMSIS DRIVER, the line 383 have no effect and need to change to
"GPIO_AFConfigure(spi->io.afio);
to
GPIO_PinRemapConfig (GPIO_Remap_SWJ_JTAGDisable, ENABLE); GPIO_PinRemapConfig (GPIO_Remap_SPI1, ENABLE);"
Of course the SPI is well configured in the RTE_Device.h but the driver not initializes the SPI well.
Thank you so much Alis,I had the same problem with SPI3 and your post solved that; thank again and GOD bless you.