FreeRTOS on AM335x

konradfoit wrote on Wednesday, March 02, 2016:

I know there’s been few discussions about that, but they’re from 2 years back.
Is there eny port of FreeRTOS to AM335x processors? I’m developing software on custom board with AM3352, but port for BeagleBone will be ok.
If not, is there port for any Cortex-A8 processor? If so is it reliable?

Best regards,

rtel wrote on Wednesday, March 02, 2016:

There are several Cortex-A9 ports, which will do what you want. Look at Renesas RZ/A, Xilinx Zynq and Altera SoC for examples. There are also Cortex-A5 ports for the Atmel SAMA5 parts - although these use a propriatory interrupt controller.

konradfoit wrote on Friday, March 04, 2016:

I’ve managed to do this. Wasn’t that hard, but the better start-point for this is the A5 port, since AM335x doesn’t have ARM GIC.
The only tricky part was modifying IRQHandler form TIs StarterWare to perform Context switching.
Although it seems that in the A5 port implementation of IRQHandler, FreeRTOS is checking if it should switch context on every interrupt, not only from SysTick. is that correct behaviour?

rtel wrote on Friday, March 04, 2016:

Yes that is correct - any interrupt can unblock a task, and if a task that has a priority above the currently running task (the task that the interrupt interrupted) is unblocked then the ISR should return directly to the unblocked task.

I would be grateful if you could post your project to the FreeRTOS Interactive site (

konradfoit wrote on Wednesday, March 09, 2016:

Now I am integrating TI’s StarterWare into project to properly handle hardware, that includes I2C for controlling PMIC in order to change core voltages, which is nedded for changing core speed. For now I will just include StarterWare without adding mutexes to it, just to get it working. If this version will be good to share I will do that by the end of the week. Of course that will lead to possible errors i.e. in communication interfaces if two threads will simultaneously access one peripheral. So shall I post it like this or after I modify StarterWare to use mutexes?

marinehero wrote on Saturday, March 25, 2017:

Hi Konrad - I see you have ported a version of FreeRTOS combined with starterware.
I have been struggling getting portRESTORE_CONTEXT() as TI compiler in CCS does not handle asm(" LDR R0, =pxCurrentTCB")…etc
I am under intense pressure and struggling against time… would you be so kind as to share it with me? email Or if you have it in a GitHub repo could you possible share?
Thanks in advance

rtel wrote on Saturday, March 25, 2017:

There are examples of how to access the pxCurrentTCB variable from asm
code in the TI compiler ports found in the FreeRTOS download - albeit
for MSP430 and Cortex-M parts, rather than Cortex-A - but you can still
use the ports as a reference for the required syntax.

marinehero wrote on Sunday, March 26, 2017:

Thx for the response… had looked at that route, but was hoping for shortcuts as I have an uncomfortable tight binding to TI Starterware, guess I’ll just have to grit my teeth and do it :wink:

shubham294 wrote on Friday, August 04, 2017:

Hi Konrad,
I know it has been a long time but it would be very kind of you if you could share the AM335x port on Github. Or maybe you could mail me the project at
Thanks in advance. :slight_smile:

shubham294 wrote on Friday, August 11, 2017:

Ok, found one. For anyone else looking for a working FreeRTOS example on AM335x/BeagleBone Black, here is the link:

kryochronic wrote on Wednesday, June 26, 2019:

Hi All, yet another port for the BBB: