Could you help me? Thanks very much!

Hi all,

Recently I bought a HiFive1 Rev B development board, but when I run the hello program on FreedomStudio according to the official manual, the following error occurred:

SEGGER J-Link GDB Server V6.80a Command Line Version

JLinkARM.dll V6.80a (DLL compiled May 29 2020 16:27:00)

Command line: -if jtag -device FE310 -endian little -speed 1000 -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:                 FE310
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed...
Shutting down...
Could not connect to J-Link.
Please check power, connection and settings.

I am sure that my board is properly connected to the host. However, Jlink could not be connected and I feel confused so much.

Pls, don’t mind that I am a freshman. I would like to learn from all of your guys. Thanks for all your help.

Hi Kaisheng,

Can you describe the steps that you took in detail leading up to the failure?

If using Linux, did you see the Getting Started Guide section: 6.2 Console Configuration

This is a Freedom Studio log of successful Hello World program run on HiFive1 rev B.

SEGGER J-Link GDB Server V6.80a Command Line Version
JLinkARM.dll V6.80a (DLL compiled May 29 2020 16:30:38)
Command line: -if jtag -device FE310 -endian little -speed 1000 -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:                 FE310
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-K22-SiFive compiled Jul 23 2021 12:54:10
Hardware: V1.00
S/N: 979000015
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 1 JTAG device, Total IRLen = 5
JTAG ID: 0x20000913 (RISC-V)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
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 = 0x00001004)
Received monitor command: regs
X0 = 00000000, X1 = 20000E10, X2 = 80002F70, X3 = 80001000
X4 = 00000000, X5 = 00000000, X6 = 00000000, X7 = 80000820
X8 = 00000000, X9 = 20005CC0, X10= 80000078, X11= 20005F30
X12= 00030000, X13= 10013000, X14= 10013000, X15= 10013000
X16= 00000061, X17= 00000074, X18= 20010000, X19= 00000001
X20= 00000000, X21= 00000004, X22= 00000005, X23= 00000000
X24= 00000000, X25= 00000000, X26= 00000000, X27= 00000000
X28= 00000009, X29= 00000045, X30= 00000000, X31= 00000000
PC = 00001004
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (4000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (SVC Addr = 0x08)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Downloading 732 bytes @ address 0x20010000 - Verified OK
Downloading 12 bytes @ address 0x200102E0 - Verified OK
Downloading 122 bytes @ address 0x200102EC - Verified OK
Downloading 3044 bytes @ address 0x20010368 - Verified OK
Downloading 15600 bytes @ address 0x20010F80 - Verified OK
Downloading 7252 bytes @ address 0x20014C70 - Verified OK
Downloading 2756 bytes @ address 0x200168C8 - Verified OK
Comparing flash   [....................] Done.
Writing register (pc = 0x20010000)
Reading 64 bytes @ address 0x20010F80
Read 4 bytes @ address 0x20010F88 (Data = 0x200107B7)
Reading all registers
Setting breakpoint @ address 0x20010F88, Size = 4, BPHandle = 0x0002
Starting target CPU...
Reading all registers
Removing breakpoint @ address 0x20010F88, Size = 4
Reading 64 bytes @ address 0x80000F40
Reading 64 bytes @ address 0x00000000
Reading register (mstatus = 0x    1800)
Reading register (misa = 0x40101105)
Reading register (mie = 0x       0)
Reading register (mtvec = 0x20010134)
Reading register (mscratch = 0xFEFFBEFF)
Reading register (mepc = 0x2001001C)
Reading register (mcause = 0x       2)
Reading register (mtval = 0x7C105073)
Reading register (mip = 0x       0)
Reading register (mvendorid = 0x       0)
Reading register (marchid = 0x       0)
Reading register (mimpid = 0x       0)
Reading register (mhartid = 0x       0)
Reading 64 bytes @ address 0x20010F80
Reading 64 bytes @ address 0x20010FC0
Starting target CPU...

Hi Jim,

Thank you for your reply. I am so stupid. I found that the problem lies in my data cable, and I succeeded after replacing a data cable. Thanks again!

No problem Kaisheng. We’ve all experienced the bad cable issue. Have fun with the HiFive1 rev B!