- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a test code running on my custom BSP and it somehow got stuck at cyhal_system_delay_ms(). I ran the debug mode and found that inside cyhal_system.c "cy_rtos_delay_milliseconds(milliseconds);" never returns:
I did include "freertos.h" and "task.h". But even though I don't include these 2 libraries, I still see it got stuck here.
Then I replaced "cyhal_system_delay_ms()" with "CyDelay()" and it works. What is difference between these 2 APIs? And what does it crash at "cyhal_system_delay_ms()"?
Does it have anything to do with the system clock setup?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your application didn't include freertos.h, but the implementation of cyhal_system_delay does. You just need to have one of the MACROs defined - CY_RTOS_AWARE or COMPONENT_RTOS_AWARE to execute that function with RTOS hooks. Look at your your Makefile. You probably included the RTOS_AWARE component or added the CY_RTOS_AWARE define.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you called from a task or from the main loop?
If you called this before starting the scheduler, you would get stuck in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I called it from the main loop. Even though I don't include "freertos" library, which means no scheduler start is needed, it still doesn't work.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your application didn't include freertos.h, but the implementation of cyhal_system_delay does. You just need to have one of the MACROs defined - CY_RTOS_AWARE or COMPONENT_RTOS_AWARE to execute that function with RTOS hooks. Look at your your Makefile. You probably included the RTOS_AWARE component or added the CY_RTOS_AWARE define.