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
SVezi.1
Associate II

@Piranha AH! You're right, it does! The funny thing though is that I did set up my I2S as "Full duplex master" in Cube and yet it put the Mode as I2S_MODE_MASTER_RX.

I'll give it a try today - I mean, it works well on the F4!

Thank you

SVezi.1
Associate II

@Piranha​ It works! I had to set the mode to Full Duplex Master and Transmission Mode as Master Transmit and *then* go and change  hi2s1.Init.Mode = I2S_MODE_MASTER_FULLDUPLEX; in the init code.

That's very weird. I'm relatively inexperienced with STM32 and I would imagine that I will eventually rely less on Cube but for now, I'm just happy that it finally works.

Thank you!