NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

SYS/BIOS Quick Start for MSP430

From Texas Instruments Wiki
Jump to: navigation, search
Sysbios image.png

This guide provides a quick “jump start” to building and running a first SYS/BIOS application for the MSP430. It provides a quick introduction to SYS/BIOS and its tooling, and then steps through building and running a sample application. After this, there are some pointers for next steps and further information, and a quick summary of what is different about the MSP430 implementation of SYS/BIOS, versus ports to other device families.

What is SYS/BIOS?[edit]

SYS/BIOS is a scalable real-time kernel that provides preemptive multithreading, communication and synchronization primitives, memory management, power management, and hardware abstraction. It enables quick development and deployment of embedded applications that require real-time scheduling and synchronization or real-time instrumentation. The kernel is designed to minimize memory and CPU requirements on the targeted CPU. A SYS/BIOS installation includes tooling for graphical configuration of applications, real-time analysis of program execution, and viewing the internal application and kernel state.

What is XDCtools?[edit]

XDCtools is a separate software product from Texas Instruments that provides the underlying tooling needed by SYS/BIOS. You must have both XDCtools and SYS/BIOS installed in order to use SYS/BIOS. XDCtools is important to SYS/BIOS users because it provides the underlying technology enabling users to configure the modules in their SYS/BIOS application, as well as a number of run-time modules and APIs that SYS/BIOS leverages for memory allocation, instrumentation, and system control.

Building and Running a Sample Application[edit]

You can use the following steps to build and run your first SYS/BIOS project in Code Composer Studio (CCS). This sample application will periodically blink an LED on the MSP-EXP430F5529 Experimenter Board.

Note: If you know the GPIO settings to control an LED on your MSP430 board, you can follow the steps in this example and substitute your MSP430 development board and the GPIO port direction register and GPIO bits as needed.

In this application, a SYS/BIOS Timer is created to “tick” every half second and toggle the state of an LED. Every 10 ticks, a SYS/BIOS Semaphore is posted to wake a SYS/BIOS Task that has pended upon the Semaphore. The Task will print a tick-count message to a Log buffer and then pend upon the Semaphore again, which results in the CPU transitioning back to a low power state while waiting for the next timer tick.

These are the steps to build and run the sample application:

  1. Launch Code Composer Studio by clicking on its icon.
  2. When prompted to “Select a workspace” click “OK” to use the default workspace.
  3. Trex tree.png
    If you do not see the TI Resource Explorer, make sure you are in the CCS Edit perspective and choose View > TI Resource Explorer from the menus.
  4. Expand the SYS/BIOS item in the tree to show SYS/BIOS > MSP430 > MSP430x5xx Family. You’ll see a long list of MSP430 devices.
  5. You can scroll down to the MSP430F5529 device and further expand the tree to see MSP430F5529 > MSP430 Examples > Task Example. (Alternately, you can type 5529 in the “enter search keyword” field above the tree and close the MSP430ware node before expanding the SYS/BIOS tree as shown here.)
  6. Make sure the Task Example is selected and you see a description of the Task Example to the right of the TI Resource Explorer resource tree.
    Trex step1.png
  7. Click the “Step 1: Import the example project into CCS” link. This creates a SYS/BIOS project in CCS for the device you selected. A green checkmark appears next to the step you completed, and the new project is added to the Project Explorer list.
  8. Depending on which version of CCS you are using, a dialog for “ULP Advisor” may appear at this point. If it does, you can click the “OK” button to dismiss it.
  9. Expand the task430_MSP430F5529 project in the Project Explorer area. These are the files used to create the application.
    Projexplore task.png
  10. Double-click on the task.c file to open it in the editor.
    Task c 1.png
  11. Scroll down in task.c to the main() function, and uncomment the line setting the GPIO port direction register P1DIR. (Since this example can run on any MSP430 board, including boards without an LED on this GPIO, the driving of the GPIO pin for the LED is commented out, and needs to be uncommented to light up the LED.)
    Task c 2.png
    Notice that after the GPIO port direction is set and a “Hello world” message is printed, the BIOS_start() function runs. This is the function that sets up SYS/BIOS services and starts the thread scheduler. Once that is done, SYS/BIOS controls the execution of the threads that run myTickFxn() and myTaskFxn().
  12. Scroll further down in task.c to myTickFxn() and uncomment the line that toggles the GPIO bit on P1OUT.
    Task c 3.png
  13. Move back to the TI Resource Explorer view and click the link for “Step 2: Build the imported project.” CCS runs the necessary steps to process the SYS/BIOS configuration, compile the code, and link the application. Notice that you see green checkmarks next to both Step 2 and Step 3 in TI Resource Explorer. This is because the project contains its own target configuration file (*.ccxml) to configure debugging this device with a USB connection.
    Trex step2.png
  14. When the project finishes building, attach the MSP-EXP430F5529 Experimenter’s Board to your PC with a USB cable. You’ll need to attach the cable to the USB connector labeled “ezUSB”, in the lower-left corner of the board.
    EXP430F5529 board wLED.png
  15. Click on “Step 4: Debug the imported project” in TI Resource Explorer. (Depending upon the version of CCS you are using, a dialog for “ULP Advisor” may appear to report some remarks. If this dialog appears, click the Proceed button to dismiss it.)
  16. Once the program is loaded on the board, the debugger will run to the start of main() and halt. At this point you can click the run icon in the CCS Debug perspective to let the program run. LED1 on the board should blink at a 1 Hz rate.
    Debug run.png

