cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Duplex I2S cannot TX/RX simultaneously through the HAL.

Takemasa
Associate III

Hi.

HAL_I2S_Transmit_DMA() and HAL_I2S_Receive_DMA doesn:'t work simultaneously. As a result, programmer cannot use I2S TX and RX together in the STMH7 Duplex I2S.

  • STM32H743
  • CubeIDE 1.2.1
  • STM32Cube FW_H7 v1.6.0

Attached screenshot points where the API returns error, and the attached project demonstrate the problem on Nucleo H743ZI.

In this program, I2S1 is configured as duplex master. Thus, TX and RX functions are available. The program checks the return code from API and display on LED.

LED2 (Blue) tests the TX API.

  • Turn On : HAL_OK
  • Blink : Not HAL_OK

LED2 (Red) tests the RX API.

  • Turn On : HAL_OK
  • Blink : Not HAL_OK

You can see the Blue LED turns on and Red LED blinks. If you remove the TX API call from program, RX API works well. Thus, this is interference of the both APIs.

Please check and fix.

11 REPLIES 11

I don't use 'H7 and I don't use Cube/HAL, but isn't the SPI/I2S module simplex?

0690X00000DCBfkQAH.png

You may want to have a look at SAI.

JW

The DS may be wrong... RM suggests the I2S in SPI can work in duplex.

But there may be obstacles in Cube/CubeMX:

https://community.st.com/s/question/0D50X0000CArlTHSQZ/fullduplex-i2s-with-master-clock-output-on-stm32h7-in-stm32cubeide

JW

PS. @Imen DAHMEN​  , can you please verify if the 'H743 I2S can indeed be used in Duplex, and if so, perhaps correct in the DS?

Imen.D
ST Employee

Hello,

Thanks for the report.

We are aware of this limitation: I2S Full duplex Transmit/receive feature is not supported by the STM32H7 HAL Driver.

We have already listed this issue and it will be fixed in the coming releases of cubeH7 firmware package.

I will check the document and raise your feedback internally to the STM32CubeIDE team, then I come back to you soon with update.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi Imen,

Thanks for the report on CubeID.

But, I mean, the DS, as in my first post above, says the I2S is only simplex, whereas according to RM, it appears to be duplex.

Can the DS be please checked and corrected if needed?

Thanks,

Jan

@Imen DAHMEN​ 

Imen.D
ST Employee

Hi Jan,

I confirm, the datasheet is wrong. I raised your request to correct the STM32H7 Datasheets.

For example, rephrase as follow: “They can be operated in master or slave mode, in simplex or full-duplex communication modes.�?

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Thanks, Imen!

Jan

@Imen DAHMEN​ 

Thanks, Imen

Takemasa

SVezi.1
Associate II

Sorry to revive an old thread but I'm having similar difficulties in getting full duplex i2s working with DMA on the H7 as well. Has this been fixed?

With hi2s1.Init.Mode = I2S_MODE_MASTER_TX, neither the TX or RX callbacks get called.

With hi2s1.Init.Mode = I2S_MODE_MASTER_RX, the RX callback gets called and my RX buffer gets copied into my TX buffer but nothing gets out.

Piranha
Chief II

It has a I2S_MODE_MASTER_FULLDUPLEX mode. But take a note that the HAL team is generally incapable of understanding asynchronous software design and the related issues...