皋陶 发表于 2020-8-23 10:11:43

RISC-V编译环境搭建

1.JTAG调试器设置
将JTAG调试器连接PC,并断开主机连接将其连接到UBUNTU虚拟机,运行lsusb
应该有以下这个设备:Bus 002 Device 010: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
设置udev rules,使JTAG调试器可以被plugdev group访问sudo gedit /etc/udev/rules.d/99-vmware-scsi-udev.rules
在里面添加ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="660", GROUP="plugdev"
使用如下命令查看该USB设备是否属于plugdev groupls -l / /dev/ttyUSB1
将用户名添加到plugdev group中
whoami
sudo usermod -a -G plugdev username
确认自己的用户名是否属于plugdev group
[*]groups

[*]将gnu-mcu-eclipse-openocd-0.10.0-8-20180724-1118-centos64.tgz放到~/根目录下,并解压


   cd ~/
   tar -xzvf gnu-mcu-eclipse-openocd-0.10.0-8-20180724-1118-centos64.tgz
   cd ~/e200_opensource/sirv-e-sdk/
   mkdir -p work/build/opencd/prefix
   cd work/build/opencd/prefix/
   ln -s ~/gnu-mcu-eclipse/openocd/0.10.0-8-20180724-1118/bin/ bin
   cd ~/e200_opensource/sirv-e-sdk/
   mkdir -p work/build/riscv-gnu-toolchain/risc32-unknown-elf/prefix/
   cd work/build/riscv-gnu-toolchain/risc32-unknown-elf/prefix/
   ln -s ~/gnu-mcu-eclipse/riscv-none-gcc/7.2.0-2-20180111-2230/bin/ bin
3.编译demo_gpio程序,命令如下:cd ~/e200_opensource/sirv-e-sdk/
make software PROGRAM=demo_gpio BOARD=sirv-e203-arty
页: [1]
查看完整版本: RISC-V编译环境搭建