Cy_Flash_StartProgram with FreeRTOS Causes an Unexpected Behavior

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
EsEs_4384886
Level 1
Level 1

I have two examples, the first one is a bare metal system and I am calling Cy_Flash_StartProgram function and it is working fine as expected. The other example is the same as the first one but depends on FreeRtos. Sometimes, when I call Cy_Flash_StartProgram the system goes in unexpected behavior. From debugging I found that Systick handler does not fire anymore for FreeRtos operations.  I believe that the system got hanged in this line "while (0UL == _FLD2VAL(SRSS_CLK_CAL_CNT1_CAL_COUNTER_DONE, SRSS_CLK_CAL_CNT1)" inside function Cy_Flash_RAMDelay.
Could anyone help, how I can solve this bug as it consumes a lot of time?

0 Likes
4 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please confirm whether you are using latest PDL 3.1.0. If not, please install the latest PDL from here and configure the PSoC 6 PDL version in PSoC Creator, Tools > Options.

pastedImage_3.png

If it does not resolve the issue, could you share the project to recreate the issue at our end?

0 Likes

I am working with modus Toolbox 1.1, how can I check PDL version ?, I still have an issue

I found that the firmware stuck at function "Cy_Flash_RAMDelay" I replace this function with "Cy_SysLib_DelayUs" is this right?

0 Likes

Hi ,

No, you can not use Cy_SysLib_DelayUs instead Cy_Flash_RAMDelay. What cy_flash.c version do you use (see in header of this file) ?  Also please inform version of cy_syspm.c. Do you use Cy_SysClk_StartClkMeasurementCounters() or Cy_SysPm_DeepSleep somewhere in your project? If so could you describe the flow how do you use those function in context of RTOS.

Thanks.
Nazar

0 Likes

Hello EsEs_4384886​,

Can you please answer questions asked by Nazar? It will help us get more insight into the problem.

Regards,

Dheeraj

0 Likes