Today, we will have a look at the Visual Studio Code Installation for Raspberry Pi Pico Programming. We will install all the tools requried. Posted at: 02 - Apr - 2022 Show
Category: Raspberry Pi Author: Ahmed Yasin 0 Comments Hello readers, I hope you all are doing great. This is the second tutorial of Raspberry Pi programming series. In our previous tutorial, we discussed the basic features and hardware architecture of Raspberry Pi Pico. In this tutorial, we will discuss the various available development environments for programming the Raspberry Pi Pico. Later, in this tutorial we will also discuss the installation of Visual Studio Code for Pi Pico programming. Fig. Raspberry Pi Pico RP2040 supports multiple programming languages like C/C++, Circuit python, MicroPython cross platform development environments. Raspberry Pi Pico module consists of a built-in UF2 bootloader enabling programs to be loaded by drag and drop and floating point routines are baked into the chip to achieve ultra fast performance. There are multiple development environments to program a Raspberry Pi Pico board like Visual Studio Code, Thonny Python IDE and Arduino IDE etc. We need to download and install some tools before installing the Visual Studio Code for programming Raspberry Pi Pico which includes:
CMakeFig. CMake CMake is an open-source system developed/designed to fulfill the need of powerful cross-platform build environment which is responsible for managing the build process in a compiler independent manner and in an OS (operating system. It is designed to work in conjunction with the native build environment. CMake is responsible for generating a build environment for compiling a source code, building executables, creating libraries and generating wrappers. It also supports dynamic and static library builds. It can handle complex hierarchies and applications dependent on several libraries. CMake can also handle projects with multiple toolkits or libraries, where each library is further having multiple directories. CMake is open-source tool which is easy to use and also having a simple yet extensible design which can be extended (as per the requirements) to support new features. Installing CMake in Windows
Fig. 3 Windows 64-bit installer
Fig. 4 Press Next
Fig. 5 Accept Agreement
Fig. 6 Add path
ARM GCC CompilerThe GCC ARM tool-chain is compatible with devices that are based on 32-bit Arm Cortex-A, Cortex-M, Cortex-R processors. Installing ARM GCC Compiler (in Windows)
Fig. 7 Downloading ARM GCC tool-chain
PythonInstalling Python (Windows PC)
Fig. 8 Download Python
Fig. 9 Add path and install
Build Tools for Visual Studio CodeThe next task is downloading and installing ‘Build Tools’ for Visual Studio Code. This tool is responsible for the command-line interface.
Fig. 10 Download Tool chain
Fig. 11 select the necessary tool
Fig. 12 installation GitGit is an open-source tool responsible for code management. Main purpose of using Git is to track the changes in the source code or any set of files, which help multiple developers in working together on non linear development or in simple words we can say that Git make a team of people or developers to work together and that is too using common/same files. Download and Installing Git
Fig. 13 Download Git for Windows
Fig. 14 Select necessary components
Fig. 15
Fig.16 Select the above highlighted choice
Fig. 17 “configure line ending conversions”
Fig. 18 configure terminal emulator
Fig. 19 “configure extra option”
Fig. 20 “Experimental support for pseudo consoles” Downloading Pico SDKOnce all the necessary tools (mentioned above) are successfully installed, we can download the Raspberry Pi Pico SDK and respective examples. Before downloading the Pico SDK and Pico examples, we need to create a folder or directory to save the SDK and pico examples. So, we are creating a folder “RPi Pico” in C:\ drive.
Fig. 21 download Pico SDK
Fig. 22
Now we are ready to program Raspberry Pi Pico using Command Prompt. Programming the Raspberry Pi Pico using Command prompt for Visual Studio Code
Fig. 23 Developer Command prompt
Fig. 24
Fig. 25 create build directory Using CMake to build the Makefiles:
Download and Install Visual Studio Code in WindowsVisual Studio Code is tool developed by Microsoft for source code editing.
Fig. 26 Download Visual Studio Code Installation of Visual Studio Code
Fig. 27 Accept the agreement
Fig. 28 Add to path
Fig. 29 Launch the Visual Studio code
Fig. 30 Visual Studio Code launched successfully Installing CMake in Visual Studio CodeAfter successfully installing the Visual Studio Code, the next thing to do is to install CMake in VS code. Steps to install CMake in Visual Studio Code are:
Fig. 31
Fig.32 setting
Fig. 33 CMake Configure Environment
Fig. 34 CMake generator
Fig. 35 Open folder Fig. 36 Select ‘pico-examples’ folder
Fig. 37 GCC fro arm-none-eabi
Before writing a program for Raspberry Pi Pico make sure you have all the necessary hardware components along with the software and compilers (installed) required to program the Pico board. Components required to program Raspberry Pi Pico are:
ConclusionThis concludes the installation procedure for Visual Studio Code in Windows ( for Raspberry Pi Pico programming) which includes the installation of various tools and compilers necessary for programming Raspberry Pi Pico. In our next tutorial, we will discuss the installation procedure of Python Thonny IDE for programming the Raspberry Pi Pico. We will also continue the programming part with Python Thonny IDE with MicroPython programming language. |