[SOLVED] Combining JLink Script and Commander command Script

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

  • [SOLVED] Combining JLink Script and Commander command Script

    Hi,

    I am trying to make a batch script for daisy chained JTAG boards. What I want to do is automate the flashing of all the boards in the chain successively using a single script.

    Reading UM08001 Jlink document, what I have understood so far is that I need to give the special initialization parameters in a Jlink script file (which looks similar to C) and then use the JLink Commander commands like 'Loadbin' to flash the board.

    Could someone explain me how to combine/connect these 2 into a single batch script for my purpose OR if you could suggest an alternative to achieve the same?
    Thanks in advance.
  • Hi,

    give the special initialization parameters in a Jlink script file (which looks similar to C)

    If the device does not work out-of-the box with J-Link and needs special initialization, this is correct.

    I would suggest the following:

    I. A Windows .batch / Linux .sh file, which calls J-Link Commander multiple times:

    Source Code

    1. call JLink.exe -JLinkScriptFile ${path to script file for Device A} -device ${Name of device / core} -if ${target interface, like JTAG/SWD} -speed{target interface speed in kHz, e.g. 4000} -autoconnect 1 -CommandFile ${path to command file for Device A}
    2. call JLink.exe -JLinkScriptFile ${path to script file for Device B} -device ${Name of device / core} -if ${target interface, like JTAG/SWD} -speed{target interface speed in kHz, e.g. 4000} -autoconnect 1 -CommandFile ${path to command file for Device B}
    3. [..]

    II. Each command file would contain sth. like:

    Source Code

    1. r
    2. loadfile ${path to datafile}
    3. r



    Best regards,
    Niklas
    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.
  • Hi Niklas,

    I just had one more doubt that I wanted to get cleared from you.
    If the device I want to flash DOES work out-of-the-box with JLink, then is there a way to program a particular device in daisy chained configuration of such devices using only commander script (without using JlinkScript) ?
    If the device does not work out-of-the box with J-Link and needs special initialization, this is correct.
    Regards,
    Vinay

    The post was edited 2 times, last by vinaysaxena93 ().

  • Hi Vinay,


    good to hear that you are up and running :)

    If the device I want to flash DOES work out-of-the-box with JLink, then is there a way to program a particular device in daisy chained configuration of such devices using only commander script (without using JlinkScript) ?

    Yes, just omit the "-JLinkScriptFile ${path to script file for Device x}" parameter. If there are multiple devices of the same type in the daisy chain, you then probably need to specify the current position by adding -JTAGConf <IRPre>,<DRPre> to the JLink.exe call.


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