Very fast context switching with TI’s MCU?

Hello. I’m new to freeRTOS and have two questions. We have two “applications” to be merged into one software where one of the app’s is very time critical. We’re currently using a Texas Instrument TMS320F28069 MCU (C2000 family) running on a 20Mhz crystal (and no RTOS). REQUIREMENTS: Max 150 uSec CPU-time can be consumed by the non-critical task/thread (every 650 uSec). If these 150 uSec are exceeded, severe damage to the hardware may occur. We use a Texas Instrument (TI) TMS320F28069 MCU (C2000 family) running on a 20Mhz crystal and Code Composer Studio (CCS) IDE. Q-1: Is it easy/simple to use/implement the freeRTOS under TI’s CCS IDE for this MCU? Q-2: Would you recommend to implement these very hard/tough real-time requirements under freeRTOS’s control? best regards terje bohler

Very fast context switching with TI’s MCU?

There are CCS ports for Cortex-M and MSP430X, but not C2000. Your timing constraints are very tight, but could possibly be achieved using an RTOS port that supports a full interrupt nesting model that includes a sub-set of interrupt priorities that are never disabled. You could then implement the high frequency real time control by using that subset of interrupts without the risk of the interrupts ever being delayed by the activity of the RTOS. You ask would I recommend doing this, and the answer would have to be, I would recommend setting up an experiment with a dummy/simple/small application to test if the requirements can be met as soon as possible into the project so you can determine quickly if it is worth pursuing or not. Regards.

Very fast context switching with TI’s MCU?

Thank you very much. best regards terje bøhler

Very fast context switching with TI’s MCU?

And by the way … If you can recomment an RTOS suitable (possibly) for our needs I would appreciate that very much. best regards terje bøhler

Very fast context switching with TI’s MCU?

If you can recommend an RTOS suitable
FreeRTOS of course 🙂 Why FreeRTOS would be a good choice? Because it is deterministic. The internal algorithms and data structures are chosen in such a way that the same actions last the same amount of time each time they’re executed. You write that the crystal gives 20 MHz, but I suppose that your TMS320F28069 will run at 90 MHz? Like Richard suggested, I would write a simulation and test for yourself if the constraints can be met. Every 650 uSec, there are at most 150 uSec available to do a secondary task. After that your primary task will run doing important things? The TMS320 has three 32-bits timers. One timer can be set-up with a small divisor so it runs very fast just to measure micro seconds and see if the constraints are being met. Suppose your primary task is sleeping in a xTaskNotifyWait(). A second 32-bit timer will serve as an alarm clock and will wake-up the primary task after N uSec by calling xTaskNotifyFromISR(). Now the primary task becomes runnable and if it has the highest priority, it will run. The time needed for a task-switch should be far below 1 uSec. It will be important for you to know exactly which interrupts are to be expected and how long it takes to handle them. Good luck.

Very fast context switching with TI’s MCU?

Thanks Hein! I think I need a little clarification here… My first response on my post (see above) says: “There are CCS ports for Cortex-M and MSP430X, but not C2000.” And you say “If you can recommend an RTOS suitable, FreeRTOS of course :-)”. Are you positive that we can use the freeRTOS for our MCU & (CCS-) IDE? I’ll appreciate clarification on this matter. best regards terje bøhler

Very fast context switching with TI’s MCU?

I believe there is at least one contributed C2000 port somewhere, as it used to be in the FreeRTOS Interactive site. I know nothing about it though, and we can’t support it ourselves as it is third party code. We don’t have a port ourselves, but you could potentially create one. Regards.

Very fast context switching with TI’s MCU?

Thank you for the information. best regards terje bøhler

Very fast context switching with TI’s MCU?

Sorry Terje, I was only responding to your question Q-2 as I know nothing about that particular FreeRTOS port. Regards.

Very fast context switching with TI’s MCU?

My first comment is that these requirements: REQUIREMENTS: Max 150 uSec CPU-time can be consumed by the non-critical task/thread (every 650 uSec). If these 150 uSec are exceeded, severe damage to the hardware may occur. We use a Texas Instrument (TI) TMS320F28069 MCU (C2000 family) running on a 20Mhz crystal and Code Composer Studio (CCS) IDE. seem to be written wrong. It is almost a certainty that the critical need isn’t to limit the tie spent in the background thread, but that some task (or set of tasks) has some very tight requirements with HARD deadlines to meet. Understanding the nature of these requirements would be an essential piece of being able to see the suitability of any given system to your requirements.