RISC-V平台IO调试不起作用Mac OS

问题描述

我在Mac OS上使用RISC-V Board Dev B和平台IO,但是即使我成功构建并上传了项目,调试也没有出现一些错误。任何人都可以帮忙吗? 如果您能解决这个问题,我将不胜感激。我试图更改init设置,再次删除并重新启动项目以及所有内容

以下是控制台:

Processing hifive1-revb (platform: sifive; board: hifive1-revb; framework: freedom-e-sdk)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v,--verbose` option
CONfigURATION: https://docs.platformio.org/page/boards/sifive/hifive1-revb.html
PLATFORM: SiFive (2.0.3) > HiFive1 Rev B
HARDWARE: FE310 320MHz,16KB RAM,16MB Flash
DEBUG: Current (jlink) On-board (jlink)
PACKAGES:
 - framework-freedom-e-sdk 2.201908.190927 (20.19.8)
 - toolchain-riscv 1.80300.190927 (8.3.0)
LDF: Library Dependency Finder -> http://bitly/configure-pio-ldf
LDF Modes: Finder ~ chain,Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
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 4622 bytes from 16777216 bytes)
========================= [SUCCESS] Took 1.55 seconds =========================
SEGGER J-Link GDB Server V6.52 Command Line Version
JLinkARM.dll V6.52 (DLL compiled Sep 27 2019 17:51:01)

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:      yes
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...
J-Link is connected.
Firmware: J-Link OB-K22-SiFive compiled Nov 22 2019 12:57:38
Hardware: V1.00
S/N: 979014797
Checking target voltage...
Target voltage: 3.30 V
ERROR: Failed to listen at socket (Err = -1)
ERROR: Failed to open listener port 2331
Restoring target state and closing J-Link connection...
Shutting down...
undefinedFailed to open listener port 2331
Reading symbols from /Users/davelee/Documents/PlatformIO/Projects/Lab1/.pio/build/hifive1-revb/firmware.elf...
PlatformIO Unified Debugger -> http://bitly/pio-debug
PlatformIO: debug_tool = jlink
PlatformIO: Initializing remote target...
0x00813800 in ?? ()
Select auto target interface speed (4000 kHz)
Resetting target
Loading section .init,size 0x17e lma 0x20010000
Loading section .text,size 0x704 lma 0x20010180
Loading section .rodata,size 0x8a4 lma 0x20010884
Loading section .init_array,size 0x8 lma 0x20011128
Loading section .data,size 0xe0 lma 0x20011130
Start address 0x20010000,load size 4622
Transfer rate: 752 KB/sec,924 bytes/write.
Temporary breakpoint 1 at 0x200101a6: file src/main.c,line 5.
PlatformIO: Initialization completed
b'"hpmcounter21h","hpmcounter22h","hpmcounter23h","hpmcounter24h","hpmcounter25h","hpmcounter26h","hpmcounter27h","hpmcounter28h","hpmcounter29h","hpmcounter30h","hpmcounter31h","",'
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> http://bitly/pio-debug
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x200101a6

Command aborted.

此外,这些是我的平台io初始化设置:

[env:hifive1-revb]
platform = sifive
board = hifive1-revb
framework = freedom-e-sdk

此外,我的主要功能和装配是: 主要:

#include <stdio.h>
void asm_main();

int main() {
    while(1) { 
        asm_main();
    } 
        return 1;
}

asm_main.S:

.section .text 
.align 2
.globl asm_main
.equ offset,0x80000000
.equ data,0xDEADBEEF 

# add program code here 
asm_main:
    li a1,data     # load immediate (32-bit)
    
    li a2,offset   # load offset address to a2
    sw a1,(a2)     # save a1 into the memory location specified by a2
    lw a3,(a2)     # load word (32-bit) from mem
    lh a4,(a2)     # load half word (16-bit) from mem 
    lb a5,(a2)     # load byte (8-bit) from mem

    mv a2,a1       # copy a1 to a2
    mv a1,x0       # clear a1. x0 is always '0'
ret

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)