J-Link can not connect to AT91SAM9G20

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

  • J-Link can not connect to AT91SAM9G20

    Hi, my computer's operating system is Windows7 and has J-Link V4.96m. I want to use J-Link to connect to AT91SAM9G20 and are facing two problems.
    1. When I use J-Link GDB Server, it always display "Waiting for GDB connection...".
    2. When I use J-Flash , I have no idea which *.jflash to choose. I think "AT91SAM9G20-EK_DataFlash.jflash" is not suitable for AT91SAM9G20, because the RAM address is 0x2F4000 and its size is 32KB. I have checked the datesheet of AT91SAM9G20, its has two SRAMs, which are both 16KB and whose address are 0x200000-0x204000 and 0x300000-0x304000.

    How can I deal with the above two problems? :S :S Thanks for instructions!
  • Hi,
    1. When I use J-Link GDB Server, it always display "Waiting for GDB connection...".
    Why is this a problem? "Waiting for GDB connection..." tells you everything went right, GDB Server started successfully and a GDB Client can connect to it.

    2. When I use J-Flash , I have no idea which *.jflash to choose. I think
    "AT91SAM9G20-EK_DataFlash.jflash" is not suitable for AT91SAM9G20,
    because the RAM address is 0x2F4000 and its size is 32KB. I have checked
    the datesheet of AT91SAM9G20, its has two SRAMs, which are both 16KB
    and whose address are 0x200000-0x204000 and 0x300000-0x304000.
    This depends on what you want to program. The AT91SAM9G20 does not have internal Flash, so in most cases a Custom RAM Code is required to program external Flash.
    The sample is used for Data Flash connected to the AT91SAM9G20 on the AT91SAM9G20-EK eval board.

    Best regards
    Johannes
    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.
  • Thanks for your answer, Johannes. However, I have met some other problems and hope
    you can help me. In my own eval board of AT91SAM9G20, I want to use
    J-Flash to flash it with "AT91SAM9G20-EK_DataFlash.jflash".



    1. After I supply power to the main board, if I press
    "Target->Connect" in a few seconds, I can not connect to it(it
    display RAM check failed @ address 0x002F4000). However, if I press
    "Target->Connect" at once, I can connect to it. I guess that the
    AT91SAM9G20 is working so I can not connect to it. Is that right?



    2. Although I can connect to the target, which start address should I choose after opening data file "Test_LEDBlinky.bin"?
  • Hi,

    There seems to be a mistake in the J-Flash Project.
    Could you change the RAM address and size to 16K @ 0x200000 at Options -> Project Settings -> CPU
    Are you able to connect now?

    The start address of Test_LEDBlink is 0x00000000.
    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.
  • Dear Johannes,
    Although I modified the RAM address and size to 16K @ 0x200000 at Options -> Project Settings -> CPU, I can connnect to the target at once after supplying power to the board. However, if I connnect to the target in a while, it will display an errer which is showed in error.jpg. Why does this happen? And how will I deal with it?

    In addition, although I can connect to the target, when I click on "Target->Auto", it will display another error showed in error_auto.jpg.

    Thanks for instructions!
    Images
    • error.jpg

      188.22 kB, 921×712, viewed 724 times
    • error_auto.jpg

      294.58 kB, 918×709, viewed 641 times
  • Hi,
    However, if I connnect to the target in a while, it will display an
    errer which is showed in error.jpg. Why does this happen? And how will I
    deal with it?
    Might it be possible that there is some application running on the target which prevents J-Link from accessing it?
    Could you try if J-Link Commander is able to connect to the device and post the output?
    In addition, although I can connect to the target, when I click on
    "Target->Auto", it will display another error showed in
    error_auto.jpg.
    Could you please confirm you have an AT45DB642D data flash connected, which you are trying to program?
    It looks like J-Flash is not able to detect it.

    Regards
    Johannes
    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.
  • Dear Johannes,
    The J-Link Commander is able to connect to the device ,which is showed in command.jpg. In addition, our board does not have an AT45DB642D data flash, but has an NAND Flash and two SDRAMs.
    Images
    • command.jpg

      87.93 kB, 686×447, viewed 636 times
  • In addition, our board does not have an AT45DB642D data flash, but has an NAND Flash and two SDRAMs.
    As I wrote initially AT91SAM9G20-EK_DataFlash.jflash is used to program the Data Flash (AT45DB642) connected to the AT91SAM9G20 on the AT91SAM9G20-EK eval board or a similar target board using the same data flash. (As it is also written in the Readme.txt shipped with the J-Flash project and indicated by the project filename.)

    It is not possible to program any other external flash with this J-Flash project.

    Regards
    Johannes
    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.
  • My development board is based on AT91SAM9G20,has an NAND Flash and two SDRAMs. Because I want to debug a project in Eclipse with J-Link. In the tab "Startup" of "Debug Configurations->GDB hardware debugging", How can I write initialization commands in my project?
    An example follows:
    target remote localhost:2331
    monitor flash breakpoints = 0
    monitor flash download = 0
    monitor AllowSimulation = 0
    monitor endian little
    monitor writeu32 0xFFFFEF1C = 0x00020000 // Set EBI Slew-Rate to slow and voltage to 1.8V
    monitor sleep 10
    monitor writeu32 0xFFFFFC20 = 0x00004001 // Enable main oscillator
    monitor sleep 10
    monitor writeu32 0xFFFFEF1C = 0x00020000 // Set EBI Slew-Rate to slow and voltage to 1.8V
    monitor sleep 10
    monitor writeu32 0xFFFFFC28 = 0x202A3F01 // Set PLLA to 800MHz
    monitor sleep 10
    monitor writeu32 0xFFFFFC2C = 0x10193F05 // Set PLLB for USB usage
    monitor sleep 10
    monitor writeu32 0xFFFFFC30 = 0x00001300 // Select prescaler
    monitor sleep 10
    monitor writeu32 0xFFFFFC30 = 0x00001302 // Select master clock
    monitor sleep 10
    echo Master clock ok.\n
    echo Configuring the SDRAM controller...\n
    monitor writeu32 0xFFFFEF1C = 0x2 // Enable EBI chip select for the SDRAM
    monitor writeu32 0xFFFFF870 = 0xFFFF0000 // Enable PC16-PC31 pins
    monitor writeu32 0xFFFFF874 = 0x00000000 // Enable PC16-PC31 pins
    monitor writeu32 0xFFFFF804 = 0xFFFF0000 // Enable PC16-PC31 pins
    monitor writeu32 0xFFFFEA08 = 0xF7339375 // SDRAM configuration for 32MB: Change this one if the SDRAM Size changes
    monitor writeu32 0xFFFFEA00 = 0x1
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x2
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x4
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x3
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA00 = 0x0
    monitor writeu32 0x20000000 = 0
    monitor writeu32 0xFFFFEA04 = 0x39D
    echo SDRAM configuration ok.\n
    monitor flash breakpoints = 0
    monitor flash download = 0
    monitor AllowSimulation = 0
    Does the debugging running in the SDRAMs?And I hope for detailed instructions of the above commands. Thanks a lot.