Texas Instruments Stellaris CPU Support Package
This package contains project templates and system files for the Texas Instruments Stellaris.
CrossWorks Version 3 Installation Instructions
- To install this support package
-
- Click the Tools > Package Manager menu option to open the package manager window.
- Right click on the Texas Instruments Stellaris CPU Support Package entry and select Install Selected Packages.
- Click Next to take you to the summary page.
- Click Next to install the package.
- Click Finish to close the package manager window.
- Click the Tools > Show Installed Packages.
- Click on the Texas Instruments Stellaris CPU Support Package link to view the package and its contents.
- To manually install this support package
-
- If you have not done so already, follow the CMSIS 3 Support Package and CrossWorks Tasking Library Package installation instructions.
- Download the file Stellaris.hzq using your web browser.
- Click the Tools > Manually Install Packages menu option.
- Select the file you have just downloaded to install the package.
- Click the Tools > Show Installed Packages.
- Click on the Texas Instruments Stellaris CPU Support Package link to view the package and its contents.
- To install this support package using other versions
Release Notes
1.10
- Moved samples into their own board support packages.
1.9
- Support for devices as specified in Stellaris Family Product Selector Guide (Rev. K).
- Removed from the startup code the disabling of the Cortex-M4F hardware lazy FP save feature for CTL. CTL supplied in CrossWorks for ARM version 2.3 supports the Cortex-M4F hardware lazy FP save feature.
- Removed core CMSIS header files from this package. New projects will reference the include directory $(TargetsDir)/CMSIS_3/CMSIS/Include of the CMSIS-3 package. If you have an existing project then you will have to add $(TargetsDir)/CMSIS_3/CMSIS/Include to the User Include Directories project property.
- Removed CrossFire-LM3S102 samples.
- Supplied TI CMSIS header files, samples and new projects will reference these.
- Supplied TI EK-LM4F120XL samples.
1.8
- Support for devices as specified in Stellaris Family Product Selector Guide (Rev. I).
- Added support for LM4F devices. This requires CrossWorks for ARM 2.1.2.
- Added GetPartName function to the target script. New projects will set the Get Part Name Script project property to enable part name detection on connect and compatibility on start debugging. This requires CrossWorks for ARM 2.1.2.
- Added sample support for EK-LM4F232 board. Note that the onboard Stellaris ICDI (not an FTDI 2232 device) requires CrossWorks for ARM 2.1.2.
1.7
- Support for devices as specified in Stellaris Family Product Selector Guide (Rev. H).
- Reset script doesn't use the reset pin and now resets the core and peripherals using register writes.
- Reset script now remaps flash to address zero for parts with ROM.
- Flash reset script now sets the USECRL register value for DustDevil, Fury and Sandstorm class devices.
- Supplied V2.01 of core CMSIS header files.
- Removed obsolete $(TargetsDir)/LM3S/lib/libcmsis$(LibExt)$(LIB) library (CMSIS V2.00 is all in header files). If referenced by existing projects remove references to it in the Linker | Additional Inputs project property.
1.6
- Section placement property now refers to standard section placement files.
- Fixed VECTORS_IN_RAM support in LM3S_Startup.s.
- Added ctl_set_isr to lm3s_ctl.c.
- Fixed bit field entries of uDMA registers in memory map files.
1.5
- Fixed flash loader computation of available RAM.
1.4
- Fixed flash loader to work on small RAM parts LMS3101/LM3S102.
- Fixed clock setup for DK-LM3S9B96 and EK-LM3S9B0 samples to run at 80Mhz.
- Added Flash Copy To RAM section placement property group.
- Section placement property group now selects the loader to use as such there is no requirement for Flash/RAM configurations.
- Added start macros to the first sections of the placement files which enables memory to be reserved at the start of the segment by defining the section placement macros.
1.3
- The flash loader now maps flash to zero for devices that have internal ROM.
- Updated device support.
- New CTL executable project types now have the lm3s_ctl_board.c for the EK-LM3S1968 added. This file should be modified for the CPU/board you are using.
- Updated CMSIS core files to V1.30.
1.2
- The vector table offset register is now always configured to allow the start address of FLASH configuration programs to be moved away from 0x00000000 without modification of startup code.
1.1
- Loader supports software breakpoints in flash memory.
1.0
- Initial release.
Documentation
Creating Stellaris Projects
To create a new Stellaris project
- Select the File > New > New Project menu item.
- Select the appropriate Generic Stellaris from the Categories list.
- Select the required project template type from the Templates list.
- Set the required project name and location directory.
- Click OK.
To build and debug an application the runs in Flash memory
- Select the project to work on by using the Project > Set Active Project menu option.
- Select the configuration you require by using the Build > Set Active Build Configuration menu option.
- Right click on the project node in the project explorer and select the Flash placement.
- Build the project by using the Build > Build Project menu option.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug > Start Debugging.
To make the application startup from reset
- Right click on the project node in the project explorer and select Properties...
- In the properties window scroll down to the Preprocessor Options section.
- Type STARTUP_FROM_RESET into the Preprocessor Definitions property editor.
Stellaris Project Specifics
Target Processor
Once a project has been created you can select different target processors by right clicking on the project node in the project explorer and selecting the Target Processor entry.
Selecting the target processor will specify the memory map that is used for the build and debug. You can view the selected memory map by right clicking on the project node in the project explorer and selecting View Memory Map or View Memory Map (as text).
Selecting the target processor will cause the preprocessor definition __TARGET_PROCESSOR to be set to the specified processor name when you compile the project.
Section Placement
CrossStudio for ARM supports Stellaris projects running applications in a number of different memory configurations. You can select the memory configuration you require by right clicking on the project node in the project explorer and selecting the Placement entry.
For Stellaris projects the set of placements are:
- Flash application runs in internal Flash memory.
- Flash Copy To RAM application starts in internal flash and copies itself to run internal RAM memory.
- RAM application runs internal RAM memory.
Stack and Heap Sizes
The stack and heap sizes are set to be 128 bytes by default when a project is created. This enables projects to run on the smallest of the Stellaris processors. It is likely that you will need to change these values when developing applications to run on the larger of the Stellaris processors.
Target Startup Code
The startup code LM3S_Startup.s is common to all Stellaris processors. There are a set of preprocessor defines that configure the startup code and are documented in the startup file itself. The startup code calls out to a weak symbol SystemInit with the stack pointer set to the top of RAM. The SystemInit function can be used to set the CPU clock or configure any external memories prior to the C initialisation code as such it cannot access initialised static data.
The startup code declares weak symbols for each interrupt service routine for example the PWM_Fault_ISR function will be called when this interrupt occurs. If you are porting code that has application specific interrupt service routine names then you can use the preprocessor definitions to rename the symbol for example PWM_Fault_ISR=MyPWMFaultISR.
Target Reset Script
The reset script LM3S_Target.js is used by the debugger to reset the target board. This script will use the SRST signal so in order to reset the target properly and therefore debug your application reliably from a defined state the SRST signal should be connected.
Stellaris LM3Sxxx Internal Flash Loader
The flash loader
for the internal Flash of Stellaris is provided.Memory Simulator
An Stellaris memory simulator is provided that simulates the memories of the various Stellaris devices. The memory simulation parameter (which is set by the Target Processor selection) specifies the size of the Flash and the RAM memories.
Header Files
TI Stellaris CMSIS Header files are supplied. The Stellaris project setup adds the directory $(TargetsDir)/LM3S/CMSIS to the User Include Directories project property.
CTL support
The file lm3s_ctl.c implements the CTL system timer using the Cortex-M3 SysTick timer. The timer is configured to interrupt at a 10 millisecond rate and increment the CTL system timer by 10 to give a millisecond timer. The implementation uses the CMSIS SystemFrequency global variable to determine the CPU clock frequency. The CTL samples that are provided in this package have board specific files that implement this variable.
The CTL interrupt support functions ctl_global_interrupts_set, ctl_set_priority, ctl_unmask_isr and ctl_mask_isr are implemented in this file. The implementation uses the lowest half of the available NVIC priorities (top bit set in the priority) for CTL interrupts and disables global interrupts by raising the NVIC basepriority above the highest CTL priority. This enables you to use the upper half of the NVIC priorities for interrupts that do not use CTL and should not be disabled by a CTL interrupt.
When you create a new CTL executable project the file lm3s_ctl_board.c is copied to the project - you will need to modify this file to work on the CPU/board you are using.