Where to Go from Here?[edit]

As a next step, you’ll probably want to read through the “SYS/BIOS Getting Started Guide”, included in the SYS/BIOS installation (for example, here: C:\ti\bios_6_35_02_14\docs\Bios_Getting_Started_Guide.pdf). This guide gives an introduction to creating new SYS/BIOS projects, running the included sample applications, using the graphical configuration tool, and using the RTOS Object Viewer.

The SYS/BIOS User's Guide (SPRUEX3) provides a detailed description of the different SYS/BIOS modules, configuring and building applications, the example applications, re-building SYS/BIOS from its sources, etc. As you read through this guide, you can build, run, and experiment with the different example applications.

For the most detailed description of the SYS/BIOS APIs, the auto-generated, browser-based “cdoc” documentation is the best reference. This is included with each new SYS/BIOS release (for example, C:\ti\bios_6_35_02_42\docs\cdoc\index.html), and can be opened and navigated using a web browser.

Finally, see SYS/BIOS for the MSP430 for MSP430-specific implementation details of SYS/BIOS.

Special Notes Regarding the Implementation of SYS/BIOS on the MSP430[edit]

Because of some differences in the MSP430 device architecture, there are a few unique features in the MSP430 implementation of SYS/BIOS that differ from its implementation on other device families. These are briefly noted below. You should keep them in mind as you read the more general SYS/BIOS documentation.

  • Interrupt Dispatcher. The generalized Hardware Interrupt (Hwi) Dispatcher is not implemented for MSP430. Instead, individual, customizable “interrupt stubs” are generated for each interrupt.
  • Creation of Hwi and Timer objects. For MSP430, applications must create hardware interrupt (Hwi) and Timer objects statically (while writing the program) in the application configuration. For other device families, these can be created dynamically at program run-time, but this is not supported on MSP430.
  • Power Management. SYS/BIOS provides a Power Manager module that simplifies the activation of MSP430 low-power modes while the CPU is waiting for new work. This module works seamlessly with the SYS/BIOS thread schedulers so that the CPU can run threads that are triggered by an interrupt and then transition naturally back to the previous low-power mode that was in effect prior to the interrupt being triggered.
  • Clock Tick Suppression. For MSP430 a new “dynamic” mode was implemented for the SYS/BIOS Clock module. Previously, on other device families, the Clock module would continuously interrupt the CPU at a user-specified periodic rate. With the new dynamic mode, the timer peripheral used by the Clock module is dynamically reprogrammed at program run-time to wake the CPU when there is new work to be done, rather than at a continuous periodic rate. This allows suppression of unnecessary Clock ticks, allowing the CPU to remain in a low power state as long as possible.

Training[edit]

The "Intro to TI-RTOS Kernel Workshop" is now available. Follow the link below to find out more. The TI-RTOS Kernel Workshop covers the SYS/BIOS operating system available for all TI embedded processors - C28x, MSP430, Tiva-C, C6000 and AM335x (Cortex A-8). You can take a LIVE workshop (scheduled at various sites around the U.S.) or download/stream the videos of each chapter online and watch at your own pace. All of the labs, solutions, powerpoint slides, student guides, installation instructions, lab procedures, etc., are all available to you. The workshop labs run on all MCU platforms and the C6000. Check it out...

Intro to TI-RTOS Kernel Workshop

 

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article SYS/BIOS Quick Start for MSP430 here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article SYS/BIOS Quick Start for MSP430 here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article SYS/BIOS Quick Start for MSP430 here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity