AnsweredAssumed Answered

RTCS with HTTP server tasks with time slice

Question asked by Nicolas G on Jan 31, 2019
Latest reply on Feb 24, 2019 by Daniel Chen



We have a project running with the following environment: KDS (1.3.0) with KSDK (3.0.0) and Processor Expert (PEX). We did a small web server with a few HTML pages. I believe that when the pages are display, the RTCS task and/or the HTTP server take a very long time to reply to the requests.


Observation 1: The watchdog not being kicked during more than a second

On our board, we have a hardware watchdog which is set to a little more than 1 second. The function kicking the watchdog is in the main task which have the highest priority and do nothing more than kicking the watchdog every 100ms.

By tracking the watchdog kicks, we can observe that, when a page is requested, the watchdog is not kicked at the same frequency it normally is. Hitting the "F5" key in the browser to generate multiple requests may even make our system reboot (because the watchdog has not been kicked during more than a second).


Observation 2: The UART communication being held up during more than 250ms

In our full system, there are 2 microcontrollers, they communicate using UART. There is a 250ms timer which is refreshed every time a word is received from the other microcontroller. When the web pages are not accessed, there are no issues (the system has been on for days). When the pages are displayed (even a few seconds after booting up), it may happen that the timer expires.


Note : Not to have a task holding up the processing time, we created the tasks with the option MQX_TIME_SLICE_TASK.


I believe creating the RTCS related tasks with the MQX_TIME_SLICE_TASK option may be a solution to the encountered problem. So I guess my question is: how to make the RTCS related tasks share their running time on a time slice base? As I stated before, it may not be the solution so I'm also open to suggestions/ideas on what to do to solve this problem.