查看: 586|回复: 0
收起左侧

[IDE] ArchLinux 下使用 MounRiver 工具链开发

[复制链接]

  离线 

  • TA的每日心情
    拍拍
    2022-10-3 08:50
  • 签到天数: 1 天

    [LV.1]

    发表于 2022-11-6 10:20:42 | 显示全部楼层 |阅读模式

    有人预言,RISC-V或将是继Intel和Arm之后的第三大主流处理器体系。欢迎访问全球首家只专注于RISC-V单片机行业应用的中文网站

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    本帖最后由 魏定国 于 2022-11-6 10:20 编辑

    MRS_Toolchain_Linux 工具链及调试器

    Arch Linux 下使用 mounriver-studio-toolchain 工具链开发
    1. # Maintainer: taotieren
    2. pkgbase=mounriver-studio-toolchain-bin
    3. pkgname=($pkgbase mounriver-studio-toolchain-openocd-bin mounriver-studio-toolchain-riscv-bin)
    4. pkgver=1.30
    5. pkgrel=1
    6. arch=('x86_64')
    7. url='http://www.mounriver.com/'
    8. license=('GPL2' 'GPL3' 'custom')
    9. provides=('MRS-Toolchain')
    10. conflicts=()
    11. depends=()
    12. makedepends=('tar')
    13. optdepends=('ch34x-dkms-git: CH341SER driver with fixed bug'
    14.             'i2c-ch341-dkms: CH341 USB-I2C adapter driver'
    15.             'spi-ch341-usb-dkms: SPI/GPIO driver for CH341'
    16.             'ch341eepromtool: An i2c serial EEPROM programming tool for the WCH CH341A'
    17.             'ch341prog-git: A simple command line tool (programmer) interfacing with ch341a'
    18.             'ch341eeprom-git: A libusb based programming tool for 24xx I²C EEPROMs using the WCH CH341A')
    19. source=("${pkgbase}-${pkgver}.tar.xz::http://file.mounriver.com/tools/MRS_Toolchain_Linux_x64_V${pkgver}.tar.xz"
    20.         )
    21. sha256sums=('8b03bab58ab6754a26736004d9a2a66f5753f55f70f488c7f59fd703ec674753')
    22. options=('!strip')
    23. noextract=(${pkgbase}-${pkgver}.tar.xz)
    24. _install(){
    25.      find ${@: 2} -type f -exec install -Dm$1 {}  ${pkgdir}/opt/wch/${pkgname%-bin}/{} \;
    26. }
    27. prepare() {
    28.     tar -xf "${srcdir}/${pkgbase}-${pkgver}.tar.xz" --strip-components=1 -C "${srcdir}/"
    29. }
    30. package_mounriver-studio-toolchain-bin() {
    31.     pkgdesc="This MRS Toolchain includes the tool chain for RISC-V kernel chip under Linux x64 and the debug download tool OpenOCD."
    32.     depends=(mounriver-studio-toolchain-openocd-bin mounriver-studio-toolchain-riscv-bin)
    33. }
    34. package_mounriver-studio-toolchain-openocd-bin() {
    35.     depends=('bash'
    36.              'libftdi-compat'
    37.              'libusb'
    38.              'hidapi'
    39.              'libusb-compat'
    40.              'libudev.so')
    41.     pkgdesc="MRS Toolchain OpenOCD supports erasure, programming, verification and debugging of the chip."
    42.     cd "${srcdir}"/OpenOCD/
    43.     _install 644 bin -name "*.cfg"
    44.     _install 755 bin -name "openocd"
    45.     _install 644 share
    46.     install -Dm0644 "${srcdir}/beforeinstall/50-wch.rules" "${pkgdir}/usr/lib/udev/rules.d/50-wch.rules"
    47.     install -Dm0644 "${srcdir}/beforeinstall/60-openocd.rules" "${pkgdir}/usr/lib/udev/rules.d/60-openocd-wch.rules"
    48.     install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-arm" << EOF
    49. #!/bin/env bash
    50. exec /opt/wch/${pkgname%-bin}/bin/openocd -f /opt/wch/${pkgname%-bin}/bin/wch-arm.cfg "\$@"
    51. EOF
    52.     install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-riscv" << EOF
    53. #!/bin/env bash
    54. exec /opt/wch/${pkgname%-bin}/bin/openocd -f /opt/wch/${pkgname%-bin}/bin/wch-riscv.cfg "\$@"
    55. EOF
    56. }
    57. package_mounriver-studio-toolchain-riscv-bin() {
    58.     pkgdesc="MRS Toolchain Support for RISC-V assembly and GNU C compilation, link operation."
    59.     depends=('bash')
    60.     install -dm0755 "${pkgdir}/opt/wch/${pkgname%-bin}"
    61.     cp -a "${srcdir}"/RISC-V\ Embedded\ GCC/* "${pkgdir}/opt/wch/${pkgname%-bin}"
    62.     install -Dm0644 /dev/stdin "${pkgdir}/etc/profile.d/${pkgname%-bin}.sh" << EOF
    63. #!/bin/sh
    64. [ -d /opt/wch/${pkgname%-bin}/bin ] && append_path '/opt/wch/${pkgname%-bin}/bin'
    65. export PATH
    66. EOF
    67. }
    68. # vim: ts=4 sw=4 et
    复制代码


    已经上传到 AUR 仓库:https://aur.archlinux.org/packages/mounriver-studio-toolchain-bin



    提供如下的包:
    1. yay -S mounriver-studio-toolchain-bin
    复制代码
    其他 linux 系统可以参考,并自行移植
    GD32VF 单片机芯片及应用-[IDE] ArchLinux 下使用 MounRiver 工具链开发risc-v单片机中文社区(1)





    上一篇:[IDE] ArchLinux 下使用 MounRiver Studio 社区版开发
    下一篇:[RISC-V Linux] Arch Linux 更新 nuclei-gcc nuclei-openocd 支持 embedded-studio-risc-v
    RISCV作者优文
    全球首家只专注于RISC-V单片机行业应用的中文网站
    回复

    使用道具 举报

    高级模式
    B Color Image Link Quote Code Smilies

    本版积分规则

    关闭

    RISC-V单片机中文网上一条 /2 下一条



    版权及免责声明|RISC-V单片机中文网 |网站地图

    GMT+8, 2024-11-6 08:05 , Processed in 0.759732 second(s), 46 queries .

    快速回复 返回顶部 返回列表