0

Raspberry Pi Port - Almost Ready

Hi Richard, and the FreeRTOS community,

I've managed to make a fully functioning port of FreeRTOS for the RaspberryPi. I shall post the full code here very shortly. I will also include a simple interrupt manager to handle the RaspberryPi interrupts, as this is really required to work correctly with FreeRTOS. Basically it has to determine which IRQ# is actually firing etc. (Kind of vectorising the interrupts for you).

In anycase, I saw in some older attempts to port to ARM11, in the portSAVE_CONTEXT() macro is a NOP. Does anyone know the real reason for this? I removed it from my code, and the Pi still runs perfectly. I suspect its some requirement for an older ARM core, or to aid debug stepping or something along those lines???

Also in an older ARM11 port they made some function calls in the ISR like: (I know this is a community port, so its not the usual high FreeRTOS standard).

__asm volatile ("bl vTaskIncrementTick");

Instead of:

vTaskIncrementTick();

I had some real problems because of this, there's no advantage to using the inline assembly, yet the compiler cannot know that the LR will be clobbered and therefore doesn't push it on function entry.

I suspect this is not a problem if the said function is the ISR called directly by the hardware, but if there's a callstack below it then there are problems.

Aside from that it wasn't too difficult. I just thought I'd mention this in case anyone searches for such a problem in the future.

==

I heard Rob Williams retired, its a bit of a shame that UWE isn't backing brilliant courses like CRTS anymore.

Take care,

 

James

 




save_context.txt

15 comments

Please sign in to leave a comment.