[SOLVED] Jlink Script

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

  • [SOLVED] Jlink Script

    Hello,
    I am using a Raspberry Pie to flash my code in a nrf52832 microcontroller so I am using a Jlink script. The problem is that I need to merge two applications ( file1.hex and file2.hex) is there a Jlink command I can use in myscript.jlink that allows me to do that ?
    Thank you
  • Hi,
    Thank you for your inquiry.

    There is no such command, as the J-Link Commander is not a production tool.
    You could either
    1) use J-Flash, SEGGER's production tool. For a merge action you do not need an additional license and you can perform this action by command line:
    Linux example: %PathToJFlash%/JFlashExe -hide -open"%PathToHex1%/hex1.hex" -merge"%PathToHex2%/hex2.hex" -saveas"%PathToDesiredLocation%/hexMerged.hex" -exit
    2) a third party application
    3) write your own application/script (e.g. with python)
    for this purpose.

    Do you have any further questions?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    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.
  • There is loadfile which supports hex files, you could probably load it with those two commands. I use two-part firmware which is loaded with loadbin like this:

    Shell-Script

    1. device stm32f427vi
    2. if swd
    3. speed 50000
    4. loadbin build/firmware/firmware.p1.bin 0x08040000
    5. loadbin build/firmware/firmware.p2.bin 0x08120000
    6. r
    7. g
    8. exit

    If you need to specify addresses, you probably need to convert the files to .bin or .elf with objcopy or something similar.