Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Docker
Ubuntu
柿饼_PersimmonUI
【开发环境】Persim-M3 Ubuntu环境搭建(Docker)
发布于 2022-09-17 19:53:41 浏览:532
订阅该版
[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-m3 -itd ubuntu:20.04 sudo docker exec -it persim-m3 /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 apt-get install -qq libncurses5-dev lib32z1 > /dev/null apt-get install u-boot-tools zlib1g-dev dosfstools mtools curl -s https://armkeil.blob.core.windows.net/developer//sitecore/shell/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux,-d-,tar.bz2 | tar xjf - -C /opt curl -s https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | tar xjf - -C /opt vim /root/.bashrc ``` 在 vim 中补充以下命令 ```bash alias get_persim_m3=' export RTT_ROOT=`pwd`/../rt-thread export RTT_CC=gcc export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-5_4-2016q3/bin $RTT_EXEC_PATH/arm-none-eabi-gcc --version ' ``` ```shell vim /root/.bash_profile ``` 在 vim 中补充以下命令 ```bash if test -f .bashrc ; then source .bashrc fi ``` 以后只需在文件的 scons 路径下执行 get_persim_m3 命令,即可获取环境变量,随后便可实现编译 配合 DockerFile 食用更佳,构建命令: `docker build -f ./dockerfile -t persim-m3: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 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://armkeil.blob.core.windows.net/developer//sitecore/shell/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux,-d-,tar.bz2 | tar xjf - -C /opt RUN curl -s https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | tar xjf - -C /opt RUN printf " alias get_persim_m3='\n" >> /root/.bashrc RUN printf " export RTT_ROOT=`pwd`/../rt-thread\n" >> /root/.bashrc RUN printf " export RTT_CC=gcc\n" >> /root/.bashrc RUN printf " export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-5_4-2016q3/bin\n" >> /root/.bashrc RUN printf " \$RTT_EXEC_PATH/arm-none-eabi-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": "arm-debug-bootloader", "type": "cppdbg", "request": "launch", "miDebuggerPath": "/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gdb", "program": "${workspaceRoot}/software/bootloader/rtthread.elf", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "text": "target remote localhost:3333" }, { "text": "restore ${workspaceRoot}/software/bootloader/rtthread.elf" }, { "text": "set $pc=0x81B00000" }, ], "launchCompleteCommand": "None", "cwd": "${workspaceFolder}" }, { "name": "arm-debug-app", "type": "cppdbg", "request": "launch", "miDebuggerPath": "/opt/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gdb", "program": "${workspaceRoot}/software/firmware/rtthread.elf", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "text": "target remote localhost:3333" }, { "text": "restore ${workspaceRoot}/software/firmware/rtthread.elf" }, { "text": "set $pc=0x80000000" }, ], "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_ROOT=`pwd`/software/rt-thread;", "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin;", "cd ${workspaceFolder}/software/bootloader;", "scons -j8;" ], "problemMatcher": [] }, { "label": "clean_bootloader", "type": "shell", "command": [ "export RTT_ROOT=`pwd`/software/rt-thread;", "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/gcc-arm-none-eabi-10-2020-q4-major/bin;", "cd ${workspaceFolder}/software/bootloader;", "scons -c;" ], "problemMatcher": [] }, { "label": "build_app", "type": "shell", "command": [ "export RTT_ROOT=`pwd`/software/rt-thread;", "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-5_4-2016q3/bin;", "cd ${workspaceFolder}/software/firmware;", "scons -j8;" ], "problemMatcher": [] }, { "label": "clean_app", "type": "shell", "command": [ "export RTT_ROOT=`pwd`/software/rt-thread;", "export RTT_CC=gcc;", "export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-5_4-2016q3/bin;", "cd ${workspaceFolder}/software/firmware;", "scons -c;" ], "problemMatcher": [] } ] } ``` 使用 VSCode 一键编译 在SDK的根目录打开 VSCode,按下 F1,选择 Run Tasks,选择 build_app,即可编译。 ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20220917/85485180f1e073fb0389fbdf513ae11d.png.webp) ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20220917/bef2c5e7b76552c20f347f9f9c6ec4d8.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
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部