Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Docker
Ubuntu
柿饼_PersimmonUI
【开发环境】Persim-M7 环境搭建(Docker)
10.00
发布于 2022-09-17 19:30:48 浏览:490
订阅该版
[tocm] ## 环境搭建 首先进行换源和docker安装,深圳这边华为云比较快,其他地区可以用阿里云 ```shell # sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list # sudo sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list sudo sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list sudo sed -i 's/security.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list sudo apt update sudo apt upgrade sudo curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun sudo docker pull ubuntu:20.04 sudo docker run --name persim-m7 -itd ubuntu:20.04 sudo docker exec -it persim-m7 /bin/bash ``` 在 docker 的 shell 中,执行以下命令 ```bash # sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list # sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list sed -i 's/security.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list apt-get update apt-get install sudo apt-utils vim net-tools inetutils-ping wget curl tree lbzip2 bzip2 git xz-utils python3 python2 python3-pip scons telnet openssl libssl-dev apt-get install -qq libncurses5-dev lib32z1 > /dev/null apt-get install u-boot-tools zlib1g-dev dosfstools mtools curl -s https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1652757104469/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6-20220516.tar.gz | tar xzf - -C /opt vim /root/.bashrc ``` 在 vim 中补充以下命令 ```bash alias get_persim_m7=' export RTT_CC=gcc export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin export RTT_CC_PREFIX=riscv64-unknown-elf- $RTT_EXEC_PATH/riscv64-unknown-elf-gcc --version ' ``` ```shell vim /root/.bash_profile ``` 在 vim 中补充以下命令 ```bash if test -f .bashrc ; then source .bashrc fi ``` 以后只需执行 get_persim_m7 命令,即可获取环境变量,随后便可实现编译 配合 DockerFile 食用更佳,构建命令: `docker build -f ./dockerfile -t persim-m7:0.0 .` ```dockerfile FROM ubuntu:20.04 RUN set -x # 换源 # RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list # RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list RUN sed -i 's/security.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y sudo apt-utils vim net-tools inetutils-ping wget curl tree lbzip2 bzip2 git xz-utils python3 python2 python3-pip scons telnet openssl libssl-dev RUN DEBIAN_FRONTEND="noninteractive" apt -y install tzdata RUN TZ=Asia/Shanghai && \ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime RUN apt-get install -qq libncurses5-dev lib32z1 > /dev/null RUN apt-get install -y u-boot-tools zlib1g-dev dosfstools mtools RUN curl -s https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1652757104469/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6-20220516.tar.gz | tar xzf - -C /opt RUN printf " alias get_persim_m7='\n" >> /root/.bashrc RUN printf " export RTT_CC=gcc\n" >> /root/.bashrc RUN printf " export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin\n" >> /root/.bashrc RUN printf " export RTT_CC_PREFIX=riscv64-unknown-elf-\n" >> /root/.bashrc RUN printf " \$RTT_EXEC_PATH/riscv64-unknown-elf-gcc --version\n" >> /root/.bashrc RUN printf "'\n" >> /root/.bashrc RUN printf "if test -f .bashrc ; then\n" >> /root/.bash_profile RUN printf " source .bashrc\n" >> /root/.bash_profile RUN printf "fi\n" >> /root/.bash_profile RUN apt clean RUN rm -rf /var/lib/apt/lists/* RUN mkdir /var/lib/apt/lists/partial RUN cat /etc/issue RUN python3 -V RUN scons --version ``` ## VSCode配置文件 launch.json ```json { "version": "0.2.0", "configurations": [ { "name": "riscv-debug-bootloader", "type": "cppdbg", "request": "launch", "miDebuggerPath": "/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin/riscv64-unknown-elf-gdb", "program": "${workspaceRoot}/software/bootloader/f133/rtthread.elf", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "text": "target remote localhost:1025" }, { "text": "restore ${workspaceRoot}/software/bootloader/f133/rtthread.elf" }, { "text": "set $pc=0x41000000" }, ], "launchCompleteCommand": "None", "cwd": "${workspaceFolder}" }, { "name": "riscv-debug-app", "type": "cppdbg", "request": "launch", "miDebuggerPath": "/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin/riscv64-unknown-elf-gdb", "program": "${workspaceRoot}/software/firmware/f133/rtthread.elf", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "text": "target remote localhost:1025" }, { "text": "restore ${workspaceRoot}/software/firmware/f133/rtthread.elf" }, { "text": "set $pc=0x40000000" }, ], "launchCompleteCommand": "None", "cwd": "${workspaceFolder}" } ] } ``` tasks.json ```json { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build_bootloader", "type": "shell", "command": [ "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin;", "export RTT_CC_PREFIX=riscv64-unknown-elf-;", "cd ${workspaceFolder}/software/bootloader/f133;", "scons -j8;" ], "problemMatcher": [] }, { "label": "clean_bootloader", "type": "shell", "command": [ "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin;", "export RTT_CC_PREFIX=riscv64-unknown-elf-;", "cd ${workspaceFolder}/software/bootloader/f133;", "scons -c;" ], "problemMatcher": [] }, { "label": "build_app", "type": "shell", "command": [ "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin;", "export RTT_CC_PREFIX=riscv64-unknown-elf-;", "cd ${workspaceFolder}/software/firmware/f133;", "scons -j8;" ], "problemMatcher": [] }, { "label": "clean_app", "type": "shell", "command": [ "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.2.6/bin;", "export RTT_CC_PREFIX=riscv64-unknown-elf-;", "cd ${workspaceFolder}/software/firmware/f133;", "scons -c;" ], "problemMatcher": [] } ] } ``` 使用 VSCode 一键编译 在SDK的根目录打开 VSCode,按下 F1,选择 Run Tasks,选择 build_app,即可编译。 ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20220917/b07942c74f48471ab915bedf24d5da22.png.webp) ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20220917/bb56cd7a847376000b3fb3677e8285ff.png.webp)
0
条评论
默认排序
按发布时间排序
登录
注册新账号
关于作者
小权一句两句
似此星辰非昨夜,为谁风露立中宵
文章
5
回答
11
被采纳
2
关注TA
发私信
相关文章
1
【PersimmonUI柿饼学习营】+ A Byte of China + 环境搭建&20W年薪广告
2
【柿饼学习营】+werrysuzhen+20W年薪作业
3
【PersimmonUI柿饼学习营】+ meetwit + 20W年薪广告&lesson01
4
【PersimmonUI柿饼学习营】+ DaZhou + 20W年薪作业+视频有彩蛋
5
【PersimmonUI柿饼学习营】+ DMY+ lesson01 20W年薪广告
6
【PersimmonUI柿饼学习营】+ Bigmagic+20W年薪广告&day01
7
【PersimmonUI柿饼学习营】+ chowguohua+年薪广告
8
【柿饼学习营】+werrysuzhen+脚本及事件学习
9
【PersimmonUI柿饼学习营】+ DaZhou+ 手把手教你做计算器
10
【PersimmonUI柿饼学习营】+ A Byte of China + 2048游戏
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
线程
RT-Thread Nano
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
807
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部