AnsweredAssumed Answered

Any code or documentation references for I2S Full Duplex using Cube-based firmware?

Question asked by maggie.roxas on Aug 6, 2014
Latest reply on Nov 18, 2014 by jb
Hi - Lately, it seems that there are 2 versions of STM32 firmwares. These firmwares appear in different sites in ST, but to put it simply, these 2 types are:
       
  • STM32Cube-based firmwares
  •    
  • Non-STM32Cube-based firmwares
Basically Cube-based ones are those which uses the new version of STM32 firmware architecture, where peripheral/hal drivers used are those which start with stm32f3xx_hal_ppp*.

Non-Cube-based ones are those which uses the old version of STM32 firmware architecture, where peripheral/hal drivers used are those which start with stm32f30x_ppp*.

Now, I would like to acquire a Cube-based firmware (or at least any documentation) that shows how to properly configure, initialize and start I2S in Full Duplex mode using DMA.

I was only able to configure and initialize I2S in Full Duplex mode, but I don't know how to start it.

In Non-Cube-based codes, it can be "started" via:

/* Enable the DMA_CHANNEL_RX transfer complete */  
DMA_ITConfig(DMA_CHANNEL_RX, DMA_IT_TC, ENABLE);
 
/* Enable the DMA_CHANNEL_TX transfer complete */ 
DMA_ITConfig(DMA_CHANNEL_TX, DMA_IT_TC, ENABLE);
 
/* Enable the DMA channel Rx */
DMA_Cmd(DMA_CHANNEL_RX, ENABLE);
 
/* Enable the DMA channel Tx */
DMA_Cmd(DMA_CHANNEL_TX, ENABLE);
 
/* Enable the I2Sext RX DMA request */
SPI_I2S_DMACmd(I2Sext, SPI_I2S_DMAReq_Rx, ENABLE); 
 
/* Enable the I2S TX DMA request */
SPI_I2S_DMACmd(SPI, SPI_I2S_DMAReq_Tx, ENABLE);
 
/* Enable the SPI Master peripheral */
I2S_Cmd(SPI, ENABLE);
 
/* Enable the I2Sext peripheral */
I2S_Cmd(I2Sext, ENABLE);

But above codes do not exist anymore in Cube-based ones. 

I can only find these 2 functions which might do the same as above snippet, but I'm not really sure how and when to call them:

HAL_I2S_Transmit_DMA @stm32f3xx_hal_i2s.c
HAL_I2S_TransmitReceive_DMA @stm32f3xx_hal_i2s_ex.c

I already understood this mechanism in Non-Cube-based one, in I2S_FullDuplexDataExchangeDMA example available in STSW-STM32108 package.

Unfortunately, Cube-based firmwares and Non-Cube-based firmwares are totally different.

I am using an STM32F303x-based board (I have both the Discovery and the Eval), but I will also appreciate samples not using F3 (ie, F4 will do) - I really just want to know the sequence of I2S, DMA calls.

Any clue, reference code, or documentation that will help me implement this using the Cube-based libraries is/are very much appreciated. Thanks,

Outcomes