[ABANDONED] App does not run with J-Link connected

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

  • [ABANDONED] App does not run with J-Link connected

    [Cross posted from a recently submitted support ticket...]

    I'm developing ARM based apps for the Microchip SAME54. I'm observing that my apps won't run when the SEGGER J-Link is connected: I need to disconnect the J-Link and pulse the reset line to start the app. This works, but it's far from optimal when I'm making many rapid changes. (Note that the apps DO run under the debugger -- that's not an issue, but I need to verify the apps when NOT running under the debugger.)

    My IDE is the Microchip MPLAB.X v6.00. To verify the issue, I loaded and ran the [very simple] systick_periodic_timeout app on a SAME54 XPRO using the integral EDBG interface. It compiled, loaded and ran as expected.

    I then made two modifications to the app: reassigned the LED GPIO for our custom board and set the Connected Hardware Tool to be the SEGGER J-Link. I then tried running it on our target hardware.

    I observed the following (and repeated the experiment on two separate boards to confirm it wasn't a hardware problem):
    • Clicking on the IDE's "Run Main Project" compiled and loaded the app, but it did not run.
    • By opening J-Link Commander, I determined that the app was halted at Reset_Handler.
    • With a 'scope, I determined that the processor was NOT being held in reset (i.e. the reset line was high)
    • In J-Link Commander, if I typed "g" (go), the program started to run.
    • If I briefly pulsed the reset line (with the J-Link connected), the app stopped again at Reset_Handler.
    • If I DISCONNECTED the J-Link and pulsed the reset line, the app ran without trouble.
    I don't recall seeing this behavior before, but I did recently upgrade my J-Link Base. Perhaps that made the difference.

    As a workaround, I can disconnect the J-Link after each time I reprogram my device. But that's far from optimal since I make frequent changes. So I'm still looking for a solution.
  • Hi,

    If I am not mistaken, the SAME54 has this „reset extension“ feature which means that the chip samples SWCLK and/or SWDIO on reset release (not only reset pin release but also WDT reset etc.) and if they have a certain level, the application is not booted.
    This is some kind of fail-safe mechanism in case you flashed some bad code into the chip.

    The problem is that there is no official spec. for SWCLK / SWDIO idle state (high or low is not defined). So each probe may choose its default states.
    Moreover, it also depends on what pull resistors are on your HW and on the probe side, what pin states will be on „idle“.

    I recommend to check the SWCLK and SWDIO line states when hitting the reset button on your board and check against the manual if they would lead to a normal boot or reset extension.
    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.