CrossStudio's New Project Wizard simplifies the creation of projects for the STMicroelectronics STA2051 processor by creating a project with the appropriate project settings, memory map files and startup files. See Creating a New Project for more information on creating projects.

##### To create a new ST STA2051 project

- Select the File | New | New Project menu item.
- Select ST STA2051 Projects from the Project Type list.
- Select the required project template type from the Templates list.
- Set the required project name and location directory.
- Click OK.

CrossStudio for ARM supports the ST STA2051 running applications from both RAM and FLASH.

##### To build and debug an application running from RAM

- Select the project to work on by using the Project | Set Active Project menu option.
- Select the RAM Debug configuration by using the Project | Set Build Configuration menu option.
- Build the project by using the Project | Build menu option.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug | Go.

##### To build and debug an application running from FLASH

- Select the project to work on by using the Project | Set Active Project menu option.
- Select the FLASH Debug configuration by using the Project | Set Build Configuration menu option.
- Build the project by using the Project | Build menu option.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug | Go.

The following sections describe the ST STA2051 support in more detail. See ARM Target Support for more information.

### Memory Map Files

The default memory map file $(StudioDir)/targets/ST_STA2051/ST_STA2051_MemoryMap.xml has been provided. This file is used to describe the memory layout of the target and is used for linking and debugging. The placement of program sections within the memory map for both RAM and FLASH configurations is described by the non-target-specific default memory maps $(StudioDir)/targets/flash_placement.xml and $(StudioDir)/targets/sram_placement.xml.

The memory segment layout for both configurations is the same and is described in the following table:

Type | Description | Start Address | End Address
FLASH | On-chip FLASH bank 1 | 0x400C0000 | 0x400C3FFF
FLASH | On-chip FLASH bank 0 | 0x40000000 | 0x4003FFFF
RAM | On-chip RAM Bank | 0x00000000 | 0x0000FFFF

### Target Definitions

Target definitions have been provided for both RAM and FLASH configurations. The default target definitions are ST STA2051 - RAM and ST STA2051 - FLASH.

The RAM target definition configures memory to match the above memory map.

The FLASH target definition maps FLASH at address 0.

### Target Startup Code

The default startup code is in $(StudioDir)/targets/ST_STA2051/ST_STA2051_Startup.s. It contains the exception vectors and the default exception handlers. The FLASH version of the code (specified by defining __FLASH_BUILD) is also responsible for configuring memory to match the above memory map and copying the exception vectors into RAM.