[SOLVED] J-Link commander silently enables debug interface of EFM32.

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

  • [SOLVED] J-Link commander silently enables debug interface of EFM32.

    Hello,
    please help me understand J-Link commander behaviour. My software locks debug interface of EFM32 (DLW). When trying to connect via AtollicTRUE Studio, connection is refused as expected. But connection via J-Link commander is succesfull and it also clears the debug interface lock without prompt. It may be something with InitTarget(), but I have not found any docs. Thank You for any info!

    Best Regards
    Ondrej.

    Log:
    -------------------------------------------
    Atollic TRUE Studio Console:
    ------------------------------------
    SEGGER J-Link GDB Server V7.64b Command Line Version

    JLinkARM.dll V7.64b (DLL compiled Apr 8 2022 15:30:15)

    Command line: -port 2331 -s -CPU Cortex-M -device Cortex-M3 -endian little -speed 4000 -if swd -vd -swoport 2332
    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: off
    Silent mode: off
    Single run mode: on
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: Cortex-M3
    Target interface: SWD
    Target interface speed: 4000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V9 compiled May 7 2021 16:26:12
    Hardware: V9.30
    S/N: 59307091
    Feature(s): GDB
    Checking target voltage...
    Target voltage: 3.50 V
    Listening on TCP/IP port 2331
    Connecting to target...
    ERROR: Silicon Labs AAP detected. Device locked

    ERROR: Could not connect to target.
    Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
    Shutting down...
    Could not connect to target.
    Please check power, connection and settings.

    -------------------------------------------------------------
    J-Link.exe:
    ---------------------------------------------------------------
    SEGGER J-Link Commander V7.64b (Compiled Apr 8 2022 15:31:33)
    DLL version V7.64b, compiled Apr 8 2022 15:30:15

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled May 7 2021 16:26:12
    Hardware version: V9.30
    S/N: 59307091
    License(s): GDB
    VTref=3.590V


    Type "connect" to establish a target connection, '?' for help
    J-Link>si swd
    Selecting SWD as current target interface.
    J-Link>speed 4000
    Selecting 4000 kHz as target interface speed
    J-Link>connect
    Please specify device / core. <Default>: CORTEX-M3
    Type '?' for selection dialog
    Device>?
    Device "EFM32JG12BXXXF1024" selected.


    Connecting to target via SWD
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x412FC231. Implementer code: 0x41 (ARM)
    Found Cortex-M3 r2p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105E00D PID 000BB000 SCS
    [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [0][4]: E0040000 CID B105900D PID 003BB923 TPIU-Lite
    [0][5]: E0041000 CID B105900D PID 003BB924 ETM-M3
    Cortex-M3 identified.
    J-Link>h
    PC = 0FE100CA, CycleCnt = 0642DEE9
    R0 = 400E4088, R1 = 40042000, R2 = 40000000, R3 = 00000004
    R4 = E000ED08, R5 = 0FE081B2, R6 = 200000C4, R7 = 00100000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000
    SP(R13)= 20000818, MSP= 20000818, PSP= 00000000, R14(LR) = 0FE10079
    XPSR = A1000000: APSR = NzCvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    FPU regs: FPU not enabled / not implemented on connected CPU.
    J-Link>
  • Hi,
    Thank you for your inquiry.

    It seems like you have checked the "Do not ask again" checkbox of the "Unsecure" dialog for these devices.
    You can reset it using the following method:
    wiki.segger.com/UM08001_J-Link…#Reset_unlock_message_box
    The Registry key you would have to erase is the follwoing:
    DontShowAgainUnlockEFM32

    BR
    Fabian
    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.
  • Hello Fabian,
    thank You for answer. When looking for solution, I have already found that method. But I have no such register. I have reinstalled J-Link suite, but it is still not there. I have added register maually, both inJlink and v764b folders, but still- the dialog window is missing.
  • Hello,
    I have caught even more interesting behaviour- J-Link commmander silently unlocks only specific EFM32. If device is set as general Cortex-M3, it correctly refuses connection.
    In the example below two attempts were made- one with CORTEX-M3 and the other with EFM32GG380F1024 (Note that the difference is in InitTarget()!):

    SEGGER J-Link Commander V7.64b (Compiled Apr 8 2022 15:31:33)
    DLL version V7.64b, compiled Apr 8 2022 15:30:15

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled May 7 2021 16:26:12
    Hardware version: V9.30
    S/N: 59307091
    License(s): GDB
    VTref=3.393V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: CORTEX-M3
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    T) cJTAG
    TIF>s
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "CORTEX-M3" selected.


    Connecting to target via SWD
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: MEM-AP (IDR: 0x16E60001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Skipped. Not an AHB-AP
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: MEM-AP (IDR: 0x16E60001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Skipped. Not an AHB-AP

    ****** Error: Silicon Labs AAP detected. Device locked

    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: MEM-AP (IDR: 0x16E60001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Skipped. Not an AHB-AP
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: MEM-AP (IDR: 0x16E60001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Skipped. Not an AHB-AP

    ****** Error: Silicon Labs AAP detected. Device locked

    Cannot connect to target.
    J-Link>device=EFM32GG380F1024
    J-Link>connect
    Device "EFM32GG380F1024" selected.


    Connecting to target via SWD
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x412FC231. Implementer code: 0x41 (ARM)
    Found Cortex-M3 r2p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105E00D PID 000BB000 SCS
    [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [0][4]: E0040000 CID B105900D PID 003BB923 TPIU-Lite
    [0][5]: E0041000 CID B105900D PID 003BB924 ETM-M3
    Cortex-M3 identified.
    J-Link>mem8 0x00 0x10
    00000000 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    J-Link>

    The post was edited 1 time, last by Ondrej Pokorny ().

  • Hi,
    I checked again.
    You are absolutely correct.
    The connect sequence is executed on the J-Link directly to apply to some timing requirements.

    This will always unlock the device, as communication with the user would not work under these circumstances.
    However, there is no other option to connect to the device but mass erasing it to lift the security.
    There are only 3 options:
    1) Not connecting to the device and not debugging it.
    2) Connect to the device which triggers a mass erase.
    3) Skip the locking of the device in your application when in debug configuration.

    Best regards,
    Fabian
    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.
  • Hello Fabian and thank You for answer.

    1) As for silent unlocking:
    If we want to avoid unlocking, we would set device to CORTEX-M3.
    Is then debugging of UNLOCKED firmware identical with device=EFM32GG... and device=CORTEX-M3?

    2) As for missing value in registry, which should control the window with unlock prompt, do You have any idea, what is wrong?

    Thank You
    Best Regards
    Ondrej
  • Hi Ondrej,
    Regarding 1):
    As long as the device is locked, debugging will be impossible, as the debugging features are turned off and the core is not reachable.
    If you want to debug the device, I would suggest option 3) of my last mail.
    This is why you cannot connect with "Cortex-M3" selected. The J-Links detects a SiLabs locking feature and stops the connect,
    because the connect can not succeed anyway:

    Ondrej Pokorny wrote:

    ****** Error: Silicon Labs AAP detected. Device locked
    Regarding 2):
    Sorry for not being clear enough:
    Due to some time critical behavior, there is no Dialog created.
    Thus there is also no registry key that could be found as it never is created.

    TL;DR:
    The behavior you experience is expected.

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