FreeRTOS vTaskDelay not working as expected

cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS vTaskDelay not working as expected

745 Views
MateoSegura413
Contributor III

Hello, I have a simple RTOS application that is only running 1 thread (task). I am using the vTaskDelay function to delay my code for 100ms as following:

vTaskDelay(100/portTICK_PERIOD_MS) 

However, my code does NOT get delayed for 100ms, but rather somehwere around 4 times that, so appx. 400ms (measured it with scope).  This code is being ran on the FreeRTOS example provided, and NONE of the settings have been changed.  We also tried this in 2 different machines and boards, and same result. It also happens with with pdMS_TO_TICKS macro and same results. Any idea as to what the issue might be?  

Thanks in advance

0 Kudos
4 Replies

734 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @MateoSegura413,

Please specify the MCU, S32DS IDE version and the RTD or SDK version.

 

Thank you,

BR, Daniel

0 Kudos

725 Views
MateoSegura413
Contributor III

Hi and thanks for your response, here's the info you need:

- MCU: S32K344

- S32DS Version 3.4

- S32K3xx development package version 3.4.3

- RTD AUTOSAR 4.4 Version 1.0.0

- FreeRTOS for S32K3 1.0.0

I'm using theFreeRTOS_Toggle_Led_Example_S32K344, no changes were made.

I also tried to create a blank application project and add RTOS and same results.

Thanks for your help!

 

0 Kudos

705 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @MateoSegura413,

I just tested it on S32K3X4EVB-Q257 (Sch-47827 REV A) with 16Mhz crystal, and it works as expected.

What boards do you use? EVBs or you custom boards?

What is frequency of the crystal there?

 

Thank you,

BR, Daniel

 

0 Kudos

690 Views
MateoSegura413
Contributor III

@danielmartynek 

I reinstalled S32DS and it works correctly now. 

Thank you for your answer.

0 Kudos