Linux JLinkExe 4.82 doesn't loadbin (nRF51822, PCA1000 Dev Board)

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

  • Linux JLinkExe 4.82 doesn't loadbin (nRF51822, PCA1000 Dev Board)

    I've just started using Segger with a Nordic nRF51822 on a PCA1000 dev board. Many of the features work (enough so that I'm sure the hardware is at least functional) and I can flash code using the Windows nRFGo application. However, my development environment (gcc, gdb, gnu-binutils) is on a Debian Linux box.

    JLinkExe-4.8.2 (and JLinkGDBServer) on Linux work somewhat, but I can't get JLinkExe to flash code, or even to load a binary file into RAM. It can change RAM locations one at a time, and I got it to do a complete Flash erase by poking values into the NVMC, but when I issue a loadbin command, it doesn't do it:

    C Source Code

    1. dhm@aluminum-debian$ JLinkExe -if SWD -device nRF51822 -speed 1000
    2. SEGGER J-Link Commander V4.82 ('?' for help)
    3. Compiled Mar 10 2014 19:08:40
    4. Info: Device "NRF51822_XXAA" selected (257 KB flash, 16 KB RAM).
    5. DLL version V4.82, compiled Mar 10 2014 19:08:37
    6. Firmware: J-Link OB-SAM3U128 V1 compiled Dec 11 2013 20:20:11
    7. Hardware: V1.00
    8. S/N: xxxxxxxxx
    9. VTarget = 3.300V
    10. Info: Found SWD-DP with ID 0x0BB11477
    11. Info: Found Cortex-M0 r0p0, Little endian.
    12. Info: FPUnit: 4 code (BP) slots and 0 literal slots
    13. Found 1 JTAG device, Total IRLen = 4:
    14. Cortex-M0 identified.
    15. Target interface speed: 1000 kHz
    16. J-Link>mem 20000400 20
    17. 20000400 = 06 20 FF 4B C6 C0 B9 F9 80 20 AD BF 03 12 FD 7D
    18. 20000410 = F7 ED 92 D0 FB FF 00 00 FB FF 01 C0 FF 7F C8 40
    19. J-Link>loadbin blink.bin 20000400
    20. Downloading file... [blink.bin]
    21. J-Link>mem 20000400 20
    22. 20000400 = 06 20 FF 4B C6 C0 B9 F9 80 20 AD BF 03 12 FD 7D
    23. 20000410 = F7 ED 92 D0 FB FF 00 00 FB FF 01 C0 FF 7F C8 40
    24. J-Link>q
    Display All


    I ran strace to see what was going on, and JLinkExe never even attempts to open the binary file. Am I using the loadbin command wrong? Is it broken in this version of the Linux software?

    Thanks for any help!
  • Hi,

    You are using the command correctly.
    It is related to this problem:
    No XMC4500 flash programming possible on Linux JLink 4.82 (works again after downgrade to 4.80e)

    We have already identified and fixed it.
    A new version comes later this week.

    Background info:
    There has been some internal re-structuring regarding the loadbin and unfortunately, there has been introduced a problem in the Linux & Mac version (does not show up under Windows)
    which causes the loadbin command in J-Link Commander to not work properly.


    - 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.
  • Release date has been moved a bit, so for now, please find a beta version (V4.83a) for download on our website, which fixes the problem:
    segger.com/jlink-software-beta-version.html


    - 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.
  • loadbin is still broken in v4.84 (Linux, 64-bit)

    v4.80h works:

    Source Code

    1. SEGGER J-Link Commander V4.80h ('?' for help)
    2. Compiled Feb 28 2014 21:51:12
    3. Emulator with USB serial number xxx selected.
    4. DLL version V4.80h, compiled Feb 28 2014 21:51:09
    5. Firmware: J-Link V9 compiled Mar 10 2014 19:02:08
    6. Hardware: V9.00
    7. S/N: xxx
    8. Feature(s): GDB
    9. VTarget = 3.308V
    10. Info: Found SWD-DP with ID 0x0BC11477
    11. Info: Found Cortex-M0 r0p1, Little endian.
    12. Info: FPUnit: 0 code (BP) slots and 0 literal slots
    13. Found 1 JTAG device, Total IRLen = 4:
    14. Cortex-M0 identified.
    15. Target interface speed: 100 kHz
    16. J-Link>r
    17. Reset delay: 0 ms
    18. Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    19. J-Link>loadbin code.img, 0x0
    20. Loading binary file... [code.img]
    21. Writing bin data into target memory @ 0x00000000.
    22. J-Link>
    Display All


    But v4.82, 4.83.1, and v4.84 do not:

    Source Code

    1. SEGGER J-Link Commander V4.84 ('?' for help)
    2. Compiled Mar 28 2014 16:31:42
    3. Emulator with USB serial number xxx selected.
    4. DLL version V4.84, compiled Mar 28 2014 16:31:38
    5. Firmware: J-Link V9 compiled Mar 10 2014 19:02:08
    6. Hardware: V9.00
    7. S/N: xxx
    8. Feature(s): GDB
    9. VTarget = 3.303V
    10. Info: Found SWD-DP with ID 0x0BC11477
    11. Info: Found Cortex-M0 r0p1, Little endian.
    12. Info: FPUnit: 0 code (BP) slots and 0 literal slots
    13. Found 1 JTAG device, Total IRLen = 4:
    14. Cortex-M0 identified.
    15. Target interface speed: 100 kHz
    16. J-Link>r
    17. Reset delay: 0 ms
    18. Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    19. J-Link>loadbin code.img, 0x0
    20. Downloading file... [code.img]
    21. J-Link>
    Display All


    I'm using the 64-bit RPM release on Fedora 20. Up until v4.82, Everything's worked like a champ.

    I've gone back to using v4.80h for the time being, but this is a pretty serious regression!
  • Hello "pizza",

    You were using the loadbin command incorrectly...
    As the name says, it was designed to work with *.bin files...
    It was *never* intended to work with other extensions, so this has been corrected. (Because there were a lot of users which passed hex files etc. to it, without knowing what they are doing)
    Pass a bin file to it (extension .bin) and it will work...
    *.img files are not really specified at all. They can contain binary data or some kind of structured data with headers etc. that shall not be downloaded.

    We will make sure that future versions output an appropriate error here, so it is clear what is going wrong.


    - 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.
  • So if I am correctly interpreting what you wrote, in order to get JLinkExe to continue to act as it did prior to v4.82, I will need to *rename* the file to have a .bin extension?

    After all, the purpose of the 'loadbin' command is to transfer a raw binary file
    into the target at an arbitrary memory location. I am using it for that
    precise purpose.

    (and FYI, my 'img' file is the flattened binary executable combined with other data the application needs -- hence the use of 'img' rather than 'bin')
  • Hi "pizza",

    So if I am correctly interpreting what you wrote, in order to get JLinkExe to continue to act as it did prior to v4.82, I will need to *rename* the file to have a .bin extension?

    Correct.
    Prior versions, by accident, did not check the file extension.


    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.