cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 HAL bug: no __IO (volatile) keyword for PPP_HandleTypeDef.State

Justyn B
Associate II
Posted on January 25, 2015 at 21:06

Hi,

I have been tracking down a bug in my application that only appeared with certain optimisation options with gcc 4.9.3.

It turns out the problem is that in the STM32F0 drivers the ''State'' member of the SPI_HandleTypeDef struct (and also the UART equivalent at least, I've not checked others) is not marked as __IO (which is a macro for volatile) even though it is modified by HAL_SPI_IRQHandler.

This can cause calls to functions like HAL_SPI_GetState to be optimised incorrectly.

I can see that State is correctly declared __IO in the STM32F4 drivers. I can also see that v1.2.0 of the STM32F0 drivers added __IO for the ErrorCode member but seems to have missed it for State.

Could someone from ST confirm this is a mistake, presumably to be fixed in the next release?

Thanks.

#bug #hal #stm32f0
2 REPLIES 2
Justyn B
Associate II
Posted on February 10, 2015 at 16:29

Is there any word that this bug (which affects several peripherals) is known about by ST?

Is there a bug tracker or something? That would be really useful.

Posted on March 16, 2015 at 11:49

Hi Justyn,

we confirm that it’s an error, and have already listed within the STM32CubeF0 HAL bugs tracker. Keep an eye out for the next update!  

Thanks for the report.

Best regards,

Heisenberg.