rust runs on EVERYTHING (no operating system, just Rust)

209,278
0
Published 2022-01-30
LOW LEVEL RUSTACEANS! Welcome back! In today's video we discuss embedded rust. Specifically, we talk about Hardware Abstraction Layer crates as they're used in rust. We use a HAL Crate for the RP2040 to upload and execute the Blink LED example onto the RP2040. Rust is an incredible programming language that gives the programmer the power of memory safety and performance on embedded systems.

🏫 COURSES 🏫
www.lowlevel.academy/courses/

LINKS:
LLL Merch: linktr.ee/lowlevellearning
Buy the RP2040: amzn.to/3uISUGn
Learn Rust with this Book!: amzn.to/3upEydx
Embedded Rust: docs.rust-embedded.org/book/
RP2040 HAL: github.com/rp-rs/rp-hal

SOCIALS:

Follow me on Twitter: twitter.com/lowlevellearni1
Follow me on Twitch: twitch.tv/lowlevellearning
Join me on Discord!: discord.gg/gZhRXDdBYY

All Comments (21)
  • @slid3rek24
    My Raspberry Pi Pico fell to a bucket of water during doing some plant watering project, I'm pretty sure it runs Rust now...
  • @Dygear
    Excellent! There are a couple of erratas. You don't actually need a variable to be marked mut to borrow it out to another function. You will actually have a much harder time borrowing a mut variable because rust wants only one place to be able to handle changing the underlying variable at any given time.
  • Please keep up with the low level Rust videos. That's one reason why I chose Rust for learning!
  • @santaclause8090
    Nice getting started video :) Thanks Just one small correction abouth the push-pull output part: it's not called push-pull because you can "pull" data from it to read: it's still an output. It's called that way because it's built with 2 transistors, one can push the output towards the supply voltage and one can pull the output to ground. Just clarifying it here before somebody tries to read data through an output :D
  • @test40323
    Nice walkthrough. HAL does make codes more readable as it is more standardized. Good low level C programmers wrap registers/dma access in small functions. Thank you!
  • @kingderderder
    "Push pull output" is actually referring to the type of output in electrical terms. It means the pin can "pull" to ground/low and "push" the voltage on the pin to vcc/high. There are other types of output types such as "open drain" which only pulls to ground, no pushing. The line setting the pin to push/pull output is equivalent to arduino pinMode(...).
  • There is actually an open-source operating system written in Rust for embedded systems called Tock OS and it has support for rp2040 too (and many other Cortex-M and RISC-V based MCU's). You can then compile and run c or rust apps on top, without needing to know all low level stuff. But if you like the low level stuff you can always contribute to Tock OS :))
  • Dude how awesome is the fact that you run the crate and it automatically uploads to the pico in the shortest amount of time? this is crazy, I have to try it
  • @apocalypseio
    After watching your last video I was tickled to see you steering folks towards installing the whole environment. I am doing a similar exploration with ESP32 and diverted to try the 2040 along with you this time. Good Stuff!
  • @kenworks6068
    Perfect level of instruction for me. I just ordered the picos, am reading the the new Rust book and have an application to code. You are cutting to the chase and having arduino experience your explanations are clear and organized - Thank You I am so pumped to be part of the Rust Everywhere world
  • @maikha8963
    slowly opens another tab and typing rust language
  • @fotnite_
    Extremely well documented seems to be a pattern with Rust IMO. It's not just the core language, but the entire ecosystem that is well-documented, and even though Rust has a ton of very unique features that I like, it's the superb documentation that wins me over in the end.
  • @bspringer
    Very nice, one thing I noticed: Push-Pull actually refers to being able to push it to 1, or pull it to 0. One alternative is High Impedance (Hi-Z), which is an input (no possibility of writing any value), and another alternative is open-drain (you can only pull it down to 0, but if you want it to go up, you need an external pullup. Useful for combining multiple output pins and the output will go low if any of the output pins of different ICs goes low)
  • @arjayUU
    that is a ton of initialization for a blink xD does this scale for more complex projects. also wondering where tbe benefits of embedded rust lie and how one would handle DMA access conpared to c++ for let's say fast ADC sampling.
  • @MrAnandml
    Oh this Rust series is going to be great...
  • @johnknight7293
    Thanks, don't forget the link to the embedded Rust doc page as you promised !
  • @frostifish
    Lovely video! Now I can finally grasp what the panic handler does and why unwarp is always called. Also, perhaps you could check out the secondary core and Programmable I/O for the Pico in Rust in a future video :)
  • Thanks, this video made me realise that C/C++ is not the pain point of embedded systems, the configurations and quality of documentation is. C/C++ are nice as in I know what my code will compile to assembly. Rust makes that memory safe but does not help with the pain of configuration.
  • @herrxerex8484
    Loved this , people like you make this world a better place !!!