[SOLVED] How to halt the CPU (ATSAML21J18B) after PowerOn until the new binary is flashed using Jlink?

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

  • [SOLVED] How to halt the CPU (ATSAML21J18B) after PowerOn until the new binary is flashed using Jlink?


    I am using the controller ATSAML21J18B in my project.
    The device is battery powered and has an application flashed and running.
    When the device is powered off and powered on again, my intention is to start with a new application instead of the existing application.

    Application-A running in the device --> Device is powered off --> Device is powered ON via Jlink and CPU is held in reset (Application-A not running)--> Application B is flashed --> Reset is released and CPU runs with Application-B.

    In ATSAML21J18B datasheet attached,in section 15.6.2. it is mentioned that "CPU Reset Extension ensures that the CPU is not executing code at startup while a debugger is connected to the system".
    But what I observe is, the application starts running immediately after I power the device via Jlink.

    Do anyone know how to achieve CPU Reset Extension immediately after powering the device via Jlink?

    Lavanya S P
  • Hello Lavanya,

    Thank you for your inquiry.
    If you are powering the target via J-Link you can create a J-Link Script file for such a setup.
    A custom connect sequence using the script file could look as follows:

    1. Power off
    2. Configure debug pins for reset extension
    3. Power on
    4. Execute Reset Extension sequence

    More information can be found in the J-Link user guide (UM08001).

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