This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTX osTimerStart() interval short

Hi! I'm trying to learn osTimerStart(), \ble_app_hrs_rtx. Compiling was successful, and it is working. If I set the timer interval shorter than 25 ms, the timer cycle becomes abnormally short. The cycle of other timers also becomes short.Is this a specification?

For example //#define RR_INTERVAL_INTERVAL 300 #define RR_INTERVAL_INTERVAL 10

Parents
  • It seems to get a better if you add

    if(expected_time != 0)
    {
        expected_time--;
    }
    

    just before os_resume(expected_time); in RTX_Conf_CM.c, but this is only without SoftDevice, or without using the SoftDevice. Starting to advertise seems to disturb the timing and actually I get like 1200 ms instead of 1000 ms. This is with RR set to 10, I see that most RR intervals are 10 ms, but some increases to 16-17 ms when the SoftDevice is advertising, and I think that is why I see 1200 ms, not 1000 ms.

    To be honest, I recommend not using RTX, at least not together with the SoftDevice. It is unstable, and not well tested. We have actually decided to remove the support for it.

    If you absolutely need an RTOS I recommend to rather look into FreeRTOS.

    See this and this for more information.

    I'm sorry for any inconvenience this has caused you.

Reply
  • It seems to get a better if you add

    if(expected_time != 0)
    {
        expected_time--;
    }
    

    just before os_resume(expected_time); in RTX_Conf_CM.c, but this is only without SoftDevice, or without using the SoftDevice. Starting to advertise seems to disturb the timing and actually I get like 1200 ms instead of 1000 ms. This is with RR set to 10, I see that most RR intervals are 10 ms, but some increases to 16-17 ms when the SoftDevice is advertising, and I think that is why I see 1200 ms, not 1000 ms.

    To be honest, I recommend not using RTX, at least not together with the SoftDevice. It is unstable, and not well tested. We have actually decided to remove the support for it.

    If you absolutely need an RTOS I recommend to rather look into FreeRTOS.

    See this and this for more information.

    I'm sorry for any inconvenience this has caused you.

Children
No Data
Related