Hi Team,
I have come across the error 03: Failed on Chip Setup: Ep(04). Cannot halt processor
Before to this I have programmed the OTP memory bank 3, word 0 - Customer control data, Boot source selection as follows.
status = Chip_OTP_ProgBootSrc(CHIP_OTP_BOOTSRC_UART0);
After this I was able to use the RDK fine, able to program and debug fine.
I have modified the USB HID code clock configuration and after this I am seeing the above error. I have tried all the possible ways mentioned in LPCware and no luck :smileyconfused:.
I tried entering ISP mode by pulling P2_7 low using the user switch sw2, I see D2 & D3 (yellow, blue) LEDs glowing, is this the right indication for ISP mode?
below is the error log
Ni: LPCXpresso RedlinkMulti Driver v8.1 (Mar 4 2016 17:16:40 - crt_emu_cm_redlink build 659)
Pc: ( 0) Reading remote configuration
Pc: ( 5) Remote configuration complete
Wc: ============= SCRIPT: LPC18LPC43InternalFLASHBootResetscript.scp =============
Wc: Boot from FLASH image pc/sp reset script
Wc: PC = 0x00000001
Wc: SP = 0x00000000
Wc: XPSR = 0x00000000
Wc: VTOR = 0x00000000
Wc: Wire Ack Fault - target connected?
Wc: Wire Ack Fault - target connected?
Wc: ============= END SCRIPT =====================================================
Xe:
Nc: Probe Firmware: LPC-LINK2 CMSIS-DAP V5.147 (NXP Semiconductors)
Nc: Serial Number: CWGUGTMV
Nc: VID:PID: 1FC9:0090
Nc: USB Path: /dev/hidraw2
Pc: ( 30) Emulator Connected
Xl:
Xc:
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: Emu(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC230. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Nc: inspected v.2 On-chip Flash Memory /usr/local/lpcxpresso_8.1.2_603/lpcxpresso/bin/Flash/LPC18x7_43x7_2x512_BootA.cfx
Nc: image 'LPC18x7/LPC43x7 2x512KB (Boot Bank A) Feb 16 2016 09:18:47'
Nc: NXP: LPC1837 Part ID: 0x00000000
Pc: ( 65) Chip Setup Complete
Nt: Connected: was_reset=true. was_stopped=false
Cr:v LPCXpresso Free License - Download limit is 256K
Pc: ( 70) License Check Complete
Nt: Loading 'usbd_rom_hid_mouse_report_id_system_consumer.axf' ELF 0x1A000000 len 0x4FEC
Nc: AFTER driver startup timeout
Wc: Driver Register State
Wc: R0: 10085000
Wc: R1: 00000000
Wc: R2: 00000000
Wc: R3: 00000000
Wc: R4: 00000000
Wc: R5: 00000000
Wc: R6: 00000000
Wc: R7: 00000000
Wc: R8: 00000000
Wc: R9: 00000000
Wc: R10: 00000000
Wc: R11: 00000000
Wc: R12: 00000000
Wc: SP: 10080FE0
Wc: LR: FFFFFFF9 (exception from main thread)
Wc: PC: FEFEFEFE
Wc: xPSR: 00000003
Wc: MSP: 10080FE0
Wc: PSP: 10081000
Wc: CFBP: 00000001
Wc:Exception information:
Wc:10080FFC: xPSR: 00000000
Wc:10080FF8: VECTPC: 10000034
Wc:10080FF4: LR: 10000035
Wc:10080FF0: R12: 00000000
Wc:10080FEC: R3: 00000000
Wc:10080FE8: R2: 00000000
Wc:10080FE4: R1: 00000000
Wc:10080FE0: R0: 10085000
Wc:E000ED04: ICSR: 00000803 (VECTPEND=0, RETTOBASE, VECTACTIVE=3)
Wc:E000ED38: BFAR: E000EDF8
Wc:E000ED28: CFSR: 00020001
Wc:E000ED2C: HFSR: 40000000 ()
Wc:E000ED30: DFSR: 00000000
Wc:E000ED3C: AFSR: 00000000
Wc:E000ED24: SHCSR: 00000000
Nc: Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.
Pb: (100) Writing Flash ended with an error.
Ed:05: File 'usbd_rom_hid_mouse_report_id_system_consumer.axf' load failure: Ef(34): Timed-out initializing flash.
Pc: (100) Target Connection Failed
I am completely stuck, please give your inputs.
Thanks & Regards,
Vamshi G.
Hi, I got same issues, and nothing helped me to unbrick the board, except programming with : RunBootRomReset.scp at the Connect Script setting within flash programming. Or if you are using command line interface you could add: -ConnectScript=ISPResetConnect.scp.
Cheers.
For reference - I have locked your other almost identical thread on this issue : Failed on chip setup: Ep(04). Cannot halt processor.
I'm not sure what board your LPC1837 RDK is, thus I can't make any comment on LEDs. It would also be useful to perhaps know exactly which LPCXpresso IDE release you are using?
But when using an LPC18 part with internal flash, external SPIFI flash will only be executed at reset if the internal flash is empty unless you pull the ISP at boot time. But I am slightly confused by what you are trying to do here, because you talk about setting OTP bits to both boot from UART and from SPIFI. And the flash driver you are launching is the one for the internal flash, not external SPIFI.
There is more information on SPIFI flash programming at LPC18xx / LPC43xx SPIFI Flash Drivers. If you are trying to use both the internal and external flash, then you should also see Configuring projects to span multiple flash devices
If the problem is being triggered by clock setup, then the possible routes to try to recover are:
- Try manually booting the part into ISP mode before connecting. Make sure you hold the ISP pin low through the whole reset sequence, as described in Regaining debug access to target MCU
- Use the ISP reset functionality from the debug tools themselves (if your board will support this) : ISP Reset over debug
- Try changing the "vector catch" setting in the launch configuration, which changes the way that the debugger handles pulling reset Regaining debug access to target MCU
If none of those help, then there is little more I can think of for you to try. If you were able to debug successfully previously, then I suspect that in writing to the OTP bits, you have (perhaps) accidentally locked the part for debugging - for instance by setting OTP memory bank 3, word 0 bit 31 when writing to the BOOT_SRC bits within the same word. In which case you have no choice but to switch out your chip/board. Typically writing to the BOOT_SRC bits is something you would only do towards the end of your development cycle.
Regards,
LPCXpresso Support
Dear Team,
I tried all means, and the error I am seeing is different from the reference links you are providing, please help me get access to the board.
Help me providing in-line answers for my previous question.
Sorry - but if you have tried everything we have already suggested, then I am afraid that there is nothing further I can suggest to recover your board.
Regards,
LPCXpresso Support
Dear Team,
I am afraid to do any other programming activity on the spare board I have apart from the one got bricked.
Is it possible to debug the issue from your end, if I ship you the board, I would like to find the root cause for this behavior. I do not want to lose any more boards during the development activity.
Please do needful.
Thanks & Regards,
Vamshi G.
Dear Team,
Thanks for your response.
I am using LPCXpresso v8.1.2 [Build 603] [2016-03-07] on Ubuntu & tried with latest version 8.1.4 [Build 606] [2016-03-14] on Win10
1) The part I am using is 1837, with internal flash. I am working to boot from internal flash only and not interested in SPIFI boot (external SPI flash boot)
2) The board I am using is the one @ link Dual USB solutions for the LPC1837 LPC1830 LPC1800 and LPC4337 LPC4330 LPC4300 NXP microcontrollers.... , used for demonstrating the Dual device functionality.
3) I have accidentally programmed the OTP region by running the demo example, misc_otp_funcs with the below line un-commented
status = Chip_OTP_ProgBootSrc(CHIP_OTP_BOOTSRC_SPIFI);
I understand by programming the bit 31 to '1' of OTP memory bank 3, word 0 will disable the access to JTAG. The above piece of code is not setting the 31st bit, correct me if I am wrong ? Please confirm me if the above line of code disabled access to JTAG
4) I have lost access to board when I mucked with USB clocks, I tried Regaining debug access to target MCU by pulling ISP pin P2_7 to low by pressing user switch sw2 on the board and tried to re-program with working firmware like a freertos_blinky example, it shows the following output
Note: I have tried changing "the "vector catch" to "true" by editing the current launch configuration"
Nc: Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.
Pb: (100) Writing Flash ended with an error.
Ed:05: File 'usbd_rom_hid_mouse_report_id_system_consumer.axf' load failure: Ef(34): Timed-out initializing flash.
Pc: (100) Target Connection Failed
Please let me know if I have failed to explain my scenario. Waiting for the response
Thanks & Regards,
Vamshi G.
Duplicate of other post Failed on chip setup: Ep(04). Cannot halt processor.
Dear Team,
Thanks for the response, I have tried this already, did not help.
Note: RDK I have, is programmed to boot from SPIF by programming the OTP region.
When I enter into ISP mode two LEDs on the RDK are glowing is this the right behavior??
Please give me some more inputs to debug this issue.
Thanks & Regards,
Vamshi G.