02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3<br />

Creating a New <strong>BSP</strong><br />

3.2 Setting Up Your Development Environment<br />

Setting up your development environment means establishing a mechanism to<br />

download code to the target and then testing the downloaded code. It is usually<br />

best to start with some simple image test code rather than a full blown VxWorks<br />

image. To find out what compiler and linker flags you need, go to your reference<br />

<strong>BSP</strong> and build either vxWorks (a RAM image) or vxWorks_resrom_nosym (a<br />

ROM image).<br />

3<br />

Choosing a Technique for Downloading Code to the Target<br />

The following are some of the more common techniques for downloading code to<br />

the target:<br />

■<br />

■<br />

Using the download protocol supplied in the board vendor’s debug ROMs.<br />

The drawback of this approach is that downloading is often slow. The<br />

advantage is that it is easy to set up.<br />

Using a JTAG debugger such as a visionICE or visionPROBE emulator. The<br />

main drawback of this approach is that support is not available for all<br />

architectures and/or CPUs. However, this method allows for a quick<br />

download and also allows you to single-step through the initialization code.<br />

■<br />

Using a ROM emulator (such as NetROM from AMC). The drawback of this<br />

approach is that it can take time for you to learn how to use it. The advantages<br />

include fast download times, portability to most boards, and a communication<br />

protocol that lets debug messages pass from the target to the host through the<br />

ROM socket.<br />

After you have downloaded code to the target, examine memory and/or ROM to<br />

make sure it is loaded into the right place. The Wind River-supplied GNU tools nm<br />

and objdump can be used on your compiled images to see what should be in the<br />

target memory. Pay special attention to the addresses of the start of the text and<br />

data segments.<br />

Choosing a Method for Testing the Downloaded Code<br />

The next step is to establish a debugging mechanism to track the progress of your<br />

initialization sequence. The following are some of the more common techniques:<br />

■<br />

■<br />

Using a JTAG device such as visionICE or visionPROBE.<br />

Using the board’s native debug ROMs (if it has breakpoint support).<br />

43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!