0
\$\begingroup\$

I'm trying to make GNU MCU Eclipse work with my XMC4800 Relax kit. Eclipse compiles the program fine. But when I try to flash or debug the code JLink seems to hang on Starting Target CPU... This is the output I get when I start the debugger:

SEGGER J-Link GDB Server V6.32b Command Line Version

JLinkARM.dll V6.32b (DLL compiled May  8 2018 18:28:22)

Command line: -if swd -device XMC4800-F144x2048 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1
-----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:               off
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:                 XMC4800-F144x2048
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Lite-XMC4200 Rev.1 compiled Apr  5 2017 11:59:07
Hardware: V1.00
S/N: 591105020
Checking target voltage...
Target voltage: 3.30 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)
Read 2 bytes @ address 0x00000000 (Data = 0xFF3C)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x08000200)
Received monitor command: regs
R0 = E000ED08, R1 = 00000263, R2 = 02000080, R3 = C8000201
R4 = 00000536, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 0C000004, R10= 00000000, R11= 00000000
R12= 00000000, R13= 1FFE8800, MSP= 1FFE8800, PSP= 00000000
R14(LR) = 000000ED, R15(PC) = 08000200
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (1875 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Read 4 bytes @ address 0x08000200 (Data = 0xD074F8DF)
Read 2 bytes @ address 0x08000200 (Data = 0xF8DF)
Downloading 40 bytes @ address 0x00000000 - Verify failed
Downloading 2 bytes @ address 0x00000028 - Verify failed
Writing register (PC = 0x00000028)
Read 4 bytes @ address 0x00000028 (Data = 0xF0116801)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x08000200)
Received monitor command: regs
R0 = E000ED08, R1 = 00000263, R2 = 02000080, R3 = C8000201
R4 = 00000536, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 0C000004, R10= 00000000, R11= 00000000
R12= 00000000, R13= 1FFE8800, MSP= 1FFE8800, PSP= 00000000
R14(LR) = 000000ED, R15(PC) = 08000200
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x08000200 (Data = 0xD074F8DF)
Read 2 bytes @ address 0x08000200 (Data = 0xF8DF)
Read 4 bytes @ address 0x000000EC (Data = 0x489BE004)
Read 2 bytes @ address 0x000000EC (Data = 0xE004)
Read 4 bytes @ address 0x000000EC (Data = 0x489BE004)
Read 2 bytes @ address 0x000000EC (Data = 0xE004)
Starting target CPU...

then it looks like the program wasn't flashed, the old program is still running. (I checked this by changing some simple parameters).

When I flash the program with CLI everything works as expected. I run this line (inside a makefile):

echo -e "connect\ndevice XMC4800-F144x2048\nspeed 1000\nsi swd\nloadfile xmc4800-ecat-slave.hex\ng\nqc\n" | ../JLink_Linux_V632b_x86_64/JLinkExe

Now I don't have a lot of experience with this, so I have trouble finding out what exactly is going wrong. If someone can show me whats going wrong I would be a happy man. Right now I'm just randomly changing settings...

I used this tutorial to set everything up

All my settings are shown in this album: https://i.sstatic.net/caiu3.jpg

\$\endgroup\$
13
  • \$\begingroup\$ Looks OK to me. The control is transferred to the flashed program. What do you expect it to do? \$\endgroup\$
    – Eugene Sh.
    Commented Jun 20, 2018 at 13:37
  • \$\begingroup\$ I clarified the question a bit: The old program is still running on the MCU, not the new one. So it looks like it's not flashing correctly \$\endgroup\$ Commented Jun 20, 2018 at 13:50
  • \$\begingroup\$ Post screenshots of your debugging setup. Take pictures of each tab in the debug configuration \$\endgroup\$
    – pgvoorhees
    Commented Jun 20, 2018 at 14:05
  • \$\begingroup\$ Actually I see some Verify failed lines \$\endgroup\$
    – Eugene Sh.
    Commented Jun 20, 2018 at 14:10
  • \$\begingroup\$ Done; see this album: imgur.com/a/O0np0r7 \$\endgroup\$ Commented Jun 20, 2018 at 14:14

1 Answer 1

0
\$\begingroup\$
Downloading 40 bytes @ address 0x00000000 - Verify failed
Downloading 2 bytes @ address 0x00000028 - Verify failed

This means that writing at 0x0 is not possible.

Your device is either somehow protected to write, or the memory map used in your program does not match the device memory map; some devices use a higher address to write the flash.

\$\endgroup\$
1
  • \$\begingroup\$ You're welcome. Please confirm the answer. \$\endgroup\$
    – ilg
    Commented Jul 4, 2018 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.