RISC-V MCU中文社区

【求助】 在使用hbird sdk过程中遇到的错误(make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash)

发表于 开源蜂鸟E203 2022-11-14 14:57:04
10
174
0

Hi 各位专家好


在执行make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash

遇到错误如下

===

Download and run helloworld.elf

riscv-nuclei-elf-gdb helloworld.elf -ex "set remotetimeout 240" \

-ex "target remote | openocd -c \"gdb_port pipe; log_output openocd.log\" -f ../../../SoC/hbirdv2/Board/ddr200t/openocd_hbirdv2.cfg" \

--batch -ex "monitor reset halt" -ex "load" -ex "monitor resume" -ex "quit"

Open On-Chip Debugger 0.11.0+dev-02420-g1d0387cb1 (2022-08-25-06:44)

Licensed under GNU GPL v2

For bug reports, read

 http://openocd.org/doc/doxygen/bugs.html

Remote communication error. Target disconnected.: Connection reset by peer.

"monitor" command not supported by this target.

You can't do that when your target is `exec'

"monitor" command not supported by this target.

===


再执行

make run_openocd

=======

Start openocd server

openocd -c "gdb_port 3333" -f ../../../SoC/hbirdv2/Board/ddr200t/openocd_hbirdv2.cfg

Open On-Chip Debugger 0.11.0+dev-02420-g1d0387cb1 (2022-08-25-06:44)

Licensed under GNU GPL v2

For bug reports, read

 http://openocd.org/doc/doxygen/bugs.html

Info : Using libusb driver

Info : clock speed 1000 kHz

Info : JTAG tap: riscv.cpu tap/device found: 0x1e200a6d (mfg: 0x536 (Nuclei System Technology Co Ltd), part: 0xe200, ver: 0x1)

Info : [riscv.cpu] Found 0 triggers

halted at 0x0 due to debug interrupt

Info : Examined RISCV core; XLEN=32, misa=0x40001105

[riscv.cpu] Target successfully examined.

Info : starting gdb server for riscv.cpu on 3333

Error: couldn't bind gdb to socket on port 3333: Address already in use

Info : Valid NUSPI on device Nuclei SoC SPI Flash at address 0x20000000 with spictrl regbase at 0x10014000

Info : Nuclei SPI controller version 0x00000000

Info : Found flash device 'gd gd25q32c' (ID 0x001640c8)

cleared protection for sectors 0 through 63 on flash bank 0


Error: couldn't bind tcl to socket on port 6666: Address already in use

../../../Build/Makefile.rules:109: recipe for target 'run_openocd' failed

make: *** [run_openocd] Error 1

=======

继续执行make run_openocd GDB_PORT=3344


=====

make run_openocd GDB_PORT=3344

Start openocd server

openocd -c "gdb_port 3344" -f ../../../SoC/hbirdv2/Board/ddr200t/openocd_hbirdv2.cfg

Open On-Chip Debugger 0.11.0+dev-02420-g1d0387cb1 (2022-08-25-06:44)

Licensed under GNU GPL v2

For bug reports, read

 http://openocd.org/doc/doxygen/bugs.html

Info : Using libusb driver

Info : clock speed 1000 kHz

Info : JTAG tap: riscv.cpu tap/device found: 0x1e200a6d (mfg: 0x536 (Nuclei System Technology Co Ltd), part: 0xe200, ver: 0x1)

Info : [riscv.cpu] Found 0 triggers

halted at 0x0 due to debug interrupt

Info : Examined RISCV core; XLEN=32, misa=0x40001105

[riscv.cpu] Target successfully examined.

Info : starting gdb server for riscv.cpu on 3344

Info : Listening on port 3344 for gdb connections

Info : Valid NUSPI on device Nuclei SoC SPI Flash at address 0x20000000 with spictrl regbase at 0x10014000

Info : Nuclei SPI controller version 0x00000000

Info : Found flash device 'gd gd25q32c' (ID 0x001640c8)

cleared protection for sectors 0 through 63 on flash bank 0


Error: couldn't bind tcl to socket on port 6666: Address already in use

../../../Build/Makefile.rules:109: recipe for target 'run_openocd' failed

make: *** [run_openocd] Error 1


=====

因此一直不知道如何消除tcl port的问题

喜欢0
用户评论 (10)
  • liao

    2022-11-17 12:22:35 liao 1#

    非常感谢胡老师的帮忙

    现在已经成功了

    >>>

    总结一下

    是因为openocd占用太多端口

    导致识别失败

    因此make upload过程中,程序未能正确下载到板子上


    注意:若是在make upload中使用ilm而不是flash

    记得注释掉 openocd里面的flash语句

    <<<

  • 胡灿

    2022-11-15 16:14:49 胡灿 2#

    liao

    胡老师好:

    1:跑make run_openocd 结果如下

    没有报错


    2:跑make run_gdb


    3:用netstat -nap查看进程,如下所示:



    Thanks

    上图显示就是连上了啊,可以用gdb的命令来下载程序了。

    注意,不要吧run_openocd和upload一起用

    看看makefile里面的内容,upload命令是带了run_openocd的,这样就会重复运行,占用端口。



  • liao

    2022-11-15 11:19:00 liao 3#

    从run_gdb跟run_openocd的结果来看

    Info : accepting 'gdb' connection on tcp/3333

    gdb跟openocd是能正常链接的



  • liao

    2022-11-15 10:19:05 liao 4#

    胡老师好:

    1:跑make run_openocd 结果如下

    没有报错


    2:跑make run_gdb


    3:用netstat -nap查看进程,如下所示:



    Thanks

  • 胡灿

    2022-11-15 09:57:39 胡灿 5#

    liao

    谢谢胡老师的回答

    我重启ubantu后,开了两个treminal

    第一个窗口跑的是:

    make openocd

    结果如下:

    >>>


    <<<

    make oenocd的结果正常



    于是接下来跑

    make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
    Note:
    USB能被正常识别


    第二个terminal不是用upload,是用run_gdb。

    upload还会再启一起openOCD

  • liao

    2022-11-15 09:43:01 liao 6#

    谢谢胡老师的回答

    我重启ubantu后,开了两个treminal

    第一个窗口跑的是:

    make openocd

    结果如下:

    >>>


    <<<

    make oenocd的结果正常



    于是接下来跑

    make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
    Note:
    USB能被正常识别


  • 胡灿

    2022-11-14 18:05:40 胡灿 7#

    liao

    更新一下:

    使用该命令,但是一直hang住,跑不完

    这个不是hang住,openOCD是在等gdb通信,需要启动gdb来连接openOCD

    不要同时启动几个openOCD,可以在任务栏里把openOCD杀掉,直接在两个terminal里面,一个启动openOCD,一个启动gdb试试

  • liao

    2022-11-14 15:11:47 liao 8#

    更新一下:

    使用该命令,但是一直hang住,跑不完

  • liao

    2022-11-14 15:02:11 liao 9#

    这是端口使用情况


  • liao

    2022-11-14 14:57:39 liao 10#

    执行过:

    make run_openocd GDB_PORT=3344 TCL_PORT=6667

    但是扔不能解决问题

liao

liao 实名认证

lwj

积分
问答
粉丝
关注
  • RV-STAR 开发板
  • RISC-V处理器设计系列课程
  • 培养RISC-V大学土壤 共建RISC-V教育生态
RV-STAR 开发板