# FreeRTOS on AM335x

**URL:** <https://forums.freertos.org/t/freertos-on-am335x/5819>\
**Category:** Kernel\
**Created:** [March 2, 2016, 1:47pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819 "2016-03-02T13:47:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 2, 2016, 1:47pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/1 "2016-03-02T13:47:23Z")

</div>

**[konradfoit](https://sourceforge.net/u/konradfoit/)** wrote on [Wednesday, March 02, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#304a):

Hi!  
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,  
Konrad

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 2, 2016, 1:57pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/2 "2016-03-02T13:57:41Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, March 02, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#9511):

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.

[http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html](http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html)  
[http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html](http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 4, 2016, 2:30pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/3 "2016-03-04T14:30:14Z")

</div>

**[konradfoit](https://sourceforge.net/u/konradfoit/)** wrote on [Friday, March 04, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#dcd6):

OK.  
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?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 4, 2016, 4:31pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/4 "2016-03-04T16:31:01Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, March 04, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#7f39):

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 ([http://interactive.freertos.org](http://interactive.freertos.org)).

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 9, 2016, 3:24pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/5 "2016-03-09T15:24:42Z")

</div>

**[konradfoit](https://sourceforge.net/u/konradfoit/)** wrote on [Wednesday, March 09, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#fdf3):

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?

---

<div class="post-metadata">

**Author:** ![marinehero](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marinehero](https://forums.freertos.org/u/marinehero)\
**Post date:** [March 25, 2017, 10:29pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/6 "2017-03-25T22:29:52Z")

</div>

**[marinehero](https://sourceforge.net/u/marinehero/)** wrote on [Saturday, March 25, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#fdf3/1f3c):

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 [xxxx@xxxx.com](mailto:xxxx@xxxx.com) Or if you have it in a GitHub repo could you possible share?  
Thanks in advance  
James

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 25, 2017, 11:01pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/7 "2017-03-25T23:01:36Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, March 25, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#fdf3/1f3c/b191):

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.

---

<div class="post-metadata">

**Author:** ![marinehero](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marinehero](https://forums.freertos.org/u/marinehero)\
**Post date:** [March 26, 2017, 4:39am UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/8 "2017-03-26T04:39:51Z")

</div>

**[marinehero](https://sourceforge.net/u/marinehero/)** wrote on [Sunday, March 26, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#fdf3/1f3c/b191/9efe):

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 😉

---

<div class="post-metadata">

**Author:** ![shubham294](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@shubham294](https://forums.freertos.org/u/shubham294)\
**Post date:** [August 4, 2017, 6:49am UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/9 "2017-08-04T06:49:10Z")

</div>

**[shubham294](https://sourceforge.net/u/shubham294/)** wrote on [Friday, August 04, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#4916):

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 [xxxx@xxxx.com](mailto:xxxx@xxxx.com).  
Thanks in advance. 🙂

---

<div class="post-metadata">

**Author:** ![shubham294](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@shubham294](https://forums.freertos.org/u/shubham294)\
**Post date:** [August 11, 2017, 7:14pm UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/10 "2017-08-11T19:14:42Z")

</div>

**[shubham294](https://sourceforge.net/u/shubham294/)** wrote on [Friday, August 11, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#207f):

Ok, found one. For anyone else looking for a working FreeRTOS example on AM335x/BeagleBone Black, here is the link: [https://github.com/dumpram/beaglertos](https://github.com/dumpram/beaglertos).

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 26, 2019, 7:25am UTC](https://forums.freertos.org/t/freertos-on-am335x/5819/11 "2019-06-26T07:25:16Z")

</div>

**[kryochronic](https://sourceforge.net/u/kryochronic/)** wrote on [Wednesday, June 26, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/410c8cd3/#739e):

Hi All, yet another port for the BBB:  
[https://github.com/kryochronic/AM335X-FreeRTOS-lwip](https://github.com/kryochronic/AM335X-FreeRTOS-lwip)
