The Rusty Bits
The Rusty Bits
  • 10
  • 209 512
Blinking an LED: Embedded Rust ecosystem explored
Today we find several ways to blink an LED, and explore the various layers of abstraction within the embedded Rust ecosystem.
Chapters:
0:00 Intro
0:36 Peripheral Control
3:47 Unsafe Rust
6:13 Peripheral Access Crate
8:09 Hardware Abstraction Layer
10:56 Some(Rust)
14:00 Board Support Package
17:03 The Rusty.. Kit?
References:
ua-cam.com/video/TOAynddiu5M/v-deo.html
@letsgetrusty ua-cam.com/video/NDIU1GSBrVI/v-deo.html
"The Book" | doc.rust-lang.org/book/index.html
Special thanks to Patreon supporters!
- David King
Переглядів: 15 123

Відео

Embedded Rust setup explained
Переглядів 74 тис.3 місяці тому
In this episode we get our development environment prepared for building bare-metal Rust projects. Follow along with your preferred editor & hardware as we begin our journey into the landscape of embedded Rust... Chapters: 0:00 Intro 1:03 Tooling 3:00 Hardware 4:10 Cross compiling 6:07 Bare Metal Rust 8:13 Dependency Management 12:55 Don't panic!() 14:46 Build & Flash 17:30 Debugging with RTT 1...
Moving from C to Rust for embedded software development
Переглядів 78 тис.4 місяці тому
Writing production-grade firmware is hard, but maybe we're making it harder than it needs to be. Join me in exploring some of the common pitfalls of embedded software development in C, and how Rust appears to be well-positioned to address these issues. Oh, and welcome to the channel! 👋 Resources: @letsgetrusty | ua-cam.com/video/usJDUSrcwqI/v-deo.html @NoBoilerplate | ua-cam.com/video/br3GIIQee...

