Coder Social home page Coder Social logo

-lab-2-setup-guide's Introduction

Lab-2-SETUP-GUIDE

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
  2. CMake
  3. Build Tools for Visual Studio 2022
  4. Python 3.10
  5. Git

1.ARM GNU Toolchain

  • We downloaded the file 'arm-gnu-toolchain-12.2.MPACBTI-Bet1-mingw-w64-i686-arm-none-eabi.exe' mentioned below. alt text
  • We move to the next stage while the download is being completed by clicking the next button and accepting the licensing agreement. alt text alt text
  • The next step is to set the path and select a few more permissions in the checklists to configure the environment for ARM GNU. alt text
  • Now installation of ARM GNU Toolchain is done.

2. CMake

  • We downloaded the file 'cmake-3.24.2-windows-x86_64.msi' mentioned below. alt text
  • Next, after accepting the licensing agreement we moved forward to path setting as shown below. alt text
  • After that the installation process occurred smoothly. alt text

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. alt text
  • 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. alt text
  • 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 alt text
  • 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). alt text

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. alt text
  • Following the download, we chose a few checklists depending on our preferences. alt text
  • And in the next step we chose Notepad as Git's default editor. alt text
  • Following the preceding step, we enabled Git to be used from the command line as well as third-party software. alt text
  • Next, We selected the checkbox "Checkout as is, commit as-is" stating how Git would treat line endings in the text files. alt text
  • Here, We selected the terminal emulator we want to use with Git Bash. alt text
  • Lastly, we enabled experimental support for pseudo consoles. alt text 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 alt text

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. alt text

-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. alt text

-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.
    alt text
  • 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.
    alt text
  • 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.
    alt text alt text

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. alt text

  • 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. alt text

-lab-2-setup-guide's People

Contributors

satyajeetburla avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.