This page is referenced from the first Embedded Projects Journal.
This is a demo for the Olimex SAM7-P64 board which has an Atmel AT91SAM7S64 controller. I am using a free ARM toolchain (gcc, as, gdb) from Codesourcery and the OpenOCD ARM debugger.
|
The lower (blue) USB connector is only for the power supply of the board. At the top left is the JTAG adaptor (soon available from http://embedded-projects.net. The adaptors RS-232 connector is hand-wired with the left RS-232 connector of the board (pins 2, 3 and 5 are connected straigth trough). On the right side is a push button which I added to port bit PA0. |
cd src make cp main.elf ../bin
sudo openocd -f oocd/sam7s-oocdlink.cfgOpenOCD writes log messages on the screen which depend on the "log level". If you do not specify a log level with the -d option the level 2 is set. Typical log output is contained in oocd/oocd-log-sample.txt.
hhoegl@egg:oocd-starter$ sudo picocom -b 9600 /dev/ttyUSB1 Password: picocom v1.4 port is : /dev/ttyUSB1 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 escape is : C-a noinit is : no noreset is : no nolock is : no send_cmd is : ascii_xfr -s -v -l10 receive_cmd is : rz -vv Terminal ready
hhoegl@egg:oocd-starter$ arm-none-eabi-gdb -x init.gdb
GNU gdb 6.4.50.20060226-cvs
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
0x00000220 in ?? ()
add symbol table from file "bin/main.elf" at
.text_addr = 0x200000
Loading section .text, size 0x3c14 lma 0x200000
Loading section .rodata, size 0x10 lma 0x203c14
Loading section .data, size 0x20 lma 0x203c24
Start address 0x200000, load size 15428
Transfer rate: 64755 bits/sec, 302 bytes/write.
(gdb) c
Continuing.
After the program starts, the string Hello World appears in
the picocom terminal window. Typing subsequent 't'
characters makes the yellow LED on the board go on and off.
To exit gdb enter Ctrl-C (stops program execution) and type exit.
hhoegl@egg:oocd-starter$ telnet localhost 4444 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger >The exit command quits the telnet interface. A list of telnet commands is here.
The OpenOCD telnet interface can easily be controlled by a program. An example written in the Python language is sam7-oocd-telnet.py.
C-z \ quit all windows
C-z p previous window
C-z n next window
C-z <n> go to window <n>
C-z ' enter window name or number
C-z " show window list
C-z ? show key bindings
C-z k kill current window
C-z C clear window
C-z c create a new shell window
C-z A enter a name for current window
Here are some screen shots: menu,
Emacs, gdb, OpenOCD,
Shell, Telnet,
UART.