Closed yyjdelete closed 1 year ago
Hi, thanks for bringing that up! SysTick_Handler in cmsis_os2 clears overflow flag to enable correct functionality of osKernelGetSysTimerCount. It does not seem like there will be an easy workaround. We need to investigate this issue and see what can be done.
Hi, please see the referenced commit: SysTick_Handler was updated: https://github.com/ARM-software/CMSIS-FreeRTOS/blob/13acfbef7be85119fc6bc56832c455d4547d92c7/CMSIS/RTOS2/FreeRTOS/Source/cmsis_os2.c#L156-L161
and as a consequence also osKernelGetSysTimerCount had to be updated:
Do you have any concerns related to the implemented workaround?
Seems SysTick_Handler in cmsis_os2 will auto clear overflow flag for SysTick_Handler https://github.com/ARM-software/CMSIS-FreeRTOS/blob/9cf2e4b4f621abfed0ee2de421d31988f8b1b0f6/CMSIS/RTOS2/FreeRTOS/Source/cmsis_os2.c#L152-L158
But it will also break the default implementation of
vPortSuppressTicksAndSleep
(#define configUSE_TICKLESS_IDLE 1
), which required to check the same flag, and it make the wakeup timer almost frozen. https://github.com/ARM-software/CMSIS-FreeRTOS/blob/3da36094e21d6fed61719ecf9bb3530a11fd2bb0/Source/portable/GCC/ARM_CM3/port.c#L552-L566Is there any way to fix the conflict?