"Ef(34): Timed-out initializing flash" when trying to programm flash memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Ef(34): Timed-out initializing flash" when trying to programm flash memory

Jump to solution
5,149 Views
arturmiller
Contributor II

Hi,

I flashed the LPC4078 MCU with a code which (most probably) improperly setting the clocking, and the flash is no longer programmable. I can connect to the target (Attach only = True), I can execute it step by step in the debug session, I can access all the registers, change their values, but I cannot program the flash anymore. 

The bad thing is that the MCU is in the BGA package and the P2.10 pin is not connected and not accessible.

If there is no software way to fix this problem I can replace the crystal with the one I programmed but I would like to avoid it (tiny SMD piece)

I thought the JTAG interface can take over the CPU and keep it from running the user code totally, so the reprogramming should be fairly easy, but it doesn't seem to be the case?

Here is the debugger log:

Ns: MCUXpresso RedlinkMulti Driver v10.0 (Jun 22 2017 23:31:55 - crt_emu_cm_redlink.exe build 272)
Pc: ( 0) Reading remote configuration
Wc(03). No cache support.
Pc: ( 5) Remote configuration complete
Nc: Reconnected to existing redlink server (PID 4294967295)
Nc: Connecting to probe 1 core 0 (server PID unknown) gave 'OK'
Nc: Probe Firmware: LPC-LINK2 CMSIS-DAP V5.182 (NXP Semiconductors)
Nc: Serial Number: I3FUFTIW
Nc: VID:PID: 1FC9:0090
Nc: USB Path: \\?\hid#vid_1fc9&pid_0090&mi_00#8&318c6fd0&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Pc: ( 30) Emulator Connected
Pc: ( 40) No Halt
Pc: ( 50) CPU ID
Nc: number of h/w breakpoints = 6
Nc: number of flash patches = 2
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Nc: Inspected v.2 On-chip Flash Memory LPC177x_8x_407x_8x_512.cfx
Nc: Image 'LPC177x_8x_407x_8x (512K) Jun 22 2017 15:17:57'
Nc: NXP: LPC4078
Pc: ( 65) Chip Setup Complete
Nt: Connected: was_reset=false. was_stopped=false
Cr:v MCUXpresso Free License - Downloads unlimited
Pc: ( 70) License Check Complete
Nc: Opening flash driver LPC177x_8x_407x_8x_512.cfx
Nc: Sending VECTRESET to run flash driver
Nc: AFTER driver startup timeout
Wc: Driver Addresses
Wc: Start: 10000000
Wc: Entry: 10000035
Wc: End: 100003DC
Wc: Stack: 100005E0
Wc: Mailbox:100025E0
Wc: Driver Register State
Wc: R0: 100025E0
Wc: R1: 00000000
Wc: R2: 00000001
Wc: R3: C8C30080
Wc: R4: 100025E0
Wc: R5: 00000000
Wc: R6: 00002EE0
Wc: R7: 100005AC
Wc: R8: 00000000
Wc: R9: 00000000
Wc: R10: 00000000
Wc: R11: 00000000
Wc: R12: 00000000
Wc: SP: 100005AC
Wc: LR: FFFFFFF9 (exception from main thread)
Wc: PC: 0000022C
Wc: xPSR: 01000003
Wc: MSP: 100005AC
Wc: PSP: 100005E0
Wc: CFBP: 00000001 (CONTROL=0x0, FAULTMASK=0x0, BASEPRI=0x0, PRIMASK=0x1)
Wc:Stacked Exception information
Wc:100005C8: xPSR: 100000EE
Wc:100005C4: VECTPC: 1000003D
Wc:100005C0: LR: 00000000
Wc:100005BC: R12: C8C30080
Wc:100005B8: R3: 00000001
Wc:100005B4: R2: 00000000
Wc:100005B0: R1: 100025E0
Wc:100005AC: R0: 00000000
Wc:Exception registers
Wc:E000ED04: ICSR: 00400803 (ISRPEND, VECTPEND=0(none), RETTOBASE, VECTACTIVE=3(hard fault))
Wc:E000ED08: VTOR: 00000000 TBLBASE=0(INCODE), TBLOFF=0x0
Wc:E000ED28: MMFSR: 00
Wc:E000ED29: BFSR: 82 (BFARVALID, PRECISERR)
Wc:E000ED2A: UFSR: 0000
Wc:E000ED2C: HFSR: 40000000 (FORCED)
Wc:E000ED30: DFSR: 00000001 (HALTED)
Wc:E000ED3C: AFSR: 00000000
Wc:E000ED24: SHCSR: 00000000
Wc:E000ED34: MMAR: C8C30108
Wc:E000ED38: BFAR: C8C30108
Wc:E000EDFC: DEMCR: 01000000 (TRCENA)
Nc: Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.
Ed:04: Failed to erase flash: Ef(34): Timed-out initializing flash.
Pc: (100) Target Connection Failed

