cancel
Showing results for 
Search instead for 
Did you mean: 

IOSWP of the STM32H7 Duplex I2S is not configurable from HAL/CubeIDE

Takemasa
Associate III

IOSwp bit of the Duplex I2S is not configurable from HAL/CubeIDE. This is harmful from the view point of the hardware design. Please make it configurable.

  • STM32H743
  • RM0433 Rev 6
  • CubeIDE 1.2.1

According to the reference manual, Both SPI and I2S can swap the serial data line by IOSWP bit . Actually, CubeIDE can configure it for SPI, But CubeIDE cannot configure the IOSWP for I2S . As a result, generated code doesn't have the IOSWP configuration. These can be seen in the screen shots.

The project code is attached as zip file.

This is NOT a small issue. the serial data line of the duplex I2S is SDI and SDO. All engineer believes the SDI and SDO are Input and Output, respectively. But this will be betrayed. When the Duplex IS2 is configured as slave, SDI and SDO are output and input, respectively.

This is not just a matter of the name. In the audio CODEC side, DAC input and ADC output will be swapped by master / slave mode ( of course! ). As a result, change of the master / slave needs the hardware modification, to swap the signal .

Thus, configuring the IOSWP is essential to the Duplex I2S control.

Please fix.

1 REPLY 1
Takemasa
Associate III

There is an workaround.

Adding two lines to the main() will swap the line.

>>>

  1. /* Configure the system clock */
  2. SystemClock_Config();
  3.  
  4. /* USER CODE BEGIN SysInit */
  5. // Swapping SDI and SDO
  6. __HAL_RCC_SPI1_CLK_ENABLE();
  7. SET_BIT(SPI1->CFG2, SPI_CFG2_IOSWP);
  8. /* USER CODE END SysInit */
  9.  
  10. /* Initialize all configured peripherals */
  11.  

<<<

The line 6 and 7 are the inserted one.

Until ST fix this issue, you can avoid the problem without changing PCB design.