Skip to content

Programming/Erasing Failed #248

@CLX102030

Description

@CLX102030

Using Faraday encrypted files of other brands' ic.elf, they can be erased and programmed normally in jlink jflash. Using pylink.erase() cannot erase them, resulting in an error when calling jlink.flash_file().

jlink.flash_file() return 0

After calling jlink.erase(), it returns 0, but the flash is not actually erased.

    jlink = pylink.JLink()
    
    jlink.open()  

  
    if not jlink.set_tif(JLinkInterfaces.SWD):
        raise RuntimeError(" SWD")

    # jlink.reset(ms=100) 
    # time.sleep(0.2)
    

    jlink.set_speed(1000) 

    jlink.connect(chip_name=CHIP_NAME, verbose=True)



    jlink.reset(ms=200) 
    jlink.halt()
    time.sleep(2)

    erase_result = jlink.erase()  
    print(erase_result )

jflash log:

Application log started

  • J-Flash V8.76 (J-Flash compiled Oct 8 2025 11:35:29)
  • JLinkARM.dll V8.76 (DLL compiled Oct 8 2025 11:35:03)
    Reading flash device list [C:\Program Files\SEGGER\JLink_V876\ETC/JFlash/Flash.csv] ...
  • List of flash devices read successfully (451 Devices)
    Reading MCU device list ...
  • List of MCU devices read successfully (13244 Devices)
    Creating new project ...
  • New project created successfully
    Connecting ...
  • Connecting via USB to probe/ programmer device 0
  • Probe/ Programmer firmware: J-Link Pro V4 V11 PLUS Mar compiled 12 2025 10:34:01
  • Probe/ Programmer S/N: 250710373
  • Device "xxxxxx20" selected.
  • Target interface speed: 4000 kHz (Fixed)
  • VTarget = 3.303V
  • Found SW-DP with ID 0x0BB11477
  • DPIDR: 0x0BB11477
  • 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: 0x04770021, ADDR: 0x00000000)
  • Iterating through AP map to find AHB-AP to use
  • AP[0]: Core found
  • AP[0]: AHB-AP ROM base: 0xE00FF000
  • CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
  • Found Cortex-M0 r0p0, Little endian.
  • Cortex-M: The connected J-Link (S/N 250710373) uses an old firmware module: V1 (current is 3)
  • FPUnit: 4 code (BP) slots and 0 literal slots
  • CoreSight components:
  • ROMTbl[0] @ E00FF000
  • [0][0]: E000E000 CID B105E00D PID 000BB008 SCS
  • [0][1]: E0001000 CID B105E00D PID 000BB00A DWT
  • [0][2]: E0002000 CID B105E00D PID 000BB00B FPB
  • Executing init sequence ...
  • Initialized successfully
  • Target interface speed: 4000 kHz (Fixed)
  • Found 1 JTAG device. Core ID: 0x0BB11477 (None)
  • Connected successfully
    Erasing selected sectors ...
  • 128 of 128 sectors selected, 1 range, 0x0 - 0xFFFF
  • Start of determining flash info (Bank 0 @ 0x00000000)
  • End of determining flash info
  • Flash bank info:
  • 128 * 512 bytes @ 0x00000000
  • Start of preparing flash programming
  • CPU could not be halted
  • ERROR: Failed to measure CPU clock frequency
  • End of preparing flash programming
  • Start of restoring
  • End of restoring
  • ERROR: Failed to erase sectors
    Disconnecting ...
  • Disconnected
    Erasing selected sectors ...
  • Connecting ...
  • Connected successfully
  • 128 of 128 sectors selected, 1 range, 0x0 - 0xFFFF
  • Start of determining flash info (Bank 0 @ 0x00000000)
  • End of determining flash info
  • Flash bank info:
  • 128 * 512 bytes @ 0x00000000
  • 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 21404 kHz.
  • Start of erasing sectors
  • Blank checking 0x00000000 - 0x0000FFFF
  • Erasing range 0x00000000 - 0x0000FFFF (128 Sectors, 64 KB)
  • End of erasing sectors
  • Start of restoring
  • End of restoring
  • Erase operation completed successfully - Completed after 1.119 sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions