cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 does not produce I2S data.

hvan.winkoop9
Associate II
Posted on May 30, 2017 at 18:54

Hi,

maybe somebody can help me out.

It's about the STM32F401. For a few days I'm struggling now but still no I2S data or clock activity shows up at the 4 SPI2 peripheral outputs. All stay low. I like to configure all uC registers by hand for learning purposes.

The SPI2 peripheral should produce I2S data. If 16-bit values are written to the SPI2 data register the debugger shows that directly after a new write the TXE bit in the status register is cleared and then reappears and new data is written. But probing the 4 SPI2/I2S2 outputs no data shows up.

Next items are checked:

- the original SPI2 peripheral outputs are used so no remapping is needed

- the SPI2 peripheral outputs are configured as alternate function outputs push-pull (highest speed)

- if the PLLI2S clock is set to external input no repeated TXE interrupts occur (so I2SPLL clock is running)

- I2S clock frequency is 96MHz

- the SPI2 peripheral clock is switched on

- (no alternate function outputs clock is available like at the STM32F103)

- SPI2 is configured while SPI2 is disabled

- SPI2 is selected to produce I2S (versus SPI) data in PCM mode

- I2SDIV=187 and I2SODD=1 (I2S settings according first line in table 91 page 590/841 of reference manual pdf)

- finally SPI2 is enabled

- using the debugger it is checked that all relevant registers contain the expected values

...still no data comes out...

Maybe I lack some knowledge or forgot something.

Just wondering what it could be.

1 REPLY 1
hvan.winkoop9
Associate II
Posted on June 07, 2017 at 22:03

Hi,

let me answer myself...

I did not know that each peripheral input/output must be redirected individual to some physical uC pin using GPIOx_AFRL/H. After doing so all works fine!

Thanks for listening!