Debugging Risc-V hifive1-revb

Hi,

I can’t get the debugging mode working. in VScode. Im running windows 10.

--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/sifive/hifive1-revb.html
PLATFORM: SiFive 1.0.0 > HiFive1 Rev B
HARDWARE: FE310 320MHz, 16KB RAM, 16MB Flash
DEBUG: Current (jlink) On-board (jlink)
PACKAGES: toolchain-riscv 1.80300.190927 (8.3.0), framework-freedom-e-sdk 2.201908.190927 (20.19.8)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Compiling .pio\build\hifive1-revb\src\setupGPIO.o
Compiling .pio\build\hifive1-revb\src\superBlink.o
Compiling .pio\build\hifive1-revb\metal\button.o
Compiling .pio\build\hifive1-revb\metal\cache.o
Compiling .pio\build\hifive1-revb\metal\clock.o
Compiling .pio\build\hifive1-revb\metal\cpu.o
Compiling .pio\build\hifive1-revb\metal\drivers\fixed-clock.o
Compiling .pio\build\hifive1-revb\metal\drivers\fixed-factor-clock.o
Compiling .pio\build\hifive1-revb\metal\drivers\inline.o
Compiling .pio\build\hifive1-revb\metal\drivers\riscv_clint0.o
Compiling .pio\build\hifive1-revb\metal\drivers\riscv_cpu.o
Compiling .pio\build\hifive1-revb\metal\drivers\riscv_plic0.o
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_clint0.c: In function '__metal_driver_riscv_clint0_set_vector_mode':
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_clint0.c:125:9: warning: enumeration value 'METAL_SELECTIVE_NONVECTOR_MODE' not handled in switch [-Wswitch]
        switch (mode) {
        ^~~~~~
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_clint0.c:125:9: warning: enumeration value 'METAL_SELECTIVE_VECTOR_MODE' not handled in switch [-Wswitch]
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_clint0.c:125:9: warning: enumeration value 'METAL_HARDWARE_VECTOR_MODE' not handled in switch [-Wswitch]
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_cpu.c: In function '__metal_driver_riscv_cpu_controller_set_vector_mode':
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\drivers\riscv_cpu.c:729:43: warning: unused variable 'intc' [-Wunused-variable]
    struct __metal_driver_riscv_cpu_intc *intc = (void *)(controller);
                                          ^~~~
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_ccache0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_clic0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fe310-g000_hfrosc.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fe310-g000_hfxosc.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fe310-g000_lfrosc.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fe310-g000_pll.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fe310-g000_prci.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_fu540-c000_l2.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_global-external-interrupts0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_gpio-buttons.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_gpio-leds.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_gpio-switches.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_gpio0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_local-external-interrupts0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_rtc0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_spi0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_test0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_trace.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_uart0.o
Compiling .pio\build\hifive1-revb\metal\drivers\sifive_wdog0.o
Compiling .pio\build\hifive1-revb\metal\entry.o
Compiling .pio\build\hifive1-revb\metal\gpio.o
Compiling .pio\build\hifive1-revb\metal\interrupt.o
Compiling .pio\build\hifive1-revb\metal\led.o
Compiling .pio\build\hifive1-revb\metal\lock.o
Compiling .pio\build\hifive1-revb\metal\memory.o
Compiling .pio\build\hifive1-revb\metal\pmp.o
Compiling .pio\build\hifive1-revb\metal\privilege.o
Compiling .pio\build\hifive1-revb\metal\rtc.o
Compiling .pio\build\hifive1-revb\metal\shutdown.o
Compiling .pio\build\hifive1-revb\metal\spi.o
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\shutdown.c:15:9: note: #pragma message: There is no defined shutdown mechanism, metal_shutdown() will spin.
#pragma message("There is no defined shutdown mechanism, metal_shutdown() will spin.")
        ^~~~~~~
Compiling .pio\build\hifive1-revb\metal\switch.o
Compiling .pio\build\hifive1-revb\metal\synchronize_harts.o
Compiling .pio\build\hifive1-revb\metal\time.o
Compiling .pio\build\hifive1-revb\metal\timer.o
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\time.c: In function 'metal_gettimeofday':
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\time.c:11:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    if (rv = metal_timer_get_cyclecount(0, &mcc)) {
        ^~
C:\Users\narim\.platformio\packages\framework-freedom-e-sdk\freedom-metal\src\time.c:14:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    if (rv = metal_timer_get_timebase_frequency(0, &timebase)) {
        ^~
Compiling .pio\build\hifive1-revb\metal\trap.o
Compiling .pio\build\hifive1-revb\metal\tty.o
Compiling .pio\build\hifive1-revb\metal\uart.o
Compiling .pio\build\hifive1-revb\metal\vector.o
Compiling .pio\build\hifive1-revb\metal\watchdog.o
Compiling .pio\build\hifive1-revb\metal-gloss\crt0.o
Compiling .pio\build\hifive1-revb\metal-gloss\nanosleep.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_access.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_chdir.o
Archiving .pio\build\hifive1-revb\libmetal.a
Compiling .pio\build\hifive1-revb\metal-gloss\sys_chmod.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_chown.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_close.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_execve.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_exit.o
Indexing .pio\build\hifive1-revb\libmetal.a
Compiling .pio\build\hifive1-revb\metal-gloss\sys_faccessat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_fork.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_fstat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_fstatat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_ftime.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_getcwd.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_getpid.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_gettimeofday.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_isatty.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_kill.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_link.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_lseek.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_lstat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_open.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_openat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_read.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_sbrk.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_stat.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_sysconf.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_times.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_unlink.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_utime.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_wait.o
Compiling .pio\build\hifive1-revb\metal-gloss\sys_write.o
Archiving .pio\build\hifive1-revb\libmetal-gloss.a
Indexing .pio\build\hifive1-revb\libmetal-gloss.a
Linking .pio\build\hifive1-revb\firmware.elf
Checking size .pio\build\hifive1-revb\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  21.0% (used 3448 bytes from 16384 bytes)
Flash: [          ]   0.0% (used 4638 bytes from 16777216 bytes)
========================= [SUCCESS] Took 5.37 seconds =========================
SEGGER J-Link GDB Server V6.52 Command Line Version

JLinkARM.dll V6.52 (DLL compiled Sep 27 2019 17:50:11)

Command line: -singlerun -if JTAG -select USB -speed 1000 -jtagconf -1,-1 -device FE310 -port 2331
-----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:               off
Init regs on start:            off
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...
Reading symbols from c:\Users\narim\OneDrive\Documenten\PlatformIO\Projects\blinCy\.pio\build\hifive1-revb\firmware.elf...
undefinedC:\Users\narim\.platformio\packages\toolchain-riscv\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
J-Link is connected.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = jlink
PlatformIO: Initializing remote target...
Firmware: J-Link OB-K22-SiFive compiled Aug 22 2019 14:12:56
Hardware: V1.00
S/N: 979001575
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
setLED (color=color@entry=524288, state=state@entry=0) at src\superBlink.c:14
14	    return 0;
Select auto target interface speed (4000 kHz)
Loading section .init, size 0x17e lma 0x20010000
Loading section .text, size 0x718 lma 0x20010180
Loading section .rodata, size 0x8a0 lma 0x20010898
Loading section .init_array, size 0x8 lma 0x20011138
Loading section .data, size 0xe0 lma 0x20011140
Start address 0x20010000, load size 4638
Received monitor command: clrbp
Received monitor command: speed auto
Select auto target interface speed (4000 kHz)
Downloading 382 bytes @ address 0x20010000
Downloading 1816 bytes @ address 0x20010180
Downloading 2208 bytes @ address 0x20010898
Downloading 8 bytes @ address 0x20011138
Downloading 224 bytes @ address 0x20011140
Writing register (pc = 0x20010000)
Received monitor command: reset
Transfer rate: 2264 KB/sec, 927 bytes/write.
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x00001004)
Read 2 bytes @ address 0x200101A2 (Data = 0x1141)
Resetting target
Temporary breakpoint 1 at 0x200101a2: file src\superBlink.c, line 20.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> http://bit.ly/pio-debug
Setting breakpoint @ address 0x200101A2, Size = 2, BPHandle = 0x0001
Starting target CPU...
ERROR: Can not read register 4224 (PC) while CPU is running
Reading all registers
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4097 (X1) while CPU is running
ERROR: Can not read register 4098 (X2) while CPU is running
ERROR: Can not read register 4099 (X3) while CPU is running
ERROR: Can not read register 4100 (X4) while CPU is running
ERROR: Can not read register 4101 (X5) while CPU is running
ERROR: Can not read register 4102 (X6) while CPU is running
ERROR: Can not read register 4103 (X7) while CPU is running
ERROR: Can not read register 4104 (X8) while CPU is running
ERROR: Can not read register 4105 (X9) while CPU is running
ERROR: Can not read register 4106 (X10) while CPU is running
ERROR: Can not read register 4107 (X11) while CPU is running
ERROR: Can not read register 4108 (X12) while CPU is running
ERROR: Can not read register 4109 (X13) while CPU is running
ERROR: Can not read register 4110 (X14) while CPU is running
ERROR: Can not read register 4111 (X15) while CPU is running
ERROR: Can not read register 4112 (X16) while CPU is running
ERROR: Can not read register 4113 (X17) while CPU is running
ERROR: Can not read register 4114 (X18) while CPU is running
ERROR: Can not read register 4115 (X19) while CPU is running
ERROR: Can not read register 4116 (X20) while CPU is running
ERROR: Can not read register 4117 (X21) while CPU is running
ERROR: Can not read register 4118 (X22) while CPU is running
ERROR: Can not read register 4119 (X23) while CPU is running
ERROR: Can not read register 4120 (X24) while CPU is running
ERROR: Can not read register 4121 (X25) while CPU is running
ERROR: Can not read register 4122 (X26) while CPU is running
ERROR: Can not read register 4123 (X27) while CPU is running
ERRO
R: Can not read register 4124 (X28) while CPU is running
ERROR: Can not read register 4125 (X29) while CPU is running
ERROR: Can not read register 4126 (X30) while CPU is running
ERROR: Can not read register 4127 (X31) while CPU is running
ERROR: Can not read register 4224 (PC) while CPU is running
ERROR: Can not read register 4128 (F0) while CPU is running
ERROR: Can not read register 4129 (F1) while CPU is running
ERROR: Can not read register 4130 (F2) while CPU is running
ERROR: Can not
read register 4131 (F3) while CPU is running
ERROR: Can not read register 4132 (F4) while CPU is running
ERROR: Can not read register 4133 (F5) while CPU is running
ERROR: Can not read register 4134 (F6) while CPU is running
ERROR: Can n
ot read register 4135 (F7)
while CPU is running
ERROR: Can not read register 4136 (F8) while CPU is running
ERROR: Can not read register 4137 (F9) while CPU is running
ERROR: Can not read register 4138 (F10) while CPU is running
ERROR: Can not read register 4139 (F11) while CPU is run
ning
ERROR: Can not read register 4140 (F12) while CPU is running
ERROR: Can not read register 4141 (F13) while CPU is
running
ERROR: Can not read register 4142 (F14) while CPU is running
ERROR: Can not read register 4143 (F15) while CPU is
running
ERROR: Can not read register 4144 (F16) while CPU is running
ERROR: Can not read register 4145 (F17) while CPU is
running
ERROR: Can not read register 4146 (F18) while CPU is running
ERROR: Can not read register 4147 (F19) while CPU is r
unning
ERROR: Can not read register 4148 (F20) while CPU is running
ERROR: Can not read register 4149 (F21) while CPU is running
ERROR: Can not read register 4150 (F22) while CPU is running
ERROR: Can not read register 4151 (F23) while CPU i
s running
ERROR: Can not read register 4152 (F24) while CPU is running
ERROR: Can not read register 4153 (F25) while CPU is running
ERROR: Can not read register 4154 (F26) while CPU
is running
ERROR: Can not read register 4155 (F27) while CPU is running
ERROR: Can
not read register 4156 (F28) while CPU is running
ERROR: Can not read register 4157 (F29) while CPU is running
ERROR: Can not read register 4158 (F30) while CPU is running
ERROR: Can not read register 4159 (F31) while CPU is running
ERROR: Can not read register 1 (FFLAGS) while CPU is running
ERROR: Can not read register 2 (FRM) while CPU is running
ERROR: Can not read register 3 (FCSR) while CPU is running
ERROR: Can not read register 0 (USTATUS) while CPU is running
ERROR: Can not read register 4 (UIE) while CPU is running
ERROR: Can not read register 5 (UTVEC) while CPU is running
ERROR: Can not read register 64 (USCRATCH) while CPU is running
ERROR: Can not read register 65 (UEPC) while CPU is running
ERROR: Can not read register 66 (UCAUSE) while CPU is running
ERROR: Can not read register 67 (UTVAL) while CPU is running
ERROR: Can not read register 68 (UIP) while CPU is running
ERROR: Can not read register 1 (FFLAGS) while CPU is running
ERROR: Can not read register 2 (FRM) while CPU is running
ERROR: Can not read register 3 (FCSR) while CPU is running
ERROR: Can not read register 3072 (CYCLE) while CPU is running
ERROR: Can not read register 3073 (TIME) while CPU is running
ERROR: Can not read register 3074 (INSTRET) while CPU is running
ERROR: Can not read register 2846 (MHPMCOUNTER30) while CPU is running
ERROR: Can not read register 2847 (MHPMCOUNTER31) while CPU is running
ERROR: Can not read register 3201 (TIMEH) while CPU is running
ERROR: Can not read register 3202 (INSTRETH) while CPU is running
ERROR: Can not read register 2947 (MHPMCOUNTER3H) w
hile CPU is running
ERROR: Can not read register 2948 (MHPMCOUNTER4H) while CPU
is running
ERROR: Can not read register 2949 (MHPMCOUNTER5H) while CPU is running
ERROR: Can not read register 2950 (MHPMCOUNTER6H) while CPU is running
ERROR: Can not read register 2951 (MHPMCOUNTER7H) while CPU is running
ERROR: Can not read register 2952 (MHPMCOUNTER8H) while CPU is running
ERROR: Can not read register 2953 (MHPMCOUNTER9H) while CPU is running
ERROR: Can not read register 2954 (MHPMCOUNTER10H) while CPU is running
ERROR: Can not read
register 2955 (MHPMCOUNTER11H) while CPU is running
ERROR: Can not read register 2956 (MHPMCOUNTER12H) while CPU is running
ERROR: Can not read register 2957 (MHPMCOUNTER13H) while CPU is running
ERROR: Can not read register 2958 (MHPMCOUNTER14H) while CPU is running
ERROR: Can not read register 2959 (MHPMCOUNTER15H) while CPU is running
ERROR: Can not read register 2960 (MHPMCOUNTER16H) while CPU is running
ERROR: Can not read register 2961 (MHPMCOUNTER17H) while CPU is running
ERROR: C
an not read register 2962 (MHPMCOUNTER18H) while CPU is running
ERROR: Can not read register 2963 (MHPMCOUNTER19H) while CPU is running
ERROR: Can not read register 2964 (MHPMCOUNTER20H) wh
ile CPU is running
ERROR: Can not read register 2965 (MHPMCOUNTER21H) while CPU is running
ERROR: Can not read register 2966 (MHPMCOUNTER22H) while CPU is running
ERROR: Can not read register 2967 (MHPMCOUNTER23H) while CPU is running
ERROR: Can not read register 2968 (MHPMCOUNTER24H) w
hile CPU is running
ERROR: Can not read register 2969 (MHPMCOUNTER25H) while CPU is running
ERROR: Can not read register 2970 (MHPMCOUNTER26H)
while CPU is running
ERROR: Can not read register 2971 (MHPMCOUNTER27H) while CPU is running
ERROR: Can not read register 2972 (MHPMCOUNTER28H) w
hile CPU is running
ERROR: Can not
read register 2973 (MHPMCOUNTER29H) while CPU is running
ERROR: Can not read register 2974 (MHPMCOUNTER30H) while CPU is running
ERROR: Can not read register 2975 (MHPMCOUNTER31H) while CPU is running
ERROR: Can not read register 256 (SSTATUS) while CPU is running
ERROR: Can not read register 258 (SEDELEG) while CPU is running
ERROR: Can not read register 259 (SIDELEG) while CPU is running
ERROR: Can not read register 260 (SIE) while CPU is running
ERROR: Can not re
ad register 261 (STVEC) while CPU is running
ERROR: Can not read register
262 (SCOUNTEREN) while CPU is running
ERROR: Can not read
register 320 (SSCRATCH) while CPU is running
ERROR: Can not read register 321 (SEPC) while CPU is running
ERROR: Can not read register 322 (SCAUSE) while CPU is running
ERROR: Can not read register 323 (STVAL) while CPU is running
ERROR: Can not read register 324 (SIP) while CPU is running
ERROR: Can not read register 384 (SATP) while CPU is running
ERROR: Can not read register 3857 (MVENDORID) while CPU is running
ERROR: Can not read register 3858 (MARCHID) while CPU i
s running
ERROR: Can not read register 3859 (MIMPI
D) while CPU is runnin
g
ERROR: Can not read reg
ister 3860 (MHARTID) while CPU is running
ERROR: Can not read register 768 (MSTATUS) while CPU is running
ERROR: Can not read register 769 (MISA) while CPU is
running
ERROR: Can not read register 770 (MEDELEG) while CPU is running
ERROR: Can not read register 771 (MIDELEG) while CPU
is running
ERROR: Can not read register 772 (MIE) while CPU is running
ERROR: Can not read register 773 (MTVEC) while CPU i
s running
ERROR: Can not read register 774 (MCOUNTEREN) while CPU is running
ERROR: Can not read register 832 (MSCRATCH) while CPU is running
ERROR: Can not read register 833 (MEPC) while CPU
is running
ERROR: Can not read register 834 (MCAUSE) while CPU is running
ERROR: Can not read register 835 (MTVAL) while CPU is running
ERROR: Can not read register 836 (MIP) while C
PU is running
ERROR: Can not read register 928 (PMPCFG0) while CPU is running
ERROR: Can not read register 929 (PMPCFG1) while
CPU is running
ERROR: Can not read register 930 (PMPCFG2) while CPU is running
ERROR: Can not read register 931 (PMPCFG3) while CPU is running
ERROR: Can not read register 944 (PMPADDR0) while CPU is running
ERROR: Can not read register 945 (PMPADDR1) while CPU
is running
ERROR: Can not read register
946 (PMPADDR2) while CPU is running
ERROR: Can not read register 947 (PMPADDR3) while CPU is running
ERROR: Can not read register 948 (PMPADDR4) while CP
U is running
ERROR: Can not read register 949 (PMPADDR5) while CPU is running
ERROR: Can not read register 950 (PMPADDR6) while CPU
is running
ERROR: Can not read register 951 (PMPADDR7) while CPU is running
ERROR: Can not read register 952 (PMPADDR8) while CPU is running
ERROR: Can not read register 953 (PMPADDR9) while
CPU is running
ERROR: Can not read register 954 (PMPADDR10) while CPU is running
ERROR: Can not read register 955 (PMPADDR11) while CPU
is running
ERROR: Can not read register 956 (PMPADDR12) while CPU is running
ERROR: Can not read register 957 (PMPADDR13) while CPU i
s running
ERROR: Can not read register 958 (PMPADDR14) while CPU is running
ERROR: Can not read registe
r 959 (PMPADDR15) while CPU is running
ERROR: Can not read register 2816 (MCYCLE) while CPU is running
ERROR: Can not read register 2818 (MINSTRET) while CPU is running
ERROR: Can not read register 2819 (MHPMCOUNTER3) while CPU is running
ERROR: Can not read register 2820 (MHPMCOUNTER4) while CPU is running
ERROR: Can not read register 2821 (MHPMCOUNTER5) while C
PU is running
ERROR: Can
not
read regi
ster 2822 (MHPMCOUNTER6) while CPU is running
ERROR: Can not read register 2823 (MHPMCOUNTER7) wh
ile CPU is running
ERROR: Can not read register 2824 (MHPMCOUNTER8) while CP
U is running
ERROR: Can not read register 2825 (MHPMCOUNTER9) while CPU is running
ERROR: Can not read register 2826 (MHPMCOUNTER10) while CPU is r
unning
E
RROR: Can not read register 2827 (MHPMCOUNTE
R11) while CPU is running
ERROR: Can not read regi
ster 2828 (MHPMCOUNTER12) while CPU is running
ERROR: Can not read register 2829 (MHPMCOUNTER13)
while CPU is running
ERROR: Can not read regi
ster 2830 (MHPMCOUNTER14) while CPU is running
ERROR: Can not read register 2831 (MHPMCOUNTER15) while CPU is running
ERROR: Can not read register 2832 (MHPMCOUNTER16) while CPU is running
ERROR: Can not read register 2833 (MHPMCOUNTER17) while
CPU is running
ERROR: Can no
t read register 2834 (MHPMCOUNTER18) while CPU is running
ERROR: Can not read regis
ter 2835 (MHPMCOUNTER19) while CPU is running
ERROR: Can not read register 2836 (MHPMCOUNTER20) while CPU is running
ERROR: Can not read register 2837 (MHPMCOUNTER21) while CPU is running
ERROR: Can not read register 2838 (MHPMCOUNTER22) while CPU is running
ERROR: Can not read register 2839 (MHPM
COUNTER23) while CPU is running
ERROR:
Can not read register 2840 (MHPMCOUNTER24) while CPU is running
ERROR: Can not read register 2841 (MHPMCOUNTER25) while CPU is running
ERROR: Can not read register 2842 (MHPMCOUNTER26) while C
PU is running
ERROR: Can not read r
egister 2843 (MHPMCOUNTER27) while CPU is running
ERROR: Can not read register 2844 (MHPMCOUNTER28) while CPU is running
ERROR: Can not read register 2845 (MHPMCOUNTER29) while CPU is running
ERROR: Can not read register 2846 (MHPMCOUNTER30) while CPU is running
ERROR: Can not read register 2847 (MHPMCOUNTER31) while CPU is running
ERROR: Can not read register 2944 (MCYCLEH) while CPU is running
ERROR: Can no
t read register 2946 (MINSTRETH) while CPU is running
ERROR: Can not read register 2947 (MHPMCOUNTER3H) while CPU is running
ERROR: Can not read register 2948 (MHPMCOUNTER4H) while CPU is running
ERROR: Can not read register 2949 (MHPMCOUNTER5H) while CPU is running
ERROR: Can not read register 2950 (MHPMCOUNTER6H) while CPU is running
ERROR: Can not read register 2951 (MHPMCOUNTER7H) while CPU is running
ERROR: Can not read register 2952 (
MHPMCOUNTER8H) while CPU is running
ERROR
: Can not read register 2953 (MHPMCOUNTER9H) while CPU is running
ERROR: Can not read regis
ter 2954 (MHPMCOUNTER10H) while CPU is running
ERROR: Can not read regist
er 2955 (MHPMCOUNTER11H) while CPU is running
ERROR: Can not read regis
ter 2956 (MHPMCOUNTER12H) while CPU is running
ERROR: Can not read regis
ter 2957 (MHPMCOUNTER13H) while CPU
is running
ERR
OR: Can not read register 2958 (MHPMCOUNTER14H
) while CPU is running
ERROR: Can not read register 2959 (MHPMCOUNTER15H) while CPU is running
ERROR: Can not read register 2960 (MHPMCOUNTER16H) while CPU is running
ERROR: Can not read register 2961 (MHPMCOUNTER17H) while CPU is running
ERROR: Can not read register 2962 (MHPMCOUNTER18H) while CPU is running
ERROR: Can not read register 2963 (MHPMCOUNTER19H) while CPU is running
ERROR: Can not read register 2964 (MHPMCOUNTER20H) while CPU is running
ERROR: Can not read register 2965 (MH
PMCOUNTER21H) while CPU is running
ERROR: Can not read register 2966 (MHPMCOUNTER22H) while CPU is running
ERROR: Can not read register 2967 (MHPMCOUNTER23H) while CPU is running
ERROR: Can not read register 2968 (MHPMCOUNTER24H) while CPU is running
ERROR: Can not read register 2969 (MHPMCOUNTER25H) while CPU is running
ERROR: Can not read register 2970 (MHPMCOUNTER26H) while CPU is running
ERROR: Can not read register 2971 (MHPMCOUNTER27H) while CPU is running
ERROR: Can not read register 2972 (MHPMCOUNTER28H) while CPU is running
ERROR: Can not read register 2973 (MHPMCOUNTER29H) while CPU is running
ERROR: Can not read register 2974 (MHPMCOUNTER30H) while CPU is running
ERROR: Can not read register 2975 (MHPMCOUNTER31H) while CPU is running
ERROR: Can not read register 803 (MHPMEVENT3) while CPU is running
ERROR: Can not read register 804 (MHPMEVENT4) while CPU is running
ERROR: Can not read register 805 (MHPMEVENT5) while CPU is running
ERROR: Can not
read register 806 (MHPMEVENT6) while CPU is running
ERROR: Can not read register 807 (MHPMEVENT7) while CPU is running
ERROR: Can not read register 808 (MHPMEVENT8) while CPU is running
ERROR: Can not read register 809 (MHPMEVENT9) while CPU is running
ERROR: Can not read register 810 (MHPMEVENT10) while CPU is running
ERROR: Can not read register 811 (MHPMEVENT11) while CPU is running
ERROR: Can not read register 812 (MHPMEVENT12) while CPU is running
ERROR: Can not read register 813 (MHPMEVENT13) while CPU is running
ERROR: Can not read register 814 (MHPMEVENT14) while CPU is running
ERROR: Can not read register 815 (MHPMEVENT15) while CPU is running
ERROR: Can not read register 816 (MHPMEVENT16) while CPU is running
ERROR: Can not read register 817 (MHPMEVEN
T17) while CPU is running
ERROR: Can not
read register 818 (MHPMEVENT18) while CPU is running
ERROR: Can not read register 819 (MHPMEVENT19) while CPU is running
ERROR: Can not read register 820 (MHPMEVENT20) while CPU is running
ERROR: Can not read register 821 (MHPMEVENT21) while CPU is running
ERROR: Can not read register 822 (MHPMEVENT22) while CPU is running
ERROR: Can not read register 823 (MHPMEVENT23) while CPU is running
ERRO
R: Can not read register 824 (M
HPMEVENT24) while CPU is running
ERROR: Can not read register 825 (
MHPMEVENT25) while CP
U is running
ERROR: Can not
read register 826 (MHPMEVENT26) while CPU is running
ERROR: Can not read register 827 (MHPMEVENT27) while CPU is running
ERROR: Can not read register 828 (MHPMEVENT28) while CPU is running
ERROR: Can not read register 829 (MHPMEVENT29) while CPU is running
ERROR: C
an not read register 830 (MHPMEVENT30) while CPU is running
ERROR: Can not read register 831 (MHPMEVENT31) while CPU is running
ERROR: Can not read register 1952 (TSELECT)
while CPU is running
ERROR: Can not re
ad register 1953 (TDATA1)
while CPU is running
ERROR: Can not read register 1954 (TDATA2) while CPU
is running
ERROR: Can not read re
gi
ster 1955 (TDATA3) while CPU is running
ERROR: Can not read register 1968 (DCSR) while CPU is running
ERROR: Can not read register 1969 (DPC) while CPU is running
ERROR: Can not read register 1970 (DSCRATCH) while CPU is running
ERROR: Can not read register 4
096 (X0) while CPU is running
ERROR: Can
not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read regi
ster 4096 (X0) while CPU is running
ERROR: Can not read register 4
096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is ru
nning
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
ERROR: Can not read register 4096 (X0) while CPU is running
Removing breakpoint @ address 0x200101A2, Size = 2

Program
received signal SIGTRAP, Trace/breakpoint trap.
0xdeadbeef in ?? ()
WARNING: CPU could not be halted
ERROR: Communication timed out: Requested 4 bytes, received 0 bytes !
Could not start CPU core. (ErrorCode: -1)
WARNING: Target connection lost.
WARNING: Failed to read memory @ address 0x00000000

With another IDE(FReefomStudio) it works.

Sorry but bumping this thread

1 Like

Sorry I have no solution, but I am facing same problem with Redboard (sparkfun) and Freedom IDE for a simple hello world project. Did you manage to solve?

So using the official Freedom IDE from SiFive results in the same error as seen above?

Thanks to @robin_hodgson’s detailed instructions on Sparkfun forum (Flashing a RED-V - SparkFun Electronics) I solved the issue. I followed them but with hello world first. When I connected the device and programmed it through Segger IDE, it first updated the driver for J-Link for each board, Redboard and ThingPlus. Both boards worked and the serial terminal displayed the output.

I repeated the same procedure with Blinky and it worked as well on both boards.

Finally, I repeated both examples for each board with Freedom IDE and this time they worked. I may repeat the procedure with Platform IO soon to see if it works.

I do not know what was the exact problem, but I guess the driver update fixed them.

Thank you again!

3 Likes

Thanks for your work!
I didn’t follow your steps, but reinstalled everything again hoping for some driver update and its working again.

Hope your work can help someone else!

1 Like