cancel
Showing results for 
Search instead for 
Did you mean: 

I2S on stm32h7b3i-dk not running :(

JulianSTM
Associate II

Hi guys,

I have a stm32h7b3i-dk board here and have been struggling with i2s for 5 days.

Can't get any further myself and have to ask for help.

I attached the project. Can someone please take a look?

The problem:

1.

HAL_I2S_TxCpltCallback is never called.

2.

Of course, I2S doesn't work.

I've tried everything possible, now create a new project.

It must have something to do with DMA... But I can't find the error.

Best regards and thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions

OK so you've narrowed down the problem to being probably DMA-related.

One of the common reasons why DMA on 'H7 does not work is, that buffer is located in inappropriate type of SRAM, where the given DMA has no access. In your case, if you use BDMA2, only the "SRD" SRAM can be used, you have to locate your buffer there.

(btw. I don't understand why ST had the urge to rename the various clock/matrix domains in the 'H7B3 so that they don't match nomenclature of other 'H7, adding to confusion... but that's ST documentation crew for you.)

0693W00000QLMmwQAH.pngThere may be other reasons, too. Read https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices .

JW

View solution in original post

5 REPLIES 5

Try to proceed step by step. Get polled I2S working first. Check clock setting in RCC, SPI/I2S, relevant GPIO settings by reading/checking registers content.

JW​

JulianSTM
Associate II

Hello Jan,

Thank you for your answer.

I've already tried that.

HAL_I2S_Transmit(&hi2s6, (uint16_t *)&i2s_data, 2, 1000);

and

HAL_I2S_Transmit_IT(&hi2s6, (uint16_t *)&i2s_data, 2);

seems to work.

I don't know if it works properly, because I need DMA, but it does produce well-looking signals on the right pins.

For HAL_I2S_Transmit_IT I just need to enable the SPI6 glabal interrupt. and then the callback is called.

In fact, it doesn't take much to start I2S.

In cubemx it is enough to configure the clocks, SPI (i2s), DMA and pins.

Generate code and enjoy.

If cubeMX does everything right.

then you start dma transmission with data that you want to transmit.

HAL_I2S_Transmit_DMA(&hi2s6, (uint16_t *)&i2s_data, 2);

You don't have to update the data, the same thing is simply sent over and over again.

Just simple, to get i2s running.

Then I use the DMA callback HAL_I2S_TxCpltCallback to update data.

It works perfectly on F0, F3, F4 Series.

But now i have H7 and its not working.

I always use Cube MX because ST sells it to me that way. "Click something together, then you get your code and can work with it"

for this reason I am not able to find the error now.

I can go through the obvious stuff like SPI, DMA_init in main but this looks fine.

It has to work but it doesn't work :(

I am not a complete beginner, I have already implemented many interesting and complicated projects.

But all this as ST promised me - just use the generated code.

JulianSTM
Associate II

Sitting on it again for 13 hours today on the sixth day.

I can't find the error, the ba--ard MX either generates incorrect or insufficient code.

Donate 500 bucks via paypal right away who will help me. No joke, no kidding.

It's not fun anymore.

I just want i2s6 to work on this board. Easy with HAL and DMA. No Freertos, no cpp snippets and no included "player.c" files.

This can and should only be a few lines of code.

Frustrated....

OK so you've narrowed down the problem to being probably DMA-related.

One of the common reasons why DMA on 'H7 does not work is, that buffer is located in inappropriate type of SRAM, where the given DMA has no access. In your case, if you use BDMA2, only the "SRD" SRAM can be used, you have to locate your buffer there.

(btw. I don't understand why ST had the urge to rename the various clock/matrix domains in the 'H7B3 so that they don't match nomenclature of other 'H7, adding to confusion... but that's ST documentation crew for you.)

0693W00000QLMmwQAH.pngThere may be other reasons, too. Read https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices .

JW

JulianSTM
Associate II

Thank you dude!!

where to donate?

Send me Private message please.