cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4xx_hal_i2s_ex seems incomplete - doesn't work

mike2399
Associate II
Posted on July 08, 2016 at 18:04

I'm developing an audio application using STM32F427, using I2S port 3 in ''full-duplex'' mode to interface to ADC and DAC.

Trying to use the non-blocking-interrupt method, as I don't want to use DMA and there are several related functions in the same RTOS thread that I don't want to block.

On trying to trace the interrupt handling code, as far as I can see, the function I2SEx_TransmitReceive_IT doesn't contain any callback calls in the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX section.  There are callbacks in the RX section, but they leave the peripheral in HAL_I2S_STATE_BUSY - which will cause any call to HAL_I2SEx_TransmitReceive_IT (in order to re-start transmission/reception) to fail.  It also leaves the macro __HAL_LOCK(hi2s) in the locked state.

I have searched through this forum history and can't see any solution.  I did see a related question, but the poster got round it by using DMA.

I'm using code originally created by CUBE FW.F4_V1.11.0, which uses HAL version 1.4.4.  I downloaded the latest CUBE (version 1.12), with HAL version 1.5.0 - but the included code is identical.

Any chance of some fully complete and working HAL files?  Or have I missed something?

5 REPLIES 5
Amel NASRI
ST Employee
Posted on July 15, 2016 at 17:08

Hi fleetwood.mike,

Thanks for highlighting this issue. It is reported internally to be fixed in one of coming releases of the STM32CubeF4 package.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

ingwmeier
Senior
Posted on July 18, 2016 at 07:57

Same issue with an STM32F051 app.

We used HAL_I2C_Master_Transmit / HAL_I2C_Master_Receive in the end to read 20bytes from a AS5600 magnetic encoder chip. This works fine in the beginning. After several readings an extra 0x00 byte is in the reception buffer at start which is not visible using a scope. We have no time to investigate this at this moment, so we use a patch to ignore this byte since the result of the chip is never 0x00 at start..

Amel NASRI
ST Employee
Posted on July 18, 2016 at 11:44

Hi Werner Meier,

This is an I2S related issue/topic (not I2C).

Could you please start a new thread in which you describe exactly the problem you are facing? If it is already done, please provide the link.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

ingwmeier
Senior
Posted on July 18, 2016 at 15:22

Ups sorry..

for I2C in interrupt mode, it worked one time,

then stayed also got stuck in HAL_I2C_STATE_BUSY mode.. I will open a new topic

mike2399
Associate II
Posted on August 01, 2016 at 14:10

Many thanks!

Since then, I have re-written the I2S in/out in low-level code, reading/writing registers direct.  But I'm sure the updated HAL code will be useful to someone.

Mike.