Ubuntu搭建RP2040开发环境-1
2024-4-23
hongxi.zhu
前置依赖(可选)
sudo apt-get install vim
sudo apt-get install cmake
sudo apt-get install libncurses-dev
sudo apt-get install libssl-dev
sudo apt-get install git
一、下载SDK和编译链
-
下载SDK
# 创建raspberry-pi pico SDK 工作路径 mkdir /home/hongxi/RP2040/ && cd /home/hongxi/RP2040/ mkdir raspberry_pi_pico && cd raspberry_pi_pico git clone -b master https://github.com/raspberrypi/pico-sdk.git cd pico-sdk/ git submodule update --init cd .. git clone -b master https://github.com/raspberrypi/pico-examples.git git clone -b master https://github.com/raspberrypi/pico-extras.git git clone -b master https://github.com/raspberrypi/pico-playground.git
-
下载交叉编译链
mkdir toolchain && cd toolchain tar -vxjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 cd gcc-arm-none-eabi-10.3-2021.10 ./bin/arm-none-eabi-gcc -v
-
配置
vim ~/.bashrc
在最后追加
#RP2040 export PICO_SDK_PATH="/home/hongxi/RP2040/raspberry_pi_pico/pico-sdk" export PICO_TOOLCHAIN_PATH="/home/hongxi/RP2040/raspberry_pi_pico/toolchain/gcc-arm-none-eabi-10.3-2021.10"
二、编译实例工程
-
新开一个终端,进入
pico-examples
目录cd pico-examples mkdir build cd build cmake ..
-
编译blink编程文章来源:https://www.toymoban.com/news/detail-858352.html
cd pico-examples/blink make
编译完成同级目录下生成:blink.uf2、blink.elf、blink.bin文章来源地址https://www.toymoban.com/news/detail-858352.html
格式 下载方式 .uf2 USB拖拽到flash中 .elf SWD下载 .bin flash烧写器烧写到flash中
到了这里,关于Ubuntu搭建RP2040开发环境-1的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!