SRUG 2024.06 Meetup

https://slides.com/u007d

Bare-Metal Embedded Systems Programming in Rust III

 

On a Raspberry Pi Pico

  • Code of Conduct

  • SRUG Discord:

https://discord.gg/Wzgya6Kjae

  • Slides:

https://slides.com/u007d

 

Personal Introduction:

Brad G.

  • Online: U007D ("Curly")
  • Started tech back in the 1980's
  • Hold a B.Sc. in Computer Science
  • Started in BASIC
  • Historically gravitated to low-level languages
    • MOS 6502/6510 Assembly
    • Motorola 68k Assembly
    • K&R C, ANSI C, Pascal/Object Pascal, C++

Upcoming Meetups

  • Thu. July 18 Meetup:
    • Lecture Format
  • Thu. Aug 15 Meetup:
    • Hands-on Beginner Session?

Prerequisites:

Hardware

* Raspberry Pi Pico

* Electronic Components Kit
* 4-Digit LED Panel
(individual LED panels are available from me at the meeting)

Software: Rust

1.  https://www.rust-lang.org/tools/install
2. `rustup target add thumbv6m-none-eabi`

 

Software: git

    Mac:            `brew install git` (see https://brew.sh/) or

                         https://github.com/git-guides/install-git
    Ubuntu:      `apt install git`
    Windows:    https://github.com/git-guides/install-git

 

 Software: Other

  • `cargo install elf2uf2-rs svd2rust form`

 

  • (Optional) Visual Studio Code Editor:
        https://code.visualstudio.com
  • (Optional)
     Mac: `brew install binutils`
     Ubuntu: `apt install binutils`

 

Setting up the Board

Setting up the Board 1

Setting up the Board 2

Setting up the Board 3

Setting up the Board 4

Setting up the Board 5

Setting up the Board 6

Setting up the Board 7

Setting up the Board 8

Setting up the Board 9

Setting up the Board 10

Setting up the Board 11

Setting up the Board 12

Setting up the Board 13

Setting up the Board 14

Setting up the Board (Final)

Running on the Pi

The Raspberry Pi Pico has a different CPU then your computer.

 

Your computer has to compile your source code to machine language for a processor it can't run.  This is called cross-compiling.

 

Your cross-compiled program then needs to be transferred to the Pi and run there.

Running on the Pi (2)

To do this:

1. Unplug your RPi Pico USB cable (either end) if it is plugged in.

2. Hold down the white button on the RPi Pico.

3. Re-connect your RPi Pico with the white button held down.

(Your RPi Pico is now ready to receive your cross-compiled program.)

4. `cargo run`. (Your program is now running on your RPi Pico.)

5. Repeat the above procedure to send and run a new version of your code to your RPi Pico.

Thank you!