Opening the Workspace

The On-Chip SDK contains an IAR workspace at onchipsdk/projects/iar/all_projects.eww. Double-click on this file to open the workspace.


The column on the left lists a number of IAR projects, each corresponding to a sample application. You can switch between projects by right-clicking on the project name you want, and choosing Set as Active.  We will select 00-hello if not already selected.

Building a Sample Application

To build a project, right-click on the project name and choose Rebuild All. IAR now executes the following steps:

During  the build process, the bottom pane of the IAR Windows lists those steps:


Building configuration: 00-hello - Debug
Updating build tree... 
8 file(s) deleted. 
dnm_local.c
cli_task.c
dnm_rate_ctrl.c
dnm_service.c
hello_app.c
...
Linking
Performing Post-Build Action
 
Total number of errors: 0 
Total number of warnings: 0


Running it on the Mote

With a Debugger

If you have a JTAG debugging pod:


When loading your application onto the board, IAR may display the following dialog.

This indicates that IAR is not able to display the source file for a module inside the library. This is normal, and is not an error.

When this message appears, check If possible, don't show this dialog again and click Skip.

If you are using a DC9003 or similar device that was previously programmed as a mote, it came with loader 1.0.3.12. The part will run on the debugger, but appear to be dead after reset, since the older loader cannot execute the signed code (the loader is bypassed when running the debugger.) See the "No Debugger" steps above to reprogram with a 1.0.5.4 or later loader.

No Debugger

If you don't have a JTAG debugging pod, you will use ESP to put your software on the mote. If you are not familiar with ESP, see the Eterna Serial Programmer Guide. ESP can be used on a DC9006/DC9003 directly, or with devices containing a recommended programming header with a DC9010 or a DC9006 with a DC9004 adapter.


ESP -E
ESP -P FT-DC9003A-M4-115K-680-0222-0004REV1.bin 0  (or other fuse table as appropriate)
ESP -P mote_part_r52074.bin 800
ESP -P ocfdk_00_hello.bin 1000
ESP -P loader_1_0_5_4_oski.bin 77800
Hello World!

Next Step: Understand What Your Application Can Do