Windows11下搭建Raspberry Pi Pico編譯環境

1. 系統與工具要求

PC平臺: Windows 11 專業版

Windows GCC: gcc-15.1.0-64.exe

GNU Make: 4.3

Git: 2.49.0

cmake: 4.0.2

python:3.12.11

Arm GNU Toolchain Downloads – Arm Developer

?2. 工具安裝與驗證

2.1 工具安裝

winget安裝依賴工具(Windows Package Manager)

管理員身份 打開 cmd.exe或者PowerShell,運行:

winget install Kitware.CMake Ninja-build.Ninja python Git.Git 7zip.7zip Arm.GnuArmEmbeddedToolchain

windows安裝包下載臨時目錄

C:\Users\Administrator\AppData\Local\Temp\WinGet

安裝日志:

Microsoft Windows [版本 10.0.26100.4061]
(c) Microsoft Corporation。保留所有權利。C:\Users\Administrator>winget install Kitware.CMake Ninja-build.Ninja python Git.Git 7zip.7zip
找到已安裝的現有包。正在嘗試升級已安裝的包...
找到已安裝的現有包。正在嘗試升級已安裝的包...
找不到可用的升級。
配置的源中沒有可用的較新的包版本。
已安裝程序包: Ninja-build.Ninja
找到已安裝的現有包。正在嘗試升級已安裝的包...
找不到可用的升級。
配置的源中沒有可用的較新的包版本。
已安裝程序包: python
找到已安裝的現有包。正在嘗試升級已安裝的包...
找不到可用的升級。
配置的源中沒有可用的較新的包版本。
已安裝程序包: Git.Git
(1/1) 已找到 CMake [Kitware.CMake] 版本 4.0.3
此應用程序由其所有者授權給你。
Microsoft 對第三方程序包概不負責,也不向第三方程序包授予任何許可證。
正在下載 https://github.com/Kitware/CMake/releases/download/v4.0.3/cmake-4.0.3-windows-x86_64.msi██████████████████████████████  32.9 MB / 32.9 MB
已成功驗證安裝程序哈希
正在啟動程序包安裝...
已成功安裝

GCC/Make安裝

從http://www.equation.com/servlet/equation.cmd?fa=fortra 下載gcc套件,gcc套件內包含make,因為編譯picotool需要gcc所以一并就裝了這倆。

解壓gcc套件,比如默認按照在了個人賬戶目錄內為 C:\Users\Administrator\gcc

ARM GNU Toolchain:

arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-eabi.zip

7z.exe x "arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-eabi.zip" -o"arm-gnu-toolchain-14.2" -y

?2.2 工具驗證

驗證方法:

命令行中輸入以下指令,會打印出版本信息

make -v
GNU Make 4.3cmake --version
cmake version 4.0.2git -v
git version 2.49.0.windows.1python -V
Python 3.12.11arm-none-eabi-gcc -v

3 SDK環境搭建

3.1 官方參考文檔

在github中獲取樹莓派pico的sdk和example(內容可參考樹莓派pico提供的資料)

pico/getting-started-with-pico.pdf

pico/pico-datasheet.pdf

pico/raspberry-pi-pico-c-sdk.pdf

pico/raspberry-pi-pico-python-sdk.pdf

rp2040/hardware-design-with-rp2040.pdf

rp2040/rp2040-datasheet.pdf

3.2 SDK源碼獲取

可通過官網獲取以下信息

sdk github鏈接https://github.com/raspberrypi/pico-sdk

example github鏈接https://github.com/raspberrypi/pico-examples

通過git下載好sdk和example,進入pico-sdk中,git執行此條指令

git submodule update --init

該過程是更新sdk中第三方的庫,例如usb、wifi等,更新內容在pico_sdk lib文件夾

3.3 編譯

首先添加一下sdk環境變量將pico-sdk的文件路徑添加PICO_SDK_PATH。

進入pico-examples參考工程目錄

