Git Product home page Git Product logo

ese519_lab2_setup's Introduction

ESE519 Lab2 setup

1. Install ToolChain

To build code for RP2040 on MacOS, we have to install some tools, like Homebrew, cmake and GCC.

1.1 Install Homebrew

Homebrew is used for quick and safe package installation on MacOS

 $ /bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

1.2 Install PICO

To start the development on the RP2040, we have to install PICO which provide support with both a C/C++ SDK.

$ cd ~/
$ mkdir pico
$ cd pico
$ git clone -b master https://github.com/raspberrypi/pico-sdk.git
$ cd pico-sdk
$ git submodule update --init
$ cd ..
$ git clone -b master https://github.com/raspberrypi/pico-examples.git

1.png

1.3 Install CMake and other supplementary

$ brew install cmake
$ brew tap ArmMbed/homebrew-formulae
$ brew install arm-none-eabi-gcc

1.4 Updating the SDK

To keep up with the version update, we have to use the commands below to follow up the update.

$ cd pico-sdk
$ git pull
$ git submodule update

2. Building with CMake Tool

To use VScode for programing in C, there are few steps for setup the "CMake Tool" extensions in VScode.

2.1 Set up 'PICO_SDK_PATH' environment variable

Change to the pico-examples directory and create a .vscode directory and add a file called settings.json to tell CMake Tools to location of the SDK. img.png

2.2 Build with CMake Tool via VScode

img.png After setting up the cmake tool configuration and choose proper CMake generator, we can add 'pico-example' to the Workspace. Once VScode load the project successfully, it will ask you to select a compiler to compile all files in 'pico-example'. Here we choose 'named 'GCC for arm-none-eabi' as the compiler and click 'Build' button on the bottom of the window to compile the files. From the figure above, this process produce elf, bin, and uf2 targets inside the 'hellow_world' folder in newly constructed 'build' directory.

3. Hello world

By connecting the RP2040 to the PC via micro-USB cable and keeping pressing the BOOTSEL button, the RP2040 will go into USB Mass Storage Mode. Once we Drag-and-drop either the hello_usb.uf2 onto the Mass Storage Device, the board will reboot, unmounting itself as a Mass Storage Device, and start to run the flashed code. Input the code below in the terminal, we can see the result 'Hello, world!' from the board collected from the port.

screen /dev/tty.usbmodem2101 115200

2.png

ese519_lab2_setup's People

Contributors

anniepan8215 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.