广州活力数据恢复中心

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2656|回复: 1

raspberry pi pico资料

[复制链接]

865

主题

1793

帖子

9618

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
9618
QQ
发表于 2021-9-5 20:39:04 | 显示全部楼层 |阅读模式
raspberry pi pico资料

https://datasheets.raspberrypi.o ... arted-with-pico.pdf

vscode设置:
cmake tools插件cmake:build environment--> add item
item: PICO_SDK_PATH
value: ../.../pico-sdk
Cmake: Generator(这里填自己对应平台的)
  • “Unix Makefiles” for Linux and macOS
  • “NMake Makefiles” for Windows (if you built everything with Build Tools for Visual Studio)
  • “MinGW Makefiles” for Windows (if you built everything with MinGW)



安装:
添加下面代码到.zshrc文件里
  1. export PICO_SDK_PATH=你的SDK路径
复制代码
执行source .zshrc生效,确认是否生效echo $PICO_SDK_PATH看输出是否跟你设置的一致.

sample:
在你project目录下新建两个文件
main.c
  1. #include <stdio.h>
  2. #include "pico/stdlib.h"

  3. int main() {

  4.     const uint led_pin = 25;

  5.     // Initialize LED pin
  6.     gpio_init(led_pin);
  7.     gpio_set_dir(led_pin, GPIO_OUT);

  8.     // Initialize chosen serial port
  9.     stdio_init_all();

  10.     // Loop forever
  11.     while (true) {

  12.         // Blink LED
  13.         printf("Blinking!\r\n");
  14.         gpio_put(led_pin, true);
  15.         sleep_ms(100);
  16.         gpio_put(led_pin, false);
  17.         sleep_ms(100);
  18.     }
  19. }
复制代码
CMakeLists.txt
  1. # Set minimum required version of CMake
  2. cmake_minimum_required(VERSION 3.12)

  3. # Include build functions from Pico SDK
  4. include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)


  5. # Set name of project (as PROJECT_NAME) and C/C++ standards
  6. project(blink C CXX ASM)
  7. set(CMAKE_C_STANDARD 11)
  8. set(CMAKE_CXX_STANDARD 17)

  9. # Creates a pico-sdk subdirectory in our project for the libraries
  10. pico_sdk_init()

  11. # Tell CMake where to find the executable source file
  12. add_executable(${PROJECT_NAME}
  13.     main.c
  14. )

  15. # Create map/bin/hex/uf2 files
  16. pico_add_extra_outputs(${PROJECT_NAME})


  17. # Link to pico_stdlib (gpio, time, etc. functions)
  18. target_link_libraries(${PROJECT_NAME}
  19.     pico_stdlib
  20. )

  21. # Enable usb output, disable uart output
  22. pico_enable_stdio_usb(${PROJECT_NAME} 1)
  23. pico_enable_stdio_uart(${PROJECT_NAME} 0)
复制代码
新建build文件夹
  1. mkdir build && cd build
  2. cmake -S project路径
  3. make
复制代码
以上命令完成没有报错就可以,接下来接着pico的bootsel键然后再把pico接到电脑,在build文件夹里找到你刚build的*.uf2文件,把这个文件拖到pico的盘里面就会自动运行.

pico在macos的端口通常是
  1. /dev/tty.usbmodemxxxxxxx
复制代码

常见报错
  1. CMake Error at CMakeLists.txt:13 (pico_sdk_init):
  2.   Unknown CMake command "pico_sdk_init".
复制代码
通常都是PICO_SDK_PATH问题


硬盘数据恢复/优盘内存卡数据恢复/服务器数据恢复
data recovery service www.rflashdata.com 数据热线+86 18620923827(微信whatsapp)
buffalo 隨身碟數據救援 bitlocker WDV2 lacie EFS等加密硬盘数据恢复,指纹爱国者加密优盘数据恢复 +86 18620923827
回复

使用道具 举报

865

主题

1793

帖子

9618

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
9618
QQ
 楼主| 发表于 2021-9-8 04:21:10 | 显示全部楼层
openocd配置
报错:
  1. ./bootstrap
  2. ./bootstrap
  3. + aclocal --warnings=all
  4. + glibtoolize --automake --copy
  5. glibtoolize:   error: $pkgauxdir is not a directory: '@@HOMEBREW_CELLAR@@/libtool/2.4.6_4/share/libtool/build-aux'
复制代码
重新安装
  1. brew rm -libtool
  2. brew install -s libtool
复制代码


  1. SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected
  2. Open On-Chip Debugger 0.11.0
  3. Licensed under GNU GPL v2
  4. For bug reports, read
  5.         http://openocd.org/doc/doxygen/bugs.html
  6. Error: The specified debug interface was not found (picoprobe)
  7. The following debug adapters are available:
  8. 1: dummy
  9. 2: ftdi
  10. 3: usb_blaster
  11. 4: jtag_vpi
  12. 5: ft232r
  13. 6: presto
  14. 7: usbprog
  15. 8: openjtag
  16. 9: jlink
  17. 10: vsllink
  18. 11: rlink
  19. 12: ulink
  20. 13: arm-jtag-ew
  21. 14: buspirate
  22. 15: remote_bitbang
  23. 16: hla
  24. 17: osbdm
  25. 18: opendous
  26. 19: aice
  27. 20: cmsis-dap
  28. 21: kitprog
  29. 22: xds110
  30. 23: st-link
  31. SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
  32. GDB server session ended. Waiting for next server session to start...
复制代码

  1. Open On-Chip Debugger 0.10.0+dev-g18b4c35-dirty (2021-09-08-04:57)
  2. Licensed under GNU GPL v2
  3. For bug reports, read
  4.         http://openocd.org/doc/doxygen/bugs.html
  5. Info : only one transport option; autoselect 'swd'
  6. Warn : Transport "swd" was already selected
  7. adapter speed: 5000 kHz

  8. target/rp2040.cfg:1: Error: Can't find target/swj-dp.tcl
  9. in procedure 'script'
  10. at file "embedded:startup.tcl", line 26
  11. at file "target/rp2040.cfg", line 1
复制代码







硬盘数据恢复/优盘内存卡数据恢复/服务器数据恢复
data recovery service www.rflashdata.com 数据热线+86 18620923827(微信whatsapp)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|硬盘FLASH数据恢复论坛

GMT+8, 2024-12-5 03:07 , Processed in 0.046919 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表