How to use FreeRTOS in my TI Cortex M4 microcontroller

mne1991 wrote on Friday, August 08, 2014:

Dear sir/madam,

I have started learning RTOS before two days, and I intend to use Free RTOS as it looks brilliant!.

Could someone help me and give me the first steps of learning, and how to use it on my TM4C1294NCPDT microcontroller (its core is ARM Cortex M4F)? and some simple examples to get used of it? and the basic concepts of RTOS?

Thank you in advance.

Regards,
Mohammed Noureldin.

rtel wrote on Friday, August 08, 2014:

The easiest way to start with FreeRTOS is to use one of the demo
applications that target the hardware you are using. While there is no
demo specifically for the TM4C, because it is a Cortex-M4F based device,
any simple Cortex-M4F demo will run on that chip - barring any IO
specifics (like which port an LED is attached to).

These links will help for a start:

http://www.freertos.org/Creating-a-new-FreeRTOS-project.html
http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html
http://www.freertos.org/simple-freertos-demos.html (these may be
somewhat out of date - but the concepts have not changed).

You might also consider one of the tutorial books. The Generic
Cortex-M3 book would probably be most suitable - although that targets a
Cortex-M3 rather than Cortex-M4F switching between the two is simple;
All you have to do is swap all the files and include paths that refer to
the FreeRTOS/Source/Portable/[compiler]/ARM_CM3 directory to instead use
FreeRTOS/Source/Portable/[compiler]ARM_CM4F directory.

Regards.

Hey!

I am a beginner trying to learn to use FreeRTOS. I use TM4C123GH6PM board on keil.
I followed the steps you suggested and try to download the demo named as “CORTEX_M4F_CEC_MEC_17xx_51xx_Keil_GCC” on the TM4C123GH6PM board. What else I need to change in the demo example to make it download on the board.
I have been searching answer to this query for hours. At last I have found this thread which is quite old but probably only hope. I don’t want to download TivaWare and use the the examples given over there because I want to follow the steps given in the documentation.

Thanks and Regards

Hi Utkarsh,

I can define myself a beginner too, but I’m sure that with a bit of patience (around 1 day)
you’ll be able to run your code as well.

I really suggest you to start from this very useful guide.

Should you have any issues refer the following articles:

https://www.freertos.org/FAQHelp.html (this contains very useful links!).

If you resist to the temptation to “run the code immediately”, you’ll be rewarded!

Regards,
AGA

Hello superaga,

Thank you for replying and for that advice. I’ll surely follow that.

I have gone through those links. But honestly, I didn’t find them helpful.
I changed the the device to TM4C123GH6PM in the project options. I wanted to know what else need to be changed in the options.
The code builds properly with 0 errors, 0 warnings. But when I try to debug it by downloading it onto the board, I got hit up with error stating “No ULINK2/ME device found”. I searched for the solution on google but didn’t came up with useful answers.

Thanks and Regards
Utkarsh

Hi Utkarsh,

I assume then that you are using Keil uVision, isn’t?
I used Keil very few times, but enough to understand that your issue is not related to FreeRTOS.
First suggestion is to create a simple blinky project (or try a demo if exists) and if you can debug it, then try to compare those 2 projects settings.
Normally you can choose between the simulator or the emulator. This last in some cases might need to be configured.

Sorry but I can’t help you more…

Regards,
AGA

Hi superaga,

I checked that too. I tried debugging the other program and was able to do it successfully. I too think that this error is not related to FreeRTOS but all other programs are compiling and debugging successfully. So, I decided to look for help here.

Thanks and regards

Do you have a ULINK2/ME that it can’t find, or are you using a different debug interface and the project is configured to use a ULINK2 you don’t have? In either case, the debug interface selected in the project options has to match whichever debug interface you are actually using. (ULINK2 being a pod that sits between your host computer where you compile the code and the target where you run the code).

Hi Richard,
My boards is directly connected to my host computer through a USB cable. I do not use a pod.
Also I’ve tried switching debug interfaces. I have tried all the options of debug interface available there.
Other programs which are successfully debugging have same project options and same debug interface i.e ULINK/ME debug interface.

Thanks and regards

Hi Utkarsh,

doing a recap:

  • You use Keil uVision as IDE
  • You don’t have the ULINK2 as debugger
  • You are using the onboard debugger

Do you have the TIVA Launchpad board? (I suspect because you wrote about a board with TM4C123).
If so, you need to add the Stellaris ICD suport. This has been removed from the uVision since version 5.29.
Then you need to re add it.
Here the link.

In any case, when you post a question, please try to add as much details as possible;
this will let you solve your issue faster.

Regards,
AGA

1 Like

Hi superaga,

Yes I use a TIVA C series launchpad board and all those points are right. I am sorry. I should have mentioned all those points clearly. I am using Keil uvision5 MDK5.29. I am using windows 10 on my host computer. I am using on board debugger that is stellaris.
Thank you for the solution. Finally able to debug the code on the board using Stellaris ICDI debugger. I can start learning FreeRTOS in detail now. Thanks a lot.

Regards,
Utkarsh

Hi Utkarsh,

no problem. Please just mark my last message as solution, so anyone with the same issue could quickly find how to solve it.

Regards,
AGA