ps-manikandan wrote on Wednesday, November 14, 2018:
1] i am using FreeRTOS[V8.0.0] on a ARM cortex M4.
2] i tried to measure the cpu free time using idle task and ticks.
3] created a task <application_task> with priority tskIDLE_PRIORITY+4 and redefined the macros traceTASK_SWITCHED_OUT/IN in FreeRTOSConfig.h file to get notified for IDLE’s entry and exit. Upon entry/exit and count the free ticks using “xTaskGetTickCount”.
4] <application_task> just runs a indefinite loop to print a string and sleeps for 2 seconds.
5] i also created a periodic timer (xTimerCreate) for every 10 seconds. In the timer callback i print the cpu free percentage.
6] I get 99% and it decreases when i reduce the sleep time in <application_task>.
With the above setup, i then programmed the spi and dma to do a memory to spi and spi to memory transaction continously through linked list dma. Once initialized for this, the M4 core will get a hardware peripheral(DMA) interrupt continoulsy every 200 micro seconds. In the ISR a very little code is written to modify the link list data. I ensured that this is happening continously but, there is no decrease in the cpu free percentage.
I don’t know whether FreeRTOS kernel knows about this ISR execution.
Does this ISR even preempts the scheduler ?
Is there any way to tell kernel about ISR execution ?
How do i include this ISR execution time into my cpu busy time ?