Техническая Спецификация для Atmel Evaluation Board using the SAM7SE Microcontroller AT91SAM7SE-EK AT91SAM7SE-EK

Модели
AT91SAM7SE-EK
Скачать
Страница из 24
22
6295A–ATARM–27-Mar-07
Application Note
4.2
Loading the Code
Once the build step is completed, one .bin file is available and ready to be loaded into the board.
The AT91-ISP solution offers an easy way to download files into AT91 products on Atmel Evalu-
ation Kits through a USB, COM or J-TAG link. Target programming is done here via SAM-BA
tools.
Two DOS batch files (prog_sdram.bat and prog_flash.bat) and two TCL script files
(prog_sdram.tcl and prog_flash.tcl) are provided to process the loading of the binary file.
The .bat file launches SAM-BA in command line mode. Parameters provided to SAM-BA are: the
connection link used, the target board, and the .tcl script file to use.
The .tcl script file contains indications about the name of the file to load, which memory module
is used, the address of code loading, and operates a go command at the code start address. A
log file is displayed at the end of the loading process.
Follow the steps below to load the code:
• Shut down the board.
• Set the J5-1 jumper on the board to erase the internal Flash.
• Plug the USB cable between the PC and the board and wait for a few seconds.
• Shut down the board and remove the jumper.
• Plug the USB cable between the PC and the board.
• Execute the prog_sdram.bat file to test the code running in external SDRAM.
• Execute the prog_flash.bat file to test the code running in internal Flash.
The code then starts running, and the LEDs are now controlled by two push buttons.
4.3
Debug Support
When debugging the Getting Started example with GDB, it is best to disable compiler optimiza-
tions. Otherwise, the source code will not correctly match the actual execution of the program.
To do that, simply comment out (with a ‘#’) the “OPTIM = -Os” line of the makefile and rebuild the
project.
In addition, a GDB command file is provided in the package to enable debugging in SDRAM.
The script is named "init_sdram.gdb" and can be executed by typing “source init_sdram.gdb” at
the GDB command prompt. It initializes the main oscillator, the PLL and the SDRAM controller,
enabling the program to be correctly uploaded to the target with the “load” command.
For more information on debugging with GDB, refer to the Atmel application not
 and to the GDB manual available on 
.