Skip to main content
Associate
October 11, 2025
Solved

H743 I2S half-duplex slave receive mode, SDI pin should map to MOSI not MISO, cubeMX v6.15, FW_H7 v1.12.1

  • October 11, 2025
  • 2 replies
  • 313 views

Created a STM32H743II prj with I2S2 enabled, half-duplex slave receive mode, and DMA1 S0 bounded to SPI2_RX, to work with an ADC in master mode.

 

Can't get data from the ADC ( DMA linked mem area always zero ), while my oscillograph can properly decode the ADC I2S data output pin ( CK & WS pin also connected between the ADC board and the H743 board, and the oscillograph ).

 

In cube, the SDI pin is mapped to SPI2_MISO, PB14. But as a slave, shouldn't the correct SDI pin map to SPI2_MOSI, PB15?

 

So I modified the cubeMX generated code manually, by changing PB14 to PB15 in the I2S2 GPIO initialization sector, and it worked, the DMA linked mem area shows the same value on my oscillograph.

 

Is this a cubeMX bug?

Best answer by AScha.3

Seems to be a bug , but no big problem, miso mosi can be swapped :

AScha3_0-1760193940621.pngAScha3_1-1760193967804.png

So let Cube do it, and if the pin swap missing, just set it yourself in the init.

 hxxx.Init.IOSwap = SPI_IO_SWAP_DISABLE; // or _ENABLE

btw

I had same problem...and used the swap feature.

(Maybe it depends on Cube/HAL version, bug might be away. Which version you use? )

2 replies

TDK
Super User
October 11, 2025

> In cube, the SDI pin is mapped to SPI2_MISO, PB14. But as a slave, shouldn't the correct SDI pin map to SPI2_MOSI, PB15?

A half duplex data connection on the slave side should be on the MISO pin, as shown in the reference manual.

TDK_0-1760193584273.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
October 14, 2025

Thanks for your reply.

 

But I couldn't get it to work with the original code cube generated, maybe I did sth wrong somewhere else.

Hope the development team can give us a clear answer, let's wait.

AScha.3
AScha.3Best answer
Super User
October 11, 2025

Seems to be a bug , but no big problem, miso mosi can be swapped :

AScha3_0-1760193940621.pngAScha3_1-1760193967804.png

So let Cube do it, and if the pin swap missing, just set it yourself in the init.

 hxxx.Init.IOSwap = SPI_IO_SWAP_DISABLE; // or _ENABLE

btw

I had same problem...and used the swap feature.

(Maybe it depends on Cube/HAL version, bug might be away. Which version you use? )

"If you feel a post has answered your question, please click ""Accept as Solution""."
Ghofrane GSOURI
Technical Moderator
October 13, 2025

Hello @KimbleYoung @AScha.3 @TDK 

Thank you all for your contributions.

Two internal tickets, 160926 and 143012, have been raised to our development team to address this issue.

THX 

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.