2020-02-22 10:19 PM
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.
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.
2020-02-25 02:46 PM
There is an workaround.
Adding two lines to the main() will swap the line.
>>>
<<<
The line 6 and 7 are the inserted one.
Until ST fix this issue, you can avoid the problem without changing PCB design.