STM32Cube MCU Full Package for the STM32H7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Yes, it is just a matter of calling
SET_BIT(hi2s1.Instance->CFG2, SPI_CFG2_IOSWP);
But, this is a matter of exposure.
I wasted hours trying to figure out why RXDR was always zero. I triple checked everything I could possibly think of; looked at everything in the reference manual that could explain what I was doing wrong.
It wasn't until I saw this sentence that I realized the problem:
SDI: Serial Data Input (mapped on the MISO pin) to receive the audio samples in
master, and to transmit the audio sample in slave.
C'mon now.
Serial Data Input is only an Input when in master mode, it is an output when in slave mode.
Aside from the poor choice of naming, this issue can be somewhat addressed by exposing IOSWP as a part of I2S_InitTypeDef, and adding the wording about SDO/SDI directionality in master vs. slave mode in its comment.
This would at least give some exposure to the problem (and a solution) and prevent others from wasting their time.
Yes, it is just a matter of calling
SET_BIT(hi2s1.Instance->CFG2, SPI_CFG2_IOSWP);
But, this is a matter of exposure.I wasted hours trying to figure out why RXDR was always zero. I triple checked everything I could possibly think of; looked at everything in the reference manual that could explain what I was doing wrong. It wasn't until I saw this sentence that I realized the problem:
C'mon now. Serial Data Input is only an Input when in master mode, it is an output when in slave mode. Aside from the poor choice of naming, this issue can be somewhat addressed by exposing IOSWP as a part of
I2S_InitTypeDef
, and adding the wording about SDO/SDI directionality in master vs. slave mode in its comment. This would at least give some exposure to the problem (and a solution) and prevent others from wasting their time.