J-Link, GDB and STR912

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • J-Link, GDB and STR912

    Hi,
    i trying to use the J-Link with GDB-Server, J-Flash and Yagarto/GNU to program and debug my STR912FA44. I already compiled and downloaded something, but i still have problems to debug my application. Im not shure how to init and run the gdb particular for this processor (how to config e.g. from .gdbconfig or Eclipse Debug-Dialog). Somebody who already relised something in this combination?
    Thanks and regards,
    Thomas
  • Hi Thomas,

    What are you exactly trying to do?
    Do you want to program your application into flash and debug it with gdb/gdb-server?
    If so, this will not work. The J-Link gdb-server does not support flash download.
    Either you let your application in RAM (modify your linker file) or
    you use an external tool to program the flash of the STR91x
    and then use the gdb/gdb-server combo to debug your application.

    Cheers,

    marocprof
  • Hi,
    sorry for the unclear explanation. I use Yagarto as developement environment for my application and afterwards i download it to the controller with Segglers J-Flash. Now i would like to debug this application with gdb and gdb-server out of Eclipse, but i have no idea how to configure the gdb to initialize the str912 (the commands for the .gdbconfig file or the Eclipse Debuger-Panel, spezially for this type).
    Regards,
    Thomas
  • Hi Thomas,

    The initialization (or a gdb init file) is quite simple for the STR912.

    The initialization (STR_912_J-Link.gdb) should only have these steps:

    Source Code

    1. # connect to the J-Link gdb server
    2. target remote localhost:2331
    3. # set speed to JTAG speed to adaptive: STR912 is an ARM966E-S
    4. monitor speed adaptive
    5. # reset the target
    6. reset 0


    I think it would be best to do the first steps with makefile and arm-elf-insight (gdb + GUI front end).
    If everything is working, the next steps would be to use the Yagarto stuff.
    To integrate the debugger into Yagarto: I think it's quite well explained on the Yagarto website.
    A good literature is the GNU-Based Software Development on AT91SAM Microcontrollers on the website.
    Follow the step described in the manual except that you use the init steps that I have described above.

    That's it.
    Let me know if you need further help.
    Regards,

    marocprof
  • I trying to use insight accordant to your description and i can connect to the device. But after connection i see only the assembler code and have no opportunity to set a breakpoint or something else. Thats the problem that i had all the time! I don't know if it's usefull but i use the adapted makefile that is used e.g. at the gnu/embos example for arm7 (avaiable at the Segger page), a adapted linker script based on a version of Keil and adapted for gnu by M. Thomas and startup-code based on a at91sam7s256 that is adapted for the str91x by someone. I don't know if there are any conditions. What's the problem??? Thanks for your help.

    By the way, i already know the yagarto howto and the documentation of james p. lynch, there are both very helpful!!!

    The post was edited 1 time, last by soundso ().

  • Sorry I meant screen shot.

    Anyway, I took some time on the weekend and made a simple project for the STR912.
    You can download it from
    1webspace.biz/marocprof/index.html
    It is a simple LED toggle project using GPIO6 as LED source.
    The following make targets are available:
    • make ROM
      - builds a ROM version of the app.
    • make ROM
      - builds a RAM version of the app.
    • make all
      - builds both
    • make debug_rom
      - builds the ROM app and start arm-elf-insight
    • make debug_rom
      - builds the RAM app and start arm-elf-insight
    • make clean
      - cleans up.
    Let me know if you can use that project and see source code instead of seeing only the assembler stuff.

    Regards,

    marocprof
  • Hi,
    thanks, you really help me a lot!!! If i download and run your example with J-Flash (entering start-address 0x0) everything is fine and the led's are blinking. But if i try to debug it with Insight, doesn't matter with your make debug_rom or entering the commands to the Insight Command Window, i receive the warning "Program received signal SIGTRAP, Trace/brakepoint trap and Insight close. Ok, i know we tell the debuger to stop at the main function, but i can not continue runing the application. If i click "Run" oder "Next" or whatever, i see a warning at the GDB-Server (see screenshot) and Insight is switching to the Assembly view, telling me "Select function to disassemble". Sorry if i doing beginner's mistakes but i have no idea what's wrong :-S

    (Ups, some webspace problems that i can not fix now. The screenshot is showing the warning at the gdb-server "Warning: Failed to read memory at address 0x8c010000)

    [img]http://www.geh-doch-zuhause.de/images/stories/screenshot.jpg[/img]

    The post was edited 3 times, last by soundso ().

  • :thumbsup: FANTASTIC NEWS :thumbsup:

    I took a look into the J-Link gdb server manual and they have a command for setting the gdb server to little endian mode thru a monitor command. --> I have update the STR912.gdb file in my test project so that the gdb server is set to little endian mode.
    If you're interested you can download it.

    Have fun... :D
  • I have embeded your example in a Yagarto/Eclipse project and everythink works well. Now i can perfectly debug the application from the Eclipse IDE! Further i tryed to use the st software lib sources by adding the source folder to the project and adding the necessary source files at your "Source" file (e.g. SOURCES = ./leds.c ./source/91x_lib.c ...), but then you have to add some additional linke flags as well. I don't know exactly why, but it only works if --no-warn-mismatch is set, otherwise there is a error with the gcclib (... libgcc.a(_divsi3.o) uses FPA instructions, whereas leds_RAM.elf does not). If everything is working well, i also try to make my project public avaiable.
  • Now everything is fine, but next problem are the interrupts. At the str91x software library you have a file 91x_it.c, where are handlers for all kinds of interrupts and you only have to implement the functionalitys for the configurated interrupts there. The connection between the handlers and the interrupts is automaticly done with the configuration in 91x_vic.c. But my handlers are not executed. I saw other versions of the startup_STR91x.s with a IRQ_Handler and i tryed to use this one but it works neither :( What's your way to handle interrupts? You directly set the handler-address at the vic-register? It would be nice to use interrupts like as yet. But i still have my problems with this assembler startup. By the way, is there a good short introduction to this topic somewhere? Regards...

    The post was edited 1 time, last by soundso ().

  • HI Thomas,

    I have been heavily busy since the last post.
    But anyhow...Regarding the question you recently posted.
    It is quite easily to implement.
    I will check if I build a simple interrupt project that uses the ST library stuff.
    More tomorrow.
    BTW: We are drifting away from the initial problem.
    I think it would be better to create a new thread in the "General" topic-folder.
    What do you think? ?(

    Cheers,

    marocprof
  • Take it easy! I'm very happy for every help to any time. You already saved me years of time :) But it would be nice if you also help me to solve that interrupt problem or you can give me some tips. Step by step i start to understand all this stuff, also the assembler startup, but not enouve detailed to make this cahnges. I can start a new topic in an other secction, but you don't thing it breaks the relation to the stuff that we have done already?