[SOLVED] Jlink fail to erase external flash.

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

  • [SOLVED] Jlink fail to erase external flash.

    Hi, I want to know how to erase external flash via Jlink or Jflash.
    I have a custom board with an STM32H750IB processor and Micron 64MB(MT25QL512) external Nor flash.The Nor flash connect to the processor by QSPI interface.
    When i erase the custom board flash,only internal flash on STM32H750IB erase ok,external Nor flash erase fail.

    =============================================================================================================================================
    log by Jlink.exe

    SEGGER J-Link Commander V6.82c (Compiled Jul 31 2020 17:37:56)
    DLL version V6.82c, compiled Jul 31 2020 17:36:49

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled Jun 2 2222 22:22:22
    Hardware version: V9.40
    S/N: 81480416
    License(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
    VTref=3.248V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: STM32H750IB
    Type '?' for selection dialog
    Device>STM32H750IB
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    T) cJTAG
    TIF>J
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>-1,-1
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>4000
    Device "STM32H750IB" selected.

    Connecting to target via JTAG
    TotalIRLen = 9, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x6BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x06450041, IRLen: 05, Unknown device
    TotalIRLen = 9, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x6BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x06450041, IRLen: 05, Unknown device
    Unknown DP version. Assuming DPv0
    Scanning AP map to find all available APs
    AP[3]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x84770001)
    AP[1]: AHB-AP (IDR: 0x84770001)
    AP[2]: APB-AP (IDR: 0x54770002)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FE000
    CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
    Found Cortex-M7 r1p1, Little endian.
    FPUnit: 8 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FE000
    ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
    ROMTbl[1] @ E00FF000
    ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
    ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
    ROMTbl[1][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
    ROMTbl[0][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
    ROMTbl[0][2]: E0043000, CID: B105900D, PID: 004BB906 CTI
    Cache: Separate I- and D-cache.
    I-Cache L1: 16 KB, 256 Sets, 32 Bytes/Line, 2-Way
    D-Cache L1: 16 KB, 128 Sets, 32 Bytes/Line, 4-Way
    Cortex-M7 identified.

    Erasing device...
    J-Link: Flash download: Only internal flash banks will be erased.
    To enable erasing of other flash banks like QSPI or CFI, it needs to be enabled via "exec EnableEraseAllFlashBanks"
    J-Link: Flash download: Total time needed: 5.327s (Prepare: 0.243s, Compare: 0.000s, Erase: 5.078s, Program: 0.000s, Verify: 0.000s, Restore: 0.005s)
    Erasing done.
    J-Link>
    Unknown command. '?' for help.
    J-Link>exec EnableEraseAllFlashBanks
    J-Link>erase
    Erasing device...
    J-Link: Flash download: Total time needed: 5.124s (Prepare: 0.078s, Compare: 0.000s, Erase: 5.020s, Program: 0.000s, Verify: 0.000s, Restore: 0.025s)
    J-Link: Flash download: Total time needed: 0.172s (Prepare: 0.107s, Compare: 0.000s, Erase: 0.064s, Program: 0.000s, Verify: 0.000s, Restore: 0.000s)

    ****** Error: Failed to erase sectors.

    ERROR: Erase returned with error code -5.
    =============================================================================================================================================
    Settings on jflash at attachments.

    log by jflash

    Application log started
    - J-Flash V6.82c (J-Flash compiled Jul 31 2020 17:37:19)
    - JLinkARM.dll V6.82c (DLL compiled Jul 31 2020 17:36:49)
    Reading flash device list [C:\Program Files (x86)\SEGGER\JLink\ETC/JFlash/Flash.csv] ...
    - List of flash devices read successfully (451 Devices)
    Reading MCU device list ...
    - List of MCU devices read successfully (7837 Devices)
    Creating new project ...
    - New project created successfully
    Connecting ...
    - Connecting via USB to probe/ programmer device 0
    - Probe/ Programmer firmware: J-Link V9 compiled Jun 2 2222 22:22:22
    - Device "STM32H750IB" selected.
    - Target interface speed: 4000 kHz (Fixed)
    - VTarget = 3.192V
    - TotalIRLen = 9, IRPrint = 0x0011
    - JTAG chain detection found 2 devices:
    - #0 Id: 0x6BA00477, IRLen: 04, CoreSight JTAG-DP
    - #1 Id: 0x06450041, IRLen: 05, Unknown device
    - TotalIRLen = 9, IRPrint = 0x0011
    - JTAG chain detection found 2 devices:
    - #0 Id: 0x6BA00477, IRLen: 04, CoreSight JTAG-DP
    - #1 Id: 0x06450041, IRLen: 05, Unknown device
    - Unknown DP version. Assuming DPv0
    - Scanning AP map to find all available APs
    - AP[3]: Stopped AP scan as end of AP map has been reached
    - AP[0]: AHB-AP (IDR: 0x84770001)
    - AP[1]: AHB-AP (IDR: 0x84770001)
    - AP[2]: APB-AP (IDR: 0x54770002)
    - Iterating through AP map to find AHB-AP to use
    - AP[0]: Core found
    - AP[0]: AHB-AP ROM base: 0xE00FE000
    - CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
    - Found Cortex-M7 r1p1, Little endian.
    - FPUnit: 8 code (BP) slots and 0 literal slots
    - CoreSight components:
    - ROMTbl[0] @ E00FE000
    - ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
    - ROMTbl[1] @ E00FF000
    - ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    - ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
    - ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
    - ROMTbl[1][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
    - ROMTbl[0][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
    - ROMTbl[0][2]: E0043000, CID: B105900D, PID: 004BB906 CTI
    - Cache: Separate I- and D-cache.

    - I-Cache L1: 16 KB, 256 Sets, 32 Bytes/Line, 2-Way
    - D-Cache L1: 16 KB, 128 Sets, 32 Bytes/Line, 4-Way
    - Executing init sequence ...
    - Initialized successfully
    - Target interface speed: 4000 kHz (Fixed)
    - CPU clock frequency: 64276 kHz (Auto detected)
    - Found 2 JTAG devices. Core ID: 0x6BA00477 (None)
    - Connected successfully
    Erasing selected sectors ...
    - 1025 of 1025 sectors selected, 2 ranges, 0x8000000 - 0x801FFFF, 0x90000000 - 0x93FFFFFF
    - Start of preparing flash programming
    - End of preparing flash programming
    - Start of determining dirty areas in flash cache
    - End of determining dirty areas
    - CPU is running at 185000 kHz.
    - Start of erasing sectors
    - Blank checking 0x08000000 - 0x0801FFFF
    - End of erasing sectors
    - Start of restoring
    - End of restoring
    - Start of determining flash info (Bank 1 @ 0x90000000)
    - End of determining flash info
    - Flash bank info:
    - 1024 * 64 KB @ 0x90000000
    - Start of preparing flash programming
    - End of preparing flash programming
    - Start of determining dirty areas in flash cache
    - End of determining dirty areas
    - CPU speed could not be measured.
    - Start of erasing sectors
    - Erasing range 0x90000000 - 0x9001FFFF ( 2 Sectors, 128 KB)
    - ERROR: Failed to erase sectors.
    - End of erasing sectors
    - ERROR: Erase failed
    - Start of restoring
    - End of restoring
    - ERROR: Failed to erase sectors
    Disconnecting ...
    - Disconnected
    =============================================================================================================================================

    I want to know how to erase external flash via Jlink or Jflash.
    Thanks for your attention.
    Images
    • settings_1.png

      105.12 kB, 1,920×1,080, viewed 27 times
    • settings_2.png

      110.74 kB, 1,920×1,080, viewed 25 times
  • Hi,
    Thank you for your inquiry.

    Unfortunately you are not using a genuine J-Link, but a clone.
    Please note that this is illegal, and we advise you to buy a proper J-Link to prevent any legal issues:
    segger.com/products/debug-probes/j-link/

    Since such a thing is also against our forum rules, we will close this thread now.

    Best regards,
    Fabian
    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 you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.