[SOLVED] Can't connect Jlink to STM32WL55RG after upgrade to FUS v1.2

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

  • [SOLVED] Can't connect Jlink to STM32WL55RG after upgrade to FUS v1.2

    Hello all,

    I'm working on NUCLEO-WL55RG, that I upgraded to FUS v1.2 and stack (from ST SDK stm32cubewb_v1-14-0) using STM32CubeProgrammer.

    After upgrade it is possible to connect target in boot-loader mode (boot0 = 1) as described in (wiki.segger.com/ST_STM32WB). But it is not possible to connect target using JLink Probe (JLinkExe or Ozone) in normal/application mode (boot0 = 0). This means JLink probe can't be used for application debugging. When STM32CubeIDE is used then application on target can be debugged (code stepped) even in normal/application mode (boot = 1).

    Please see JLinkExe logs below.

    My questions:
    - Is it an issue between JLinkExe and FUS v1.2?
    - Can It be patched somehow?
    - Was JLinkExe working with FUS v1.1?

    #
    #
    # NUCLEO_WB55RG (in boot-loader mode / boot0 = 1)
    #
    #

    /opt/SEGGER/JLink_Linux_V766g_x86_64/JLinkExe -device STM32WB55RG -if SWD -speed 4000 -autoconnect 1
    SEGGER J-Link Commander V7.66g (Compiled Jul 7 2022 10:40:16)
    DLL version V7.66g, compiled Jul 7 2022 10:40:01

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Nov 2 2021 12:14:50
    Hardware version: V10.10
    S/N: 600107460
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=3.348V
    Device "STM32WB55RG" selected.


    Connecting to target via SWD
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: AHB-AP (IDR: 0x84770001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [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 000BB9A1 TPIU
    [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [0][6]: E0043000 CID B105900D PID 005BB906 CTI
    Cortex-M4 identified.
    J-Link>mem32 0x1FFF8000 0x20
    1FFF8000 = 3DFFF1AA C2000E55 000001FF FFFFFE00
    1FFF8010 = 80000000 7FFFFFFF 000000FF FFFFFF00
    1FFF8020 = 000000FF FFFFFF00 000001FF FFFFFE00
    1FFF8030 = 00000000 FFFFFFFF FFFFFFFF FFFFFFFF
    1FFF8040 = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1FFF8050 = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1FFF8060 = FFFFFFFF FFFFFFFF FFFFC000 00003FFF
    1FFF8070 = 000010CF FFFFEF30 9E2B3C00 61D4C3FF
    J-Link>mem32 0x08000000 0x20
    08000000 = 20030000 08002E01 08001EF1 08001EFF
    08000010 = 08001F05 08001F0B 08001F11 00000000
    08000020 = 00000000 00000000 00000000 08001F17
    08000030 = 08001F25 00000000 08001F33 08001F41
    08000040 = 08002E55 08002E55 08002E55 08001F4D
    08000050 = 08002E55 08002E55 08001FDB 08001FE9
    08000060 = 08002E55 08002E55 08001FCD 08002E55
    08000070 = 08002E55 08002E55 08001F59 08002E55
    J-Link>



    #
    #
    # NUCLEO_WB55RG (in normal mode / boot0 = 0)
    #
    #

    /opt/SEGGER/JLink_Linux_V766g_x86_64/JLinkExe -device STM32WB55RG -if SWD -speed 4000 -autoconnect 1
    SEGGER J-Link Commander V7.66g (Compiled Jul 7 2022 10:40:16)
    DLL version V7.66g, compiled Jul 7 2022 10:40:01

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Nov 2 2021 12:14:50
    Hardware version: V10.10
    S/N: 600107460
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=3.348V
    Device "STM32WB55RG" selected.


    Connecting to target via SWD
    Found SW-DP with ID 0x6BA02477
    Failed to power up DAP
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: AHB-AP (IDR: 0x84770001)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 0 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    Cortex-M4 identified.
    J-Link>mem32 0x1FFF8000 0x20
    Could not read memory.
    J-Link>mem32 0x08000000 0x20
    Could not read memory.
    J-Link>

    [/quote]
  • I received excelled support from Segger via other channel. Results:
    • My observation was misleading. Issue is not FUS but in application firmware I had flashed on device (ST' example Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex)
      • This example disables SWD debugger support in runtime.
        • Enable CFG_DEBUGGER_SUPPORTED=1 in app_conf.h h to keep debugger working.
    • STM32CubeIDE overrides this (partially) by connection under reset.



    Following sequence process connect-under-reset using JLinkExe:

    # Launch JLink commander
    JLinkExe -device STM32WB55RG -if SWD -speed 4000 -nogui 1


    # JLink Commander Commands:

    # Force device reset
    r0

    # Connect to device
    connect

    # Device is connected but firmware was already launched.
    # Force device to reset again.
    r0

    # Call normal reset which ends by halting device
    RSetType 0
    r

    # Following commands now works :)
    mem32 0x08000000 0x20
    h
    erase 0x08000000 0x080CF000




    # The 'erase' command without argument returns error as it tries to erase protected area of stack and FUS.