Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.
Example project with Cortex M3 and BIOS6
This page is intended to describe how to create a DSP/BIOS project for the new Cortex M3 devices using CCSv4.
With the recent incorporation of Stellaris® microcontroller product line, there is an instant need to get help and information about support for this family. The information below is intended to be a helper for developers interested in know more about how to start development using CCSv4. This page is continuously being updated as support is being added everyday. It should be checked regularly.
- Code Composer Studio v4 Beta 5 that contains: Code Composer Studio v4
- Code Generation Tools release 4.5.1
- DSP/BIOS 6.20.00.27
Creating projects and configuring targets in CCSv4: Demonstrating_CCS
Creating custom targets when using CCSv4: Creating_Custom_Target_Configurations
Reference about Simulators: Simulation
To know more about TI support for ARM cores check: ARM_Code_Generation_Tools_v4.4.x
Creating a sample DSP/BIOS project in CCSv4
Generic information on how to create a simple Hello world project in CCSv4 can be found in the first reference, however the steps below show an specific example for Cortex M3 with DSP/BIOS support added to it.
Creating a new project
- With CCS open, click on File -> New -> CCS project
- Give a name to the project (<CortexM3_bios_example> was used) and click Next.
- The project type is set to ARM by default. Two configurations (Debug and Release) will be created with different optimization levels. Leave everything as default and click Next.
- No referenced projects are needed (in case any existing project is needed as a dependency, this is the place to select it). Click Next.
- This screen allows the selection of the device and the development tools needed to do the project. In Device Variant select Generic CortexM3 Device. The Device endianess can be changed in the drop-down box just below - for this example change it to little. In the box Target Content select the option Enable RTSC Support (required for DSP/BIOS v6.xx, Codec Engine v3.xx, etc.). Click Next.
- This next screen allows the use of an existing RTSC configuration (that contains the DSP/BIOS settings) for the project. Click Next.
- This screen allows changing the name of the RTSC configuration. By default it is named <name_of_the_project>_configuration. Click Next.
- This next screen sets the default configurations of the device used. A pop up asks for the need to select or specify a RTSC platform (the board or simulator used). All the fields but RTSC Platform are pre-populated. Click on the down arrow in RTSC Platform and select ti.platforms.simCM3 to select the Cortex M3 simulator. Click Next.
- This next screen allows to select an existing example project to be used as a framework to your project. Check the box Create a project using one of the templates and select Log example. Click Finish.
Building and running the project
- After completing the creation steps above the project is ready to be built. Go to menu Project -> Build Active Project. No errors should be found.
- Before running the simulator, one additional step must be done: the creation of a Target Configuration. Right-click on the project name (for this example it is <CortexM3_bios_example>) and select New -> Target Configuration File.... The box that opens will allow to create a different filename for this configuration. Type in the desired name (in this example it was used <CortexM3_sim>) and click Finish.
- A window with several boxes will open. By default the Connection drop-down box is pre-populated with TI Simulator. Leave it that way and check the box next to Cortex-M3 Device Cycle Accurate Simulator, Little Endian in the Device selection list. Click on the button Save at the right of this list.
- This concludes the target configuration process. To debug the project, go to menu Target -> Debug Active Project.
- The perspective will change from development to debugging (check the little boxes at the top right of the CCS window that say Debug and C/C++). By default the code is automatically loaded to the target, the boot process is performed and the PC is located at the main() function.
- The menu Target contains several commands to debug the target like step, run, halt, reload, reset, etc. Also, the View menu contains additional commands to view memory, registers, variables, breakpoints, etc.
- If run to the end, the sequence of printed messages on the console window can be seen below. They show the flow of events on the system - basically the timestamps where each event occurs: entering tasks, yielding to other tasks and switching between tasks. The cluttered information is due to the fact that Real-time Analysis is not yet implemented for this architecture.
#0000000001 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x0, oldfunc: 0x0, newtsk: 0x20000008, newfunc: 0x221 #0000000002 [t=0x05fe0d40] xdc.runtime.Main: tsk0 Entering. arg0,1 = 1 2 #0000000003 [t=0x05fe0d40] xdc.runtime.Main: tsk0 Calling Task_yield #0000000004 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_yield: tsk: 0x20000008, func: 0x221, currThread: 2 #0000000005 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x20000008, oldfunc: 0x221, newtsk: 0x20000860, newfunc: 0x2ed #0000000006 [t=0x05fe0d40] xdc.runtime.Main: tsk1 Entering. arg0,1 = 11 12 #0000000007 [t=0x05fe0d40] xdc.runtime.Main: tsk1 Calling Semaphore_pend #0000000008 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x20000860, oldfunc: 0x2ed, newtsk: 0x200010b8, newfunc: 0x409 #0000000009 [t=0x05fe0d40] xdc.runtime.Main: tsk2 Entering. arg0,1 = 21 22 #0000000010 [t=0x05fe0d40] xdc.runtime.Main: tsk2 Calling Task_yield #0000000011 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_yield: tsk: 0x200010b8, func: 0x409, currThread: 2 #0000000012 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x200010b8, oldfunc: 0x409, newtsk: 0x20000008, newfunc: 0x221 #0000000013 [t=0x05fe0d40] xdc.runtime.Main: tsk0 Exiting #0000000014 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x20000008, oldfunc: 0x221, newtsk: 0x200010b8, newfunc: 0x409 #0000000015 [t=0x05fe0d40] xdc.runtime.Main: tsk2 Exiting #0000000016 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x200010b8, oldfunc: 0x409, newtsk: 0x200041b8, newfunc: 0x6035 #0000000017 [t=0x05fe0d40] xdc.runtime.Main: Entering idl0Fxn. #0000000018 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x200041b8, oldfunc: 0x6035, newtsk: 0x20000860, newfunc: 0x2ed #0000000019 [t=0x05fe0d40] xdc.runtime.Main: tsk1 Exiting #0000000020 [t=0x05fe0d40] ti.sysbios.knl.Task: LM_switch: oldtsk: 0x20000860, oldfunc: 0x2ed, newtsk: 0x200041b8, newfunc: 0x6035 #0000000021 [t=0x05fe0d40] xdc.runtime.Main: Calling System_exit
Known issues and limitations
- As mentioned before, BIOS6 for Cortex M3 does not yet support Big endian modes.
- All the BIOS6 Real-time Analysis (RTA) tools are not yet supported. These are located in menu Tools -> ROV and Tools -> RTA. All other debugging tools on this menu are supported.
- Currently only the Cortex M3 simulator is available as a development target. Support for hardware development boards will be added as its emulation device drivers become available.
--Rsjsouza 18:19, 18 May 2009 (CDT)