Could not erase chip RA6M3G

Hello, @supporter.

I am working on an RA6M3G device.

I tried to erase the chip using J-Flash Lite V7.92c but was unsuccessful.

I used Jlink Commander V7.92c but still failed.

Here log: 

SEGGER J-Link Commander V7.92c (Compiled Aug 30 2023 15:00:03)
DLL version V7.92c, compiled Aug 30 2023 14:58:23

Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-S124 compiled Jun 20 2023 17:09:11
Hardware version: V1.00
J-Link uptime (since boot): 0d 00h 06m 55s
S/N: 831334275
USB speed mode: Full speed (12 MBit/s)
VTref=3.300V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: R7FA6M3AH
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 "R7FA6M3AH" selected.


Connecting to target via SWD
InitTarget() start
Identifying target device...
SWD selected. Executing JTAG -> SWD switching sequence...
Initializing DAP...
DAP initialized successfully.
InitTarget() end - Took 11.2ms
Found SW-DP with ID 0x5BA02477
DPIDR: 0x5BA02477
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]: APB-AP (IDR: 0x44770002)
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]: E0042000 CID B105900D PID 002BB908 CSTF
[0][7]: E0043000 CID B105900D PID 001BB961 TMC
[0][8]: E0044000 CID B105F00D PID 001BB101 TSG
Memory zones:
  Zone: "Default" Description: Default access mode
Cortex-M4 identified.
J-Link>erase
No address range specified, 'Erase Chip' will be executed
'erase': Performing implicit reset & halt of MCU.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
T-bit of XPSR is 0 but should be 1. Changed to 1.
T-bit of XPSR is 0 but should be 1. Changed to 1.
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"

****** Error: Timeout while erasing sectors, RAMCode did not respond in time (PC = 0x1FFE040A, XPSR = 0x41000000, SP = 0x1FFE08C0)!
Failed to erase sectors.

J-Link: Flash download: Total time needed: 10.220s (Prepare: 0.161s, Compare: 0.000s, Erase: 10.006s, Program: 0.000s, Verify: 0.000s, Restore: 0.052s)
ERROR: Erase returned with error code -5.
J-Link>

Could you please help me check it and give me the solution?

Thank you.

