Changed the lcd_drawrect() api.
[kugel-rb.git] / gdb / README
blob751fb22946faee1623b78d7609eda173462d25fd
1 --------------------------------------------------------------------
2              __________               __   ___.
3    Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
4    Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
5    Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
6    Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
7                      \/            \/     \/    \/            \/
8  $Id$
10  Copyright (C) 2002 by Linus Nielsen Feltzing
12 --------------------------------------------------------------------
14 Debugging the Archos Jukebox
15 ----------------------------
17 To debug using the serial port on the Jukebox, you need to do the following:
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.
23 2) Build or download a GDB SH1 cross debugger
25 3) Compile the GDB stub from the CVS "gdb" archive
27 4) Copy the newly built ARCHOS.MOD to the Jukebox.
29 5) Start the Jukebox and fire up the GDB with the elf file you want to debug
30    as an argument along with the baud rate:
32    # sh-elf-gdb -b 38400 test.elf
34 6) In GDB, type:
36    (gdb) target remote /dev/ttyS0
37    
38    /dev/ttyS0 is the serial port you want to use. I guess Windows users
39    would type COM1 or something like that.
41    GDB should answer with a message like:
43    Remote debugging using /dev/ttyS0
44    0x090014b6 in ?? ()
45    (gdb)
47 7) Load the code from the elf file you specified on the command line:
49    (gdb) load
51    GDB should answer like this:
53    Loading section .text, size 0x6b00 lma 0x9018000
54    Loading section .data, size 0x738 lma 0x901eb00
55    Start address 0x9018290, load size 29240
56    Transfer rate: 11696 bits/sec, 102 bytes/write.
57    (gdb)
59 8) You're set. Now try to set a breakpoint and run:
61    (gdb) b 22
62    Breakpoint 1 at 0x90182c6: file led.c, line 14.
63    (gdb) c
64    Continuing.
66    Breakpoint 2, main () at led.c:15
67    15       SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
68    (gdb)
70    Good luck!
73 Technical details:
75    As for now, the GDB stub occupies the memory from 0x900000 up to
76    0x9018000. This will change.
78    Compile and link your test program at 0x9018000 and up, and it will work.
80    The baud rate is 38400, and the settings are 8N1.