Skip to contentSkip to conversation

How can I add a gdb-stub into U-boot-0.4.8 for AT91RM9200-DK ?

U-Boot-Users peike 2 participants 2 messages Dec 15, 2005

lore
Share & tools
lore

peike

author
#0 lore raw

Hello,Wolfgang

I'm using u-boot-0.4.8 at Atmel's AT91RM9200-DK machine.Following is information:
U-Boot 0.4.8 (Oct 13 2005 - 16:29:32)

U-Boot code: 21F00000 -> 21F13C20 BSS: -> 21F1F9A0 DRAM Configuration:
Bank #0: 20000000 64 MB

Atmel: AT49BV1614 (16Mbit)
Flash: 16 MB
In:    serial
Out:   serial
Err:   serial

start linux now(y/n):
Uboot>tftp 23000000 zImage
Uboot> tftp 20800000 ramdisk.image.gz
Uboot> go 23000000

*****I download a image by tftp into board's SDRAM and then start it,just like an old friend say"Now, I wonder if it is possible to start the image under control of gdb.
As I understand it, there can run a small 'gdb-stub' on the target which talks
by serial line or by ethernet with the gdb on the development host.
In common/kgdb.c there seems to be something like this small 'gdb-stub'?
Does it work for ARM? How can it be used?"

*********My question is:If I want to add a debugging stub(at91rm9200dk-stub.c or gdbserver)into u-boot-0.4.8,how to do it? Isn't it a difficult task? ************

The following is my U-boot starting linux process infomormation:

start linux...
## Starting application at 0x23000000 ...
Uncompressing Linux.............................................................Linux version 2.4.19-rmk7 (root at localhost.localdomain) (gcc version 2.95.3 20015CPU:
Arm920Tid(wb) revision 0
Machine: ATMEL AT91RM9200
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: initrd=0x20800000,32M root=/dev/ram init=/linuxrc
console0Console: colour dummy device 80x30
Calibrating delay loop... 89.90 BogoMIPS
Memory: 64MB = 64MB total
Memory: 29796KB available (1804K code, 346K data, 76K init)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes) Inode cache hash table entries: 4096 (order: 3, 32768 bytes) Mount-cache hash table entries: 1024 (order: 1, 8192 bytes) Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes) Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12a (20020514) Richard Gooch (rgooch at atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
S1D13XXX: Phys address:C480F000 Phys Reg address:C480D000
Console: switching to colour frame buffer device 30x20
fb0: s1d13xxx frame buffer device
Display 240 x 320 16Bpp
pty: 256 Unix98 ptys configured
Keyboard(PS/2): initiate successfully!

*********************keybd_init**************
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx ioremap:c4a10000
ide0: CPCI405 IDE interface
IDE: waiting for drives to settle...
IDE: waiting for drives to settle...
IDE: waiting for drives to settle...
hdb: probing with STATUS(0x28) instead of ALTSTATUS(0x0e)
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
CSLIP: code copyright 1989 Regents of the University of California. RAMDISK driver initialized: 16 RAM disks of 15360K size 1024 blocksize PPP generic driver version 2.4.2
SCSI subsystem driver Revision: 1.00
kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2
kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2 AT91ARM9200 flash device: 1000000 at 10000000
Search for id:(89 18) interleave(1) type(2)
Search for id:(89 18) interleave(1) type(2)
Search for id:(89 18) interleave(1) type(2)
Search for id:(89 18) interleave(2) type(1)
Search for id:(89 18) interleave(2) type(1)
Search for id:(89 18) interleave(2) type(1)
Search for id:(89 00) interleave(2) type(2)
Search for id:(89 00) interleave(2) type(2)
Search for id:(89 00) interleave(2) type(2)
JEDEC: Found no AT91ARM9200 flash device device at location zero Using buffer write method
Creating 4 MTD partitions on "AT91ARM9200 flash device":
0x00000000-0x00040000 : "reserved for bootloader"
mtd: Giving out device 0 to reserved for bootloader 0x00040000-0x00140000 : "reserved for kernel"
mtd: Giving out device 1 to reserved for kernel 0x00140000-0x00540000 : "reserved for ramdisk"
mtd: Giving out device 2 to reserved for ramdisk 0x00540000-0x00d40000 : "jffs2(8M)"
mtd: Giving out device 3 to jffs2(8M)
physmap flash device: 800000 at 10540000
Using buffer write method
mtd: Giving out device 4 to Physically mapped flash
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb.c: registered new driver usb_mouse
usbmouse.c: v1.6:USB HID Boot Protocol mouse driver
usb.c: registered new driver keyboard
usbkbd.c: :USB HID Boot Protocol keyboard driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
ttyS%d0 at MEM 0xfefff200 (irq = 1) is a AT91_SERIAL
ttyS%d1 at MEM 0xfefc0000 (irq = 6) is a AT91_SERIAL
ttyS%d2 at MEM 0xfefc4000 (irq = 7) is a AT91_SERIAL
ttyS%d3 at MEM 0xfefc8000 (irq = 8) is a AT91_SERIAL
ttyS%d4 at MEM 0xfefcc000 (irq = 9) is a AT91_SERIAL
eth0: Link now 100-FullDuplex
eth0: AT91 ethernet at 0xfefbc000 int=24 100-FullDuplex (00:01:02:03:04:05) usb-ohci.c: USB OHCI at membase 0xc6219000, IRQ 23
usb.c: new USB bus registered, assigned bus number 1
Product: USB OHCI Root Hub
SerialNumber: c6219000
hub.c: USB hub found
hub.c: 2 ports detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 32768K
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing init memory: 76K
mount /etc as ramfs
re-create the /etc/mtab entries
eth0: Link now 100-FullDuplex
mtdblock_open
ok
jffs2_read_inode(): No data nodes found for ino #85 jffs2_read_inode(): But it has children so we fake some modes for it
exec: 5: /jffs2/etc/ipset: Permission denied

Please press Enter to activate this console.

BusyBox v1.00-pre10 (2004.06.15-14:16+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands.

~ # ls

application  dev          jffs2        linuxrc      qt           usr
bin          etc          lib          mnt          sbin         var
bitmap       font         linuette     proc         tmp

Please!
Thank you very much!

yours peike

#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

U-Boot 0.4.8 (Oct 13 2005 - 16:29:32)

Please use current code. Version 0.4.8 is so old that I really don't care any more about it.

Quoted 3 lines

Uboot>tftp 23000000 zImage
Uboot> tftp 20800000 ramdisk.image.gz
Uboot> go 23000000

Please read the documentation. This is not the correct and supported way to boot Linux.

Quoted 3 lines

As I understand it, there can run a small 'gdb-stub' on the target which talks
by serial line or by ethernet with the gdb on the development host.
In common/kgdb.c there seems to be something like this small 'gdb-stub'?

Right.

Quoted 1 line

Does it work for ARM? How can it be used?"

It does work, but requires you to add the missing cpu/*/kgdb.S file.

Quoted 2 lines

*********My question is:If I want to add a debugging stub(at91rm9200dk-stub.c or gdbserver)into u-boot-0.4.8,how to do it? Isn't it a difficult task? ************

Don;t add anything to U-Boot 0.4.8. Dump it. Use current code.

And no, this is not a difficult task, just a somewhat laborious task.

Quoted 1 line

2.4.19-rmk7 (root at localhost.localdomain) (gcc version 2.95.3 20015CPU:

This is also ancient code. Forget it. You will not receive much help for this.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every time history repeats itself the price goes up.