# 進入pico-examples文件夾中
cd D:\workspace\raspberrypi\pico-examples\
# 創建build目錄
mkdir build
# 進入到build目錄
cd build
# 生成Makefile文件
D:\workspace\raspberrypi\pico-examples\build>cmake -G "MinGW Makefiles" ..
Using PICO_SDK_PATH from environment ('D:\workspace\raspberrypi\pico-sdk')
PICO_SDK_PATH is D:/workspace/raspberrypi/pico-sdk
Defaulting platform (PICO_PLATFORM) to 'rp2040' since not specified.
Defaulting target board (PICO_BOARD) to 'pico' since not specified.
Using board configuration from D:/workspace/raspberrypi/pico-sdk/src/boards/include/boards/pico.h
Pico Platform (PICO_PLATFORM) is 'rp2040'.
-- Defaulting build type to 'Release' since not specified.
Defaulting compiler (PICO_COMPILER) to 'pico_arm_cortex_m0plus_gcc' since not specified.
Configuring toolchain based on PICO_COMPILER 'pico_arm_cortex_m0plus_gcc'
Defaulting PICO_GCC_TRIPLE to 'arm-none-eabi'
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- The ASM compiler identification is GNU
-- Found assembler: D:/workspace/zephyrproject/zephyr-sdk/arm-none-eabi-gcc-14.2.1/bin/arm-none-eabi-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/workspace/zephyrproject/zephyr-sdk/arm-none-eabi-gcc-14.2.1/bin/arm-none-eabi-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/workspace/zephyrproject/zephyr-sdk/arm-none-eabi-gcc-14.2.1/bin/arm-none-eabi-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type is Release
-- Found Python3: C:/Users/Administrator/AppData/Local/Programs/Python/Python313/python.exe (found version "3.13.4") found components: Interpreter
TinyUSB available at D:/workspace/raspberrypi/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at D:/workspace/raspberrypi/pico-sdk/lib/btstack
cyw43-driver available at D:/workspace/raspberrypi/pico-sdk/lib/cyw43-driver
lwIP available at D:/workspace/raspberrypi/pico-sdk/lib/lwip
mbedtls available at D:/workspace/raspberrypi/pico-sdk/lib/mbedtls
CMake Warning at D:/workspace/raspberrypi/pico-sdk/tools/Findpicotool.cmake:30 (message):No installed picotool with version 2.1.1 found - building from sourceIt is recommended to build and install picotool separately, or to setPICOTOOL_FETCH_FROM_GIT_PATH to a common directory for all your SDKprojects
Call Stack (most recent call first):D:/workspace/raspberrypi/pico-sdk/tools/CMakeLists.txt:138 (find_package)D:/workspace/raspberrypi/pico-sdk/tools/CMakeLists.txt:493 (pico_init_picotool)D:/workspace/raspberrypi/pico-sdk/src/cmake/on_device.cmake:56 (picotool_postprocess_binary)blink/CMakeLists.txt:13 (pico_add_extra_outputs)# 由于下載https://github.com/raspberrypi/picotool.git非常困難
# 這里需要修改pico-sdk目錄下的tools/Findpicotool.cmake文件
# 使用https://gitee.com/msntec/picotool.git鏡像源替換
Downloading Picotool
Only building blink_any for non W boards as PICO_CYW43_SUPPORTED is not set
Skipping encrypted example which is unsupported on this platform
Skipping hello_dcp example which is unsupported on this platform
Skipping runtime_flash_permissions example which is unsupported on this platform
Skipping dvi_out_hstx_encoder example which is unsupported on this platform
Skipping spi_lcd example which is unsupported on this platform
Skipping multicore_doorbell example which is unsupported on this platform
Skipping hello_otp example which is unsupported on this platform
Skipping boot_info example which is unsupported on this platform
Skipping universal examples as PICO_RISCV_TOOLCHAIN_PATH and PICO_ARM_TOOLCHAIN_PATH are not defined
Skipping TinyUSB dual examples, as TinyUSB hw/mcu/raspberry_pi/Pico-PIO-USB submodule unavailable
Skipping SHA256 examples as pico_sha256 or pico_mbedtls unavailable
Skipping FreeRTOS examples as FREERTOS_KERNEL_PATH not defined
-- Configuring done (53.7s)
-- Generating done (30.2s)
-- Build files have been written to: D:/workspace/raspberrypi/pico-examples/build

?會遇到pico-tool下載問題,請使用下面資源替代

