XMC4500 cannot flash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
My xmc4500 stopped working. I am using DAVE4 and debugging with a j-link edu over SWD.

First it kept breaking into HardFault_Handler, then it couldn't halt the cpu anymore. I connected via j-link commander and erased the chip. Now I am getting this when trying to debug:


SEGGER J-Link GDB Server V5.10l Command Line Version

JLinkARM.dll V5.10l (DLL compiled Feb 11 2016 18:55:09)

-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: on
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: XMC4500-F100x1024
Target interface: SWD
Target interface speed: auto
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V9 compiled Feb 2 2016 18:43:46
Hardware: V9.30
S/N: 269303478
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 4.56 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x2000FF3C)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x000000E6)
R0 = 00000000, R1 = 00000002, R2 = 00000000, R3 = 0000006C
R4 = 00000536, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 0C000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 2000FF3C, MSP= 2000FF3C, PSP= 00000000
R14(LR) = 000013F7, R15(PC) = 000000E6
XPSR 41000000, APSR 40000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x000000E6 (Data = 0xF000E7FE)
Select auto target interface speed (2000 kHz)
Flash breakpoints enabled
Read 4 bytes @ address 0x000000E6 (Data = 0xF000E7FE)
Downloading 692 bytes @ address 0x0C000000 - Verified OK
Downloading 4096 bytes @ address 0x0C020000 - Verified OK
Downloading 4096 bytes @ address 0x0C021000 - Verified OK
Downloading 4096 bytes @ address 0x0C022000 - Verified OK
Downloading 4096 bytes @ address 0x0C023000 - Verified OK
Downloading 4096 bytes @ address 0x0C024000 - Verified OK
Downloading 4096 bytes @ address 0x0C025000 - Verified OK
Downloading 4096 bytes @ address 0x0C026000 - Verified OK
Downloading 4096 bytes @ address 0x0C027000 - Verified OK
Downloading 4096 bytes @ address 0x0C028000 - Verified OK
Downloading 4096 bytes @ address 0x0C029000 - Verified OK
Downloading 4096 bytes @ address 0x0C02A000 - Verified OK
Downloading 4096 bytes @ address 0x0C02B000 - Verified OK
Downloading 4096 bytes @ address 0x0C02C000 - Verified OK
Downloading 4096 bytes @ address 0x0C02D000 - Verified OK
Downloading 4096 bytes @ address 0x0C02E000 - Verified OK
Downloading 4096 bytes @ address 0x0C02F000 - Verified OK
Downloading 4096 bytes @ address 0x0C030000 - Verified OK
Downloading 4096 bytes @ address 0x0C031000 - Verified OK
Downloading 4096 bytes @ address 0x0C032000 - Verified OK
Downloading 4096 bytes @ address 0x0C033000 - Verified OK
Downloading 1328 bytes @ address 0x0C034000 - Verified OK
Downloading 8 bytes @ address 0x0C034530 - Verified OK
Downloading 1032 bytes @ address 0x0C034538 - Verified OK
ERROR: Failed to download RAMCode!
Writing register (PC = 0x08000200)
Read 4 bytes @ address 0x08000200 (Data = 0x00000000)
Read 2 bytes @ address 0x0802C970 (Data = 0xF01E)
Read 2 bytes @ address 0x0802C970 (Data = 0xF01E)
Read 2 bytes @ address 0x0802EF5E (Data = 0xF7FE)
Read 2 bytes @ address 0x0802EF5E (Data = 0xF7FE)
Read 2 bytes @ address 0x0802C8F8 (Data = 0x687B)
Read 2 bytes @ address 0x0802C8F8 (Data = 0x687B)
Resetting target
Halting target CPU...
...Target halted (PC = 0x000000E6)
Read 2 bytes @ address 0x0802EF5E (Data = 0xF7FE)
Read 2 bytes @ address 0x0802EF5E (Data = 0xF7FE)
Read 2 bytes @ address 0x0802EF5E (Data = 0xF7FE)
R0 = 00000000, R1 = 00000002, R2 = 00000000, R3 = 0000006C
R4 = 00000536, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 0C000000, R10= 00080000, R11= 00000008
R12= 00000000, R13= 2000FF3C, MSP= 2000FF3C, PSP= 00000000
R14(LR) = 000013F7, R15(PC) = 000000E6
XPSR 41000000, APSR 40000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x000000E6 (Data = 0xF000E7FE)
Setting breakpoint @ address 0x0802C8F8, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x0802C970, Size = 2, BPHandle = 0x0002
Setting breakpoint @ address 0x0802EF5E, Size = 2, BPHandle = 0x0003
Starting target CPU...
Debugger requested to halt target...
...Target halted (PC = 0x000000E6)
Reading all registers
Read 4 bytes @ address 0x000000E6 (Data = 0xF000E7FE)
Removing breakpoint @ address 0x0802C8F8, Size = 2
Removing breakpoint @ address 0x0802C970, Size = 2
Removing breakpoint @ address 0x0802EF5E, Size = 2
GDB closed TCP/IP connection
Restoring target state and closing J-Link connection...


Note the "ERROR: Failed to download RAMCode!" - Is the chip broken? Do I need to flash a new bootloader after erasing the chip (is there a bootloader image somewhere?)? Is this maybe an electrical problem with the debugger connection?

EDIT: It also says "Target voltage: 4.56 V" - shouldn't this be close to 3.3V? Does this mean my power regulation is faulty?
0 Likes
1 Reply
Not applicable
Nevermind, it must be an intermittent short circuit in the power supply circuitry or something like that. After letting the device sit for a while and turning it back on the voltage is now 3.3V and the XMC is working.
0 Likes