freeRTOS support of MSP430X

williamjsell wrote on Sunday, April 24, 2011:

I tried to port freeRTOS over to the msp430f5529 platform from the existing msp430f449 freeRTOS demo;  I am using Crossworks V2.0 as the dev environment; it was pretty straightforward, or so it seemed; but when I called the asm line “call #_prvSetupTimerInterrupt”, the call never returns; at first I thought this was the stack getting manipulated to vector to the first task, but the call to portRESTORE_CONTEXT is never reached, which means the stack should have the return address to the calling function. But this is not working and I cannot see the reason;  Paul Curtis at Crossworks thinks this is something to do with the compilation being for the MSP430X series of processors which have a different idea of function pointers.  To save myself some time figuring this issue, I thought I would check and see if anyone else has encountered a similiar problem; the new series of MSP’s from TI are getting very popular with the extended memory range and internal USB hardware, so it seems like a good thing to fix



rtel wrote on Sunday, April 24, 2011:

If you have the compiler set to use the extended memory, then you should be calling “calla”, not “call”.  Check out the MSP430X instruction set.

I would suggest using the provided IAR and CCS4 MSP430X ports (in the FreeRTOS download) as a reference.  The Rowley compiler differs somewhat with regard to how function pointers are are used though, so when setting up the initial stack for the task you will have to de-reference to 16 bit pxCode parameter in the pxPortInitialiseStack() function to find the true 20 bit value.  (the function pointer actually points to a look up table that contains the real addresses).


bart_tormans wrote on Sunday, October 09, 2011:


Have there been any new developments in this area? I would also, very much like to use FreeRTOS/MSP430X/CrossStudio combination.

Could anyone please share some experience?

Many thanks in advace