This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

KGDB on AM3517evm

Other Parts Discussed in Thread: AM3517, TCA6416, TSC2004, TVP5146

Hi,

I'm facing a problem regarding the kernel debug using GDB.

 

I recompile my kernel (linux 2.6.37) with KGDB over serial console with debug info.

 

On the uboot bootargs I added "kgdbwait kgdboc = ttyO2, 115200" (I even tried using kgdb8250, same output)

 

My board boot normally without stoping to wait for the connection with gdbserver.

 

Did someone already try KGDB and was able to figure that out? Hope it's possible otherwise the troubleshooting for my device drivers is going to be really difficult.

 

Thanks

  • I noticed something else when I want to invoke KDB with the Magic SysRq 'g' using echo g >/proc/sysrq-trigger I get the help menu. It seems that the "g" command is not implemented.

    root@am3517-evm:~# echo g >/proc/sysrq-trigger                                 
    SysRq : HELP : loglevel(0-9) reBoot Crash show-all-locks(D) terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) thaw-filesystems(J)

    saK show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T)

    Unmount show-blocked-tasks(W) dump-ftrace-buffer(Z)

    I included 2 screenshots, one is my kernel menuconfig where KGDB is checked and the second one is the kernel build where you can see that KDB is compiled.

    Any help on how to make KGDB works will be appreciated, thanks.

  • Can you please post the boot log from when you pass in kgdbwait and such?  Thanks.

  • Hi,

    here is my complete boot log, the bootargs with kgdbwait is in red and bold (kgdbwait is declared after kgdboc). There are few errors because I removed the application board from the main board.

    The idea is to share ttyO2 with the console and Kgdb.

    Thanks for the help.

     

     

    Texas Instruments X-Loader 1.51 (Jul  5 2011 - 17:42:20)
    Booting from nand . . .
    Starting OS Bootloader...


    U-Boot 2010.06 (Sep 19 2011 - 11:44:04)

    OMAP34xx/35xx-GP ES1.0, CPU-OPP2 L3-165MHz
    AM3517EVM Board + LPDDR/NAND
    I2C:   ready
    DRAM:  256 MiB
    NAND:  HW ECC [Kernel/FS layout] selected
    512 MiB
    In:    serial
    Out:   serial
    Err:   serial
    Die ID #1b4a000100000000015da39616019003
    Net:   davinci_emac_initialize
    Ethernet PHY: GENERIC @ 0x00
    DaVinci EMAC
    Hit any key to stop autoboot:  0
    BOOTP broadcast 1
    DHCP client bound to address 10.0.5.195
    Using DaVinci EMAC device
    TFTP from server 10.0.42.1; our IP address is 10.0.5.195
    Filename 'uImage'.
    Load address: 0x82000000
    Loading: #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #######################################################
    done
    Bytes transferred = 2942448 (2ce5f0 hex)
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   Linux-2.6.37
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2942384 Bytes = 2.8 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Linux version 2.6.37 (laurent@laurent-ubuntu) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-2
    03) ) #16 Tue Oct 11 10:44:27 EDT 2011
    CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
    Machine: OMAP3517/AM3517 EVM
    Reserving 4194304 bytes SDRAM for VRAM
    Memory policy: ECC disabled, Data cache writeback
    AM3517 ES1.1 (l2cache iva sgx neon isp )
    SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64000
    Kernel command line: console=ttyO2,115200n8 rw noinitrd root=/dev/nfs nfsroot=10.0.42.1:/home/laurent/ti-sdk-am3517-evm-05.02.00.00/targetNFS,nolock,rsize=1024,wsize=1024 ip=10.0.42.2::10.0.42.1:::eth0:off kgdboc=ttyO2,115200 kgdbwait
    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 252MB = 252MB total
    Memory: 242428k/242428k available, 19716k reserved, 0K highmem
    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
        DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
        vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
        lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .init : 0xc0008000 - 0xc003a000   ( 200 kB)
          .text : 0xc003a000 - 0xc056f8d8   (5335 kB)
          .data : 0xc0570000 - 0xc0722fe0   (1740 kB)
    NR_IRQS:375
    Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz
    omap_hwmod: i2c1: softreset failed (waited 10000 usec)
    omap_hwmod: i2c2: softreset failed (waited 10000 usec)
    omap_hwmod: i2c3: softreset failed (waited 10000 usec)
    Reprogramming SDRC clock to 332000000 Hz
    dpll3_m2_clk rate change failed: -22
    IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
    Total of 96 interrupts on 1 active controller
    GPMC revision 5.0
    Trying to install interrupt handler for IRQ368
    Trying to install interrupt handler for IRQ369
    Trying to install interrupt handler for IRQ370
    Trying to install interrupt handler for IRQ371
    Trying to install interrupt handler for IRQ372
    Trying to install interrupt handler for IRQ373
    Trying to install interrupt handler for IRQ374
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    OMAP clockevent source: GPTIMER1 at 32768 Hz
    Console: colour dummy device 80x30
    Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    ... MAX_LOCKDEP_SUBCLASSES:  8
    ... MAX_LOCK_DEPTH:          48
    ... MAX_LOCKDEP_KEYS:        8191
    ... CLASSHASH_SIZE:          4096
    ... MAX_LOCKDEP_ENTRIES:     16384
    ... MAX_LOCKDEP_CHAINS:      32768
    ... CHAINHASH_SIZE:          16384
     memory used by lock dependency info: 3951 kB
     per task-struct memory footprint: 2304 bytes
    Calibrating delay loop... 597.64 BogoMIPS (lpj=2334720)
    pid_max: default: 32768 minimum: 301
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    regulator: core version 0.5
    regulator: dummy:
    NET: Registered protocol family 16
    ------------[ cut here ]------------
    WARNING: at arch/arm/mach-omap2/pm.c:94 _init_omap_device+0x84/0xa4()
    _init_omap_device: could not find omap_hwmod for iva
    Modules linked in:
    [<c004a678>] (unwind_backtrace+0x0/0xec) from [<c0070cfc>] (warn_slowpath_common+0x4c/0x64)
    [<c0070cfc>] (warn_slowpath_common+0x4c/0x64) from [<c0070d94>] (warn_slowpath_fmt+0x2c/0x3c
    )
    [<c0070d94>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0051dd4>] (_init_omap_device+0x84/0xa4)
    [<c0051dd4>] (_init_omap_device+0x84/0xa4) from [<c00100b8>] (omap2_common_pm_init+0x2c/0x10
    c)
    [<c00100b8>] (omap2_common_pm_init+0x2c/0x10c) from [<c003a3b8>] (do_one_initcall+0xc8/0x1a0
    )
    [<c003a3b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>] (kernel_init+0x94/0x14c)
    [<c0008690>] (kernel_init+0x94/0x14c) from [<c0045590>] (kernel_thread_exit+0x0/0x8)
    ---[ end trace 1b75b31a2719ed1c ]---
    OMAP GPIO hardware version 2.5
    OMAP GPIO hardware version 2.5
    OMAP GPIO hardware version 2.5
    OMAP GPIO hardware version 2.5
    OMAP GPIO hardware version 2.5
    OMAP GPIO hardware version 2.5
    omap_mux_init: Add partition: #1: core, flags: 0
    Display initialized successfully
    _omap_mux_init_gpio: Multiple gpio paths (2) for gpio126
    NOR: Unable to find configuration in GPMC
    hw-breakpoint: debug architecture 0x4 unsupported.
    OMAP DMA hardware revision 4.0
    bio: create slab <bio-0> at 0
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    omap_device: omap_i2c.1: new worst case activate latency 0: 30517
    omap_i2c omap_i2c.1: bus 1 rev3.12 at 400 kHz
    omap_device: omap_i2c.1: new worst case deactivate latency 0: 30517
    omap_i2c omap_i2c.2: bus 2 rev3.12 at 400 kHz
    pca953x 2-0021: interrupt support not compiled in
    omap_i2c omap_i2c.3: bus 3 rev3.12 at 400 kHz
    tca6416-keypad 3-0020: tca6416_read_reg failed, reg: 1, error: -121
    tca6416-keypad: probe of 3-0020 failed with error -121
    pca953x 3-0021: failed reading register
    pca953x: probe of 3-0021 failed with error -121
    Switching to clocksource 32k_counter
    musb-hdrc: version 6.0, otg (peripheral+host), debug=0
    musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    <6>Waiting for PHY clock good...
    musb-hdrc musb-hdrc.0: USB OTG mode controller at d0810000 using DMA, IRQ 71
    NET: Registered protocol family 2
    IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    TCP bind hash table entries: 8192 (order: 6, 360448 bytes)
    TCP: Hash tables configured (established 8192 bind 8192)
    TCP reno registered
    UDP hash table entries: 128 (order: 1, 12288 bytes)
    UDP-Lite hash table entries: 128 (order: 1, 12288 bytes)
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    NetWinder Floating Point Emulator V0.97 (double precision)
    omap_init_opp_table: no hwmod or odev for iva, [9] cannot add OPPs.
    AM3517  Linux PSP version 04.02.00.07 (AM3517EVM)
    VFS: Disk quotas dquot_6.5.2
    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    JFFS2 version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
    msgmni has been set to 473
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    OMAP DSS rev 2.0
    omapdss supply vdds_dsi not found, using dummy regulator
    OMAP DISPC rev 3.0
    omapdss supply vdda_dac not found, using dummy regulator
    OMAP VENC rev 2
    OMAP DSI rev 1.0
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
    omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
    omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
    console [ttyO2] enabled
    brd: module loaded
    loop: module loaded
    mtdoops: mtd device (mtddev=name/number) must be supplied
    omap2-nand driver initializing
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron )
    Creating 5 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000080000 : "xloader-nand"
    0x000000080000-0x000000240000 : "uboot-nand"
    0x000000240000-0x000000280000 : "params-nand"
    0x000000280000-0x000000780000 : "linux-nand"
    0x000000780000-0x000020000000 : "jffs2-nand"
    davinci_mdio davinci_mdio: davinci mdio revision 1.5
    davinci_mdio davinci_mdio: detected phy mask fffffffe
    davinci_mdio: probed
    davinci_mdio davinci_mdio: phy[0]: device ffffffff:00, driver SMSC LAN8710/LAN8720
    vcan: Virtual CAN interface driver
    CAN device driver interface
    TI High End CAN Controller Driver 0.7
    ti_hecc ti_hecc: device registered (reg_base=d0890000, irq=24)
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver dm9601
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci-omap.0 supply hsusb0 not found, using dummy regulator
    ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
    ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
    ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
    ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: OMAP-EHCI Host Controller
    usb usb1: Manufacturer: Linux 2.6.37 ehci_hcd
    usb usb1: SerialNumber: ehci-omap.0
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 3 ports detected
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new interface driver usbtest
    g_ether gadget: using random self ethernet address
    g_ether gadget: using random host ethernet address
    usb0: MAC 0a:7e:85:37:2b:64
    usb0: HOST MAC f2:70:ee:4f:2d:fe
    g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    g_ether gadget: g_ether ready
    musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: MUSB HDRC host driver
    usb usb2: Manufacturer: Linux 2.6.37 musb-hcd
    usb usb2: SerialNumber: musb-hdrc.0
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    mice: PS/2 mouse device common for all mice
    omap_device: omap_i2c.1: new worst case activate latency 0: 152587
    input: TSC2004 Touchscreen as /devices/virtual/input/input0
    rtc-s35390a 1-0030: rtc core: registered rtc-s35390a as rtc0
    i2c /dev entries driver
    Linux video capture interface: v2.00
    usbcore: registered new interface driver uvcvideo
    USB Video Class driver (v1.0.0)
    vpfe_init
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    tvp514x 3-005c: tvp514x 3-005c decoder driver registered !!
    tvp514x 3-005c: Write: retry ... 0
    tvp514x 3-005c: Write: retry ... 1
    tvp514x 3-005c: Write: retry ... 2
    tvp514x 3-005c: Write: retry ... 3
    tvp514x 3-005c: Write: retry ... 4
    tvp514x 3-005c: Write: retry ... 5
    tvp514x 3-005c: Write failed. Err[-121]
    tvp514x 3-005c: Unable to turn on decoder
    tvp514x 3-005c: Read: retry ... 0
    tvp514x 3-005c: Read: retry ... 1
    tvp514x 3-005c: Read: retry ... 2
    tvp514x 3-005c: Read: retry ... 3
    tvp514x 3-005c: Read: retry ... 4
    tvp514x 3-005c: Read: retry ... 5
    tvp514x 3-005c: Unable to query std
    vpfe-capture vpfe-capture: v4l2 sub device tvp5146 registered
    vpfe_register_ccdc_device: DM6446 CCDC
    DM6446 CCDC is registered with vpfe.
    omap_device: omap_wdt.-1: new worst case activate latency 0: 30517
    OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
    omap_device: omap_wdt.-1: new worst case deactivate latency 0: 30517
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    oprofile: hardware counters not available
    oprofile: using timer interrupt.
    TCP cubic registered
    Initializing XFRM netlink socket
    NET: Registered protocol family 17
    NET: Registered protocol family 15
    can: controller area network core (rev 20090105 abi 8)
    NET: Registered protocol family 29
    can: raw protocol (rev 20090105)
    can: broadcast manager protocol (rev 20090105 t)
    Registering the dns_resolver key type
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
    ThumbEE CPU extension supported.
    Power Management for TI OMAP3.
    clock: disabling unused clocks to save power
    rtc-s35390a 1-0030: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
    omap_vout omap_vout: Buffer Size = 3686400
    omap_vout omap_vout: : registered and initialized video device 1
    omap_vout omap_vout: Buffer Size = 3686400
    omap_vout omap_vout: : registered and initialized video device 2
    davinci_mdio davinci_mdio: resetting idled controller
    net eth0: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=ffffffff:00, id=7c0f1
    )
    IP-Config: Guessing netmask 255.0.0.0
    IP-Config: Complete:
         device=eth0, addr=10.0.42.2, mask=255.0.0.0, gw=10.0.42.1,
         host=10.0.42.2, domain=, nis-domain=(none),
         bootserver=255.255.255.255, rootserver=10.0.42.1, rootpath=
    PHY: ffffffff:00 - Link is Up - 100/Full
    VFS: Mounted root (nfs filesystem) on device 0:14.
    Freeing init memory: 200K
    INIT: version 2.86 booting
    Please wait: booting...
    Starting udev
    udevd (608): /proc/608/oom_adj is deprecated, please use /proc/608/oom_score_adj instead.
    Root filesystem already rw, not remounting
    Caching udev devnodes
    Populating dev cachemv: cannot rename '/tmp/devices': No such file or directory
    ALSA: Restoring mixer settings...
    NOT configuring network interfaces: / is an NFS mount
    /usr/sbin/alsactl: load_state:1625: No soundcards found...
    Thu Jul  7 13:19:00 UTC 2011
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting Hardware abstraction layer hald
    Starting Dropbear SSH server: dropbear.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    Starting thttpd.
    Starting PVR
    Usage: insmod filename [args]
    FATAL: Module omaplfb not found.
    FATAL: Module bufferclass_ti not found.
    BusyBox v1.13.2 (2011-07-05 21:30:53 CDT) multi-call binary

    am3517-evm login:

  • So, just to let people know, after working on that issue for 3 days, I noticed that all the post I read and the User Guide from LogicPD do not use linux 2.6.37 but older (2.6.32).

     

    Therefore I tried with the same kernel version 2.6.32 and it turned out that it's working.

     

    So, it seems that there is a bug somewhere or a command is missing if I want to do the same with the linux kernel 2.6.37 provided by TI in their PSP.

     

    Can someone recommand me a good Jtag debugger. Is BDI3000 is good for the AM3517?

     

    Thanks

  • JTAG debugger is to some degree a matter of personal preference.  With my TI hat on, I'd point you towards http://www.ti.com/tool/xds100 as a starting point.  With my personal hat on, if you've got a JTAG solution you like and are comfortable with, go ahead and use it with the AM3517.

  • It turns out that the omap serial drivers do not implement polling, which prevents the -g option in sysrq-trigger.  See the blog below for more details.

    http://e2e.ti.com/support/embedded/linux/f/354/p/132640/479435.aspx#479435

    Here's the patch file I created based off the blog to fix this problem, for /drivers/serial/omap-serial.c

    907a908,920
    > #ifdef CONFIG_CONSOLE_POLL
    > static int serial_omap_console_getchar(struct uart_port *port)
    > {
    >        struct uart_omap_port *up = (struct uart_omap_port *)port;
    >        unsigned char lsr = serial_in(up, UART_LSR);
    >
    >        if (!(lsr & UART_LSR_DR))
    >                return NO_POLL_CHAR;
    >
    >        return serial_in(up, UART_RX);
    > }
    > #endif
    >
    915a929,935
    > #ifdef CONFIG_CONSOLE_POLL
    > static void serial_omap_console_putchar_polling(struct uart_port *port, unsigned char ch)
    > {
    >     serial_omap_console_putchar(port, ch);
    > }
    > #endif
    >
    1024a1045,1048
    > #ifdef CONFIG_CONSOLE_POLL
    >     .poll_get_char  = serial_omap_console_getchar,
    >     .poll_put_char  = serial_omap_console_putchar_polling,
    > #endif

    This brought kdb up for me as far as I could tell, but I am still having trouble getting kgdb up.  Also, ekgdboc is used for early kernel debugger launching I believe, although I have not brought kgdb up at all yet.