Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 1 | -------------------------------------------------------------------- |
| 2 | __________ __ ___. |
| 3 | Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | \/ \/ \/ \/ \/ |
| 8 | $Id$ |
| 9 | |
| 10 | Copyright (C) 2002 by Linus Nielsen Feltzing |
| 11 | |
| 12 | -------------------------------------------------------------------- |
| 13 | |
| 14 | Debugging the Archos Jukebox |
| 15 | ---------------------------- |
| 16 | |
| 17 | To debug using the serial port on the Jukebox, you need to do the following: |
| 18 | |
| 19 | 1) Connect the serial port to the PC. This is best done with the "serial |
| 20 | port mod" described on the home page, along with a serial port converter |
| 21 | for the 3V signals from the Jukebox. |
| 22 | |
| 23 | 2) Build or download a GDB SH1 cross debugger |
| 24 | |
| 25 | 3) Compile the GDB stub from the CVS "gdb" archive |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 26 | For Player models, just type: |
| 27 | # make |
| 28 | |
| 29 | For Recorder, type |
| 30 | #make RECORDER=1 |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 31 | |
| 32 | 4) Copy the newly built ARCHOS.MOD to the Jukebox. |
| 33 | |
| 34 | 5) Start the Jukebox and fire up the GDB with the elf file you want to debug |
| 35 | as an argument along with the baud rate: |
| 36 | |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 37 | For Player: |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 38 | # sh-elf-gdb -b 38400 test.elf |
| 39 | |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 40 | For Recorder: |
| 41 | # sh-elf-gdb -b 115200 test.elf |
| 42 | |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 43 | 6) In GDB, type: |
| 44 | |
| 45 | (gdb) target remote /dev/ttyS0 |
| 46 | |
| 47 | /dev/ttyS0 is the serial port you want to use. I guess Windows users |
| 48 | would type COM1 or something like that. |
| 49 | |
| 50 | GDB should answer with a message like: |
| 51 | |
| 52 | Remote debugging using /dev/ttyS0 |
| 53 | 0x090014b6 in ?? () |
| 54 | (gdb) |
| 55 | |
| 56 | 7) Load the code from the elf file you specified on the command line: |
| 57 | |
| 58 | (gdb) load |
| 59 | |
| 60 | GDB should answer like this: |
| 61 | |
| 62 | Loading section .text, size 0x6b00 lma 0x9018000 |
| 63 | Loading section .data, size 0x738 lma 0x901eb00 |
| 64 | Start address 0x9018290, load size 29240 |
| 65 | Transfer rate: 11696 bits/sec, 102 bytes/write. |
| 66 | (gdb) |
| 67 | |
| 68 | 8) You're set. Now try to set a breakpoint and run: |
| 69 | |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 70 | (gdb) b main |
| 71 | Breakpoint 1 at 0x9011b2a: file main.c, line 192. |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 72 | (gdb) c |
| 73 | Continuing. |
| 74 | |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 75 | Breakpoint 1, main () at main.c:192 |
| 76 | 192 app_main(); |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 77 | (gdb) |
| 78 | |
| 79 | Good luck! |
| 80 | |
| 81 | |
| 82 | Technical details: |
| 83 | |
| 84 | As for now, the GDB stub occupies the memory from 0x900000 up to |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 85 | 0x9018000. |
Linus Nielsen Feltzing | 6de9787 | 2002-04-15 13:26:40 +0000 | [diff] [blame] | 86 | |
| 87 | Compile and link your test program at 0x9018000 and up, and it will work. |
| 88 | |
Linus Nielsen Feltzing | 1dc42d1 | 2003-05-17 00:31:50 +0000 | [diff] [blame] | 89 | The baud rate is 38400 for Player, 115200 for Recorder, and the settings |
| 90 | are 8N1. |
| 91 | |
| 92 | Note that you may have to change the ATA I/O address in the ATA_CONTROL |
| 93 | macro in sh-stub.c. go to Menu->Debug (keep out)->View HW info to find out. |
| 94 | |
| 95 | Linus Nielsen Feltzing |