[SOLVED] automate flash writing with a command file

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

  • [SOLVED] automate flash writing with a command file

    I would like to automate the writing of flash. The problem is that the file name to write changes from time to time depending on the version. Is there any way using a parametrized command or script file so that the filename to write becomes a parameter?

    best regards
    Max
  • No. J-Link Commander is not designed for production.
    There are currently no plans to add a command / extension like parameterized command / script.

    You may however create the script on demand, by the caller, depending on the file to program.
    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.
  • Just create a program.jlink file with all commands needed, like this with Python or ...

    Source Code

    1. si SWD
    2. speed 4000
    3. connect
    4. loadfile CONFIG_X.hex
    5. loadfile Filename_XY1.hex
    6. loadfile OptionByte_X.hex
    7. rx 500
    8. go
    9. exit
    Call jlink.exe -device XYZ -CommandFile program.jlink

    Of course, interface and speed could be set in command line already.

    You have full control inside (reset and/or run or...) and can change the filename(s) to be flashed here.

    I call this commandfile scripted with a fixed name, but I change the content (filename-hex, config or version) every time before start. I also evaluate the output or log to check for errors (no USB, not properly connected, other write fails due to readout protection still set etc.).

    I do not need a single "loadfile" filename in the command line, that would not be enough in my case. I would need 3 filenames (for DataFlash, Flash and OptionByte), but I like the flexibility of these command files.


    Best regards,

    HaJo