cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: HAL_TSC_GroupGetStatus gives wrong results

seren
Associate II

In STM32Cube_FW_L0_V1.11.2\Drivers\STM32L0xx_HAL_Driver the function TSC_GROUP_COMPLETED in Src\stm32l0xx_hal_tsc.c returns TSC_GROUP_ONGOING even if it should return TSC_GROUP_COMPLETED.

This is due to

#define __HAL_TSC_GET_GROUP_STATUS(__HANDLE__, __GX_INDEX__) \

((((__HANDLE__)->Instance->IOGCSR & (uint32_t)(1UL << (((__GX_INDEX__) & (uint32_t)TSC_NB_OF_GROUPS) + 16UL))) == (uint32_t)(1UL << (((__GX_INDEX__) & (uint32_t)TSC_NB_OF_GROUPS) + 16UL))) ? TSC_GROUP_COMPLETED : TSC_GROUP_ONGOING

in Inc\stm32l0xx_hal_tsc.h

Where (__GX_INDEX__) & (uint32_t)TSC_NB_OF_GROUPS always evaluates to 0 while it should evaluate to __GX_INDEX__. The result is that accidentally always only group 1 (__GX_INDEX__ = 0) is evaluated.

In this case (TSC_NB_OF_GROUPS-1) instead of TSC_NB_OF_GROUPS would work (as long as TSC_NB_OF_GROUPS is a power of two).

Is there a better place to report bugs (e.g. an issue tracker) than this forum?

1 REPLY 1
Imen.D
ST Employee

Hello @seren​ 

We have already passed this issue along to our development team.

This will be fixed in the next version (v1.12.0) of STM32CubeL0 firmware package. Keep an eye out for the next update !

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen