[SOLVED] AT91R40008-66AU J-Link Issues via batch file

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

  • [SOLVED] AT91R40008-66AU J-Link Issues via batch file

    I'm currently working on loading new firmware on the AT91R40008-66AU chip using j-link. I'm having issues being able to not only load new firmware to the chip but also erase anything loaded on the chip. It currently shows that it completed erasing but when I check it using another utility the tools still has whatever firmware that was loaded to it still on it.

    Also sometimes it returns with an error code -1. Also I can't seem to successfully load .hex and .bin files using the batch file method. I do know that we need to set the power on in the batch file script so that's not the issue.

    Here is what I have so far:

    if JTAG
    device ARM7
    power on
    hwinfo
    speed 30
    r
    w4 0xFFE00000 0x0100253D
    w4 0xFFE00024 0x00000006
    w4 0xFFE00020 0x00000001
    speed 4000
    erase
    //loadfilec:\images\filename.hex
    //loadfile \\winvatar\firmware\firmware_install\filename.bin,0x1010000
    r
    go
    //exit

    Can someone help with this?
  • Hello,

    Thank you for your inquiry.
    What kind of memory are you trying to write to?
    Keep in mind that for the AT91R40008 only RAM debug is supported or a CFI complaint external parallel NOR Flash: segger.com/downloads/supported-devices.php

    The address you are looking to write to at 0x1010000 is reserved according to the target device manual.



    Best regards,
    Nino
    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.
  • When we run it normally through the SEGGER J-flash V5.00c utility it runs fine. Able to erase and download files no problem. It looks like the memory I'm trying to write to is the RAM. I'm kind of new to all of this, so I could be wrong. Because it says the target ram in the image attached is where I assume I'm trying to write to.
    Images
    • J-linkIssue.jpg

      277.79 kB, 917×637, viewed 234 times
  • Hello,

    Attached is the devices memory map.
    There is no RAM at 0x10000000. So writing there will fail or cause unexpected behaviour.

    VicOje08 wrote:

    When we run it normally through the SEGGER J-flash V5.00c utility it runs fine.
    What do you mean with runs fine?
    J-Flash V5 is very very old and it is possible that certain errors are not caught properly. Also J-Flash is meant to write Flash memory, not RAM. So it is the wrong tool to use.

    Best regards,
    Nino
    Images
    • Capture.PNG

      72.65 kB, 751×921, viewed 252 times
    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.
  • Hello,

    Great to hear that you are up and running again.
    This thread will be closed now.

    Best regards,
    Nino
    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.