Labels (1)
0 Kudos
Reply
1 Solution
4,552 Views
arturmiller
Contributor II

I have managed to answer the question myself. Thank you, whoever got the idea for this switch, for the  "--rst" option.

Using the command line flasher (here the --rst option does the job) I erased the flash without running the user code:

C:\nxp\MCUXpressoIDE_10.0.2_411\ide\bin>crt_emu_cm_redlink.exe --flash-erase --rst -pLPC4078
Ns: MCUXpresso RedlinkMulti Driver v10.0 (Jun 22 2017 23:31:55 - crt_emu_cm_redlink.exe build 272)
Wc(03). No cache support.
Nc: Probe Firmware: LPC-LINK2 CMSIS-DAP V5.182 (NXP Semiconductors)
Nc: Serial Number: I3FUFTIW
Nc: VID:PID: 1FC9:0090
Nc: USB Path: \\?\hid#vid_1fc9&pid_0090&mi_00#8&318c6fd0&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: number of h/w breakpoints = 6
Nc: number of flash patches = 2
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Nc: Inspected v.2 On-chip Flash Memory LPC177x_8x_407x_8x_512.cfx
Nc: Image 'LPC177x_8x_407x_8x (512K) Jun 22 2017 15:17:57'
Nc: NXP: LPC4078
Cr:v MCUXpresso Free License - Downloads unlimited
Nt: Reset target (system)
Nc: Opening flash driver LPC177x_8x_407x_8x_512.cfx
Nc: Sending SYSRESETREQ to run flash driver
Nt: Erase flash at 0x0
Nc: Closing flash driver LPC177x_8x_407x_8x_512.cfx
Nt: Erase completed (in 106ms)
Nc: error closing down debug session - Nn(05). Wire ACK Fault in DAP access

Now the board is up and running again. 

View solution in original post

0 Kudos
Reply
2 Replies
3,110 Views
MNoman
Contributor I

After spending approximately four days on it, I managed to resolve the issue by updating the SDK to at least version 2.6.3 and installing the latest version of MCUXpress IDE. I recommend trying the SDK examples first to verify if the issue has been successfully resolved...

0 Kudos
Reply
4,553 Views
arturmiller
Contributor II

I have managed to answer the question myself. Thank you, whoever got the idea for this switch, for the  "--rst" option.

Using the command line flasher (here the --rst option does the job) I erased the flash without running the user code:

C:\nxp\MCUXpressoIDE_10.0.2_411\ide\bin>crt_emu_cm_redlink.exe --flash-erase --rst -pLPC4078
Ns: MCUXpresso RedlinkMulti Driver v10.0 (Jun 22 2017 23:31:55 - crt_emu_cm_redlink.exe build 272)
Wc(03). No cache support.
Nc: Probe Firmware: LPC-LINK2 CMSIS-DAP V5.182 (NXP Semiconductors)
Nc: Serial Number: I3FUFTIW
Nc: VID:PID: 1FC9:0090
Nc: USB Path: \\?\hid#vid_1fc9&pid_0090&mi_00#8&318c6fd0&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: number of h/w breakpoints = 6
Nc: number of flash patches = 2
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Nc: Inspected v.2 On-chip Flash Memory LPC177x_8x_407x_8x_512.cfx
Nc: Image 'LPC177x_8x_407x_8x (512K) Jun 22 2017 15:17:57'
Nc: NXP: LPC4078
Cr:v MCUXpresso Free License - Downloads unlimited
Nt: Reset target (system)
Nc: Opening flash driver LPC177x_8x_407x_8x_512.cfx
Nc: Sending SYSRESETREQ to run flash driver
Nt: Erase flash at 0x0
Nc: Closing flash driver LPC177x_8x_407x_8x_512.cfx
Nt: Erase completed (in 106ms)
Nc: error closing down debug session - Nn(05). Wire ACK Fault in DAP access

Now the board is up and running again. 

0 Kudos
Reply