Skip to main content
Lep
Senior
May 10, 2022 3:58 PM UTC
Solved

STM32WB55 GPIO alternative SPI2(GPIO_AF3_SP2 vs GPIO_AF5_SPI2).

STM32WB55RGV6 connects ADS1299 by spi. And I choose spi2. There are three signas miso\ mosi and sck. SPI2 has two alternative: GPIO_AF3_SP2 and GPIO_AF5_SPI2.

① STM32CUBEMX automatically generated miso(GPIO_AF3_SP2), mosi and sck(GPIO_AF5_SPI2).Initialization is ok, but no data.

② All ​GPIO_AF3_SP2. Initialization is failed and application crash.

③​ All ​GPIO_AF5_SP2. Successfully.

Although the result is good, I do not understand why:sad_but_relieved_face:

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
May 10, 2022 4:31 PM UTC

Which pins?

Look at the Alternate functions table in the datasheet to determine, which AF number to use for each pin.

For example:

0693W00000NpiP4QAJ.png 

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
May 10, 2022 4:31 PM UTC

Which pins?

Look at the Alternate functions table in the datasheet to determine, which AF number to use for each pin.

For example:

0693W00000NpiP4QAJ.png 

JW

Lep
LepAuthor
Senior
May 10, 2022 4:45 PM UTC

Thank you,I found the error,SCK(PD1), GPIO_AF5_SPI2.