2.3.2 Create a new project

This section describes how to create a new project.

Remark

When a project for RH850 multi-core is created, see "2.3.4 Create a project for multi-core [RH850]".

 

From the [Project] menu, select [Create New Project...], the Create Project dialog box will open.

Figure 2.6

Create Project Dialog Box (When First Started)

 

Set the items in the order below.

(1)

Select the microcontroller type

Select the microcontroller type to use in the project on [Microcontroller].

You can select the item below.

-

RH850

-

RX

-

RL78

(2)

Select the microcontroller

Select the microcontroller to use in the project on the [Using microcontroller] area.

If your microcontroller is not in the [Using microcontroller] area, click the [Update...] button.

You can open the CS+ Update Manager window, and check for microcontroller information updates via the network.

Caution

The [Update...] button is only enabled when this product is installed using the installer. It is disabled when a packaged item is being used.

(3)

Select the project type

Select the project type to create on [Kind of project].

You can select the item below.

-

Application(CC-RH/CC-RX/CC-RL)

Select this to generate the load module file and hex file from C source files, by using the build tool provided by CS+.

The generated file will be the debug target.

Caution

This item is not displayed when microcontrollers for RH850 multi-core are selected in "(2) Select the microcontroller".

Remark 1.

If the build tool is CC-RH, the following start-up source files are generated in the project folder.
These files are also registered in the project tree.

File Name

Description

boot.asm

For defining the processing from the occurrence of a reset to a branch to the start-up routine and defining the interrupt vector table

cstart.asm

For defining the start-up routine

iodefine.h

For defining I/O registers

main.c

For defining the empty main function

Remark 2.

If the build tool is CC-RX, the following start-up source files are generated in the project folder.
The files marked with "OK" in the "Registration in Project Tree" column are also registered in the project tree. When necessary, also register the files marked with "--" in the project tree.

File Name

Description

Registration in Project Tree

ProjectName.c

For defining the main function

OK

dbsct.c

For setting up standard sections

OK

hwsetup.c

For initializing hardware

--

intprg.c

For defining interrupt functions

OK

iodefine.h

For defining I/O registers

OK

lowlvl.src

For defining low-level I/O functions (source file for assembler)

--

lowsrc.c

For defining low-level I/O functions

--

lowsrc.h

Prototypes for low-level I/O functions

--

resetprg.c

For defining initialization for C language

OK

sbrk.c

For defining the function for allocating the heap memory

OK

sbrk.h

For defining the heap size

OK

stacksct.h

For defining pragma for the stack

OK

typedefine.h

For defining typedefine for the types used in sbrk.c, etc.

OK

vect.h

Prototypes for interrupt vector functions

OK

vecttbl.c

For defining the interrupt vector table

OK

Remark 3.

If the build tool is CC-RL, the following start-up source files are generated in the project folder.
These files are also registered in the project tree.

File Name

Description

cstart.asm

For defining the start-up routine from the occurrence of a reset to a branch to the main function

The memory address and stack area need to be modified to match the microcontroller used.

iodefine.h

For defining the names of I/O registers and interrupt requests

main.c

For defining the empty main function

-

C++ Application(CC-RX)

Select this to generate the load module file and hex file from a C++ source file (only a file that has a main function) and C source files, by using build tool CC-RX provided by CS+.
The generated file will be the debug target.

Remark

The following start-up source files are generated in the project folder.
The files marked with "OK" in the "Registration in Project Tree" column are also registered in the project tree. When necessary, also register the files marked with "--" in the project tree.

File Name

Description

Registration in Project Tree

ProjectName.c

For defining the main function

OK

dbsct.c

For setting up standard sections

OK

hwsetup.c

For initializing hardware

--

intprg.c

For defining interrupt functions

OK

iodefine.h

For defining I/O registers

OK

lowlvl.src

For defining low-level I/O functions (source file for assembler)

--

lowsrc.c

For defining low-level I/O functions

--

lowsrc.h

Prototypes for low-level I/O functions

--

resetprg.c

For defining initialization for C language

OK

sbrk.c

For defining the function for allocating the heap memory

OK

sbrk.h

For defining the heap size

OK

stacksct.h

For defining pragma for the stack

OK

typedefine.h

For defining typedefine for the types used in sbrk.c, etc.

OK

vect.h

Prototypes for interrupt vector functions

OK

vecttbl.c

For defining the interrupt vector table

OK

-

Empty Application(CC-RH/CC-RX)

Select this to generate the load module file, by using build tool CC-RH/CC-RX provided by CS+.
The generated file will be the debug target.
Sample startup programs are not generated when the project is created.

-

Boot Loader for Multi-core(CC-RH)

Select this to create a boot loader project for multi-core, by using build tool CC-RH provided by CS+.

A boot loader project is used to set application projects configuring a project for multi-core.

Caution

This item is displayed only when microcontrollers for RH850 multi-core are selected in "(2) Select the microcontroller".

Remark

The following start-up source files are generated in the project folder.
These files are also registered in the project tree.

File Name

Description

bootn.asm

For defining the processing from the occurrence of a reset to a branch to each application project and defining the interrupt vector table

iodefine.h

For defining I/O registers

The core number n is sometimes included in the file name of a startup file (bootn.asm) for a core.

-

Application for Multi-core(CC-RH)

Select this to create an application project for multi-core, by using build tool CC-RH provided by CS+.

Caution

This item is displayed only when microcontrollers for RH850 multi-core are selected in "(2) Select the microcontroller".

Remark

The following start-up source files are generated in the project folder.
These files are also registered in the project tree.

File Name

Description

cstartn.asm

For defining the start-up routine for each application

iodefine.h

For defining I/O registers

main.c

For defining the empty main function

The core number n is sometimes included in the file name of a startup file (cstartn.asm) for a core.

-

Library(CC-RH/CC-RX/CC-RL)

Select this to generate a library file for a user library, by using the build tool provided by CS+.

-

Debug Only

Select this to debug a load module file or hex file generated with a build tool other than the one provided by CS+ (i.e. creates a debug-dedicated project).
See "E. USING AN EXTERNAL BUILD TOOL" for details on how to create and use the debug-dedicated project.

(4)

Specify the project name and location to create the project file

Specify the name of the project and the location to create the project file in [Project name] and [Place].

If you don’t create a folder with the project name under the specified location, clear the [Make the project folder] check box.

Caution

When directly entering the location to create the project file, enter it as an absolute path.

Remark

It is recommended to specify the same folder as the diverted project for the location to create the project file.
If a folder different from the diverted project is specified, there is a possibility that path determination fails and a build error is occurred.

(5)

Specify the reuse of the file structure of an existing project

When creating a project that reuses the file structure of an existing project, check [Pass the file composition of an existing project to the new project] and specify the location of the project filename to reuse in [Project to be passed].

Caution

You cannot specify an e2 studio, CubeSuite, High-performance Embedded Workshop, or PM+ project file.
If you wish to copy an existing e2 studio, CubeSuite, High-performance Embedded Workshop, or PM+ project, open the project in CS+, then save it as a CS+ project (see "2.4.10 Convert an e2 studio project into a CS+ project [RX][RL78]", "2.4.11 Convert a CubeSuite project into a CS+ project", "2.4.12 Convert a HEW project into a CS+ project", "2.4.13 Convert a PM+ project into a CS+ project" for details). Next, specify the saved project file in this area.

Remark 1.

When the version of the build tool used in the source project is different from the version of the build tool in the project to be created, it is automatically diverted (the case that "Debug Only" is specified with [Kind of project] is excluded).

 

An image of the dialog box after setting the items is shown below.

Figure 2.7

Create Project Dialog Box (After Setting Items)

 

When you click the [Create] button, the project file is created in the location specified in (4) and the structure of the created project is displayed as a tree in the Project Tree panel.

Figure 2.8

Project Tree Panel (After Creating a New Project)

Remark

After creating a project, you must add target files to the project in order to perform building or debugging.
For details on how to add these files, see the following.

-

When "Application" or "Library" is selected on [Kind of project]

-> See the "2.6.1 Add a file to a project"

-

When "Debug Only" is selected on [Kind of project]

-> See "E.3 Add a File to a Project"