本文來源電子發(fā)燒友社區(qū),作者:jf_99374259, 帖子地址:https://bbs.elecfans.com/jishu_2308788_1_1.html
【感芯科技64線程MC3172開發(fā)板免費試用體驗】Fedora Linux 搭環(huán)境
這里我所用的環(huán)境是 Fedora Linux 36,KDE Plasma 桌面
MC3172介紹
廈門感芯科技多線程處理器 MC3172開發(fā)板,64線程同步并行運行,各個線程速度可按需配置,硬件級實時響應(yīng),無需中斷服務(wù)程序,無需實時操作系統(tǒng)。RISC-V RV32IMC 指令集,100%單周期指令,133至200MHz主頻,3.37coremark/MHz。極其適合高實時多并發(fā)應(yīng)用場景。
下載交叉編譯工具鏈
感芯科技官網(wǎng)上有開發(fā)資料
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
下載和編譯 MC3172-CMake 例子
dreamcmi 已經(jīng)配好了可以編譯的 MC3172-CMake 工程
git clone https://github.com/dreamcmi/MC3172-CMake
修改 CMakeLists.txt 中的工具鏈設(shè)置
set(TOOLPATH "/home/nihui/osd/MRS_Toolchain_Linux_x64_V1.50/RISC-V Embedded GCC/bin/riscv-none-embed-")
cmake 常規(guī)的步驟編譯
cd MC3172-CMake
mkdir build
cd build
cmake ..
make -j4
使用 wine 啟動 MC3172 線程配置工具
fedora 安裝 wine
su
dnf install wine
wine 啟動線程配置工具,用法和 Windows 環(huán)境一致
cd MC3172-CMake/MC3172
wine 線程配置工具_(dá)V1.exe
下載和編譯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
}
燒錄固件,串口連接和測試
普通用戶啟動 GX-ISPTool,找不到 MC3172 設(shè)備,用 root 啟動解決
su
./GX-ISPTool
microusb線連接 MC3172開發(fā)板
[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
連接設(shè)備,選擇 MC3172-CMake/build/mc3172-cmake.hex
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
至此已完全可以在純Linux環(huán)境下開發(fā)應(yīng)用了~
發(fā)布評論請先 登錄
相關(guān)推薦
評論