D:\msys64\home\Weston\pico-sdk> git diff tools/Findpicotool.cmake
warning: in the working copy of 'tools/Findpicotool.cmake', LF will be replaced by CRLF the next time Git touches it
diff --git a/tools/Findpicotool.cmake b/tools/Findpicotool.cmake
index e5bfaea..cbc2e3a 100644
--- a/tools/Findpicotool.cmake
+++ b/tools/Findpicotool.cmake
@@ -36,7 +36,7 @@ if (NOT TARGET picotool)message("Downloading Picotool")FetchContent_Populate(picotool QUIET
-            GIT_REPOSITORY https://github.com/raspberrypi/picotool.git
+            GIT_REPOSITORY https://gitee.com/msntec/picotool.gitGIT_TAG developSOURCE_DIR ${picotool_INSTALL_DIR}/picotool-src

進入到build目錄下的blink工程

接著執行編譯指令,不出意外,接著就是刷刷的編譯時間

make -j4Building ASM object pico-sdk/src/rp2040/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
Built target picotoolForceReconfigure
Creating directories for 'picotoolBuild'
Linking ASM executable bs2_default.elf
No download step for 'picotoolBuild'
No update step for 'picotoolBuild'
Built target bs2_default
No patch step for 'picotoolBuild'
Generating bs2_default.bin
Generating bs2_default_padded_checksummed.S
Performing configure step for 'picotoolBuild'
Not searching for unused variables given on the command line.
Building ASM object pico-sdk/src/rp2040/boot_stage2/CMakeFiles/bs2_default_library.dir/bs2_default_padded_checksummed.S.obj
Built target bs2_default_library
-- The C compiler identification is GNU 15.1.0
-- The CXX compiler identification is GNU 15.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/Administrator/gcc/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/Administrator/gcc/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using the single-header code from D:/workspace/raspberrypi/pico-examples/build/_deps/picotool-src/lib/nlohmann_json/single_include/
PICOTOOL_NO_LIBUSB is set - no USB support will be built
-- Configuring done (5.3s)
-- Generating done (0.4s)
-- Build files have been written to: D:/workspace/raspberrypi/pico-examples/build/_deps/picotool-build
Performing build step for 'picotoolBuild'
-- The C compiler identification is GNU 15.1.0
[  2%] Built target errors
-- The C compiler identification is GNU 15.1.0
-- The CXX compiler identification is GNU 15.1.0
-- The CXX compiler identification is GNU 15.1.0
-- The ASM compiler identification is GNU
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/Administrator/gcc/bin/gcc.exe
-- Found assembler: C:/Users/Administrator/gcc/bin/gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/Administrator/gcc/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working C compiler: C:/Users/Administrator/gcc/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/Administrator/gcc/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working CXX compiler: C:/Users/Administrator/gcc/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Using precompiled enc_bootloader.elf
-- Configuring done (4.3s)
-- Generating done (0.0s)
-- Build files have been written to: D:/workspace/raspberrypi/pico-examples/build/_deps/picotool-build/enc_bootloader
Using precompiled enc_bootloader.elf
-- Configuring done (4.4s)
-- Generating done (0.0s)
-- Build files have been written to: D:/workspace/raspberrypi/pico-examples/build/_deps/picotool-build/enc_bootloader_mbedtls
[  4%] Built target elf
[ 11%] Built target enc_bootloader
[ 18%] Built target enc_bootloader_mbedtls
[ 20%] Built target embedded_data_no_libusb
[ 22%] Built target elf2uf2
[ 90%] Built target mbedtls
[ 92%] Built target bintool
[100%] Built target picotool
Performing install step for 'picotoolBuild'
[  2%] Built target errors
[ 70%] Built target mbedtls
[ 72%] Built target elf
[ 79%] Built target enc_bootloader
[ 81%] Built target elf2uf2
[ 88%] Built target enc_bootloader_mbedtls
[ 90%] Built target bintool
[ 92%] Built target embedded_data_no_libusb
[100%] Built target picotool
Install the project...
-- Install configuration: "Release"
Performing test step for 'picotoolBuild'
picotool v2.1.2-develop (Windows, GNU-15.1.0, Release)
Completed 'picotoolBuild'
Built target picotoolBuild
Building C object blink/CMakeFiles/blink.dir/blink.c.obj
......
......
Linking CXX executable blink.elf
Built target blinkD:\workspace\raspberrypi\pico-examples\build\blink>dirVolume in drive D is DATAVolume Serial Number is 0EFA-D4A2Directory of D:\workspace\raspberrypi\pico-examples\build\blink2025/06/18  21:08    <DIR>          .
2025/06/18  21:06    <DIR>          ..
2025/06/18  21:08             6,764 blink.bin
2025/06/18  21:08           125,987 blink.dis
2025/06/18  21:08           351,204 blink.elf
2025/06/18  21:08           398,194 blink.elf.map
2025/06/18  21:08            19,091 blink.hex
2025/06/18  21:08            13,824 blink.uf2
2025/06/18  21:07    <DIR>          CMakeFiles
2025/06/18  21:05             1,551 cmake_install.cmake
2025/06/18  21:05           118,156 Makefile
2025/06/18  21:05    <DIR>          picotool8 File(s)      1,034,771 bytes4 Dir(s)  3,577,542,651,904 bytes free

下載方法:按住BOOT鍵進行上電,使電腦彈出虛擬U盤,將.uf2文件拖拽到樹莓派pico的虛擬U盤中,這時樹莓派pico會自動重啟,運行下載后的程序。

到此,整個樹莓派pico的基礎環境就算搭建完成啦。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/85263.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/85263.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/85263.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【C語言極簡自學筆記】重講運算符

一、算術操作符 算術操作符描述把兩個操作數相加-第一個操作數減去第二個操作數*把兩個操作數相乘/分子除以分母%取模運算符&#xff0c;整除后的余數 注意&#xff1a;1.除號的兩端都是整數的時候執行的是整數的除法&#xff0c;兩端只要有一個浮點數&#xff0c;就執行浮點…

持續集成 CI/CD-Jenkins持續集成GitLab項目打包docker鏡像推送k8s集群并部署至rancher

Jenkins持續集成GitLab項目 GitLab提交分支后觸發Jenkis任務 之前是通過jar包在shell服務器上進行手動部署&#xff0c;麻煩且耗時。現通過Jenkins進行持續集成實現CI/CD。以test分支為例 提交即部署。 由于是根據自己實際使用過程 具體使用到了 gitlabjenkinsdockerharborra…

Apache Iceberg與Hive集成:非分區表篇

引言 在大數據處理領域&#xff0c;Apache Iceberg憑借其先進的表格式設計&#xff0c;為大規模數據分析帶來了新的可能。當Iceberg與Hive集成時&#xff0c;這種強強聯合為數據管理與分析流程提供了更高的靈活性和效率。本文將聚焦于Iceberg與Hive集成中的非分區表場景&#…

webpack 如何區分開發環境和生產環境

第一種方法: 方法出處&#xff1a;命令行接口&#xff08;CLI&#xff09; | webpack 中文文檔 1.利用webpack.config.js 返回的是個函數&#xff0c;利用函數的參數&#xff0c;來區分環境 具體步驟 1&#xff09; package.json文件&#xff1a;在npm scripts 命令后面追加 …

React組件通信——context(提供者/消費者)

Context 是 React 提供的一種組件間通信方式&#xff0c;主要用于解決跨層級組件 props 傳遞的問題。它允許數據在組件樹中"跨級"傳遞&#xff0c;無需顯式地通過每一層 props 向下傳遞。 一、Context 核心概念 1. 基本組成 React.createContext&#xff1a;創建 C…

“微信短劇小程序開發指南:從架構設計到上線“

1. 引言&#xff1a;短劇市場的機遇與挑戰 近年來&#xff0c;短視頻和微短劇市場呈現爆發式增長&#xff0c;用戶碎片化娛樂需求激增。短劇小程序憑借輕量化、社交傳播快、變現能力強等特點&#xff0c;成為內容創業的新風口。然而&#xff0c;開發一個穩定、流暢且具備商業價…

RPC與RESTful對比:兩種API設計風格的核心差異與實踐選擇

# RPC與RESTful對比&#xff1a;兩種API設計風格的核心差異與實踐選擇 ## 一、架構哲學與設計目標差異 1. **RPC&#xff08;Remote Procedure Call&#xff09;** - **核心思想**&#xff1a;將遠程服務調用偽裝成本地方法調用&#xff08;方法導向&#xff09; - 典型行為…

【pytest進階】pytest之鉤子函數

什么是 hook (鉤子)函數 經常會聽到鉤子函數(hook function)這個概念,最近在看目標檢測開源框架mmdetection,里面也出現大量Hook的編程方式,那到底什么是hook?hook的作用是什么? what is hook ?鉤子hook,顧名思義,可以理解是一個掛鉤,作用是有需要的時候掛一個東西…

深度學習計算——動手學深度學習5

環境&#xff1a;PyCharm python3.8 1. 層和塊 塊&#xff08;block&#xff09;可以描述 單個層、由多個層組成的組件或整個模型本身。 使用塊進行抽象的好處&#xff1a; 可將塊組合成更大的組件(這一過程通常是遞歸) 如 圖5.1.1所示。通過定義代碼來按需生成任意復雜度…

NodeJS的fs模塊的readFile和createReadStream區別以及常見方法

Node.js 本身沒有像 Java 那樣嚴格區分字符流和字節流&#xff0c;區別主要靠編碼&#xff08;encoding&#xff09;來控制數據是以 Buffer&#xff08;二進制字節&#xff09;形式還是字符串&#xff08;字符&#xff09;形式處理。 詳細解釋&#xff1a; 方面JavaNode.js字節…

基于二進制XOR運算的機器人運動軌跡與對稱圖像自動生成算法

原創&#xff1a;項道德&#xff08;daode3056,daode1212&#xff09; 新的算法出現&#xff0c;往往能給某些行業與產業帶來革命與突破。為探索機器人運動軌跡與對稱圖像自動生成算法&#xff0c;本人已經通過18種算法的測試&#xff0c;最終&#xff0c;以二進制的XOR運算為…

Spring AI 項目實戰(七):Spring Boot + Spring AI Tools + DeepSeek 智能工具平臺(附完整源碼)

系列文章 序號文章名稱1Spring AI 項目實戰(一):Spring AI 核心模塊入門2Spring AI 項目實戰(二):Spring Boot + AI + DeepSeek 深度實戰(附完整源碼)3Spring AI 項目實戰(三):Spring Boot + AI + DeepSeek 打造智能客服系統(附完整源碼)4Spring AI 項目實戰(四…

spring-webmvc @RequestHeader 典型用法

典型用法 基礎用法&#xff1a;獲取指定請求頭值 GetMapping("/info") public String getInfo(RequestHeader("User-Agent") String userAgent) {return "User-Agent: " userAgent; }如果請求中包含 User-Agent 請求頭&#xff0c;則其值將被…

Ubuntu:20.04中安裝docker

是的&#xff0c;您列出的命令是完整的安裝步驟&#xff0c;但為了確保100%可靠性和處理可能的問題&#xff0c;我建議進行以下優化和補充&#xff1a; 完整優化的安裝腳本&#xff08;包含錯誤處理和驗證&#xff09; #!/bin/bash# 1. 徹底清理舊版本和配置 sudo apt remove…

大數據實時風控引擎:Spark Streaming、Kafka、Flink與Doris的融合實踐

大數據實時風控引擎&#xff1a;Spark Streaming、Kafka、Flink與Doris的融合實踐 在數字金融、電商交易與在線服務的核心戰場&#xff0c;風險控制能力已成為業務的生命線。傳統批量風控模式在應對瞬息萬變的欺詐攻擊、信用風險時捉襟見肘。本文將深入探討如何利用**Spark St…

【創龍瑞芯微 RK3576 全國產 ARM 八核 2.2GHz 工業開發板-硬件說明書】

前 言 本文主要介紹TL3576-EVM評估板硬件接口資源以及設計注意事項等內容。 RK3576J/RK3576處理器的IO電平標準一般為1.8V、3.3V,上拉電源一般不超過3.3V或1.8V,當外接信號電平與IO電平不匹配時,中間需增加電平轉換芯片或信號隔離芯片。按鍵或接口需考慮ESD設計,ESD器件…

一文吃透ADB,從入門到精通

目錄 一、ADB 簡介1.1 什么是 ADB1.2 ADB 的工作原理1.3 ADB 的安裝與環境配置 二、ADB 基礎命令2.1 設備連接相關命令2.2 應用管理命令2.3 文件傳輸命令 三、ADB 高級命令3.1 ADB Shell 深入探究3.2 日志查看與分析3.3 設備信息獲取3.4 屏幕操作與錄制 四、ADB 常見問題與解決…

PostgreSQL高可用架構設計與實踐指南

# PostgreSQL高可用架構設計與實踐指南 ## 一、高可用性核心訴求 PostgreSQL作為企業級關系型數據庫&#xff0c;高可用設計需要滿足以下關鍵指標&#xff1a; - 故障恢復時間&#xff08;RTO&#xff09;&#xff1a;秒級到分鐘級自動切換能力 - 數據損失容忍度&#xff0…

今天我想清楚了

首先說一聲抱歉&#xff0c;很多天沒有更新了&#xff0c;因為在我這里&#xff0c;我的內心感到迷茫&#xff0c;從來沒有這樣過&#xff0c;不知道為什么自己一直要做的事&#xff0c;進度太慢了&#xff0c;因為我的人生是空虛的&#xff0c;我感覺我做的不夠好&#xff0c;…

代碼隨想錄day3鏈表1

new關鍵字 1.new是一個關鍵字&#xff0c;用于開辟空間&#xff0c;開辟的空間在堆上&#xff0c;而一般聲明的變量存放在棧上&#xff1b; 2.new得到的是一段空間的首地址。所以一般需要用指針來存放這段地址 new int(10);//返回new出來這塊內存的地址int *pnew int(10);//…