[SOLVED] J-Link script file documentation

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

  • [SOLVED] J-Link script file documentation

    Gotta question about the documentation of the script files.

    One thing is: where are the return codes / values documented for the Actions that can be customized?

    E.g. prototype int ResetTarget(void). The doc (UM08001_JLink) does not have info on what this should return, or any of the Actions.
  • Hi,


    The doc (UM08001_JLink) does not have info on what this should return, or any of the Actions.

    Thanks for pointing that out.
    return values for all J-Link script file functions are:

    C Source Code

    1. < 0 error
    2. >= 0 O.K.

    We will update the documentation accordingly.


    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,

    What about the actions by the DLL or the caller of the customized J-Link scripts when return status is error?
    Will they (or should ..) abort process, or not?

    I tried returning different returns from ResetTarget() (which I've seen in one Segger example returns void for some reason ..) , and I don't
    see that doing much difference.

    Also, do the return values you posted apply to all of the Script file API functions? (5.12.2 / p 163)
  • Hi,

    What about the actions by the DLL or the caller of the customized J-Link scripts when return status is error?
    Will they (or should ..) abort process, or not?

    I need to check with engineering on this.
    Some should definitely fail, like InitTarget().

    I am not sure about ResetTarget(), on some target devices, the reset does not work reliably, therefore aborting after one fail would not be good.
    Needs to be discussed if ResetTarget() aborts after multiple fails or not at all.

    (which I've seen in one Segger example returns void for some reason ..)

    They all all used to returned void. In order to not break old scripts, this still works.
    Can you point me to the example?

    Also, do the return values you posted apply to all of the Script file API functions?

    C Source Code

    1. < 0 error
    2. >= 0 O.K.

    Is the default, but does not apply for all functions.
    The documentation needs to be updated, e.g.

    C Source Code

    1. JLINK_JTAG_GetU32()
    2. // Gets 32 bits JTAG data, starting at given bit position.
    3. // Prototype
    4. int JLINK_JTAG_GetU32(int BitPos);


    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.
  • They all all used to returned void. In order to not break old scripts, this still works. Can you point me to the example?
    You can actually look into iMX7D default installation scripts, they all have void ResetTarget().. I tried modifying one to an int ResetTarget() and returning a non-good value, but saw no effect ..
  • Hi,


    the next version of the J-Link software comes with an updated documentation on the script file functions.
    New functions and the return values of all existing functions have been added to the documentation.

    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.