Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
ART-Pi Smart
【ART-Pi Smart】 上手体验以及 vscode 插件使用
发布于 2021-12-22 09:11:46 浏览:2317
订阅该版
[tocm] ## 开箱 包装内自带了两根 Type-C 线和一根网线。开发板整体接口还是很丰富的:SDIO、USB、ETH、LCD、Camera。可玩性还是很高的。来几张靓照: ![000.jpg](https://oss-club.rt-thread.org/uploads/20211222/80dae89011e3a3e3125abd69bc63c384.jpg.webp) ![001.jpg](https://oss-club.rt-thread.org/uploads/20211222/3a85f122508dad8e799344cc6a7ae3f7.jpg.webp) ![002.jpg](https://oss-club.rt-thread.org/uploads/20211222/e1cbc2d7d2fce50fd9f83bac004440ea.jpg.webp) ## 上电 拿到新开发板的第一件事,当然是插电,开机,打印 `hello, world`! 1. 插入 Type-C 电源和网线,打开终端,波特率设置为 115200 ![0.png](https://oss-club.rt-thread.org/uploads/20211222/1a7f6b23830ef59067542a9e3dc5f24a.png) 2. 上电调试信息: ```shell U-Boot 2017.03-g002b758ac9-dirty (Nov 24 2021 - 20:08:02 +0800) CPU: Freescale i.MX6ULL rev1.1 696 MHz (running at 396 MHz) CPU: Industrial temperature grade (-40C to 105C) at 38C Reset cause: WDOG Model: Freescale i.MX6 ULL 14x14 EVK Board Board: MX6ULL 14x14 EVK DRAM: 512 MiB MMC: FSL_SDHC: 0, FSL_SDHC: 1 *** Warning - bad CRC, using default environment Display: TFT7016 (1024x600) Video: 1024x600x24 In: serial Out: serial Err: serial switch to partitions #0, OK mmc1(part 0) is current device Net: eth1: ethernet@020b4000, eth0: ethernet@02188000 [PRIME] Normal Boot Hit any key to stop autoboot: 0 reading /kernel/rtthread.bin 1149312 bytes read in 73 ms (15 MiB/s) ## Starting application at 0x80001000 ... \ | / - RT - Thread Smart Operating System / | \ 5.0.0 build Dec 15 2021 2006 - 2020 Copyright by rt-thread team lwIP-2.1.2 initialized! [15] E/drv.enet: emac device init success [20] I/I2C: I2C bus [i2c3] registered [24] I/I2C: I2C bus [i2c4] registered [83] E/drv.enet: PHY Link down, please check the cable connection and link partner setting. [94] I/SDIO: SD card capacity 31166976 KB. [156] I/SDIO: emmc card capacity 3817472 KB. found part[0], begin: 2098176, size: 500.0MB found part[1], begin: 526386176, size: 1.0GB found part[2], begin: 1600128000, size: 10.0MB found part[3], begin: 1610613760, size: 200.0MB [266] I/touch: rt_touch init success [270] I/gt911: touch device gt911 init success [275] I/sal.skt: Socket Abstraction Layer initialize success. emmc file system initialization done! Dir / sd0 mount failed! [1751] E/[RW007]: The wifi Stage 1 status 0 0 0 1 [1758] I/WLAN.dev: wlan init success [1763] I/WLAN.lwip: eth device init ok name:w0 [1768] I/WLAN.dev: wlan init success [1773] I/WLAN.lwip: eth device init ok name:w1 rw007 sn: [rw00700000000fc584a2c5001] rw007 ver: [RW007_2.1.0-a7a0d089-57] [5247] D/drv.enet: enet1 link up [5789] W/WLAN.mgnt: F:rt_wlan_connect L:1091 not find ap! ssid:rt-thread hello rt-smart! /sd/wifi.sh wi-fi configuration file not exist in sd card! [5807] I/mcf.link.tcp: TCPServer Waiting for client on port 5555... [5814] I/mcf.link: MCF link port(3) register successfully. msh />[5850] I/mcf.trans: MCF(V0.1.0) initialized successfully. [5855] I/urpc: uRPC(V0.1.0) initialize successfully. [5861] I/mcf.trans: MCF protocol started successfully. 3. 在终端输入命令 `help` 查看帮助信息 ```shell msh />help RT-Thread shell commands: reboot - reboot system cpu_usage - display cpu usage dbg - dbg memcheck - check memory data memtrace - dump memory trace information gic_dump - show gic status list_page - show page info list_fd - list file descriptor lsof - list open files mount - mount
unmount - unmount the mountpoint hello - say hello world clear - clear the terminal screen version - show RT-Thread version information list_thread - list thread list_sem - list semaphore in system list_event - list event in system list_mutex - list mutex in system list_mailbox - list mail box in system list_msgqueue - list message queue in system list_memheap - list memory heap in system list_mempool - list memory pool in system list_timer - list timer in system list_device - list device in system list - list all symbol in system help - RT-Thread shell help. ps - List threads in the system. free - Show the memory usage in the system. ls - List information about the FILEs. cp - Copy SOURCE to DEST. mv - Rename SOURCE to DEST. cat - Concatenate FILE(s) rm - Remove(unlink) the FILE(s). cd - Change the shell working directory. pwd - Print the name of the current working directory. mkdir - Create the DIRECTORY. mkfs - format disk with file system df - disk free echo - echo string to file set - set or show environment variable list_channel - list IPC channel information list_process - list process kill - send a signal to a process killall - kill processes by name list_shm - show share memory info sys_log - sys_log 1(enable)/0(disable) ifconfig - list the information of all network interfaces ping - ping network host dns - list and set the information of dns netstat - list the information of TCP / IP pwm_enable - pwm_enable pwm1 1 pwm_disable - pwm_disable pwm1 1 pwm_set - pwm_set pwm1 1 100 50 date - get date and time or set [year month day hour min sec] wifi - wifi command. ``` 4. 执行用户 app。用户 app 存放在目录 **/root/bin** 目录下 ```shell msh /root/bin>pong.elf & msh /root/bin> Pong: wait on the IPC channel: 3 msh /root/bin>ping msh /root/bin>ping.elf msh /root/bin> Ping: send count = 0 Pong: receive count = 0 Pong: reply count = 0 Ping: receive the reply 0 Ping: send count = 1 Pong: receive count = 1 Pong: reply count = 1 Ping: receive the reply 1 Ping: send count = 2 Pong: receive count = 2 Pong: reply count = 2 Ping: receive the reply 2 Ping: send count = 3 Pong: receive count = 3 Pong: reply count = 3 Ping: receive the reply 3 Ping: send count = 4 Pong: receive count = 4 Pong: reply count = 4 Ping: receive the reply 4 Ping: send count = 5 Pong: receive count = 5 Pong: reply count = 5 Ping: receive the reply 5 Ping: send count = 6 Pong: receive count = 6 Pong: reply count = 6 Ping: receive the reply 6 Ping: send count = 7 Pong: receive count = 7 Pong: reply count = 7 Ping: receive the reply 7 ``` ## 下载源码 ART-Pi Smart 的最新源码仓库地址:[ART-Pi-smart: ART-Pi smart开发板的SDK仓库 (gitee.com)](https://gitee.com/rtthread/ART-Pi-smart) 使用 git 工具下载源码:`git clone https://gitee.com/rtthread/ART-Pi-smart.git ` ## vscode 插件体验 RT-Thread 官方提供了 vscode 插件用来开发用户 app 代码。下面分享一下 ART-Pi Smart Vscode 插件的使用体验。 ### 安装插件 打开 vscode,在扩展中搜索 RT-Thread Smart ![00.png](https://oss-club.rt-thread.org/uploads/20211222/9f23e9a5c95d05dfc6b06f79079e61c3.png.webp) ### 创建工程 - 使用快捷键 `ctrl + shift + p`, 选择创建 RT-Thread Smart 工程 ![01.png](https://oss-club.rt-thread.org/uploads/20211222/93fbdc30d0e849ab28e279f6a04f256c.png) - 选择 RT-Thread Smart SDK 的根目录,回车 ![02.png](https://oss-club.rt-thread.org/uploads/20211222/bc3c407f2fbe83804865ed4bef4de166.png.webp) gitee 下载下来的源码目录结构如下 ![03.png](https://oss-club.rt-thread.org/uploads/20211222/2156fc17ddab3efa930ddb87285cc065.png) - 新建一个 `hello`工程,回车 ![04.png](https://oss-club.rt-thread.org/uploads/20211222/054975a23e13d0e9bda4c330e89f00d6.png.webp) - 选择编译工具,目前 windows 下只有 scons。如果开发环境中没有安装 scons,需要使用命令 `pip install scons ` 安装 scons 工具。 ![05.png](https://oss-club.rt-thread.org/uploads/20211222/aacd8071fa092b281ec3d16b5f9daa75.png.webp) - 通过上面的步骤,一个用户 app 示例就创建完成了 ![06.png](https://oss-club.rt-thread.org/uploads/20211222/bfc065ce34ea3183d7caee025bcc4054.png.webp) ### 下载用户态代码 vscode 支持下载用户代码到 Smart 开发板。 - 在终端输入命令 `ifconfig` 获取开发板 IP 地址。这里的 MAC 在代码中是写死的,不知道为什么要使用这种方法。如果你的局域网中插入两块 Smart 开发板,可能会有问题,因为这两块开发板的 IP 地址是一样的。 ```shell msh />ifconfig network interface device: e1 (Default) MTU: 1500 MAC: a8 5e 45 91 92 93 FLAGS: UP LINK_UP INTERNET_UP DHCP_ENABLE ETHARP BROADCAST IGMP ip address: 192.168.110.34 gw address: 192.168.110.1 net mask : 255.255.255.0 ipv6 link-local: FE80::AA5E:45FF:FE91:9293 VALID ipv6[1] address: 0.0.0.0 INVALID ipv6[2] address: 0.0.0.0 INVALID dns server #0: 211.136.150.66 dns server #1: 211.136.112.50 network interface device: w0 MTU: 1500 MAC: fc 58 4a 2c 50 01 FLAGS: UP LINK_DOWN INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP ip address: 0.0.0.0 gw address: 0.0.0.0 net mask : 0.0.0.0 ipv6 link-local: FE80::FE58:4AFF:FE2C:5001 VALID ipv6[1] address: 0.0.0.0 INVALID ipv6[2] address: 0.0.0.0 INVALID dns server #0: 211.136.150.66 dns server #1: 211.136.112.50 network interface device: w1 MTU: 1500 MAC: fc 58 4a 2c 50 00 FLAGS: UP LINK_DOWN INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP ip address: 0.0.0.0 gw address: 0.0.0.0 net mask : 0.0.0.0 ipv6 link-local: FE80::FE58:4AFF:FE2C:5000 VALID ipv6[1] address: 0.0.0.0 INVALID ipv6[2] address: 0.0.0.0 INVALID dns server #0: 211.136.150.66 dns server #1: 211.136.112.50 ``` - 编译代码 ![08.png](https://oss-club.rt-thread.org/uploads/20211222/cde7588a01af1a4f07514948988c349e.png.webp) - 设置 IP 地址,使用快捷键 `ctrl + shift + p` 选择打开 RT-Thread Smart 设置 ![09.png](https://oss-club.rt-thread.org/uploads/20211222/f0c7cc5276d90bc955cd31b337e33f74.png.webp) 填入开发板 IP 地址,保存设置并退出 ![010.png](https://oss-club.rt-thread.org/uploads/20211222/ee07e168a38beffb14658e553806f112.png.webp) - 下载代码 ![011.png](https://oss-club.rt-thread.org/uploads/20211222/8b5ab534a1dd010cad84a0ab2e9aba83.png.webp) 当终端显示以下界面时,表示代码下载成功 ![012.png](https://oss-club.rt-thread.org/uploads/20211222/ab5baf16651824bac1205addad98f190.png.webp) - 运行可执行文件 ![013.png](https://oss-club.rt-thread.org/uploads/20211222/9dfb9c7822fd48c07353faa06e796e15.png) ### 调试用户态代码 - 使用快捷键 `F5` 进入调试模式,可以在代码处设置断点 ![014.png](https://oss-club.rt-thread.org/uploads/20211222/409f0225c431fb7d461b71c747e9a7e5.png.webp) - 可以使用快捷键 `F11` 进行单步调试 ### UDB 工具 在下载代码和调试代码时,在终端发现 vscode smart 插件使用的是一个叫 **udb** 的工具。udb 工具位于 **ART-Pi-smart\tools\udb-tools**。RT-Thread 提供了windows 和 linux 两个版本的 udb 工具。 ![015.png](https://oss-club.rt-thread.org/uploads/20211222/f6c27d8b27838e9b89188c302395a1a7.png) windows 下目录结构: - server.log :udb 的运行日志 - udb.exe :可执行文件 - udb.ini :tcp 配置文件,保存了 smart 开发板的 ip 地址 #### udb 命令 在该目录下打开 windows 终端,输入命令 `udb.exe --help ` 查看 udb 命令。 ![016.png](https://oss-club.rt-thread.org/uploads/20211222/e023f0f7b3a1e9903748d1adb41c61f4.png) #### udb devices 查看当前 udb 链路设备 ```bash PS D:\repo\gitee\ART-Pi-smart\tools\udb-tools\windows> .\udb.exe devices List of devices attached serial mtu version state 192.168.110.34:5555 1024 2.0.0 active ``` #### udb push 推送本地文件到远端设备 ![7.gif](https://oss-club.rt-thread.org/uploads/20211222/ea9f37f2a8b43b7af86b804915918d2e.gif) ![018.png](https://oss-club.rt-thread.org/uploads/20211222/7e867e5c4ae1287b2df8a583ffd86071.png) #### udb pull 拉取远端文件到本地 ![8.gif](https://oss-club.rt-thread.org/uploads/20211222/e242bdcd80b14ad06f706535476e0bff.gif)
2
条评论
默认排序
按发布时间排序
登录
注册新账号
关于作者
Papalymo
请勿打扰
文章
25
回答
85
被采纳
17
关注TA
发私信
相关文章
1
求助vscode开发art-pi smart开发板的问题
2
vscode下载rt-smart用户态代码时udb有问题
3
RGB565 显示图片异常
4
浮点数打印,从内核态直接打印和从用户态访问设备再触发打印,效果不一致
5
csi 开启 DMA_REQ_EN_RFF 前提下,开启 CSI 就卡住无打印
6
求助如何移植rt-thread到野火imx6ull开发板上
7
RT-thread smart 用户态程序运行出错
8
art-pi-smart 编译报错
9
ART-PI Smart User 运行LED 程序崩溃
推荐文章
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
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
I2C_IIC
ESP8266
UART
WIZnet_W5500
ota在线升级
cubemx
PWM
flash
freemodbus
BSP
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
出出啊
1518
个答案
343
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
813
个答案
177
次被采纳
crystal266
549
个答案
161
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
出出啊
1
篇文章
3
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
3
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
2
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部