rockbox/gdb
Tomasz Malesinski e7f7c3d15c Mapped iFP DRAM to 0xc00000 and enabled caching in this area.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8668 a1c6a512-1295-4272-9138-f99709370657
2006-02-12 23:16:05 +00:00
..
arm-stub.c Added reboot and power_off commands, watchdog support, binary 2006-02-04 00:07:31 +00:00
FILES files to include in release archive 2002-05-27 11:57:55 +00:00
linker.cfg Mapped iFP DRAM to 0xc00000 and enabled caching in this area. 2006-02-12 23:16:05 +00:00
Makefile GDB stub for ARM 2006-01-25 01:43:07 +00:00
README Now compiles without newlib. Refined the Makefile a little. 2003-05-17 00:31:50 +00:00
setjmp.S Now compiles without newlib. Refined the Makefile a little. 2003-05-17 00:31:50 +00:00
sh-stub.c Port A inits for cold-start capability 2003-06-29 21:57:20 +00:00
SOURCES GDB stub for ARM 2006-01-25 01:43:07 +00:00
start.s Fixed the mess with all the different stacks 2002-04-23 21:59:20 +00:00

--------------------------------------------------------------------
             __________               __   ___.
   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
                     \/            \/     \/    \/            \/
 $Id$

 Copyright (C) 2002 by Linus Nielsen Feltzing

--------------------------------------------------------------------

Debugging the Archos Jukebox
----------------------------

To debug using the serial port on the Jukebox, you need to do the following:

1) Connect the serial port to the PC. This is best done with the "serial
   port mod" described on the home page, along with a serial port converter
   for the 3V signals from the Jukebox.

2) Build or download a GDB SH1 cross debugger

3) Compile the GDB stub from the CVS "gdb" archive
   For Player models, just type:
   # make

   For Recorder, type
   #make RECORDER=1

4) Copy the newly built ARCHOS.MOD to the Jukebox.

5) Start the Jukebox and fire up the GDB with the elf file you want to debug
   as an argument along with the baud rate:

   For Player:
   # sh-elf-gdb -b 38400 test.elf

   For Recorder:
   # sh-elf-gdb -b 115200 test.elf

6) In GDB, type:

   (gdb) target remote /dev/ttyS0
   
   /dev/ttyS0 is the serial port you want to use. I guess Windows users
   would type COM1 or something like that.

   GDB should answer with a message like:

   Remote debugging using /dev/ttyS0
   0x090014b6 in ?? ()
   (gdb)

7) Load the code from the elf file you specified on the command line:

   (gdb) load

   GDB should answer like this:

   Loading section .text, size 0x6b00 lma 0x9018000
   Loading section .data, size 0x738 lma 0x901eb00
   Start address 0x9018290, load size 29240
   Transfer rate: 11696 bits/sec, 102 bytes/write.
   (gdb)

8) You're set. Now try to set a breakpoint and run:

   (gdb) b main
   Breakpoint 1 at 0x9011b2a: file main.c, line 192.
   (gdb) c
   Continuing.

   Breakpoint 1, main () at main.c:192
   192         app_main();
   (gdb)

   Good luck!


Technical details:

   As for now, the GDB stub occupies the memory from 0x900000 up to
   0x9018000.

   Compile and link your test program at 0x9018000 and up, and it will work.

   The baud rate is 38400 for Player, 115200 for Recorder, and the settings
   are 8N1.

   Note that you may have to change the ATA I/O address in the ATA_CONTROL
   macro in sh-stub.c. go to Menu->Debug (keep out)->View HW info to find out.

   Linus Nielsen Feltzing