2024-02-06 01:06 AM - last edited on 2024-02-06 01:50 AM by Sarra.S
Hello There,
I'm working on an app utilizing STM32H7A3 with CMSIS-OS2.
I'm facing a problem with osDelay(). Most of the time it returns too early than the actual delay. While HAL_Delay() always works fine.
I have debugged osDelay(3500) with oscilloscope. It's giving a delay of 141ms.
The before and after ticks were also 5537 and 5678 respectively.
Freertos tick rate is 1000Hz.
I have also tried setting the delay between 500 and 3500. But the actual one comes out to be 100-200ms.
Any help is appreciated.
Regards,
Keshav Aggarwal
2024-02-13 05:20 AM
Can anyone help me on this?
2024-02-13 10:52 AM
What is your MCU core clock source and rate? Have you used CubeMX/IDE to generate clock setup code?
2024-02-13 09:19 PM
Yes I used CubeIDE. Below is the clock configuration.
2024-02-13 09:23 PM - edited 2024-02-13 09:24 PM
@Pavel A. I think the issue is with the Freertos/CMSIS_OS2 as osThreadSuspend/osThreadResume is conflicting with osDelay.
I also checked the stacks. They were fine.