感芯科技
直播中

jf_99374259

2年用户 71经验值
擅长:处理器/DSP
私信 关注

【感芯科技64线程MC3172开发板免费试用体验】Fedora Linux 搭环境

【感芯科技64线程MC3172开发板免费试用体验】Fedora Linux 搭环境

这里我所用的环境是 Fedora Linux 36,KDE Plasma 桌面

MC3172介绍

厦门感芯科技多线程处理器 MC3172开发板,64线程同步并行运行,各个线程速度可按需配置,硬件级实时响应,无需中断服务程序,无需实时操作系统。RISC-V RV32IMC 指令集,100%单周期指令,133至200MHz主频,3.37coremark/MHz。极其适合高实时多并发应用场景。

图片.png

下载交叉编译工具链

感芯科技官网上有开发资料

http://www.gxchip.cn/down/show-70.html

http://www.mounriver.com/download

选择 Linux,下载 MRS_Toolchain_Linux_x64_V1.50.tar.xz

解压到 /home/nihui/osd/MRS_Toolchain_Linux_x64_V1.50

图片.png

下载和编译 MC3172-CMake 例子

dreamcmi 已经配好了可以编译的 MC3172-CMake 工程

git clone https://github.com/dreamcmi/MC3172-CMake

修改 CMakeLists.txt 中的工具链设置

set(TOOLPATH  "/home/nihui/osd/MRS_Toolchain_Linux_x64_V1.50/RISC-V Embedded GCC/bin/riscv-none-embed-")

图片.png

cmake 常规的步骤编译

cd MC3172-CMake
mkdir build
cd build
cmake ..
make -j4

使用 wine 启动 MC3172 线程配置工具

fedora 安装 wine

su
dnf install wine

wine 启动线程配置工具,用法和 Windows 环境一致

cd MC3172-CMake/MC3172
wine 线程配置工具_V1.exe

图片.png

下载和编译GX芯片下载工具 GX_ISPTool

https://gitee.com/gxchip/GX_ISPTool

生成makefile,编译报错找不到 hidapi

qmake-qt5 -makefile GX_ISPTool.pro
make -j4

fedora 安装依赖包 hidapi-devel

su
dnf install hidapi-devel

修改工程配置,链接库改为 hidapi-libusb,重新生成makefile编译通过

unix:!macx {
        LIBS += -L$$_PRO_FILE_PWD_/hidapi/linux  -lhidapi
    }
unix:!macx {
        LIBS += -L$$_PRO_FILE_PWD_/hidapi/linux  -lhidapi-libusb
    }

图片.png

烧录固件,串口连接和测试

普通用户启动 GX-ISPTool,找不到 MC3172 设备,用 root 启动解决

su
./GX-ISPTool

microusb线连接 MC3172开发板

[22616.377685] usb 1-3: new full-speed USB device number 5 using xhci_hcd
[22616.665383] usb 1-3: New USB device found, idVendor=5131, idProduct=2007, bcdDevice= 2.00
[22616.665386] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[22616.665387] usb 1-3: Product: GX_LINK
[22616.665388] usb 1-3: Manufacturer: GAN
[22616.665389] usb 1-3: SerialNumber: 2021-07-25
[22616.691221] hid-generic 0003:5131:2007.0005: hiddev98,hidraw4: USB HID v1.00 Device [GAN GX_LINK] on usb-0000:02:00.0-3/input0

连接设备,选择 MC3172-CMake/build/mc3172-cmake.hex

图片.png

USB串口的TX接PC2,RX接PC3

[22914.744467] usb 1-5: new full-speed USB device number 6 using xhci_hcd
[22915.139345] usb 1-5: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[22915.139349] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[22915.139351] usb 1-5: Product: FT232R USB UART
[22915.139352] usb 1-5: Manufacturer: FTDI
[22915.139353] usb 1-5: SerialNumber: A50285BI
[22915.177101] usbcore: registered new interface driver ftdi_sio
[22915.177107] usbserial: USB Serial support registered for FTDI USB Serial Device
[22915.177142] ftdi_sio 1-5:1.0: FTDI USB Serial Device converter detected
[22915.177151] usb 1-5: Detected FT232RL
[22915.183426] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB0

root用户启动tio串口通讯,GX-ISPTool 中点击单次运行

su
tio /dev/ttyUSB0

图片.png

至此已完全可以在纯Linux环境下开发应用了~

更多回帖

发帖
×
20
完善资料,
赚取积分