Skip to main content
lanchon
Associate III
November 25, 2009
Question

STM32 C/C++ build environment using CodeSourcery Sourcery G++

  • November 25, 2009
  • 26 replies
  • 5222 views
Posted on November 25, 2009 at 04:13

STM32 C/C++ build environment using CodeSourcery Sourcery G++

#fyi
    This topic has been closed for replies.

    26 replies

    sjo
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Quote:

    GDB (the one included in the codesourcery toolchain) could connect with a ''target remote localhost:3333'', which would stop the app from running. Entering 'continue' would make it continue, but gdb became unresponsive, and did not return a '(gdb)' prompt after the continue command.

    gdb will go modal after a continue is executed, a ctrl-c will halt the target again.

    could you provide more info, openocd, gdb version etc - and any logs.

    Cheers

    sjo

    gmonti64
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Hi,

    I'm looking for a FAT implementation running on STM32, and reading this post, I would to signal a similar demo (Eclipse + GDB on STM32) at the following link

    http://sites.google.com/a/stf12.net/developer-sw-fw/eclipse-demo

    miles
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    > Also, I never use debuggers (I instrument code instead) so I

    > can't help you in the least bit with GDB.

    I had assumed gdb worked and that I did something wrong to break it. I'll keep working on gdb, and post back if I have success.

    Thanks,

    Miles

    sjo
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    I do not have a problem, i was trying to help with yours??

    Cheers

    sjo

    gmonti64
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Your GDB problem isn't clear for me.

    I'm able to start a debug session and use standard features - Step Into, Step Over, Suspend and Resume.

    This is a good starting point for my project (FAT implementation on STM32).

    What about to contact the developer's demo?

    you can find the reference on the site.

    [ This message was edited by: gmonti64 on 02-07-2008 23:27 ]

    pandoraems
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Can someone with working GDB please post their setup?

    I.e:

    - gdb version (anglia? codesourcery? ...)

    - gdb initialization file

    - any other tricks you've done to make it work?

    Thanks

    andreas2
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Ok, here it is... I use it mostly with r6xx something, I noticed recent versions have a cleaner variant in the src/target/target dir.

    EDIT: Hum, I wonder where it went. I'll paste it inline:

    stm32_ft2cfg

    ------

    daemon configuration

    telnet_port 4444

    gdb_port 3333

    gdb_detach reset

    gdb_memory_map enable

    gdb_flash_program enable

    daemon_startup reset

    interface

    interface ft2232

    ft2232_device_desc ''Amontec JTAGkey''

    ft2232_device_desc ''Amontec JTAGkey A''

    ft2232_layout jtagkey

    ft2232_vid_pid 0x0403 0xcff8

    jtag_speed 10

    reset_config trst_and_srst

    jtag scan chain

    format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

    jtag_device 4 0x1 0xf 0xe

    jtag_device 5 0x1 0x1 0x1e

    target configuration

    target

    target cortex_m3 little reset_halt 0

    run_and_halt_time 0 30

    working_area 0 0x20000000 0x5000 nobackup

    flash configuration

    flash bank stm32x

    0 0

    flash bank stm32x 0x08000000 0x20000 0 0 0

    ------

    [ This message was edited by: andreas1 on 08-09-2008 01:11 ]

    pandoraems
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    thanks for the response Andreas

    Yes, please clean the file up and post it here. I am sure you'll help a few like myself here by doing this.

    Cheers

    andreas2
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    I've got debugging up and running on both linux and winxp.

    I've tried both CodeSourcery's gdb (the current, and the previous), as well as a recent gdb i compiled myself.

    I use OpenOCD (versions r653 to current, yagarto has a precompiled windows binary) with an Amontec JTAGkey (ft2232-based) interface. I can post the config file on request, have to clean it up a bit.

    Startup commands consist of something like:

    target remote :3333

    load

    monitor reset

    thb main

    c

    I also wrote a gdb stub for debugging the target over a serial line. Quite usable, but it's work in progress.

    Debugging works great in both cases, both command line and from within eclipse.

    rockydt18
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:25

    Hey!

    First of all: lanchon great work! your linker scripts helped me a lot to get things working. But i have one little problem.

    I can debug in RAM or Flash and my application is working like it should(tested it with IAR workbench) but i can't get any interrupt. Why..?

    I used your stm32exceptions.c and .h file and put my code in it, but it still doesn't trigger any interrupt.

    Maybe your or someone has an advice for me...

    with kind regards

    --

    rocky