2017-01-17 08:44 PM
Hello folks,
I am working to migrate my firmware from stm32f103 to stm32f20f family, for that I have gone through the guide provide by st
.Now my firmware includes spi (in master mode), GPIOs(in irq), Systick(configured in micros) all these are woking very well in stm32f1 and i am getting my desired output on tis MCU but when I migrated GPIOs(irq), SPI (tx irq), Systick works as expected but tough I am not getting my out put on spi slave device.
Here my slave device is 1.44 '' TFT LCD.
I am using Hal Library here.
For testing I did LED blinking it worked i also did uart but uart is also not working.
It seems like its something related to clocks.
I have configured my clocks on HSE 8 MHZ.
Requested to guide me here.
Also please let me know if i can provide any more details.
Thanks & Regards,
Rutvij trivedi
#stm32f1-to-stm32f2-spiSolved! Go to Solution.
2017-01-18 12:09 AM
Hey,
Thank you for your quick response, really appreciate .I got my solution and SPI is now working what I missing was
'GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;' in spi init.I thought
'GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;' is enough filed to set the GPIO in alternate functionality.
rest of the things were good to go, i just added the above mentioned filed and it worked !
Thanks & Regards,
Rutvij Trivedi
2017-01-17 09:40 PM
The way to manage alternate functions for gpio may be different (from f103 to f437 in my case). Toggling a gpio may not show this. If having a debugger, check the gpio and peripheral registers. If a group of them is zero, it means the clock enable for a peripheral may be missing. Look at the register in debugger mode and even manually play with them to find out. Most problems boil down to something very simple to fix. Alsi compare the clock tree diagram from ref manual, some improvements for peripheral clock source are implemented in some STM32.
2017-01-18 12:09 AM
Hey,
Thank you for your quick response, really appreciate .I got my solution and SPI is now working what I missing was
'GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;' in spi init.I thought
'GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;' is enough filed to set the GPIO in alternate functionality.
rest of the things were good to go, i just added the above mentioned filed and it worked !
Thanks & Regards,
Rutvij Trivedi