cancel
Showing results for 
Search instead for 
Did you mean: 

Weirdest thing happening with STM32H7 I2S hardware

CLeo.1
Senior II

Hi guys! I am having the biggest issue with the I2S right now

What is happening: For whatever reason the I2S does not want to transmit any samples VIA DMA. Doesnt matter what I do what I try.

The weird thing happening: The I2S WS, SCLK wont work. Only if the DMA associated with the Tx part is enable (DMA1_Stream1) which I find so weird. All it does it set the WS pin to HIGH

What I have tried:

  • Verified the registers are correctly setup
  • Ensure with measuring tools the right signals are shooting out (WS, MCLK, SCLK) when the DMA1_Stream1 is enable
  • Swapped out the ADC/DAC for another one
  • Ensured the ADC is sending out its digital signal
  • Ensured the STM32 is receiving samples and transmitting to the Tx Buffer associated with the DMA

How the code works.

The code waits around till an UART signal is received VIA the DMA, once received in goes into a super loop where it process UART signals

Depending on what UART signal was received it will enable not only the I2S peripheral but setup the clock, Interrupt, anything to make the I2S running with DMA etc...

Then the stm32 should now be ready to take in I2S signals and spit them out

Code: (Using PasteBin as code is too long here)

Main.c

https://pastebin.com/GZCTs8Sd

I2S_Factory.c (Setups GPIO, and DMA)

https://pastebin.com/tDXjzVaX

Audio_Selector.c (Setups the I2S Clock, interrupt, and DMA)

https://pastebin.com/mHjDgZaX

DSP_FACTORY.c (Where in takes in the Rx Samples and transfer it to the Tx Buffer for transitmission)

https://pastebin.com/WNt9TSrA

Any help would be amazing, I am stumped right now its not even funny.

25 REPLIES 25

Oh sorry that was the old code, I can ensure you that RXDMAEN and TXDAMEN are set.

I tried to get it running without the DMA and still cant get it working.

CLeo.1
Senior II

@TDK​ Here you go king.

https://pastebin.com/EFaLMLgR thats the code, currently using

It's frustrating to look through code that is posted and find several errors, only to then be told that the posted code wasn't actually the code you used. You are not the only one, it happens more often than I would like. That's a waste of my time, as well as yours.
If you feel a post has answered your question, please click "Accept as Solution".

Its not your fault thats mine. I do apologize for that. If you have it in you, the latest code below this is the right one and is the one I am confident in. If you can spot anything in that that would be amazing.

Piranha
Chief II

If you cannot get something working, back off to a minimum. Make a simple polling pattern transmitter without DMA or even interrupts.

Fair enough, Would be able to look at my code and see if theres anything wrong https://pastebin.com/EFaLMLgR?