The port was developed on an ES449 development/prototyping board from SoftBaugh (instructions are provided should you wish to use an alternative development board), using the CrossWorks MSP430 compiler and a SoftBaugh FETP parallel port JTAG interface
The ES449 is a neat little MSP430F449 based prototyping board. It allows easy access to the MSP430 peripherals and includes an LCD display - great for debugging! The FETP / CrossWorks interface is seamless and fast making this a very easy to use development platform.
As downloaded this demo application does not demonstrate the use of co-routines. See the co-routine documentation page for information on how co-routine functionality can be quickly added to this demonstration.
FreeRTOS V5.1.0 upgraded this port and demo to permit tasks to use the MSP430 low power modes 1 to 3.
The CrossWorks project used to build the MSP430 FreeRTOS demo is located in the Demo/msp430_CrossWorks directory.
The single on board LED is used by one of the ComTest tasks. It is toggled every time a character is received on the serial port.
The demo application creates 10 tasks - 9 of the standard demo application tasks and the idle task. When executing correctly the demo application will behave as follows:
The '*' in the fifth position on the LCD is under control of the 'Check' task. Every three seconds the 'Check' task examines all the tasks in the system to ensure they are executing without error. It then toggles '*' 5. If '*' 5 is toggling every three seconds then no errors have ever been detected. The toggle rate increasing to 500ms indicates that the 'Check' task has discovered at least one error.
The demo application uses the LCD in place of LEDs so no other hardware setup is required.

It should also be noted that the serial drivers are written to test some of the real time kernel features - and they are not intended to represent an optimised solution.
Each port #defines 'portBASE_TYPE' to equal the most efficient data type for that processor. This port defines portBASE_TYPE to be of type short.
Note that vPortEndScheduler() has not been implemented.
Method 1 only requires C code so is simpler to implement than method 2. It only saves and restores the task context when a context switch is actually required, so can also be more efficient. However - a context switch being performed within the interrupt will result in some processor registers being saved twice (once on interrupt entry, and then again for the context switch). This means the stack allocated to each task will need to be larger when using method 1 compared to that required when using method 2.
void vRxISR( void ) __interrupt[ UART1RX_VECTOR ]
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Get the character from the UART and post it on the queue of Rxed
characters. */
cChar = U1RXBUF;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken )
{
/*If the post causes a task to wake force a context switch
as the woken task may have a higher priority than the task we have
interrupted. */
taskYIELD();
}
/* Make sure any low power mode bits are clear before leaving the ISR. */
__bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
}
/* Ensure the required header files are included. */
#include "FreeRTOSConfig.h"
#include "portasm.h"
.CODE
/* Example wrapper for the Rx UART interrupt. */
_vUARTRx_Wrapper:
/* portSAVE_CONTEXT must be the first macro to be called. This is defined within
portasm.h. */
portSAVE_CONTEXT
/* Following portSAVE_CONTEXT the C portion of the handler can be called. */
call #_vRxISR
/* Finally portRESTORE_CONTEXT must be called at the end of the wrapper. This too
is defined within portasm.h. */
portRESTORE_CONTEXT
/*******************************************************************************************/
/* The wrapper must be installed as the interrupt handler. */
.VECTORS
.KEEP
ORG UART1RX_VECTOR
DW _vUARTRx_Wrapper
END
/* This is the standard C function called by the assembly file wrapper. */
void vRxISR( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Get the character from the UART and post it on the queue of Rxed
characters. */
cChar = U1RXBUF;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
/*If the post causes a task to wake force a context switch
as the woken task may have a higher priority than the task we have
interrupted. */
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}