cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-H743ZI No data out in I2S slave mode

savvn001
Associate II

HI, I'm trying to interface this board to a cirrus logic CS42448 codec. I set up the I2S3 peripheral in slave mode configured in CubeMX as so:

0690X000006BzZyQAK.png

The project is built with this and in the main while loop I have a simple bit of code to get it to transmit some random data:

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

bool channel = false;

uint16_t data_test[2] = { 0x0324, 0x0000};

while (1) {

 /* USER CODE END WHILE */

 /* USER CODE BEGIN 3 */

if (HAL_I2S_GetState(&hi2s3) == HAL_I2S_STATE_READY) {

HAL_I2S_Transmit(&hi2s3, &data_test[channel], 1, 0);

channel = !channel;

}

}

 /* USER CODE END 3 */

}

The codec is providing the LR/WS clock and bit clock and I have it running at a sample rate of 32kHz (my logic analyser has limited bandwith). I can verify however that the clocks are coming in at the right frequencies with my logic analyser, however there isn't any data coming out of the board.

When I re-configure the board in I2S master mode however and disconnect the codec, with the exact same settings and code I can see there is data coming out.

Thanks!

4 REPLIES 4

From RM0433, 50.9.2 Pin sharing with SPI function:

> SDO: Serial Data Output (mapped on the MOSI pin) to transmit the audio samples in

> master, and to receive the audio sample in slave.

You can try to set SPI_CFG2.IOSWP.

I am not sure about what  Serial data line swapping table indicates, IMO it contradicts the narrative I quoted above.

Disclaimer, I don't use the 'H7.

JW

savvn001
Associate II

Hi, thanks for the response, I've tried that but it's not making a difference. I've got probes on the input and output pins so I would see if something comes out of either

As I've said I don't use 'H7, and the SPI/I2S on that is different from the other STM32 families, so can't help with that, sorry.

JW

savvn001
Associate II

Has anyone else managed to get I2S working on the STM32H7? Hit a bit of a brick wall here with this one, as there isn't any example projects at all for I2S or even SAI with the H743.