Parents Reply Children
  • Hello,

    If you have written data in Option Settinh Memory 0x400 in code flash, the only way to recover the flash is by trying the attached jlink script to erase the first block of code flash( as the Security MPU be enabled). If that doesn't work the device may be not recoverable.

    2260.RA6M3_Erase_Block_0.zip

    Regards

  • Hello, 

    This is log:

    SEGGER J-Link Commander V7.82d (Compiled Nov 23 2022 16:10:38)link -CommanderScript RA6M3_Block_0_Erase.jlink
    DLL version V7.82d, compiled Nov 23 2022 16:09:10


    J-Link Command File read successfully.
    Processing script file...
    J-Link>Device R7FA6M3AH
    J-Link connection not established yet but required for command.
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-S124 compiled Jun 20 2023 17:09:11
    Hardware version: V1.00
    J-Link uptime (since boot): 0d 00h 27m 21s
    S/N: 831334275
    USB speed mode: Full speed (12 MBit/s)
    VTref=3.300V
    J-Link>si SWD
    Selecting SWD as current target interface.
    J-Link>speed 4000
    Selecting 4000 kHz as target interface speed
    J-Link>connect
    Device "R7FA6M3AH" selected.


    Connecting to target via SWD
    Found SW-DP with ID 0x5BA02477
    Found SW-DP with ID 0x5BA02477
    DPIDR: 0x5BA02477
    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]: APB-AP (IDR: 0x44770002)
    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]: E0042000 CID B105900D PID 002BB908 CSTF
    [0][7]: E0043000 CID B105900D PID 001BB961 TMC
    [0][8]: E0044000 CID B105F00D PID 001BB101 TSG
    Cortex-M4 identified.
    J-Link>rsettype 0
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    J-Link>r
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    T-bit of XPSR is 0 but should be 1. Changed to 1.
    J-Link>h
    PC = F44F6210, CycleCnt = 00000000
    R0 = DFFE997D, R1 = BF79F66B, R2 = 78148615, R3 = 7C9EE779
    R4 = 6F9E5E0B, R5 = B1BFF157, R6 = 694EB6E7, R7 = C7FBD8F7
    R8 = EAE76113, R9 = EB3A4E3E, R10= 8BDD35E7, R11= 5D4BBDBC
    R12= FDFE675B
    SP(R13)= EA412100, MSP= EA412100, PSP= EEA1BC3C, R14(LR) = FFFFFFFF
    XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00

    FPS0 = F4A59958, FPS1 = F1F0919A, FPS2 = 739D2079, FPS3 = 29EA7E89
    FPS4 = B2F517B4, FPS5 = 276E3839, FPS6 = 93FE8E41, FPS7 = BAB8F621
    FPS8 = EA6BFBB9, FPS9 = BEFEB612, FPS10= 71FB7FD7, FPS11= 8D18043E
    FPS12= E25BB1DA, FPS13= 6A7AF33D, FPS14= FFFF7EBE, FPS15= F17F57E1
    FPS16= 7263FE7C, FPS17= 0A8DFDC5, FPS18= 557137D9, FPS19= B32BEFD9
    FPS20= 2D3C5AFC, FPS21= DBAED1EC, FPS22= F323C96F, FPS23= 4C7A62D9
    FPS24= 3EFEF03D, FPS25= 22CACCBF, FPS26= F9FBCA4D, FPS27= 93DBEA3C
    FPS28= B0ECFC11, FPS29= C3D5E9FE, FPS30= 6ABF2DDC, FPS31= F23BAE81
    FPSCR= 00000000
    J-Link>sleep 100
    Sleep(100)
    J-Link>w2 0x4001e3fe, 0xa50B
    Writing A50B -> 4001E3FE
    J-Link>w4 0x4001e020, 0x11011221
    Writing 11011221 -> 4001E020
    J-Link>w1 0x4001E416, 0x01
    Writing 01 -> 4001E416
    J-Link>w2 0x407fe08c, 0x2d01
    Writing 2D01 -> 407FE08C
    J-Link>sleep 10
    Sleep(10)
    J-Link>w2 0x407fe08c, 0x2d00
    Writing 2D00 -> 407FE08C
    J-Link>sleep 10
    Sleep(10)
    J-Link>w2 0x407FE0E4, 0x1E04
    Writing 1E04 -> 407FE0E4
    J-Link>w2 0x407FE084, 0xAA01
    Writing AA01 -> 407FE084
    J-Link>w4 0x407FE030, 0x00000000
    Writing 00000000 -> 407FE030
    J-Link>w1 0x407E0000, 0x20
    Writing 20 -> 407E0000
    J-Link>w1 0x407E0000, 0xD0
    Writing D0 -> 407E0000
    J-Link>mem32 0x407FE080, 1
    407FE080 = 00000000
    J-Link>sleep 1000
    Sleep(1000)
    J-Link>mem32 0x407FE080, 1
    407FE080 = 00000000
    J-Link>w2 0x407FE084, 0xAA00
    Writing AA00 -> 407FE084

    Script processing completed.

    Type "connect" to establish a target connection, '?' for help
    J-Link>

    => I reset the board and re-debug again but did not success Disappointed

  • Hello,

    Can you recall the sequence of operation  that you used to flash you MCU the first time? Maybe this will help to understand what have happened.

    Also, please check carefully the causes 1,2,3 Maybe, your usb cable or your power supply is the reason.

    Regards,

    AL_Renesas

  • Hello,

    About the sequence of operation, I flash on MCU the first time,

    I ran the unity test r_usbx_port project.

  • When I erase the chip.

    I think it failed when erasing the range 0x010A150 + 32Byte.

    This range is 

  • Can you connect with J-Link commander and read AWS register:

    >mem32 0x0100A164 1

  • Hello,

    At the screenshot that you sent with Segger J-link to flash download, the process is stuck for long time or just 1-2 seconds?

    Also, on the J-Flash Lite V7.92c, do you see the same error  as your initial screenshot or something else?

  • Hello,

    At the screenshot that you sent with Segger J-link to flash download, the process is stuck for long time or just 1-2 seconds? 

      The process is stuck for just 1-2 seconds.

    > On the J-Flash Lite V7.92c, do you see the same error as your initial screenshot or something else?

      I see the same error.

    Thank you