1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,6 +23,7 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
board/**/build
|
||||
board/**/.settings
|
||||
board/*/MDK-ARM/DebugConfig/
|
||||
board/*/obj/
|
||||
board/*/MDK-ARM/Obj/
|
||||
|
@@ -1,3 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
executable.name=openocd
|
||||
install.folder=/Users/ace/sys/gnu-mcu-eclipse/openocd/self/bin
|
||||
eclipse.preferences.version=1
|
||||
executable.name=openocd
|
||||
install.folder=/Users/ace/sys/gnu-mcu-eclipse/openocd/self/bin
|
||||
|
@@ -1,2 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
toolchain.path.512258282=/Users/ace/sys/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/bin
|
||||
eclipse.preferences.version=1
|
||||
toolchain.path.512258282=/Users/ace/sys/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/bin
|
||||
|
@@ -1,48 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.1626121275" name="Debug">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1310167466484573552" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.991040509" name="Release">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1317474887408019048" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.1626121275" name="Debug">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1310167466484573552" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.991040509" name="Release">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1317474887408019048" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
</project>
|
||||
|
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
@@ -1,3 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
executable.name=openocd
|
||||
install.folder=/Users/ace/sys/gnu-mcu-eclipse/openocd/self/bin
|
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
toolchain.path.512258282=/Users/ace/sys/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/bin
|
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.1626121275" name="Debug">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1331743227127997179" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.991040509" name="Release">
|
||||
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1317474887408019048" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</extension>
|
||||
|
||||
</configuration>
|
||||
|
||||
</project>
|
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
141
doc/RISC-V eclipse 开发环境搭建.md
Normal file
141
doc/RISC-V eclipse 开发环境搭建.md
Normal file
@@ -0,0 +1,141 @@
|
||||
#RISC-V eclipse 开发环境搭建
|
||||
|
||||
## 软件列表
|
||||
|
||||
* eclipse
|
||||
* riscv toolchain
|
||||
* riscv openocd
|
||||
|
||||
|
||||
## eclipse
|
||||
|
||||
下载安装过程略
|
||||
|
||||
## riscv toolchain
|
||||
|
||||
在下载页`https://github.com/gnu-mcu-eclipse/riscv-none-gcc/releases`选择相应平台下载。并解压,放到合适的目录。
|
||||
|
||||
## riscv openocd
|
||||
|
||||
签出代码```git clone https://github.com/riscv-mcu/riscv-openocd```
|
||||
|
||||
编译
|
||||
```
|
||||
./configure --enable-cmsis-dap --enable-ftdi --prefix=安装目录路径
|
||||
|
||||
make
|
||||
|
||||
make install
|
||||
```
|
||||
|
||||
|
||||
## 配置eclipse
|
||||
|
||||

|
||||
|
||||
|
||||
配置toolchain路径
|
||||
|
||||

|
||||
|
||||
|
||||
配置openocd路径
|
||||
|
||||

|
||||
|
||||
|
||||
##调试设置
|
||||
|
||||
添加如下两行
|
||||
|
||||
```
|
||||
set arch riscv:rv32
|
||||
set remotetimeout 250
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
## 如果用gd-link调试
|
||||
|
||||
配置文件
|
||||
|
||||
```
|
||||
adapter_khz 1000
|
||||
reset_config srst_only
|
||||
adapter_nsrst_assert_width 100
|
||||
|
||||
|
||||
|
||||
interface cmsis-dap
|
||||
|
||||
transport select jtag
|
||||
|
||||
#autoexit true
|
||||
|
||||
set _CHIPNAME riscv
|
||||
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x1000563d
|
||||
|
||||
set _TARGETNAME $_CHIPNAME.cpu
|
||||
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
|
||||
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 20480 -work-area-backup 0
|
||||
|
||||
|
||||
# Work-area is a space in RAM used for flash programming
|
||||
if { [info exists WORKAREASIZE] } {
|
||||
set _WORKAREASIZE $WORKAREASIZE
|
||||
} else {
|
||||
set _WORKAREASIZE 0x5000
|
||||
}
|
||||
|
||||
# Allow overriding the Flash bank size
|
||||
if { [info exists FLASH_SIZE] } {
|
||||
set _FLASH_SIZE $FLASH_SIZE
|
||||
} else {
|
||||
# autodetect size
|
||||
set _FLASH_SIZE 0
|
||||
}
|
||||
|
||||
# flash size will be probed
|
||||
set _FLASHNAME $_CHIPNAME.flash
|
||||
|
||||
flash bank $_FLASHNAME gd32vf103 0x08000000 0 0 0 $_TARGETNAME
|
||||
riscv set_reset_timeout_sec 1
|
||||
init
|
||||
|
||||
halt
|
||||
```
|
||||
|
||||
## 如果用sipeed riscv debugger调试
|
||||
|
||||
配置文件
|
||||
|
||||
```
|
||||
adapter_khz 1000
|
||||
|
||||
interface ftdi
|
||||
ftdi_device_desc "Dual RS232"
|
||||
ftdi_vid_pid 0x0403 0x6010
|
||||
|
||||
transport select jtag
|
||||
ftdi_layout_init 0x0008 0x001b
|
||||
ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
|
||||
|
||||
set _CHIPNAME riscv
|
||||
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x1e200a6d
|
||||
|
||||
set _TARGETNAME $_CHIPNAME.cpu
|
||||
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
|
||||
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 10000 -work-area-backup 1
|
||||
|
||||
set _FLASHNAME $_CHIPNAME.flash
|
||||
flash bank $_FLASHNAME gd32vf103 0x08000000 0 0 0 $_TARGETNAME
|
||||
|
||||
riscv expose_csrs 3040-3071
|
||||
|
||||
init
|
||||
|
||||
halt
|
||||
# We must turn on this because otherwise the IDE version debug cannot download the program into flash
|
||||
#flash protect 0 0 last off
|
||||
```
|
BIN
doc/img/riscv/debug.png
Normal file
BIN
doc/img/riscv/debug.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 393 KiB |
BIN
doc/img/riscv/openocd.png
Normal file
BIN
doc/img/riscv/openocd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
BIN
doc/img/riscv/properties.png
Normal file
BIN
doc/img/riscv/properties.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 636 KiB |
BIN
doc/img/riscv/toolchain.png
Normal file
BIN
doc/img/riscv/toolchain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 KiB |
Reference in New Issue
Block a user