FreeRTOS port

XCore Project reviews, ideas, videos and proposals.
User avatar
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

FreeRTOS port

Postby Bianco » Thu Feb 18, 2010 1:05 pm

Version: 7.6
Status: Complete
License: Custom Licence

Update February 2014: Now based on FreeRTOS version 7.6.0 (Requires tools v13 or newer to build).
This is a port of FreeRTOS (website v6.0.2 to the XMOS XS1 architecture.

It should contain all the features available on FreeRTOS however not all of them are tested.
Features of FreeRTOS include:
- Pre-emptive scheduling (timeslices)

- Co-operative scheduling

- Delays

- Message queues

- Semaphores
User avatar
XCore Addict
Posts: 169
Joined: Fri Jan 08, 2010 12:13 am

Postby paul » Thu Feb 18, 2010 10:38 pm

Good work - will have to take a look at this implementation. I'm sure I will be back with more comments soon!

On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
User avatar
Junior Member
Posts: 4
Joined: Sun Dec 13, 2009 2:02 pm

Postby kristianpaul » Tue Feb 23, 2010 2:46 am

Hey thats fantastic, how may rtos can i run at the same time?
User avatar
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Tue Feb 23, 2010 2:20 pm

Currently you can only run FreeRTOS at one thread on Core 0.
This is due to the fact that FreeRTOS shares its main code with a lot of other architecture ports and i left this code intact.
User avatar
Active Member
Posts: 50
Joined: Wed Dec 16, 2009 6:04 pm
Location: London

Postby errordeveloper » Mon Jul 12, 2010 11:13 pm

Contiki port could be good to have as well ..
i would like to have a look at that sometime :)
Junior Member
Posts: 7
Joined: Sat Oct 30, 2010 9:48 am

Postby Goncalo » Fri Jun 24, 2011 2:38 am

Hi Bianco,

I am currently doing an internship at XMOS... more specifically a benchmark for UAVs hardware platforms. Studying/comparing the traditional microprocessors with XMOS architecture! A lot of the times a RTOS is used.

I read your thesis and I look to the code done... nice job.... very well written and a really good work.
I have just on question for you... the OS that you developed who do I need to talk with on XMOS to have access to it if you don't mind of course!

Thank you
User avatar
XCore Legend
Posts: 1121
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Mon Feb 17, 2014 11:48 am

Good work on the update - I'm sure there will be many who benefit from this.
User avatar
Posts: 1
Joined: Fri Oct 10, 2014 4:08 pm

Postby gsrsatyam » Wed Mar 04, 2015 12:56 pm

what are the tools required to run this port.
User avatar
Respected Member
Posts: 314
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Feb 22, 2019 6:12 pm

Just wondering if there is any advice for improving the port to work better with XCORE-200. With the XCORE-200 having so much more memory per tile than the XS1 it is a superior target to run meaningful programs in a FreeRTOS core (you can run one FreeRTOS core per tile, of course). It's great for me because I have a lot of legacy code for ARM Cortex-M targets that use FreeRTOS. And I just can write a few little .xc helper functions to interface that code to other parts of the chip (e.g. for I2C, UART, USB, Ethernet, etc).

The main challenges for XCORE-200 are discussed here: viewtopic.php?f=8&t=6370

Essentially you need to set portBYTE_ALIGNMENT to 8, and I have found that all the code that runs on the FreeRTOS core must be compiled with -mno-dual-issue, otherwise I get exceptions. Presumably related to either the clock interrupt or executing one of the assembly instructions, e.g. kcall instruction to jump to the kernel or disabling interrupts for a critical section and something screws up the issue alignment? I am honestly not a huge expert on how to deal with moving between dual issue and single issue code properly, especially with these asynchronous calls with interrupts and kcall. So I wonder if anyone has advice on where to look to get some insight on this? Of course I can continue to force the code on that core to be single issue, but it seems like it should be possible to make a few changes to the porting code so it would work with dual issue code (i.e. modify portmacro.h, port_asm.S, port.c and port_xc.xc).

Anyway, I have pulled in FreeRTOS 9 with just minor changes to the portmacro.h, so the port is by no means obsolete. I haven't tried FreeRTOS 10 yet, but I do like the MIT license.

Who is online

Users browsing this forum: No registered users and 0 guests