IMPORTANT! Notes on using MSP430X RTOS DemoPlease read all the following points before using this RTOS port.See also the FAQ My application does not run, what could be wrong?
Source Code OrganisationThe RTOS source code download contains the files for every FreeRTOS port and every demo application, so contains many more files than are required by the MSP430FR5969 demo. See the Source Code Organization section of this website for a description of the downloaded files.The IAR and CCS projects are both located in the /FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS directory:
Building and Running the MSP430FR5969 MSP430X RTOS ApplicationThe RTOS demo projects can be configured to build a simple blinky project, or a comprehensive test and demo application. The constant mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is used to switch between the two. mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is defined at the top of main.c.
The demo uses an LED built onto the MSP-EXP430FR5969 Launchpad development kit, so no hardware setup is required. The following sub-sections provide instructions on using the tool chains for which pre-configured projects are provided.
Building with IAR Embedded Workbench
Selecting the large or small data model build configuration using the IAR IDE Note: The IAR project can fail to build and get corrupted (so it can no longer be used with any IAR version) if it is opened in a version of EW430 that is older than the version that was used to originally create the project.
Building with TI Eclipse based Code Composer Studio (CCS)
Selecting the large or small data model build configuration using the CCS IDE Note: The CCS project references files using relative paths, including FreeRTOS+CLI files from the /FreeRTOS-Plus directory. The project may fail to build if a directory path is changed or if a file is moved. Eclipse's 'export' features can be used to convert the project into a stand-alone project that only uses directories under the directory in which the .project file is located.
Demo Application FunctionalityThe simply blinky examplemainCREATE_SIMPLE_BLINKY_DEMO_ONLY is defined at the top of main.c. When mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1 main() will call main_blinky():
The comprehensive test and demo applicationSample CLI session Note: The CLI output is sporadic when the demo application is executing in the debugger, but much smoother when the demo application is executing standalone. mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is defined at the top of main.c. When mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1 main() will call main_full():
RTOS Configuration and Usage DetailsData modelsThe RTOS supports both the large and the small data model. The data model is selected using the build options in the chosen IDE.Note for IAR users: If you are using the IAR tools then there is an additional step that must be performed when configuring FreeRTOS as follows:
Defining the necessary assembler symbol Configuring the RTOS tick interruptFreeRTOS requires exclusive use of a timer that is capable of generating a periodic interrupt called the RTOS 'tick' interrupt. The timer is configured in a user definable hook (or callback) function, so giving the application writer the flexibility to decide which timer peripheral is actually used. The name and prototype of the hook function is shown below:void vApplicationSetupTimerInterrupt( void );The constant configTICK_VECTOR must be set to the interrupt vector number of the chosen peripheral. configTICK_VECTOR is defined in the FreeRTOSConfig.h header file. This demo project includes an implementation of vApplicationSetupTimerInterrupt() that configures timer TA0 to generate the tick interrupt and therefore sets configTICK_VECTOR to TIMER0_A0_VECTOR. The provided code will have to be modified only if the application being developed needs TA0 to be free for some other purpose.
Interrupt service routinesUnlike most ports, interrupt service routines that cause a context switch have no special requirements and can be written as per the compiler documentation. The macro portYIELD_FROM_ISR() can be used to request a context switch from within an ISR. Note: portYIELD_FROM_ISR() must be the last statement in the ISR.This demo project provides examples of FreeRTOS interrupt service routines - including prvUSCI_A0_ISR() defined in serial.c. Note that prvUSCI_A0_ISR() is implemented to stress the port and demonstrate queues being used from interrupts - it is not intended to be a demonstration of an efficient or a generic interrupt service routine!
RTOS port specific configurationConfiguration items specific to these demos are contained in the FreeRTOSConfig.h file located in the same directory as the project file. The constants defined in FreeRTOSConfig.h can be edited to meet the needs of your application. In particular -
Each port #defines 'BaseType_t' to equal the most efficient data type for that processor. The MSP430X RTOS port defines BaseType_t to be of type short. Note that vPortEndScheduler() has not been implemented. Memory allocationSource/Portable/MemMang/heap_4.c is included in the MSP430X demo application project to provide the memory allocation required by the RTOS kernel. Please refer to the Memory Management section of the API documentation for full information.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|
Latest News
NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS. Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019 Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed. View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS. Careers
FreeRTOS and other embedded software careers at AWS. FreeRTOS Partners
|