2022-09-18 06:24 AM
on H743 board (DevEboard) I2S1 (master 16b 44k1) -> ES9038 DAC (I2S slave) :
DAC playing music fine, ok.
now switching DAC to I2S master , H743 to slave transmitter mode : no data / silence.
test with DSO : pin PA7 (SDO) is tri state now! thats WRONG !!!!
looking in ds/manual , see, maybe change SDi/SDO pins, when change master -> slave mode....
so i try: set in cubeIDE pin PA6 (i2S SDI ) manual to SDI ("no mode" , "yellow" ( pin in cube) = warning);
compile...run : DAC playing, so data coming from "inactive" and "no mode" pin, but from ("green": pin in cube) SDO nothing coming.
i think, this is obvious error in cube; missing the IOSWAP in SPI_CFG2 to set or wrong setting preset.
to proof , i add pinswap in HAL_I2S.c driver / init slave mode:
now sound is ok again; so data coming from SDO now (again).
@Imen DAHMEN or @Julien D_OEHAUDT ... STM
so please rectify, if i am right.
2022-09-24 06:58 AM
seems STM has not very much interest in this...
2022-09-26 11:47 AM
Hello @AScha.3 ,
Which Cube package version are you using?
Are you using CubeMx tool for your settings and to generate your project ? If yes, which version ?
Did you try to change IOSWP bit in SPI_CFG2 register?
hi2s1.Init.IOSwap = I2S_IO_SWAP_ENABLE;
The SPI/I2S offers the possibility to swap the function of SDI and SDO lines thanks to IOSWP bit located into SPI_CFG2. Details can be found in RM0433:
Bit 15 IOSWP: swap functionality of MISO and MOSI pins
0: no swap
1: MOSI and MISO are swapped
When this bit is set, the function of MISO and MOSI pins alternate functions are inverted.
Original MISO pin becomes MOSI and original MOSI pin becomes MISO.
Note: This bit can be also used in PCM and I2S modes.
Please see the "Serial data line swapping" table in RM0433.
Imen
2022-09-27 10:11 AM
Hello @Imen DAHMEN ,
so...i use :
STM32CubeIDE
Version: 1.10.1
Build: 12716_20220707_0928 (UTC)
OS: Linux, v.4.19.0-1-amd64, x86_64 / gtk 3.22.11
Java vendor: Eclipse Adoptium
Java runtime version: 11.0.14.1+1
Java version: 11.0.14.1
STM32CubeMX 6.6.1.2022
and yes, to proove : i changed IOSWP bit in SPI_CFG2 , in HAL lib:
>> SPI1->CFG2 = 0x008000; // test ! pin swap
as i wrote in first post.
so i think, solution is just : make pinSwap available in I2S mode in cube and setting initial to "1" ;
so SDO stays SDO when selecting slave mode from master mode...and reverse.
(seems , not sooo many people have ever tried, to use I2S transmittter slave mode setting in Cube/HAL on H7xx . )
best regards
Alfred
2022-10-07 04:15 AM
so.... make pinSwap available in I2S mode in cube ?
2022-10-22 09:15 AM
now i tried your idea: swap-enable in cfg , but:
>> ...error: 'I2S_InitTypeDef' {aka 'struct <anonymous>'} has no member named 'IOSwap' <<
so its really missing here.
2023-01-16 06:12 AM
Hello @AScha.3
Thank you for your contributions and for your detailed explanations,
Your suggestion is taken into consideration, it has been reported to STM32CubeMX development team .
Internal ticket number: 143012 (This is an internal tracking number and is not accessible or usable by customers).
I will keep you posted with updates.
Thx,
Ghofrane
2023-02-08 01:27 AM
Hello,
I just had the same problem with a H723, using I2S as slave RX, and only after setting IOSWP it worked.
I'm mostly using Cube and HAL libs to "learn" when using a new peripheral, and there I didn't come across IOSWP.
The problem is either:
So it's not only a Cube, but also a HAL problem.
2023-03-24 08:55 AM
I confirm that the problem is still present in STM32Cube_FW_H7 v1.11.0
and happening regardless of transmission or reception.
i am using a STM32H723ZG
Adding to stm32h7xx_hal_i2s.c @ line 455
else
hi2s->Instance->CFG2 = 0x008000;
solves the issue.