IAR 4.11A
Download Project
The goal of this project is to download a
project build under the IAR tools using two methods, a standalone project
which uses the semihosting or the IAR Flash Tools
The
semihosting is a mechanism whereby the target communicates I/O requests
made in the application code to the host system, rather than attempting to
support the I/O itself.
To create the extra output file, choose Project->Options and
select the linker category. Select the Allow C-SPY-specific extra output
file option. In the Extra Output dialog, select the Generate
extra output file option. Choose “mpds-code” output format and format variant -YA. Do
not override the default output file as it
is a default project setting.
Process
-
Compile the Flash
bin workspace application to generate the binary file named Basic.bin
1) Compile the tools workspace application
2) Download this application using a JTAG ICE interface
with the "Debug" command
3) Run this application
4) Select the “Terminal I/O: input needed!”
5) Set the cursor in “input:” area and press enter.
Check in the Debug log windows for the following trace:
**** SAM7 Flash Programming Utility ****
**** This Utility work for external SAM7 board !
**** Please Enter return for start !
-Enter
**** File to download at 0x100000****
-c:/tmp/basic.bin
Input file is : c:/tmp/basic.bin
Load address is: 100000
Read
Programming page 0
Read
Programming page 1
…
The IAR Embedded Workench IDE features a Tools Flash utility.
This method can write in flash a IAR file format (*.sim) (output format generated using option simple-code)
The IAR Flash download option to use a flash loader to download
your application to flash memory. If a flash loader is available for the selected
chip, it will be used as default. A
flash loader can be described as being an agent that is downloaded to the
target. It fetches the actual application from the C-SPY debugger and programs
it into flash memory.
The flash loader uses the file I/O mechanism to read the application
program from the host. When the Flash download option is enabled, the
following steps will be performed when the debug session starts:
1 C-SPY downloads the flash loader into target
RAM.
2 C-SPY starts execution of the flash loader.
3 The flash loader opens the file holding the
application code.
4 The flash loader reads the application code and
programs it into flash memory.
5 The flash loader terminates.
6 C-SPY switches context to the user application.
A set of flash loaders for various microcontrollers is provided with the
ARM IAR Embedded Workbench. In addition to these, other flash loaders are
provided by chip manufacturers and third-party vendors.
Two output files must be generated. The first is the usual UBROF file (d79) that
provides the debugger with debug and symbol information. The second file is an
IAR file (*.sim) that will be opened and read by the flash loader when downloading the
application to flash memory.
To create the extra output file, choose Project->Options and
select the linker category. Select the Allow C-SPY-specific extra output
file option. In the Extra Output dialog, select the Generate
extra output file option. Choose intel-extended output format and format
variant None. Do not override the default output file.
Any errors during the download will be logged to a log file. The log
file will have the same path and name as the output files but with the tail and
filename extension _flash.log.
-
Compile the Flash
Debug workspace application to generate the IAR file named basic.sim and the
debug file named basic.d79
1) Download this application using a JTAG ICE interface
with the "Debug" command
2) Open the “Debug Log” window
3) Now you can start the Flash debugging
JTAG speed fixed to: 30 kHz
---------------------------------------- FLASH Download
---------------------------------------- Chip ID 0x27080340 (or 0x27090540)
---------------------------------------- Extention 0x00000000
---------------------------------------- Flash Version 0x00000110
4577 bytes downloaded (13.03
Kbytes/sec)
Loaded module
Target reset
Download: AT91SAM7Sx At:
0x100000
Download: AT91SAM7Sx Version:
0x110
Download:page 0x0
Download:page 0x1
Download:page 0x2
Download:page 0x3
Download:page 0x4
Download:page 0x5
Download:page 0x6
Program exit reached.