[SOLVED]Atmel SAM-ICE (by Segger) and J-Link GDB-Server (v4.10i) - Very slow load speeds

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

  • [SOLVED]Atmel SAM-ICE (by Segger) and J-Link GDB-Server (v4.10i) - Very slow load speeds

    Hey everyone!
    I'm new to this forum and embedded development in general, so please bear with me. I tried looking for a solution using the search function but unfortunately coudn't find someone with a same-ish problem.
    I will try to provide as much information on the issue.
    I am developing a chip-support-package as well as a board-support-package for the .NET MicroFramework and our proprietary board housing an ATMEL AT91SAM9261 chip. It is quite similar to the AT91SAM9261-EK distributed by ATMEL.
    I use a toolchain set up pretty much exactly like the one in this tutorial:
    discovertheexperience.blogspot…-gdb-to-debug-net_09.html
    which means:
    Eclipse CDT with Zylin Embedded CDT as an IDE / Debugger Front-End
    Raisonance Ride 7 Compiler / Debugger for ARM
    End instead of OpenOCD I use the Segger J-Link GDB Server.
    Things that work so far:
    Having installed the drivers for the J-Link Device, I can hook it up to both my PC and my board. It will be detected properly by the GDB-Server which identifies it as a SAM-ICE with an ARM9 Processor behind it. Right now, I am providing my Raisonance GDB with the "gdbinit_template.jlink" configuration file that came in the examples folder of the J-Link GDB-Server. Using the following commands from within Eclipse, I can start downloading my image to the device RAM:

    Source Code

    1. target remote 127.0.0.1:2331
    2. monitor reset
    3. monitor sleep 500
    4. break PreStackEntry
    5. load
    6. continue

    Accompanying my binary image in the build output there is an *.axf-file that references the components to be downloaded to the target and their respective addresses, as far as I understood.
    So the one problem I suffer is that the sum of the components that will be deployed is at roughly 3MB and it takes literally ages to deploy them. Must be something like 1KB/s. Also, I've never even seen the process being finished as every single time up until now the GDB-Server encountered a memory write timeout, probably due to the low transferring speeds.
    I could really use a hand in crafting a better init configuration for the GDB that would enable me to deploy faster using my J-Link.
    Any help would be greatly appreciated! :)
  • Hi Koarl,

    I assume you are downloading your application into the external SDRAM, correct?
    Please notice that the SDRAM has to be initialized before you can download to it. (I say this because I do not see any SDRAM init in your GDBInit file).

    Moreover, after reset the AT91SAM9261 starts up with the internal RC oscillator as CPU clock (32 kHz).
    Since it is an ARM926EJ-S core the maximum JTAG speed which can be used is 1/8 core speed.

    A PLL init in your GDB init file should allow you to set a higher JTAG speed via "monitor speed <SpeedInkHz>"

    Please find below a sample GDBInit file which initializes the PLL of a SAM9260 device (should be very similar to the init sequence for a 9261):
    target remote localhost:2331
    monitor endian little
    monitor speed adaptive
    # Disable watchdog
    monitor long 0xFFFFFD44 = 0x00008000
    monitor sleep 10
    # Initialize PLL
    monitor long 0xFFFFFC20 = 0x00000601
    monitor sleep 100
    monitor long 0xFFFFFC30 = 0x00000001
    monitor sleep 10
    # Setup GDB for faster downloads
    set remote memory-write-packet-size 1024
    set remote memory-write-packet-size fixed
    monitor speed adaptive
    break main
    load
    #continue


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thank you very much for the reply, Alex!

    Being a total newbie, these were just enough keywords to help me find what I needed. 8)
    For everyone else suffering of a similar problem, I found another developer's blog with a complete GDB initialization script for the AT91SAM9261 here:
    yangchern.blogspot.com/2010/02…1-gdb-initial-script.html :whistling:
    The .NET MF Port I want to debug already has initialization routines for everything, once it is deployed and booted so I only took the PLL initialization part of that script.