2025-01-15 02:41 PM
I am following a basic example from stm32: Getting started with SPI - stm32mcu
I follow the steps for setting up SPI master with polling (Blocking mode). I did make sure to select the board STM32H573 DK instead of the one listed in the example.
I initially used SPI5, however it wouldn’t transmit anything and its clock was always high.
Then I switched to using SPI2, however it was always stuck low.
Any insight would be appreciated.
I connected a logic analyzer and here is an image of this :
Solved! Go to Solution.
2025-01-17 08:50 AM
Update of the day: I was able to get SPI2 to work and still no success with getting SPI5 to work. I will continue forward with SPI2.
2025-01-15 02:44 PM
Are you sure those pins aren't occupied by something else on the board?
Check with the User Manual and/or Schematics
Can you toggle the pins when they're just in GPIO output mode?
2025-01-16 01:08 AM
Hello @A_Bit_More ,
Please check this article includes SPI characteristics and clarification of maximum clock frequency for STM32H5 devices: SPI maximum clock frequency for STM32H5 MCUs devices when using PB13 and PB14 I/Os
2025-01-16 08:30 AM - edited 2025-01-16 08:33 AM
Hi Andrew!
The only mode for the pin is Alternative Function PP and I have been able to set it high through STM32CubeMX.
This is the User Manual I'm following : attached below
For spi2 I don't see anything directly connected to it, other than it being an extension for arduino to connect.
For spi5, I don't see anything directly connected to it either, other than it having an extension for STMOD+.
Note: there is a typo on Table 31, where it states some pins are for spi5, but they are really for spi2. You can verify with table 32.
2025-01-16 11:42 AM - edited 2025-01-16 12:14 PM
Hi Imen.D
I'm not using PB13 or PB14.
Currently I'm using the default configs for the clock:
the pins I'm using:
for spi2 is
and for spi5 is :
2025-01-16 02:19 PM
Read out and check/post content of SPI and relevant GPIO registers.
JW
2025-01-17 08:50 AM
Update of the day: I was able to get SPI2 to work and still no success with getting SPI5 to work. I will continue forward with SPI2.
2025-01-17 08:51 AM
For Future Reference: SPI2 is good to use with this settings and to Avoid using SPI5