[RP2040]Ubuntu搭建RP2040开发环境

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编程

    cd pico-examples/blink/build
    make
    

    编译完成同级目录下生成:blink.uf2、blink.elf、blink.bin

    格式下载方式
    .uf2USB拖拽到flash中
    .elfSWD下载
    .binflash烧写器烧写到flash中
  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

坂田民工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值