Skip to main content
denis2399
Associate
January 11, 2010
Question

HOWTO use uClinux GDB on STM32E-EVAL ?

  • January 11, 2010
  • 4 replies
  • 1092 views
Posted on January 11, 2010 at 16:35

HOWTO use uClinux GDB on STM32E-EVAL ?

    This topic has been closed for replies.

    4 replies

    denis2399
    denis2399Author
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:37

    Hello,

    The AN3012 application note, getting started with uClinux for STM32F10x, does not guide for debugging user applications, like only with an simple example.

    HOW TO implement the GDB on the target to debug via serial port ?

    Maybe it's not possible ! :-[

    Thanks

    g-ab
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:37

    Hello!

    To use GDB with STM3210E-EVAL you need to have gdbserver in the target file system. It can be included from uClinux distribution Configuration menu.

    Also as I see there is only one serial port initialized to handle the default console. You will need to update the driver to handle the second one.

    Regards,

    G-Ab.

    denis2399
    denis2399Author
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:37

    Hello,

    Thanks, i am not alone :D

    When i valid GDB, uClinux start like this :

    platform Initialisation finished jumping to kernel.

    Linux version 2.6.26-uc0 (cadiot@cadiot-linux) (gcc version 4.3.3 (Sourcery G++

    Lite 2009q1-163) ) #6 Sat Jan 9 10:35:12 CET 2010

    CPU: ARMv7-M Processor [411fc231] revision 1 (ARMv?(11)M)

    Machine: STM3210E-EVAL

    SRAM Config: bank[0] @ 0x68000000 (size: 1024KB) - bank[1] @ 0x20000000 (size: 6

    4KB).

    Built 1 zonelists in Zone order, mobility grouping off. Total pages: 254

    Kernel command line: noinitrd root=mtd1 ro rootfstype=jffs2 init=/linuxrc consol

    e=ttyS0

    PID hash table entries: 16 (order: 4, 64 bytes)

    console [ttyS0] enabled

    Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)

    Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)

    Memory: 1MB 0MB = 1MB total

    Memory: 980KB available (440K code, 55K data, 8K init)

    Mount-cache hash table entries: 512

    JFFS2 version 2.2. © 2001-2006 Red Hat, Inc.

    simple-gpio: now handling 16 GPIOs: 0 - 15

    ttyS0 at MMIO 0x40013800 (irq = 37) is a STM32 USART1 Port

    Probed and found the STM3210E-EVAL NOR flash chip

    Creating 4 MTD partitions on ''M29W128F NOR FLASH'':

    0x00000000-0x00100000 : ''Kernel raw data''

    0x00100000-0x00160000 : ''rootfs''

    0x00160000-0x00190000 : ''rawdata''

    0x00190000-0x001c0000 : ''cramfs_partition''

    rtc-stm3210e_eval rtc-stm3210e_eval.0: rtc core: registered rtc-stm3210e_eval as

    rtc0

    rtc-stm3210e_eval rtc-stm3210e_eval.0: setting system clock to 1970-01-01 21:53:

    35 UTC (78815)

    VFS: Mounted root (jffs2 filesystem) readonly.

    Freeing init memory: 8K

    Mounting proc fs

    Mounting sysfs

    Welcome to

    ____ _ _

    / __| ||_|

    _ _| | | | _ ___ _ _ _ _

    | | | | | | || | _ \| | | |\ \/ /

    | |_| | |__| || | | | | |_| |/

    | ___ \____|_||_|_| |_|\____|\_/\_/

    | |

    |_|

    For further information check:

    http://www.uclinux.org/

    http://www.st.com/stm32

    CPU: 0 Not tainted (2.6.26-uc0 #6)

    pc : [] lr : [] psr: 81000000

    sp : 68087f68 ip : 00000000 fp : 00000000

    r10: 680879e8 r9 : 00000000 r8 : 680860d1

    r7 : 680878e9 r6 : 00000001 r5 : 68087fac r4 : 00001985

    r3 : 00000000 r2 : 6c000000 r1 : 73431df2 r0 : 7d9be41e

    Flags: Nzcv IRQs on Mode USER_26 ISA Segment kernel

    But the system stops.

    The contents of linuxrc is :

    !/bin/sh

    echo Mounting proc fs

    mount -t proc proc /proc

    echo Mounting sysfs

    mount -t sysfs sysfs /sys

    clear

    cat /etc/motd

    Splash&

    Led_Show&

    exec /bin/sh/

    You wrote : You will need to update the driver to handle the second one, but i do not know how to do.

    Best regards

    Denis

    g-ab
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:37

    Hello,

    I suppose that maybe there is an overwrite of ''rawdata'' partition, can you check that the new ''rootfs.img.bin'' fit in ''rootfs'' partition.

    /*

    * 0x00000000-0x00100000 : ''Kernel raw data''

    * 0x00100000-0x00160000 : ''rootfs''

    * 0x00160000-0x00190000 : ''rawdata''

    * 0x00190000-0x001c0000 : ''cramfs_partition

    */

    To update the driver, Application note section ''8 - How to add new features'' can be a good starting point. ;)

    Regards,

    G-Ab.