We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi.
Is there a RTX context switch time constraint?
I'm testing RTX on TM4C129KCPDT.
My setting is shown below.
Sysclock = 60MHz(,using internal PLL)
When I set tick value 5us,which can't context switch,only running main thread.
If tick value is 10us,which can running context switch.
[question]
1.Since it is described as <300 cycles on RTX specifications, is it possible to context switch with 5us when sysclock is 60MHz?
2.Is there an upper limit sysclock fequency?
[tick value 5us is running only main thread]
[tick value 10us]
code is below.
void led_thread3(void const *argument) { for(;;){ unsigned int tick,delayPeriod; tick = osKernelSysTick(); led3 = 1; do { } while ((osKernelSysTick() - tick) < osKernelSysTickMicroSec(100)); tick = osKernelSysTick(); led3 = 0; do { } while ((osKernelSysTick() - tick) < osKernelSysTickMicroSec(100)) }}
void led_thread2 (void const *argument) { for (;;) { led2 = 1; tick = osKernelSysTick(); do { } while ((osKernelSysTick() - tick) < osKernelSysTickMicroSec(1000)); led2 = 0; tick = osKernelSysTick(); do { } while ((osKernelSysTick() - tick) < osKernelSysTickMicroSec(1000)); }}
osThreadDef(led_thread3, osPriorityNormal, 1, 0);osThreadDef(led_thread2, osPriorityNormal, 1, 0);
uint32_t clock=0;/*---------------------------------------------------------------------------- * Main: Initialize and start RTX Kernel *---------------------------------------------------------------------------*/int main (void) {
SystemCoreClockUpdate(); clock = SysCtlClockFreqSet( SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 60000000); osKernelInitialize(); led_ID3 = osThreadCreate(osThread(led_thread3), NULL); led_ID2 = osThreadCreate(osThread(led_thread2), NULL);
osKernelStart();}
I would appreciate it if you could teach me.