2021-06-07 10:11 AM
Hi guys,
I have no idea whats going on. I no longer can't get the I2S peripheral working on the STM32H753ZI.
The I2S was working.
From the last post the Tx was not working, but as I kept working on the code to get the Tx back online, now the clocks that were produced (WS, SCLK, MCLK) no longer is working. I
have no idea whats going on but every-time I keep working on the I2S more and more stop working.
I believe I need a new set of eyes to look at this as I dont see anything wrong, as I went back to old forum post, questions, very old code (THAT WAS CONFIRMED WORKING) are now no longer working.
Can please someone help me get the I2S working again. Completely lost on this.
CODE (UP TO DATE): https://pastebin.com/q2QdpKFT
UPDATE 1: Tried using HAL to setup this thing and the behaviour is the samething.
CODE (FOR HAL): https://pastebin.com/KuP3Gf2z
Solved! Go to Solution.
2021-06-13 06:33 AM
Check at the schematic.
https://www.st.com/en/evaluation-tools/nucleo-h753zi.html#cad-resources
By default PA7 is connected to ETH PHY.
2021-06-07 10:53 AM
You are enabling the DMA streams before the SPI/I2S peripheral is even configured.
By the way...
RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA1EN); // Useless
RCC->AHB1ENR |= RCC_AHB1ENR_DMA1EN;
There is no point in clearing single bit fields. And...
// Instead of this:
GPIOC->MODER &= ~(GPIO_MODER_MODE4);
GPIOC->MODER |= (GPIO_MODER_MODE4_AF);
// Use this:
uint32_t reg; // Can be reused for multiple operations.
reg = GPIOC->MODER & ~(GPIO_MODER_MODE4);
GPIOC->MODER = reg | (GPIO_MODER_MODE4_AF);
2021-06-07 10:57 AM
@Piranha Oh? I read somewhere in the STM32 APP note that you should be enabling DMA before the peripheral so as soon as the peripheral is enable the DMA can start taking in request.
Update: try enabling the DMA after the I2S, nothing.
2021-06-07 05:28 PM
UPDATE: I changed the MOSI pin from PA7 -> PB5 and it worked. I didnt mention but Iam using the NUCLEO STM32H753ZI, is there something configured on the hardware thats causing PA7 to go low?
2021-06-13 06:33 AM
Check at the schematic.
https://www.st.com/en/evaluation-tools/nucleo-h753zi.html#cad-resources
By default PA7 is connected to ETH PHY.