# Stuck at "Starting target CPU.." with J-Link EDU downloading Blinky to FE310 FPGA coreplexIP

**URL:** <https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402>\
**Category:** SiFive RISC-V Core IP Evaluation\
**Created:** [July 12, 2018, 12:07am UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402 "2018-07-12T00:07:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![albertliuster](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@albertliuster](https://forums.sifive.com/u/albertliuster)\
**Post date:** [July 12, 2018, 12:07am UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402/1 "2018-07-12T00:07:07Z")

</div>

Hello,

I’m trying to test the FE310 softcore on Arty Artix-7 35T board with some programs. I don’t have a Olimex-ARM-USB-H but I do have a J-Link EDU, which, according SEGGAR, supports the RISC-V FE310 coreplexIP. I followed carefully the instructions from “SiFive-E310-arty-gettingstarted-v1.0.6.pdf” and downloaded the “sifive\_coreip\_E31\_FPGA\_Evaluation\_v3p0\_0.mcs” bitstream to the board with Vivado Hardware Manager. The default program coupled with the mcs runs successfully with one tri-color LED flashing and the SiFive logo appears on PC serial terminal.

Then I followed the instructions from  
[https://wiki.segger.com/SiFive\_Arty\_FPGA\_Dev\_Kit](https://wiki.segger.com/SiFive_Arty_FPGA_Dev_Kit)  
and used Freedom Studio to debug the app “Blue Blinky”, and this is when the problem came up. The following is the log info:

SEGGER J-Link GDB Server V6.33g (beta) Command Line Version

JLinkARM.dll V6.33g (DLL compiled Jun 28 2018 15:09:48)

Command line: -if jtag -device RISC-V -endian little -speed 4000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui  
-----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: RISC-V  
Target interface: JTAG  
Target interface speed: 4000kHz  
Target endian: little

Connecting to J-Link…  
J-Link is connected.  
Firmware: J-Link V10 compiled Jun 27 2018 10:57:29  
Hardware: V10.10  
S/N: 260109090  
OEM: SEGGER-EDU  
Feature(s): FlashBP, GDB  
Checking target voltage…  
Target voltage: 3.27 V  
Listening on TCP/IP port 2331  
Connecting to target…  
J-Link found 1 JTAG device, Total IRLen = 5  
JTAG ID: 0x20000001 (RISC-V)  
Connected to target  
Waiting for GDB connection…Connected to 127.0.0.1  
Reading all registers  
Reading register (PC = 0x00000000)  
Received monitor command: speed 4000  
Target interface speed set to 4000 kHz  
Received monitor command: clrbp  
Received monitor command: reset  
Resetting target  
Received monitor command: halt  
Halting target CPU…  
…Target halted (PC = 0x404002CA)  
Received monitor command: regs  
X0 = 00000000, X1 = 4040010A, X2 = 8000FFE0, X3 = 800007C0  
X4 = 00000000, X5 = 00000000, X6 = 00000010, X7 = 404007C0  
X8 = 01484812, X9 = 00000000, X10= 01484817, X11= 00000000  
X12= 014849A2, X13= 00000000, X14= 000000FF, X15= 00000000  
X16= 0200C000, X17= 00000000, X18= 02000080, X19= 00000000  
X20= 00000000, X21= 00000000, X22= 00000000, X23= 00000000  
X24= 00000000, X25= 00000000, X26= 00000000, X27= 00000000  
X28= 20005000, X29= 0000002F, X30= 000000FF, X31= 00000000  
PC = 404002CA  
Reading register (PC = 0x404002CA)  
Received monitor command: speed 4000  
Target interface speed set to 4000 kHz  
Received monitor command: flash breakpoints 1  
Flash breakpoints enabled  
Reading all registers  
Downloading 108 bytes @ address 0x40400000 - Verify failed  
Downloading 2534 bytes @ address 0x4040006C - Verify failed  
Downloading 59 bytes @ address 0x40400A54 - Verify failed  
Downloading 44 bytes @ address 0x40400A90 - Verify failed  
Downloading 1072 bytes @ address 0x40400ABC - Verify failed  
Writing register (PC = 0x40400000)  
Reading register (MISA = 0x40101105)  
Read 2 bytes @ address 0x40400552 (Data = 0x2020)  
Received monitor command: clrbp  
Received monitor command: reset  
Resetting target  
Received monitor command: halt  
Halting target CPU…  
…Target halted (PC = 0x404002CA)  
Reading register (PC = 0x404002CA)  
Reading all registers  
Reading 64 bytes @ address 0x01484800  
WARNING: Failed to read memory @ address 0x01484800  
Read 4 bytes @ address 0x0148480E (Data = 0x24232423)  
Reading 64 bytes @ address 0x01484800  
WARNING: Failed to read memory @ address 0x01484800  
Read 4 bytes @ address 0x0148480E (Data = 0x24232423)  
Reading 64 bytes @ address 0x01484800  
WARNING: Failed to read memory @ address 0x01484800  
Read 4 bytes @ address 0x0148480E (Data = 0x24232423)  
Reading 64 bytes @ address 0x01484800  
WARNING: Failed to read memory @ address 0x01484800  
Read 4 bytes @ address 0x0148480E (Data = 0x24232423)  
Reading 64 bytes @ address 0x01484800  
WARNING: Failed to read memory @ address 0x01484800  
Read 4 bytes @ address 0x0148480E (Data = 0x24232423)  
Read 2 bytes @ address 0x40400552 (Data = 0x2020)  
Received monitor command: regs  
X0 = 00000000, X1 = 4040010A, X2 = 8000FFE0, X3 = 800007C0  
X4 = 00000000, X5 = 00000000, X6 = 00000010, X7 = 404007C0  
X8 = 01484812, X9 = 00000000, X10= 01484817, X11= 00000000  
X12= 014849A2, X13= 00000000, X14= 000000FF, X15= 00000000  
X16= 0200C000, X17= 00000000, X18= 02000080, X19= 00000000  
X20= 00000000, X21= 00000000, X22= 00000000, X23= 00000000  
X24= 00000000, X25= 00000000, X26= 00000000, X27= 00000000  
X28= 20005000, X29= 0000002F, X30= 000000FF, X31= 00000000  
PC = 404002CA  
Reading register (PC = 0x404002CA)  
Setting breakpoint @ address 0x40400552, Size = 2, BPHandle = 0x0001  
Starting target CPU…

And it just stuck at Starting target CPU… and apparently the Blue Blinky was not flashed to QSPI Flash as I pushed the reset button.

This is quite annoying and can some one please help? (I also tried to run other apps like the dhrystone and coremark example ones but all ended up stuck at Starting target CPU…

Thanks

---

<div class="post-metadata">

**Author:** ![tgm](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tgm](https://forums.sifive.com/u/tgm)\
**Post date:** [July 13, 2018, 12:31pm UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402/2 "2018-07-13T12:31:03Z")

</div>

Seems to me like you first need to figure out why all the verify operations after download are failing?

---

<div class="post-metadata">

**Author:** ![albertliuster](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@albertliuster](https://forums.sifive.com/u/albertliuster)\
**Post date:** [July 14, 2018, 2:40am UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402/3 "2018-07-14T02:40:02Z")

</div>

The project “Blue Blinky” I ran on Freedom Studio was downloaded from  
[https://wiki.segger.com/SiFive\_Arty\_FPGA\_Dev\_Kit](https://wiki.segger.com/SiFive_Arty_FPGA_Dev_Kit)  
and the C source code for that program is here:

#include \<stdint.h\>  
#include \<stdbool.h\>  
#include \<stdatomic.h\>  
#include “encoding.h”  
#include \<platform.h\>

#ifndef \_SIFIVE\_COREPLEXIP\_ARTY\_H  
#error ‘coreplexip\_welcome’ demo only supported for Coreplex IP Eval Kits  
#endif

static void \_Delay(volatile unsigned int DelayLoops) {  
while(–DelayLoops);  
}

int main (void){  
unsigned char LEDState;  
volatile int i;  
//  
// Set up RGB PWM  
//  
PWM0\_REG(PWM\_CFG) = 0;  
PWM0\_REG(PWM\_CFG) = (PWM\_CFG\_ENALWAYS) | (PWM\_CFG\_ZEROCMP) | (PWM\_CFG\_DEGLITCH);  
PWM0\_REG(PWM\_COUNT) = 0;  
PWM0\_REG(PWM\_CMP0) = 0x88; // Half power for the RGB LED  
PWM0\_REG(PWM\_CMP1) = 0xFF; // Red LED == off  
PWM0\_REG(PWM\_CMP2) = 0xFF; // Green LED == off  
PWM0\_REG(PWM\_CMP3) = 0xFF; // Blue LED == off  
do {  
PWM0\_REG(PWM\_CMP3) = 0x44; // Blue LED == on  
\_Delay(10000000);  
PWM0\_REG(PWM\_CMP3) = 0xFF; // Blue LED == off  
\_Delay(10000000);  
} while (1);  
}

However, the project still contains a .cfg file which uses Olimex-ARM-USB-H as debugger:

# JTAG adapter setup

adapter\_khz 10000

interface ftdi  
ftdi\_device\_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"  
ftdi\_vid\_pid 0x15ba 0x002a

ftdi\_layout\_init 0x0808 0x0a1b  
ftdi\_layout\_signal nSRST -oe 0x0200  
#ftdi\_layout\_signal nTRST -data 0x0100 -oe 0x0100  
ftdi\_layout\_signal LED -data 0x0800

set \_CHIPNAME riscv  
jtag newtap $\_CHIPNAME cpu -irlen 5 -expected-id 0x20000001

set \_TARGETNAME $\_CHIPNAME.cpu

target create $\_TARGETNAME.0 riscv -chain-position $\_TARGETNAME  
$\_TARGETNAME.0 configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1

# Un-comment these two flash lines if you have a SPI flash and want to write

# it.

flash bank spi0 fespi 0x40000000 0 0 0 $\_TARGETNAME.0 0x20004000  
init  
if {[info exists pulse\_srst]} {  
ftdi\_set\_signal nSRST 0  
ftdi\_set\_signal nSRST z  
}  
halt  
flash protect 0 64 last off  
echo “Ready for Remote Connections”

I’m not sure if the problem occurred as a result of incompatibility of the J-Link debugger and the cfg file?

Other than that, I carefully checked all the hardware connections between J-Link and Arty Pmod JD as well as GDB Server / Client settings of Freedom Studio and they all seem ok.

For GDB client, the riscv-none-embed-gdb is used.

---

<div class="post-metadata">

**Author:** ![riscv-fun](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@riscv-fun](https://forums.sifive.com/u/riscv-fun)\
**Post date:** [June 9, 2020, 5:22pm UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402/4 "2020-06-09T17:22:17Z")

</div>

Problem solved yet? What was the reason though? Got similar issue and want to get some clue… Thanks

---

<div class="post-metadata">

**Author:** ![TaLucGiaHoang](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@TaLucGiaHoang](https://forums.sifive.com/u/TaLucGiaHoang)\
**Post date:** [September 1, 2020, 3:25am UTC](https://forums.sifive.com/t/stuck-at-starting-target-cpu-with-j-link-edu-downloading-blinky-to-fe310-fpga-coreplexip/1402/5 "2020-09-01T03:25:30Z")

</div>

I got the same issue. How to solved this problem?
