[SOLVED] Target device stops working with jlink commander script

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

  • [SOLVED] Target device stops working with jlink commander script

    Hello,
    I am using SAM ICE debugger in Jlink SWD interface to connect with SAML21J18 xplained pro board,
    I want to read a particular memory address of the RAM of the target device (SAML21) using Jlink SWD.
    I use a commandscript command.jlink with the following commands

    device ATSAML21J18B
    speed 4000
    if SWD
    mem 0x20007FFF 1

    I face a problem When I pass the command file to jlink.exe, the target device goes to an unknown state.
    This problem exists only when the commands "mem 0x20007FFF 1" or "w1 0x20007FFF 1" ( commands to read/write memory address) are used.

    I don't face the same when I manually type the command in jlink.exe

    Is there a reason for this behavior? Please let me know how to read / write a memory address (RAM) of the target device with commander script
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    We tried to reproduce the described issue with the sequence you mentioned.
    J-Link software used V6.32e, board: SAML21 X Plained Pro

    Commandscript used is attached as well as Commander output.
    As you can see everything was working correctly.

    Are you using custom hardware or an eval board?
    Could you provide a screenshot of a Commander session?
    Could you also provide a J-Link log file of the failed session?
    wiki.segger.com/Enable_J-Link_log_file

    Best regards,
    Nino
    Images
    • Capture.PNG

      34.65 kB, 677×630, viewed 21 times
    Files
    • test.jlink

      (57 Byte, downloaded 23 times, last: )
    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 contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • Hi Nino, Thanks for the reply,

    We are using a SAML21 xplained pro hardware kit from ATMEL.
    The following is the commander session, I have highlighted the difference between your commander session and mine. Can you please let me know why the 'secure' issue occurs,

    What do I need to do to read the memory without causing a reset or mass erase?
    Images
    • CommanderSession.JPG

      132.77 kB, 1,085×717, viewed 21 times
    Files
  • Hello,

    Thank you for providing the log and screenshot.
    It seems that the SAM device is detected as secured. Under windows you usually get a prompt asking how to proceed.
    Under Linux and Mac the device will simply be unsecured.
    There have been some improvements in that regard in the newer J-Link software versions. We recommend using the latest version.
    Should you get no pop up under Windows then you have selected "don't ask again" at some point. How to reset this value is explained here: wiki.segger.com/Secured_ST_device_detected
    More information about SAM device securing can be found here: wiki.segger.com/ATSAM_Device_Series


    Rohitvv wrote:

    What do I need to do to read the memory without causing a reset or mass erase?
    You can't. Once the device is secured the debug interface is blocked. For J-Link to be able to access device again after securing it a mass erase must be executed.

    Best regards,

    Nino
    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 contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • Hi Nino,

    Thanks for the reply,

    I believe the device is detected as secured as our SAM device is in sleep mode when I access it via Jlink.
    I see this message and issue only when I access the SAM device when it is in sleep mode.
    Is this behavior known?

    We are in need to connect and read the memory of the target which is in sleep mode,
    While doing so we do not want the target to be reset as we are reading the RAM memory.
    Is there any way or possibility to do so?
  • Hello,

    Thank you for clarifying.
    How sleep modes work is target device dependent.
    J-Link can access most target devices while in sleep but only if the debug interface is not disabled.
    If your target device has different sleep modes we recommend selecting one that keeps the debug interface clocked/enabled.

    Best regards,
    Nino
    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 contact us per e-mail.
    The following contact form can be used for this: Contact Us