КОМЕНТАРІ

  • @Godovd
    @Godovd 20 годин тому

    Let's goo baby it's time to get some rusty

  • @utubercj
    @utubercj 23 години тому

    The video is awesome : it makes embedded rust fun to learn !

  • @anthonygayflor
    @anthonygayflor День тому

    New the channel, subscribed immediately the moment you went “let’s have fun with this” 😂

  • @newton-342
    @newton-342 3 дні тому

    Yes, we can emulate Rust enum with tagged unions in C/C++. Fun Fact: The option enum with a pointer can be automatically optimized because the null pointer can be used for the None variant

  • @yondaime500
    @yondaime500 3 дні тому

    One consequence of that is that adding a variant to a public enum is a breaking change, unless you mark it with the non_exhaustive attribute (this is also true for structs with public fields, which can also be destructured with pattern matching). This is only a concern for library authors/maintainers, of course.

  • @rotors_taker_0h
    @rotors_taker_0h 5 днів тому

    You make it look too simple

  • @simonakpoveso5022
    @simonakpoveso5022 10 днів тому

    This channel is a goldmine in my search for embedded content. I've been writing software for over 5 years and miss my early embedded career. I'd like to transition back and your videos are wonderful. Thank you and I look forward to future videos

  • @Franfran722
    @Franfran722 14 днів тому

    Keep Ariane launch 501 in mind ! Overflows danger

  • @marccawood
    @marccawood 15 днів тому

    I regularly crash code in dev which will just log an error

  • @lohikarhu734
    @lohikarhu734 15 днів тому

    absolutely excellent presentation, both presentation and content...great for this old 'bare-metal' programmer/systems guy...(just how 'bare-metal' you can see from an IC that I co-designed..lp5523...check out the register maps on a 'simple' LED driver..btw, seems to have some Rust support!)

    • @lohikarhu734
      @lohikarhu734 15 днів тому

      but, i do need to learn more Rust basics...back to the books!

  • @BehruzbekOtayev
    @BehruzbekOtayev 17 днів тому

    As a decorated senior engineer, I'm ashamed. I don't know shit. That was a bit high level. Can't follow unless I have basics of embedded engineering.

  • @viper440
    @viper440 17 днів тому

    If its uint8 like i think it is, should be 0 right?

  • @frankdearr2772
    @frankdearr2772 17 днів тому

    Great topic, thanks 👍

  • @user-gp7sn4fh9t
    @user-gp7sn4fh9t 18 днів тому

    I can't wait for the next tutorial, the are so great!

  • @lawrencemanning
    @lawrencemanning 18 днів тому

    Does Rust have ranged integers? That’s the next level integer type. These were extremely useful when I looked at Ada many years back. Debug builds only, I suppose.

    • @therustybits
      @therustybits 18 днів тому

      Kind of? Looks like it's currently only available in the nightly version of the compiler: docs.rs/ranged_integers/latest/ranged_integers/

  • @skeleton_craftGaming
    @skeleton_craftGaming 19 днів тому

    That's the best kind of depends. [And I will admit that is one way that rust is better than C /C++]

    • @warguy6474
      @warguy6474 7 днів тому

      well it may become it depends on the platform 😂

    • @skeleton_craftGaming
      @skeleton_craftGaming 6 днів тому

      @@warguy6474 well no I do think it is objectively better to panic over something that could be unexpected behavior in a debug build, the fact that C++ compilers cannot do that is very much a point to rust. I say as an avid c++ developer

  • @j-p-d-e-v
    @j-p-d-e-v 19 днів тому

    Whenever I watch your videos. It always inspires me to continue studying Embedded Rust Programming.

  • @zypheroq
    @zypheroq 19 днів тому

    why you askin me

  • @AndyDuplain
    @AndyDuplain 19 днів тому

    Fantastic information! Thank you!

  • @Alsteraib985
    @Alsteraib985 19 днів тому

    Great channel !

  • @Alsteraib985
    @Alsteraib985 19 днів тому

    I like to call the Rust safety as conciseness, because of the correctness of the code results.

  • @eter9nitysslut131
    @eter9nitysslut131 20 днів тому

    this is why rust sucks

  • @jakobgegeniger6793
    @jakobgegeniger6793 20 днів тому

    Great Introduction, I followed your guide and the setup was a piece of cake. I would love to learn from you, how to structure a bigger embedded project. Hopefully some with unit tests, that could also run partly on the Host system.

  • @asumiluna9066
    @asumiluna9066 20 днів тому

    That looked weird

    • @lawrencemanning
      @lawrencemanning 18 днів тому

      Useful for finding many obscure bugs though.

  • @rammrras9683
    @rammrras9683 22 дні тому

    You found too many ways of blinking an LED and I found a great channel to follow!

  • @utubercj
    @utubercj 23 дні тому

    Simple and easy follow Tutorial: Please make a tutorial on Embedded Debugging , thank you

  • @0x_cromosomes
    @0x_cromosomes 24 дні тому

    Thank you for this great tutorial 🎉

  • @chari_md2
    @chari_md2 24 дні тому

    what are you using to edit your videos? great work not only on the embedded side but also on the editing wow

    • @therustybits
      @therustybits 24 дні тому

      Thanks! Currently using Final Cut Pro for video editing.

  • @marcelocorrea7916
    @marcelocorrea7916 25 днів тому

    Congrats on the video, well paced, well explained. A suggestion, to make a risc-v version of this video.

  • @TenderAI
    @TenderAI 26 днів тому

    It is so impressive that you show me a way to make it and give me the passions of starting learn rust. And could you help to create a new tutorial for how to rust embedded with raspberry cm4 or pi? Or could you just explain any differences between micro bits board and RPI board in your new video or shorts?

  • @teuluPaul
    @teuluPaul 29 днів тому

    For Gentoo Linux users: to use gdb with embedded devices - enable the multitarget flag for dev-debug/gdb, then re-install. Invoke simply with gdb, and follow along with the instructions in the video. Everything else works as explained in the video and the "Errata" post.

  • @ChidleyITCompute-ye7hc
    @ChidleyITCompute-ye7hc Місяць тому

    I feel like I'm getting a little bit clever with every video.

  • @i.8530
    @i.8530 Місяць тому

    I like your style, informative and relaxed :) This is also a bit of a nitpick but you're not allowed to bypass the borrow checker even in unsafe. For example casting a shared reference to a mutable reference through raw pointers is UB. Same for having multiple mutable references to the same variable, it's just not enforced like in safe Rust.

    • @therustybits
      @therustybits Місяць тому

      Ahh that makes sense, thanks for the feedback!

  • @targaR32
    @targaR32 Місяць тому

    always preferable to use rust over c 😅 also new mic is sounding good.

  • @paulroberto2286
    @paulroberto2286 Місяць тому

    And then there's people like me who were drawn to rust thanks to cargo :)

  • @rohanpandey9957
    @rohanpandey9957 Місяць тому

    sir you need to post more videos this was so awesome, the first video ive watched in 1x speed and enjoyed every bit of it ig time for me to deep dive into rust

  • @ignaciodelvalle158
    @ignaciodelvalle158 Місяць тому

    I was very lost between the concepts of embedded without knowing where to start and I came across this video. It's a revelation. And I skipped it at first because I can't stand those that appear on the screen for a long time, but luckily (because there are actually very few of them) I insisted again. Great exhibition. Thank you so much.

  • @vit4mint685
    @vit4mint685 Місяць тому

    Thank you, looking forward to where you take this series.

  • @jesusvelasco4893
    @jesusvelasco4893 Місяць тому

    Amazing

  • @HolarMusic
    @HolarMusic Місяць тому

    on windows, just do winget install rustlang.rustup

  • @arnetriesyoutube
    @arnetriesyoutube Місяць тому

    I really loved this video and I hope to see more from you soon :) One question: What is your workflow with music? Do you write it yourself or is there some nice software you use? Is it stock music that is just timed really well? Thanks!

    • @therustybits
      @therustybits Місяць тому

      All the music is from Epidemic Sound, for now at least.. I think I'm burning through some of their best content at an alarming rate 😅 I try to find songs that fit the mood of the chapter or just sound cool & help carry the story forward, and try not to reuse tracks between videos. Editing is done in Final Cut Pro. We'll see how long I can continue making videos this way, but for now I'm really enjoying how they turn out 😀

  • @debuti
    @debuti Місяць тому

    Thanks for sharing!! Id love to see async rust on embedded if possible

    • @therustybits
      @therustybits Місяць тому

      Hopefully next main channel video will cover async 😅

  • @TheEvertw
    @TheEvertw Місяць тому

    This is a masterful video, HIGHLY recommended if you want to start with embedded Rust.

  • @PauloLuisFranchiniCasaretto
    @PauloLuisFranchiniCasaretto Місяць тому

    Great content, and great production. The music is such a vibe

  • @timothymApps
    @timothymApps Місяць тому

    Thanks for the video. Was trying to follow the Rust book for Embedded Development and was already having issues. Your video helped a TON! Please keep up the good work.

  • @12rjig13gb
    @12rjig13gb Місяць тому

    Thanks to your introduction, I've been having fun in bare-metal rust

  • @Onyx-it8gk
    @Onyx-it8gk Місяць тому

    Have you heard of Zed by chance? It's made by the devs of Electron, Atom and tree-sitter, and it's written in Rust! They have a release version for Mac, but I'm still waiting on the Linux release. It's very new, so I would imagine there aren't as many third-party plug-ins available as vscode.

    • @therustybits
      @therustybits Місяць тому

      Yes Zed looks awesome! Going to have to give it a try some time..

    • @Onyx-it8gk
      @Onyx-it8gk Місяць тому

      ​@therustybits It would be really interesting to hear a little of your back story, like how you got interested in computers/programmers, what got you interested in embedded, that sort of stuff. It felt like I was kind of mindlessly learning programming without really knowing what I ultimately wanted to do. I'm still relatively new to programming. Once I discovered embedded, I absolutely fell in love with it. I'm now back in school for it and just finished my first semester while returning.

  • @weiSane
    @weiSane Місяць тому

    The production quality and the simple way you teach and explain things makes it such a great experience to watch and learn from your videos. This is too good 👌

  • @casper-3
    @casper-3 Місяць тому

    I can't believe your earliest video is only 3 months old! The quality tells me you've been doing this for years, but I'm glad I caught this train just as it was leaving the station.

  • @JulianBolivarGaleno74
    @JulianBolivarGaleno74 Місяць тому

    Good to know that crate to help on the stack overflow debugging