Skip to main content
seren
Associate II
July 3, 2019
Question

BUG: HAL_TSC_GroupGetStatus gives wrong results

  • July 3, 2019
  • 1 reply
  • 1143 views

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?

This topic has been closed for replies.

1 reply

ST Technical Moderator
July 3, 2019

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks