CrossStudio's New Project Wizard simplifies the creation of projects for the Revely RMS101 SBC 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 Revely RMS101 SBC project

- Select the File | New | New Project menu item.
- Select Revely RMS101 SBC 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 Revely RMS101 SBC running applications from both RAM and FLASH.

##### To build and debug an application

- 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.
- Build the project by using the Build | Build Project menu option.
- If downloading a FLASH application, connect the board's Write Enable jumper to permit writes to the FLASH.
  Warning: Be aware that this will overwrite the bootloader code shipped with the board. See Installing the Revely RMS101 SBC Bootloader for a description of how you re-install the bootloader using CrossWorks. It is also possible to for the program downloaded to FLASH to cause the JTAG interface to stop responding, see the Toubleshooting section for more information.
- Please note that this will overwrite the bootloader code shipped with the board.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug | Start Debugging.

The following sections describe the Revely RMS101 SBC support in more detail. See ARM Target Support for more information.

### Memory Map Files

The default memory map file $(StudioDir)/targets/Revely_RMS101_SBC/Revely_RMS101_SBC_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
SDRAM | External SDRAM | 0x20000000 | 0x200FFFFF
FLASH | External FLASH | 0x40000000 | 0x400FFFFF
SRAM | Internal SRAM | 0x60000000 | 0x00007FFF

The external SDRAM is also mapped to address 0x00000000 in both RAM and FLASH configurations in order to allow the exception vectors to be modified at runtime.

### Target Startup Code

The default startup code is in $(StudioDir)/targets/Revely_RMS101_SBC/Revely_RMS101_SBC_Startup.s. It contains the exception vectors, target specific startup code and the default exception handlers.

### Installing the Revely RMS101 SBC Bootloader

To install the bootloader using CrossWorks for ARM:

- Load the samples/Revely_RMS101_SBC/kick/kick.hzp project.
- Open CrossWorks terminal emulator window by clicking View | Terminal Emulator.
- Set the terminal emulator properties to 115000 baud, 8 bits, no parity, 1 stop bit.
- Download and execute the kick application by clicking Debug | Start Without Debugging.
- Download the bootloader by clicking Send File from the terminal emulator's menu and selecting the boot.s19 file.

### Troubleshooting

- It appears to be possible for a program to get the LH79520 into a state where the JTAG will not respond. If you have a program in FLASH that does this it can appear that the board or target is malfunctioning as the code that effects the JTAG will always be run, even after reset. If you are unable to connect to a target in this state, disable the Identify Target target property, this will allow you to connect to the target even if the JTAG interface is not responding. You should then be able to erase the program in FLASH that is causing the problem by either Installing the Revely RMS101 SBC Bootloader or running the samples/Revely_RMS101_SBC/flash_erase/flash_erase.hzp example. Please note that because of the way the nSRST signal is connected on this board it is possible for the FLASH program to run after reset prior to download. The successful download of the FLASH erasing program is therefore reliant on being able to stop the processor before the code that effects the JTAG is executed. It may therefore take a number of attempts to download the program and in the worse case be impossible using this scheme.