在树莓派 Pico 上运行 AWTK

本文档只在 MacOS 上验证过,Ubuntu 请根据情况自行调整。

0. 安装环境

  • cmake
sh 复制代码
brew install cmake
  • openocd
sh 复制代码
brew install openocd
  • arm-none-eabi-gcc

用 brew 安装的版本会出现如下错误:

sh 复制代码
arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or directory

用 arm 官方的版本没有问题。

sh 复制代码
cd ~/Downloads
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-darwin-arm64-arm-none-eabi.tar.xz

cd /opt
sudo tar xf ~/Downloads/arm-gnu-toolchain-13.3.rel1-darwin-arm64-arm-none-eabi.tar.xz
  • arm-none-eabi-gdb
sh 复制代码
brew install arm-none-eabi-gdb
  • minicom
sh 复制代码
brew install minicom

1. 下载源码

  • 下载 awtk-pico
sh 复制代码
https://github.com/zlgopen/awtk-pico.git

2. 编译

  • 编译 awtk

    cd src/awtk
    scons
    cd -

  • 生成 demo 资源

    cd src/demos/hello
    python scripts/update_res.py all
    cd -

  • 编译 pico 固件

请编辑 build_rp2040.sh,修改 PICO_TOOLCHAIN_PATH 为实际路径。

sh 复制代码
./build_rp2040.sh

3. 烧录

  • 方法 1

    按住按钮,插上电源。 会加载一个磁盘分区,把固件拷贝到该磁盘分区。完成后,会自动重启。

  • 方法 2

使用 openocd 烧录。

sh 复制代码
./upload.sh ./build_rp2040/src/demos/app.elf

4. 调试

请确认连接了 pico debug probe。

  • 启动 openocd
sh 复制代码
./start_debug.sh 
  • 启动 gdb
sh 复制代码
./debug.sh 

5. 硬件说明

测试所用显示屏的尺寸为 3.5 寸,分辨率为 480x320,微雪 出品,如果使用其它硬件, 代码需要做相应调整。

注意事项

  • 为了将字体和图片等资源数据编译到代码中,需要修改示例项目的 project.json 文件:

    "const": "all_data",

参考:src/demos/hello/project.json

7. 参考资源

相关推荐
纪纯4 天前
PicoVR Unity Integration SDK 3.4 常用交互API
unity·游戏引擎·vr·pico
戏舟的嵌入式开源笔记2 个月前
上手RP2040(基于C SDK)
c语言·pico·嵌入式软件·rp2040
李先静5 个月前
经典 PLC 程序(4) - 消音按钮
awtk·awplc
李先静5 个月前
经典 PLC 程序(3) - 延时启动和停止
st·awtk·awplc
李先静5 个月前
AWTK fscript 中的文件流扩展函数
awtk·fscript
fcm196 个月前
pico之调试unity项目
unity·vr·pico
EQ-雪梨蛋花汤8 个月前
【Pico企业版】Pico企业版的多种Wifi快速连接方式(Pico 4UE的快捷Wifi连接技巧)
vr·pico
maki0778 个月前
虚幻版Pico大空间VR入门教程 05 —— 原点坐标和项目优化技巧整理
android·游戏引擎·vr·虚幻·pico·htc vive·大空间
maki0778 个月前
VR大空间资料 01 —— 常用VR框架对比
android·ue5·游戏引擎·vr·虚幻·pico
maki0778 个月前
VR大空间资料 02 —— 常用Body IK对比
android·游戏引擎·vr·虚幻·pico·ik