To start developing an application, you create a new project. To create a new project, do the following:
- From the File menu, click New then New Project...
The New Project dialog appears. This dialog displays the set of project types and project templates.
We'll create a project to develop our application in C:
- Select the Generic ARM7 > Generic ARM7 Board project type in the Project Types pane.
- Select the ARM7 RAM Only Executable icon in the Templates pane which selects the type of project to add.
- Type Tutorial in the Name edit box, which names the project.
- You can use the Location edit box or the Browse button to locate where you want the project to be created.
- Click OK.
This will create a project for a generic ARM 7 device with RAM located at address 0x00000000, as we are going to run this example on the simulator this is fine. ARM hardware however is rarely so accommodating, as memory will be mapped at different addresses, target specific startup code may be required to initialize peripherals, different techniques need to be employed to reset the target and target specific loader applications are required to program FLASH. To create a project to run on hardware you should instead select a template from the project type matching your target, this will create a project with the memory maps, startup code, reset script and FLASH loader for your target.
Once created, the project setup wizard prompts you to set some common options for the project.
Here you can specify an additional file format to be output when the application is linked, heap and stack sizes, and what library support to include if you use printf and scanf. You can change these settings after the project is created using the Project Explorer.
Clicking Next displays the files that will be added to the project.
The Links to system files group shows the links that will be created in the project to CrossStudio system files. As these files are links they will, by default, be shared with other projects so modifying one will effect all projects containing similar links. To prevent accidental modification, these files are created as read-only. Should you wish to modify a shared file without effecting other projects you can do so by importing them into the project first. Importing a shared file will be demonstrated later in this tutorial. Project links are fully explained in Project management.
The Project files group shows the files that will be copied into the project. As these files are copied to the project directory they can be modified without effecting any other project.
Clicking Next displays the configurations that will be added to the project.
Here you can specify the default configurations that will be added to the project. See Project management for more information on project configurations.
Complete the project creation by clicking Finish.
The Project Explorer shows the overall structure of your project. To see the project explorer, do one of the following:
- From the View menu, click Project Explorer.
—or—
- Type Ctrl+Alt+P.
—or—
- Right click the tool bar area.
- From the popup menu, select Project Explorer.
This is what our project looks like in the Project Explorer:
You'll notice that the project name is shown in bold which indicates that it is the active project (and in our case, the only project). If you have more than one project then you can set the active project using the dropdown box on the build tool bar or the context menu of the project explorer.
The files are arranged into two groups:
- Source Files contains the main source files for your application which will typically be header files, C files, and assembly code files. You may want to add files with other extensions or documentation files in HTML format, for instance.
- System Files contains links to source files that are not part of the project, yet are required when the project is built and run. In this case, the system files are crt0.s which is the C runtime startup written in assembly code, sram_placment.xml which is a placement file that describe how program sections should be placed in memory segments, Standard_ARM_RAM_Only_MemoryMap.xml which is a memory map file that describes a target's memory segments , Standard_ARM_Startup.s which contains the target specific start code and exception vectors and Standard_ARM_Target.js which contains the target specific target script which instructs the debugger on how to reset the target and what to do when the processor stops or starts. Files which are stored outside of the project’s home directory are shown by a small purple shortcut indicator at the bottom left of the icon, as above.
These folders have nothing to do with directories on disk, they are simply a means to group related files together in the project explorer. You can create new folders and specify filters based on the file extension so that when you add a new file to the project it will be placed in the folder whose filter matches the file extension.