SATYAJEET DAS
LinkedIn: https://www.linkedin.com/in/satyajeet-das/
Tested on:DELL Inspiron 16 Plus (16-inch, 2022), Windows 11 Home 21H2
Setup Gide for SDK on your Windows Machine for Raspberry Pi Pico.
This lab's prelab section covered how to become familiar with the various terminals and text editors available.
However, in this lab, we had to install the SDK (Software Development Kits) for C/C++ in order to configure our PC for RP2040 development using Pico.
Since we used a Windows PC, we had to follow the steps below to install the C/C++ SDK, browse the pico-examples repository, and successfully run our first "hello_usb.c" program.
To install C/C++ SDK on Windows 11, we needed to install the following additional tools:
1.ARM GNU Toolchain
- We downloaded the file 'arm-gnu-toolchain-12.2.MPACBTI-Bet1-mingw-w64-i686-arm-none-eabi.exe' mentioned below.
- We move to the next stage while the download is being completed by clicking the next button and accepting the licensing agreement.
- The next step is to set the path and select a few more permissions in the checklists to configure the environment for ARM GNU.
- Now installation of ARM GNU Toolchain is done.
2. CMake
- We downloaded the file 'cmake-3.24.2-windows-x86_64.msi' mentioned below.
- Next, after accepting the licensing agreement we moved forward to path setting as shown below.
- After that the installation process occurred smoothly.
3. Build Tools for Visual Studio 2022
- In the next step of our process, We downloaded the file "Build Tools for Visual Studio 2022" mentioned below.
- Following the download, we choose the modules to be installed, as seen below. We selected to install Windows 11 SDK because we use Windows 11 Operating systems.
- After this the installation procedure was completed.
4. Python 3.10
- In the next step, We downloaded the file Latest Python 3 Release - Python 3.10.7
- Following after downloading this file while installing it we chose "Add to Path" option. Because Adding Python to PATH makes it possible for you to run (use) Python from your command prompt (also known as command-line or cmd).
5. Git
- To follow the last step in Toolchain installation, We downloaded Git named as 64-bit Git for Windows Setup. for our 64-bit PC.
- Following the download, we chose a few checklists depending on our preferences.
- And in the next step we chose Notepad as Git's default editor.
- Following the preceding step, we enabled Git to be used from the command line as well as third-party software.
- Next, We selected the checkbox "Checkout as is, commit as-is" stating how Git would treat line endings in the text files.
- Here, We selected the terminal emulator we want to use with Git Bash.
- Lastly, we enabled experimental support for pseudo consoles.
The Toolchain installation was finally done.
6. Getting the SDK and examples
-After that we executed the below commands in the command line. We used Powershell
7. Building "Hello World" from the Command Line
-Then, from the Windows menu, we launched the Developer Command Prompt window by selecting Windows > Visual Studio 2022 > Developer Command Prompt for VS 2023 and and set the path as below.
-Before proceeding, we closed our current Command Prompt window and opened a second Developer Command Prompt session where this environment variable will now be appropriately configured.
-To construct the target, we proceeded to the pico-examples folder and generated the 'Hello World' example, as seen below.
-This generated elf, bin, and uf2 targets, which we can see within the build directory in the hello world/serial and hello world/usb directories. The UF2 binaries may be dragged and dropped straight onto an RP2040 board connected via USB to your PC.
8.SERIAL CONSOLE โ SCREEN, PUTTY, ETC.
- We will install putty as our serial console.
- The first thing to do is download the latest version of PuTTY. You'll want to download the Windows installer file. It is most likely that you'll need the 64-bit version. Download the file and install the program on your machine. If you run into issues, you can try downloading the 32-bit version instead. However, the 64-bit version will work on most PCs.
- You'll use Windows Device Manager to determine which port the board is using. The easiest way to determine which port the board is using is to first check without the board plugged in. Open Device Manager. Click on Ports (COM & LPT). You should find something already in that list with (COM#) after it where # is a number.
- Now plug in your board. The Device Manager list will refresh and a new item will appear under Ports (COM & LPT). You'll find a different (COM#) after this item in the list.
- Sometimes the item will refer to the name of the board. Other times it may be called something like USB Serial Device, as seen in the image above. Either way, there is a new (COM#) following the name. This is the port your board is using.
- Now you need to open PuTTY.
-Under Connection type: choose the button next to Serial.
-In the box under Serial line, enter the serial port you found that your board is using.
-In the box under Speed, enter 115200. This called the baud rate, which is the speed in bits per second that data is sent over the serial connection.
9. Flashing and Running "Hello World"
-Connect the Raspberry Pi Pico to your Raspberry Pi using a micro-USB cable, making sure that you hold down the
BOOTSEL button to force it into USB Mass Storage Mode.
- The board should automatically appear as a external drive.
- You can now drag-and-drop the UF2 binary onto the external drive.
- The Raspberry Pi Pico will reboot, and unmount itself as an external drive, and start running the flashed code.
- You can now see hello world being printed in the serial console.