Raspberry Pi Pico program template for C. https://www.hs-anhalt.de
Tobias Müller 6cc5e23748 move project folder to new pico extension | 1 mês atrás | |
---|---|---|
.vscode | 1 mês atrás | |
core | 3 meses atrás | |
docs | 1 ano atrás | |
inc | 1 ano atrás | |
libs | 1 ano atrás | |
pics | 1 ano atrás | |
src | 1 ano atrás | |
.gitignore | 1 ano atrás | |
CMakeLists.txt | 1 mês atrás | |
LICENSE | 1 ano atrás | |
README.md | 8 meses atrás | |
README.pdf | 8 meses atrás | |
pico_sdk_import.cmake | 1 mês atrás |
This repository can be used as a template for a new Raspberry Pi Pico C-Project.
Note: Once you have downloaded/cloned this repository, open it in Visual Studio Code. Note, to follow the guideline of folder structure and all necessary programs and plugins for Visual Studio Code. Open cmake in Visual Studio Code and build the "blink" project. Copy the "blink.uf2" file from the
build
folder to the Raspberry Pi Pico by following the instructions according to the description in Core.
Regardless which operating system is used for compilation, the Pico-SDK is always needed. The Raspberry Pi version of OpenOCD is optional and only required, if the Pico should be debugged and the system integrated version of OpenOCD does not support Picoprobe as a debugger. Picoprobe is also optional and only required, if a second Pico should be used as a debugger.
Name | Description | Link |
---|---|---|
Raspberry Pi Pico-SDK |
The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico in C, C++ or assembly language. | https://github.com/raspberrypi/pico-sdk |
Raspberry Pi OpenOCD (optional) |
OpenOCD provides on-chip programming and debugging support with a layered architecture of JTAG interface and TAP support. | https://github.com/raspberrypi/openocd |
Raspberry Pi Debugprobe (optional) |
Debugprobe allows a Pico / RP2040 to be used as USB -> SWD and UART bridge. This means it can be used as a debugger and serial console for another Pico. | https://github.com/raspberrypi/debugprobe |
This repository refers to the Pico-SDK, which must be in search path. The Pico-SDK must be at the same folder level as this repository. If debugging is needed, also the OpenOCD folder must be at the same level.
Project Folder
|
├──Pico-SDK
|
├──OpenOCD (optional)
|
└──<This Repository>
For windows is an installer available, which provide all the necessary tools to compile C-Code for the Raspberry Pi Pico.
Name | Description | Link |
---|---|---|
Pico Setup Windows |
This project aims to create an easy-to-use installer to get started on Windows (using the C/C++ SDK) with Raspberry Pi Pico and other RP2040-based boards. It is inspired by, and is roughly equivalent to, the pico-setup project for Linux systems. | https://github.com/raspberrypi/pico-setup-windows |
This intstaller includes the following software:
On Mac-OS the following software is needed to compile C-Code for the Raspberry Pi Pico.
Name | Description | Link |
---|---|---|
Visual Studio Code |
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages and runtimes (such as C++, C#, Java, Python, PHP, Go, .NET). | https://code.visualstudio.com/ |
Git |
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. | https://git-scm.com/ |
Homebrew Formulae (CMake) |
CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. | https://formulae.brew.sh/formula/cmake |
Homebrew Formulae (Arm-None-EABI-GCC) |
The GNU Arm Embedded Toolchain is a ready-to-use, open-source suite of tools for C, C++ and assembly programming. The GNU Arm Embedded Toolchain targets the 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families. The GNU Arm Embedded Toolchain includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux, and Mac OS X operating systems. | https://formulae.brew.sh/formula/arm-none-eabi-gcc#default |
The Installation for Toolchain and CMake depends on Homebrew, if you don’t have Homebrew installed you should go ahead and install it.
$ /bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then install the Toolchain and CMake.
$ brew install cmake
$ brew tap ArmMbed/homebrew-formulae
$ brew install arm-none-eabi-gcc
On Linux the following software is needed to compile C-Code for the Raspberry Pi Pico.
Name | Description | Link |
---|---|---|
Visual Studio Code |
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages and runtimes (such as C++, C#, Java, Python, PHP, Go, .NET). | https://code.visualstudio.com/ |
Git |
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. | Part of Linux Distribution |
CMake |
CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. | Part of Linux Distribution |
Arm-None-EABI |
The GNU Arm Embedded Toolchain is a ready-to-use, open-source suite of tools for C, C++ and assembly programming. The GNU Arm Embedded Toolchain targets the 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families. The GNU Arm Embedded Toolchain includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux, and Mac OS X operating systems. | Part of Linux Distribution |
Git, CMake and Toolchain are normally part of the Linux Distribution and can be installed with the package manager.
pacman -S git cmake arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-newlib arm-none-eabi-binutils
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential
If you are developing for Raspberry Pi Pico on the Raspberry Pi 4B, or the Raspberry Pi 400, most of the installation steps can be skipped by running the setup script.
Note: This setup script requires approximately 2.5GB of disk space on your SD card, so make sure you have enough free space before running it. You can check how much free disk space you have with the
df -h
command.
wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh
chmod +x pico_setup.sh
./pico_setup.sh
Name | Description | Link |
---|---|---|
C/C++ |
The C/C++ extension adds language support for C/C++ to Visual Studio Code, including editing (IntelliSense) and debugging features. | https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools |
CMake |
This extension provides support for CMake in Visual Studio Code. | https://marketplace.visualstudio.com/items?itemName=twxs.cmake |
CMake Tools |
CMake Tools CMake Tools provides the native developer a full-featured, convenient, and powerful workflow for CMake-based projects in Visual Studio Code. | https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools |
Name | Description | Link |
---|---|---|
Cortex-Debug (optional) |
DARM Cortex-M GDB Debugger support for VSCode. | https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug |
VSCode PDF |
Display pdf in VSCode. | https://marketplace.visualstudio.com/items?itemName=tomoki1207.pdf |
German Language Pack for Visual Studio Code |
Das deutsche Sprachpaket bietet eine lokalisierte Benutzeroberfläche für VS Code. | https://marketplace.visualstudio.com/items?itemName=MS-CEINTL.vscode-language-pack-de |
Name | Description | Link |
---|---|---|
Material Theme |
Color Theme | https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme |
Material Icon Theme |
Icon Theme | https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme |
Hochschule Anhalt | Anhalt University of Applied Sciences | Fachbereich 6 EMW
Prof. Dr.-Ing. Ingo Chmielewski
:e-mail: Ingo.Chmielewski@HS-Anhalt.de
Tobias Müller, M. Eng.
:e-mail: Tobias.Mueller@HS-Anhalt.de
:copyright: es-lab.de, 05.09.2023