Embedded Rust setup explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ค. 2024
  • 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
    19:42 Debugging with gdb
    22:29 Conclusion
    22:54 The Rusty Bandit
    References:
    Install Rust | www.rust-lang.org/tools/install
    Microbit v2 Product Spec | tech.microbit.org/hardware/
    Rust Platform Support | doc.rust-lang.org/beta/rustc/...
    nRF52833 Data Sheet | infocenter.nordicsemi.com/pdf...
    Crates Registry | crates.io/
    Arm GNU Toolchain | developer.arm.com/downloads/-...
    "The Book" | doc.rust-lang.org/book/index....
    FAQ:
    Terminal setup:
    - JetBrainsMono Nerd Font : www.nerdfonts.com/font-downloads
    - Oh-My-Z : ohmyz.sh/
    - alias ls='colorls'
    - Powerlevel10k theme : github.com/romkatv/powerlevel10k
    - zsh-autosuggestions : github.com/zsh-users/zsh-auto...
    - zsh-syntax-highlighting : github.com/zsh-users/zsh-synt...
    See @typecraft_dev : • How to setup your Mac ...
    Playlist:
    (All via Epidemic Sound)
    Chasing Snakes - Martin Landstrom
    Revving - Martin Landstrom
    Before Chill - Yomoti
    Still on My Mind - Sarah, the Illstrumentalist
    Rich and Thick - spring gang
    Sorvete de Limao - Martin Landstrom
    Will of Minds - Magnus Ringblom
    Disc Me Bro - Basixx
    Simple Pleasantries - Arthur Benson
    Deep Space Samurai - Forever Sunset
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 398

  • @therustybits
    @therustybits  หลายเดือนก่อน +26

    VIDEO ERRATA
    Forgive me audience, for I have erred...
    ERRORS
    - 13:52 : The compiler is not actually inserting the panic during the array-access-by-index bounds checking... It's actually the `Index` trait implementation on arrays and slices that will perform the bounds-check logic and invoke the panic macro if necessary. Thanks to @werecatOmega for pointing this out!
    - 16:07 : The standalone `cargo-embed` crate is no longer being updated, as this tool is now part of `probe-rs`. Once `probe-rs` is installed, `cargo embed` should work as shown in the video, with the exception that the `--list-chips` option is now available via `probe-rs chip list`. Apologies for the confusion, and thanks to @12rjig13gb and @therealjpster for the heads up! See `probe-rs` installation: probe.rs/docs/getting-started/installation/
    OF NOTE
    - 5:19 : This series will primarily focus on the 'microcontroller' subset of bare-metal hardware, but for those working with application-class SoCs, @pppgggr notes that the 64-bit Arm v8-A architecture is listed on the Rust platform support page under the `aarch64` target arch.
    OMISSIONS
    - 5:00 : The nRF52833 has a floating-point unit (FPU), and this is why we opted for the "hard-float" bare-metal target variant of the Arm v7E-M core architecture (thumbv7em-none-eabihf)
    - Linux folk : I forgot to include a step prior to connecting your hardware to modify udev rules so you don't need to use sudo to access it.. Please check out: docs.rust-embedded.org/discovery/microbit/03-setup/linux.html#udev-rules
    - Yes, I am aware of the probe-rs VS Code plugin, and it does look great! I was somewhat conflicted when making the video whether to present the probe-rs + VS code plugin or the "half-way" solution of pairing `cargo embed` with GDB... I figured the `cargo embed`/GDB route might be more helpful for those using a different editor, and/or already used to debugging in GDB. The probe-rs VS Code plugin looks amazing, though by their own admission it's currently in a preproduction/alpha stage: I did try it out, but found the disassembly for my code was jumbled, with some instructions showing up out-of-order, which could leave a newcomer a bit confused... Regardless, I know the probe-rs team is working hard on it, and it definitely has the potential to be the best solution for embedded debugging (plus its Rust all the way down!), so there will be a dedicated video on getting it set up in the future.

    • @robert36902
      @robert36902 หลายเดือนก่อน +3

      22:35 "If you found anything in this video useful" - This is clearly wrong. EVERYTHING in this video is useful. It's disgustingly good. It's a very complicated subject that deserves many hours of explanation, but you've somehow managed to condense the important bit into a fantastic video!

  • @simsim0228
    @simsim0228 2 หลายเดือนก่อน +289

    This series will be where I finally learn rust

    • @cdgonepotatoes4219
      @cdgonepotatoes4219 หลายเดือนก่อน +9

      What I was also thinking. This type of application is closest to what I'm studying for

    • @neekonsaadat2532
      @neekonsaadat2532 หลายเดือนก่อน +3

      Yep, easy to tell this series is going to be an instant classic. Also looking forward to this series!

    • @shivashankar28
      @shivashankar28 หลายเดือนก่อน +1

      Same here I was ringing the same

  • @TheMisterSpok
    @TheMisterSpok หลายเดือนก่อน +178

    This is the most concise and to-the-point embedded rust video I've ever watched. Bravo!

  • @ryanbrownie4634
    @ryanbrownie4634 หลายเดือนก่อน +54

    This series will be responsible for a next gen of Rust embedded developers . I Love this 🤖

    • @therustybits
      @therustybits  หลายเดือนก่อน +21

      The embedded Rust revolution will be televised 🦀🦾

    • @spacebunsarah
      @spacebunsarah 26 วันที่ผ่านมา +1

      It very well could be! Hoping to follow along for the ride. Who knows, might even be me

  • @MrScorpianwarrior
    @MrScorpianwarrior หลายเดือนก่อน +69

    I have no use for this, I have never written for an embedded machine, but boy do I love your style of content. You go into just the right amount of detail to keep me engaged, and I love learning about this sort of thing.

  • @isfandyar3797
    @isfandyar3797 หลายเดือนก่อน +75

    please dont stop this series i want to learn rust for embedded rather than c++ because rust is future in next 10 yrs

    • @alaamroue
      @alaamroue หลายเดือนก่อน +6

      Just like Go was the future

    • @kippie80
      @kippie80 หลายเดือนก่อน +4

      Go and rust complement each other very well.

    • @Cobalt985
      @Cobalt985 หลายเดือนก่อน

      @@alaamroue rust is literally endorsed by the white house, it's not going away buddy

    • @RiwenX
      @RiwenX หลายเดือนก่อน +1

      @@alaamroue Go is a garage collected language, Rust is not. With the release of embedded HAL 1.0, I think it's justified to get excited about the prospect of embedded Rust going mainstream.

  • @mikkelens
    @mikkelens 2 หลายเดือนก่อน +62

    This is incredible! I have been searching for this exact series for the last 2 years! No other embedded rust videos are anywhere near as accessible as this, and I'm very excited to see where this goes. Actually showing the "dumb" steps like how to look up the architecture for a basic microcontroller is super essential for not losing people like me who have only touched external-chip development through something like the Arduino IDE or PlatformIO in some primitive C-like language. I finally have a reason to dust off my bootleg Uno device without having to find out of date oversimplified tutorials, downloading sketchy firmware or going using giant vscode extensions.

  • @jorgegomezreus7019
    @jorgegomezreus7019 2 หลายเดือนก่อน +36

    Best video about embedded rust I've seen, please continue this awesome series!

  • @MegaDuncz
    @MegaDuncz 2 หลายเดือนก่อน +45

    Love your work, informative, interesting and professionally edited, hope the channel blows up!

  • @munzrs
    @munzrs หลายเดือนก่อน +9

    The quality of this video is just insane. The editing is crisp. The writing makes it so clear. The pacing is quick, but not overwhelming. The scope of the topic allows going into the perfect amount of detail of each item for a beginner. The music... it's perfect. It's so clean and classy. It matches the tone of the vocals and topic so well. The most obvious sub I've ever made.

  • @Dygear
    @Dygear หลายเดือนก่อน +8

    I consider this to be the missing Rust Embedded Tutorial. Great job!

  • @osalem192
    @osalem192 2 หลายเดือนก่อน +17

    This channel is gonna be one of my favourites, keep hardworking on 🔥

  • @iyadelwy1500
    @iyadelwy1500 หลายเดือนก่อน +4

    You Absolutely Positively HAVE to continue this series!🔥

  • @sudman08
    @sudman08 หลายเดือนก่อน +7

    Amazing, This is beyond any tutorial / learning thing that I have ever came across, 20 mins felt like 2, I think am going to be a rust dev because of this series. Keep it up 🔥

  • @SibylDark
    @SibylDark หลายเดือนก่อน +4

    8:50 Oh brother! Seriously though, really great and methodical walkthrough. Good for newbies too, I think a lot of us in embedded space assume everyone has intimate knowledge of linkers, memory maps, ISAs, vector tables, etc. thet you pick up along the way doing embedded dev. Its great to hear these things explained in context with Rust.

  • @nahfamimgood
    @nahfamimgood หลายเดือนก่อน +1

    This video couldn't come at a better time. excited for the series!

  • @johncoleman5666
    @johncoleman5666 หลายเดือนก่อน

    Enjoying the series so far, looking forward to what's to come.

  • @Yannick-ei2tz
    @Yannick-ei2tz หลายเดือนก่อน +1

    A very good start. Plus I love the jazz loops behind. Please go ahead !

  • @lenninlc
    @lenninlc หลายเดือนก่อน +1

    Fantastic tutorial! Looking forward to your next video 🎉

  • @radoslavdanev9556
    @radoslavdanev9556 หลายเดือนก่อน +1

    Great video! Great balance between new info and knowledge of Rust. I'm looking forward for next one.

  • @noisetide
    @noisetide หลายเดือนก่อน +2

    Impressively explained!

  • @ViniciusSoaresBatista
    @ViniciusSoaresBatista หลายเดือนก่อน

    This is amazing. From the content to the visuals, sound…you nailed it!

  • @quasarpulsarspark
    @quasarpulsarspark หลายเดือนก่อน

    Very nice and informative video, thank you. Please continue this series.

  • @arcowo
    @arcowo หลายเดือนก่อน +1

    I love how you write your scripts, the words you use, and your voiceovers/narration. Very easy to listen to!

  • @MrAlFuture
    @MrAlFuture หลายเดือนก่อน

    Brilliant! Thank you!

  • @lucasviana7663
    @lucasviana7663 หลายเดือนก่อน

    Loved this video! It really gets me hyped for the series. You did an awesome job explaining things in a way that's super easy to follow. Keep it up!

  • @mytrant
    @mytrant หลายเดือนก่อน

    You enjoy this work and it shows! Great listening and learning

  • @H3MAESSAM
    @H3MAESSAM หลายเดือนก่อน

    Amazing video, just ordered the board and planning to follow along with this series. Please keep the awesomeness coming 🎉

  • @2788west
    @2788west หลายเดือนก่อน +1

    Excellent content, thank you!

  • @zeroows
    @zeroows หลายเดือนก่อน +1

    Please make more of these great videos. Thank you.

  • @markay7311
    @markay7311 หลายเดือนก่อน +2

    As a system security researcher trying to dive into embedded systems, this video has been like music to my ears!

  • @macmoholic6283
    @macmoholic6283 หลายเดือนก่อน +1

    Woo! I've been waiting for the next video to hit my home page. Thanks for this!

  • @sciencelab4225
    @sciencelab4225 หลายเดือนก่อน +2

    Oh wow this is absolutely what I need to get started with embedded Rust! Thank you so much for this awesome content!

  • @justinw6978
    @justinw6978 หลายเดือนก่อน

    Very excited for the rest of this series! 🥳 Subscribed 💪

  • @maxlee3838
    @maxlee3838 หลายเดือนก่อน

    I love that you share and point out all the issues you run into along the way. Very enjoyable format.

  • @tanmay______
    @tanmay______ หลายเดือนก่อน +3

    You just gave me the motivation to start learning rust. Trying it embedded will surely be a nice challenge!

  • @slincolne
    @slincolne หลายเดือนก่อน

    Very slick presentation - well done !

  • @garvamel
    @garvamel หลายเดือนก่อน

    Absolutely fantastic content. This is perfect.

  • @TeamDman
    @TeamDman หลายเดือนก่อน

    Insanely good resource. Covers many things I wouldn't have even guessed at. Thank you for this!

  • @user-si1md7qt5f
    @user-si1md7qt5f หลายเดือนก่อน +1

    Loving the tempo and quality of production and content, really professional. Thanks @therustybits, looking forward to watching more content!

  • @dmatking2000
    @dmatking2000 หลายเดือนก่อน

    Love this video! I have the microbit v2 and everything worked perfectly. Can't wait for more.

  • @pabloqp7929
    @pabloqp7929 หลายเดือนก่อน

    Music and production is top notch. You're gonna crush it with this quality kudos!

  • @emnul8583
    @emnul8583 หลายเดือนก่อน

    I really enjoyed the thorough explanation of the purpose of all the different packages and tooling.

  • @frroossst4267
    @frroossst4267 หลายเดือนก่อน

    Been looking for this kind of content for a while! Thanks much! Keep going strong!

  • @TomazKompara
    @TomazKompara หลายเดือนก่อน +2

    I have been planning to get started with Rust for embedded systems for quite some time now. I am looking forward to the next video. I can't believe this is your second video and it is already top-notch. Keep up the good work!

  • @michaelashby9654
    @michaelashby9654 หลายเดือนก่อน

    Best video I've seen on this topic. Well done.

  • @phillipassmann9959
    @phillipassmann9959 หลายเดือนก่อน

    Really great explanations, concise and not oversimplified. Also good editing work! Will definitely follow for more updates

  • @code_poseidon
    @code_poseidon หลายเดือนก่อน +2

    Amazing content, this is the kind of video about Rust on bare metal that TH-cam was needing, this series will be Incredible! 🚀

  • @jayedr8728
    @jayedr8728 หลายเดือนก่อน

    this is the most useful embedded rust video i watched to date, thank you very much, please continue on this series, liked and subscribed!

  • @teemo_fpv
    @teemo_fpv หลายเดือนก่อน

    such a nice and clear way to explain stuff! love your videos definetly will learn rust with this series ❤

  • @Ramiprops
    @Ramiprops หลายเดือนก่อน

    Absolutely incredible video. All other embedded rust videos are so clunky, but yours is so streamlined. Will recommend this video to people for sure.

  • @a_tabaza
    @a_tabaza หลายเดือนก่อน +1

    You are good, very good! These videos are excellent, and how much effort and passion went into them SHOWS

  • @themecatronicaproject1670
    @themecatronicaproject1670 หลายเดือนก่อน

    Thank you for releasing these videos! I am looking forward to learn rust and microcontrollers might be the way to start.

  • @Nik930714
    @Nik930714 หลายเดือนก่อน +1

    The best "all in one place" tutorial I've seen for embedded Rust. I'm looking forward to future videos from you.

  • @FedynaPavlo
    @FedynaPavlo หลายเดือนก่อน

    Apart from the content, I adore the quality, the style and the effort put into the video. Love it!

  • @lmmlStudios
    @lmmlStudios หลายเดือนก่อน +1

    Astounding. I was trying to search for this a couple months ago but could only find years-old articles that were impossible to follow. This is perfect

  • @GintsPolis
    @GintsPolis หลายเดือนก่อน

    Many thanks for making this video.

  • @evertonoriente7150
    @evertonoriente7150 หลายเดือนก่อน

    Amazing video, the first one everything works and with good explanation about the topics.

  • @yvescloutier1580
    @yvescloutier1580 2 หลายเดือนก่อน

    Wow! absolutely amazing! Great work.

  • @vit4mint685
    @vit4mint685 7 ชั่วโมงที่ผ่านมา

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

  • @Ztaticify
    @Ztaticify หลายเดือนก่อน

    I played around with embedded rust about 4 years ago and i have to say it's come a long way. Great tutorial

  • @andrewhadfield7754
    @andrewhadfield7754 หลายเดือนก่อน

    extremely high quality content. Been waiting to see a tutorial for embedded Rust and this is it.

  • @j-p-d-e-v
    @j-p-d-e-v 22 วันที่ผ่านมา

    The calmest rust development video I ever watched. Great Content!

  • @Alexander-productionsDe
    @Alexander-productionsDe หลายเดือนก่อน +1

    Great video! Can’t wait to watch more.

  • @kalvinpearce
    @kalvinpearce หลายเดือนก่อน +1

    Just came across your channel, and I love it. I already use Rust for applicaitons and webserver dev at work but I love the idea of learning Rust for the embedded space too. Keen to see where this series goes. You've got a great style already and balancing that sweet spot of engaging and informitive

  • @kryptic6174
    @kryptic6174 หลายเดือนก่อน

    Absolutely exactly what I have been looking for. Keep it up!

  • @Just_Browsing-cz4nt
    @Just_Browsing-cz4nt หลายเดือนก่อน

    Quite literally ordered an ESP32-C3 a few days ago to get started with embedded Rust, and then youtube recommends this. Will be following along this series once I get it. Here's hoping I can keep up with the different hardware.

  • @jenseng8977
    @jenseng8977 หลายเดือนก่อน

    You sir are a wonderful teacher!

  • @henrynester8061
    @henrynester8061 16 วันที่ผ่านมา +1

    this video is awesome and what's more it actually worked the first time. you earned a subscriber!

  • @MrBrown78
    @MrBrown78 หลายเดือนก่อน

    Always wanted to get into embedded programming and Rust... I love you!

  • @BjarneSvanberg
    @BjarneSvanberg หลายเดือนก่อน +2

    I have been eyeballing Rust for embedded systems for far too long. This is just what I need. Love that the information is so dense. Good format. Keep it up 😃👍

  • @rick_er2481
    @rick_er2481 หลายเดือนก่อน

    Thank you for making this!!

  • @christophborowski725
    @christophborowski725 หลายเดือนก่อน

    Great introduction to embedded development in Rust!

  • @maxsuster5067
    @maxsuster5067 หลายเดือนก่อน

    Keep up the great presentation and content!

  • @ben_wurster
    @ben_wurster 2 หลายเดือนก่อน +3

    Hands down my new favorite youtube channel!

  • @abbadon2741
    @abbadon2741 หลายเดือนก่อน +1

    This is perfect! I read the rust embedded book and got up and running in a few hours, but this is so much better and concise. Please keep these quality videos coming :)

  • @huso7796
    @huso7796 หลายเดือนก่อน

    Been on the hunt for Rust-embedded tutorials and it felt like a ghost town. Then I found your stuff - exactly what I was looking for. Huge thanks!

  • @felixman9691
    @felixman9691 หลายเดือนก่อน

    Wow thanks so much for making this! I haven’t followed along on a board of my own yet, I have a few things going on right now and can’t split my attention to far, but I will asap. I don’t have a portenta yet, but one of my designs would really benefit from a portenta h7 with its huge number of pins. I’m so excited for more of your videos. You are very clear and have a good mind for what subjects to cover. Can’t thank you enough.

  • @beeesy4268
    @beeesy4268 หลายเดือนก่อน

    Great tutorial, thanks a lot! So far I only used only C for my projects but now that I‘ve seen your two videos I’m exited to try out embedded rust. I’m looking forward to your next videos as they are well structured and generally super high in quality so far.

  • @nothingtoseehere93
    @nothingtoseehere93 หลายเดือนก่อน

    This is my new favorite channel. I might actually finally learn some rust but I also use esphome a lot

  • @Destructificial
    @Destructificial หลายเดือนก่อน

    Great video, and your voice is a pleasure to listen to!

  • @Casperdroid5
    @Casperdroid5 หลายเดือนก่อน

    Amazing video! And wow the editing on this one... Crazy

  • @ejon
    @ejon หลายเดือนก่อน

    Looking forward to more videos like this🎉

  • @randomhunter47
    @randomhunter47 หลายเดือนก่อน

    Bought a board but didn't know how to start. Thank you. Might be the best intro to Rust on embedded devices on TH-cam right now

  • @slinco65
    @slinco65 28 วันที่ผ่านมา

    Just starting out with Rust and I really like your teaching style. Keep up the good work.

  • @brielov
    @brielov หลายเดือนก่อน +1

    I never wanted this video to end

  • @maxwebstudio
    @maxwebstudio หลายเดือนก่อน

    Really cool video. Thank you

  • @joe-skeen
    @joe-skeen หลายเดือนก่อน +1

    Such an excellent guide, and timely! I had just started playing around with a Nordic microcontroller and had only figured out how to make it work with C. Thanks for helping me be able to Rustify this project!

  • @devinosborne3396
    @devinosborne3396 หลายเดือนก่อน

    this was very simple, straightforward, elegant, and actually got me excited to hear about Rust. Very easy and light to understand. Well done.

  • @sstijn577
    @sstijn577 หลายเดือนก่อน

    Wish this came out before i started my rust embedded journey, excellent video about setting up the basics requires, figuring this out on my own did teach me a lot about how a lot of this stuff truly works though, great vid mate❤

  • @thetruekingofwaffles
    @thetruekingofwaffles หลายเดือนก่อน

    This video has been beyond merely educational for me, it helped me reduce errors with rust-analyzer with the check all targets and errors, it helped me find other extensions to help supplement my rust-analyzer, further immersed me in config.toml files, and finally taught me two new Linux commands. I'd just like to say thank you as a relatively novice Rust developer for your guidance kind sir.

  • @LtdJorge
    @LtdJorge หลายเดือนก่อน

    Stellar video. Already had some basic embedded experience with Rust, but I can learn a lot from newer videos, and I got some clues about RTT an cargo embed which were under heavy development when I read about them. Thanks.

  • @nader2560
    @nader2560 หลายเดือนก่อน

    The choice of music is just awesome 😮 !!!

  • @waqas-qammar
    @waqas-qammar หลายเดือนก่อน

    Simple, clean intuitive.🎉

  • @ToumalRakesh
    @ToumalRakesh หลายเดือนก่อน +2

    This is an extremely useful tutorial. It's not just well-produced but you're really touching all the important points. Like making rust-analyzer stop trying to do automatic windows builds! Excellent. And subscribed.

  • @bosr
    @bosr 20 วันที่ผ่านมา

    Thanks so much. The content awesome, it is perfectly detailed and articulated, at a great pace. Looking forward your next videos.

  • @PietPanzer
    @PietPanzer หลายเดือนก่อน

    thank you ❤

  • @jasonbraithwaite9204
    @jasonbraithwaite9204 7 วันที่ผ่านมา

    Thank you for this excellent video 👍

  • @jarrod817
    @jarrod817 หลายเดือนก่อน +1

    whoa, this was great. I'm going to have to watch a second time to absorb more.

  • @creativerio
    @creativerio หลายเดือนก่อน +1

    You're probebly a movie director in a parallel universe. I've never coded Rust but I truly loved the way you explained everything. Keep it up.