Forums - RTOS system tick

6 posts / 0 new
Last post
RTOS system tick
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Wed, 2020-02-05 23:33

Hi,

I am using ThreadX as the choice of RTOS and figured out by measuring that the system tick seems to run at a rate of 10ms.
e.g. calling the function qurt_thread_sleep(1); will result in a delay of 10ms, measured using a toggling GPIO pin.

I want to set system tick to 1ms. How can I do that? There is a section n DevCfg_master_fom_out_cdb.xml, but it seems not to have the desired effect.
<driver name="Timetick">
<props name="TIMER_FREQ" type="0x00000002">
       <!-- Timer frequency = -->  32000
 

Any help appreaciated, thanks

Andreas

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2020-02-11 10:19

Our default qurt_thread_sleep(qurt_time_t duration)  accept duration in ticks where 1 tick ~ 10 msec

However if you want to sleep for 1msec , kindly use as below:

qurt_thread_sleep(qurt_timer_convert_time_to_ticks(10, QURT_TIME_MSEC));

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Mon, 2020-02-17 03:58

Hi Raja,

thanks for the reply but this does not work as described. If I use you code example to sleep for 1ms this results again in a 10ms sleep, which makes sense if you tick interval is 10ms.

How can I change the tick interval to 1 ms?

Regards

Andreas

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2020-02-18 12:28

Kindly try using qapi_Task_Delay ( uint32_t time_us ) which should help with your use case .

void qapi_Task_Delay ( uint32_t time_us )
Delays the current task by the time specified in microseconds.



 

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Thu, 2020-02-20 00:39

Hi Raja,

I can confirm that using  qapi_Task_Delay(1000); will delay the execution by 1ms now. Can you confirm that this really puts the RTOS thread to a sleep of 1ms and let other threads still run?  To be sure that this function is not just a kind of loop that delays the execution of this thread and blocks others to run in the meantime.

Why is this function not part of the qurt API, which collects all OS related functions, if this is a task sleep?


Thanks, Andreas

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2020-02-25 11:42

void qapi_Task_Delay ( uint32_t time_us )   //Delays the current task by the time specified in microseconds.

Yes, this API puts the current task to a sleep of 1ms and let other threads still run.
 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.