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

  ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 203,382

Low Level Learning

Low Level Learning

Π”Π΅Π½ΡŒ Ρ‚ΠΎΠΌΡƒ

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: / lowlevellearni1
Follow me on Twitch: / lowlevellearning
Join me on Discord!: / discord

ΠšΠžΠœΠ•ΠΠ’ΠΠ Π†: 223
@slid3rek24
@slid3rek24 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
My Raspberry Pi Pico fell to a bucket of water during doing some plant watering project, I'm pretty sure it runs Rust now...
@alexdubois6585
@alexdubois6585 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
safely
@amunkus2773
@amunkus2773 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
@@alexdubois6585 and it cannot race anymore!
@dieSpinnt
@dieSpinnt Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Only direct short circuits and then also with a clear path e.g. between the 5V section and sensitive 3V logic and with a correspondingly high current flow can seriously endanger your board/parts. This basically happens when measuring or when trying around on the breadboard. In the water this is very unlikely. Of course, there are sensitive components where water damage in and of itself affects the function, but a little patience will probably suffice for you. It's best to use a few dry cloths and not even a (hot-air) hair dryer or the oven ... because you can damage more with them than with water. Have fun bathing and crafting! :)
@aayushmaharjan6412
@aayushmaharjan6412 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
🀣🀣🀣
@andersonwaithaka3720
@andersonwaithaka3720 9 місяців Ρ‚ΠΎΠΌΡƒ
πŸ˜‚πŸ˜‚πŸ˜‚
@Dygear
@Dygear 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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.
@r.pizzamonkey7379
@r.pizzamonkey7379 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Yup. You can only have one mutable reference OR multiple read-only references.
@paulmulders3648
@paulmulders3648 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
erratum to your comment, errata is plural already
@rumplstiltztinkerstein
@rumplstiltztinkerstein 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@r.pizzamonkey7379 In rust speech, & implements Copy and &mut doesn't
@r.pizzamonkey7379
@r.pizzamonkey7379 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@rumplstiltztinkerstein sort of but not quite. I'm pretty sure it's a different system which supercedes traits.
@rumplstiltztinkerstein
@rumplstiltztinkerstein 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@r.pizzamonkey7379 maybe they're just special pointers
@alemartinezz1022
@alemartinezz1022 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Please keep up with the low level Rust videos. That's one reason why I chose Rust for learning!
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
More to come!
@JaJakubYT
@JaJakubYT 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Check out videos on my channel. I have 6 videos on Rust embedded and more to come.
@nathan12581
@nathan12581 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
I second this
@keylanoslokj1806
@keylanoslokj1806 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
What an era to live in. When such content is available
@selfscience
@selfscience 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Specially for knowledge hoarders like ourselves.
@notsojharedtroll23
@notsojharedtroll23 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@selfscience yesir πŸ€™πŸ€™πŸ€™
@santaclause8090
@santaclause8090 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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
@fltfathin
@fltfathin 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
to make it more clear, other type of output is open drain in which you need to add pullup resistor to keep it high
@louiscloete3307
@louiscloete3307 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Wanted to say the same. Thanks!
@test40323
@test40323 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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!
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Good tip!
@Mr.Leeroy
@Mr.Leeroy 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
What's wrong with proper commenting? Do you have to add pointless jump commands around your low-level instructions, complicate the things happening in stack, etc?
@kingderderder
@kingderderder 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
"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(...).
@apocalypseio
@apocalypseio 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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!
@SandwichMitGurke
@SandwichMitGurke 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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
@maikha8963
@maikha8963 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
*slowly opens another tab and typing rust language*
@mydearaniryx7829
@mydearaniryx7829 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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 :))
@herrxerex8484
@herrxerex8484 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Loved this , people like you make this world a better place !!!
@alevez2004
@alevez2004 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Pretty neat explanation, thanks! I'm gonna try this myself. I've always wanted to use rust in some projects, now I found how to do it having fun.
@mattg5262
@mattg5262 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Amazing video! For future videos writing a driver for a simple i2c device using embedded hal traits would be super helpful. There are barely any up to date tutorials out there on it. There are so many hardware devices that don't have abstractions yet and a video on it would be a huge help to the community.
@MrAnandml
@MrAnandml 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Oh this Rust series is going to be great...
@frostifish
@frostifish 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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 :)
@kenworks6068
@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
@LowLevelLearning
@LowLevelLearning Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Glad it was helpful!
@first-thoughtgiver-of-will2456
@first-thoughtgiver-of-will2456 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you for bringing more attention to this.
@typeer
@typeer 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Love this series thanks man
@act0r399
@act0r399 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Man, this is incredible, thanks UKposts that show you in recommendations, you explaining every fucking line code , just amazing, keep creating tutorial like this, thanks
@kenworks6068
@kenworks6068 7 місяців Ρ‚ΠΎΠΌΡƒ
Great job, I was able to follow your explanations and get the program running on my pico from my Mac.
@echoptic775
@echoptic775 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I love i found out about this channel, right as u started programming in rust, i know that rust is a viable c alternative, but without the crazy things that can happen in c. I think its finally time for c to not be the best solution for embedded systems
@fotnite_
@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.
@par5ek
@par5ek 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks. I’ve been waiting for this.
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
No problem!
@omarmhaimdat
@omarmhaimdat 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Excellent and honest video, keep going !
@bspringer
@bspringer 4 місяці Ρ‚ΠΎΠΌΡƒ
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)
@jotrockenmitlocken
@jotrockenmitlocken 5 місяців Ρ‚ΠΎΠΌΡƒ
This video is a beauty. Thanks very much for this.
@Alex-hr2df
@Alex-hr2df 9 місяців Ρ‚ΠΎΠΌΡƒ
Brilliant, man!
@debuti
@debuti 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Good! I have a primitive rust scheduler running in the rp2040. It was a funny project
@NathanLTPK
@NathanLTPK 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
keep doing these rust & pi pico tutorials with showcasing more peripherals connected to the board. great job, like and sub-ed
@sourabhk2373
@sourabhk2373 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
keep making rust + embedded videos please!
@RonSheely
@RonSheely Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Excellent. Thank you.
@harrytsang1501
@harrytsang1501 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
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.
@criptouni
@criptouni Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Great videos and keep 'em coming! given the high-quality of your videos could you share your setup? workstation, mic/headset, software used? We want to start making some videos ourselves for Spanish speakers about Rust but we're not too sure on hardware equipment required. Thanks!
@johnknight7293
@johnknight7293 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks, don't forget the link to the embedded Rust doc page as you promised !
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you for the reminder! Done.
@TrolleyMC
@TrolleyMC 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I think arch repos keep an up to date version of rust, so really depending on your distro or UNIX-like OS, it may or may not be necessary to use rustup
@thewilltejeda
@thewilltejeda 4 місяці Ρ‚ΠΎΠΌΡƒ
This is pretty cool, ive learning rust ( as a typescript/python dev ) and have been wondering about rust and the rp2040
@chairmakerPete
@chairmakerPete 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
This looks super-exciting. Cannot get into python at all, but rust seems shockingly brilliant.
@wChris_
@wChris_ 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
There is actually a project template you can use, to get started on your own project!
@ZenoTasedro
@ZenoTasedro 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great video! Will def subscribe and catch up
@justins7796
@justins7796 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
subbed. dude this is great work
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks for the sub!
@Bianchi77
@Bianchi77 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Nice video, thank you for sharing :)
@arjayUU
@arjayUU 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
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.
@rafaelbachmann7246
@rafaelbachmann7246 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Gotta setup those clocks :) DMA usage is currently same as C or C++: write to registers and make sure no races etc. can happen. Some HAL implementations make this ridiculously easy, see e.g. h7 hal. In the future, some efforts such as embedded-dma and bbqueue might standardise this, but it's hard.
@markday3145
@markday3145 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Yes, it's very verbose. The Rust style is to encode as much as possible into the type, so the compiler can check it for you. But that means you need ownership of a lot of pieces of data, and that means a lot of source code (which may boil down to very little code at runtime). For example, you'd need a separate variable for each GPIO pin you want to use, and you have to pass those variables to any function that needs to access that pin. You can hide some of that complexity by putting that initialization and extraction of variables into your own library function. The downside there is that your function has to return a lot of pieces of data. It would certainly be possible to create a much simpler API (similar to Arduino, for example) that is in some sense less safe. For example, if you pass pin numbers as integers, you end up having to do runtime sanity checking of that number, and it's easier to accidentally type the wrong number or have two routines manipulating the same pin when they should be manipulating different pins.
@doctorbobstone
@doctorbobstone 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
In C or C++ (or any language, really) you generally have to do all this stuff to setup the hardware. Some environments like Arduino hide much more if it. This usually means you have less ability to customize, but you have less boilerplate in your code, too. All the setup code is still being called for you, though. The level of detail exposed is a trade off of simplicity vs. control. I think what we've seen here looks like a pretty reasonable level of detail, at least in my opinion.
@AstroMechanicalEngineer
@AstroMechanicalEngineer Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Nice! Thanks for this video, my guy. I didn't even know Rust worked on MCUs. :D
@akasakasvault7597
@akasakasvault7597 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Rust on everything : Devs : let's go Chemists : ...
@louiscloete3307
@louiscloete3307 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Tip: `cargo build` is aliased to `cargo b`; similarly, `cargo run` is aliased to `cargo r`. It gets handy when you have to type it a lot.
@soumen_pradhan
@soumen_pradhan 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Is there a similar thing for --release ?
@louiscloete3307
@louiscloete3307 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@soumen_pradhan cargo b --release and cargo r --release
@Fleebee.
@Fleebee. 2 місяці Ρ‚ΠΎΠΌΡƒ
If you're using a pico W this wont blink the onboard led. pick a different pin and connect it to a circuit to check its working
@MichaelFlynnhasneatv
@MichaelFlynnhasneatv Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
I literally have an entire module dedicated to programming and debugging this board using C and Assembly. Seeing how it's done at a higher level of abstraction with rust is really interesting. Maybe the video already exists but how does rust handle hardware interrupts?
@scheimong
@scheimong 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Love it. I've coded in Rust for nearly two years now, but embedded Rust has always been somewhat intimidating. This video series has been an excellent quick start guide for people like me who are pretty experienced in general programming but have little experience working with embedded code.
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great to hear!
@AlbinoCordeiroJunior
@AlbinoCordeiroJunior 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks!
@IamSentient314
@IamSentient314 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hi. I love these videos you make on the Pi Pico. If you can, could you cover DMA on the Pi Pico? Mem to mem, DMA SPI & DMA I2C etc.
@TobyMole
@TobyMole Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Ex-C embedded engineer here. Semi-following these embedded rust videos, interested to see just how Rust compares to C in embedded, great to see HAL coming in! When you say the HAL prevents using unsafe sections, does it mean that the HAL has unsafe parts that it does for you, or does it have some way of performing the needed operations without being unsafe at all?
@zachbrown7272
@zachbrown7272 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
The HAL itself has unsafe parts that it does for you. From what I can tell reading the HAL source though, they are beyond what a c dev would consider "good enough" about how they manage their memory though.
@markalanboyd
@markalanboyd 5 місяців Ρ‚ΠΎΠΌΡƒ
Great video! Would love to see some hardware audio DSP like a little guitar FX pedal or something.
@JeremyChone
@JeremyChone Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Thanks, great video. On a related topic, somehow, I cannot figure out how to read from PWM? The rp-hal/rp-pico have write example, but not read (I might be missing something).
@alirezaalavi1504
@alirezaalavi1504 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
dude I have the same wallpaper as you and for couple of seconds I was so confused :))
@echoptic775
@echoptic775 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
What are ur plans with rust? I just saw u had a series of making an os, will u do sth similar with rust?
@tk5782
@tk5782 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Fantastic, thank you! For anybody else who might be getting soem build issues on windows, I had to use the following 2 commands to get the environment set up. Now I have blinky on my RP Pico but it doesn't work on an RP2040 Connect. Is that a different HAL? rustup target add thumbv6m-none-eabi cargo install elf2uf2-rs
@therealjpster
@therealjpster 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Same HAL but it has a different flash chip so you need to change the boot2 line. The bit that says W25Q80 is actually telling you the part number of the flash chip that particular boot2 supports. Or use the Nano Connect 2040 BSP which sets this up for you.
@michaelscholten3639
@michaelscholten3639 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
I had build issues on Linux (Ubuntu) and after using those commands, my code worked. Thanks for your help.
@Niohimself
@Niohimself 2 місяці Ρ‚ΠΎΠΌΡƒ
11:19 that's not what push-pull means. Push-pull means the pin can push the voltage high (sending current into the wire) or pull the voltage low (sinking current FROM the wire). This is opposed to "Open collector" that can pull but can't push. The reason you would ever want OC mode for a pin is when you want to connect several outputs to a single input, as in this case one pin outputting 1 and the other outputting 0 will just result in an overal value of zero instead of frying both pins.
@Slushee
@Slushee 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
This is amazing! I would really really appreciate if you did the same but for the ESP32
@asksejsbo331
@asksejsbo331 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
A question: a lot of no_std libraries are able to run with vectors using "extern crate alloc", would this be the same for the pico's?
@michawhite7613
@michawhite7613 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You don't need the ok() call on line 67. Results also have an unwrap() method
@HeadakusMaximus
@HeadakusMaximus 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You might wish to use purge rather than remove when uninstalling.
@markbratcher9095
@markbratcher9095 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Where did /mnt2/rp-hal come from? You didn't mention creating it or mounting it for a particular purpose. It looks like you created it as a dedicated location for the rp stuff.
@99codemister
@99codemister Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Serious question: Is there significant advantage to using embassy over using the HAL directly?
@jellyfin449
@jellyfin449 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You do a good job of breaking the code down linexline
@pup4301
@pup4301 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you are. Your talking my language. ;)
@falxie_
@falxie_ 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
This is making me want to buy a Pico, but I have no real projects to work on for it
@edgeeffect
@edgeeffect 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
This seems hellishly over-complicated when compared to C or Assembly Language.... All of that boiler-plate initialising things I would never intend to use. I was initially optimistic about Rust because I can't stand C and I've been looking for a modern replacement for years. But 50-ish lines of boiler plate is making Ada look like a simpler alternative. Do we really really need a bootloader in our binary? To load a program that's already in the flash? :(
@9names783
@9names783 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You really *do* need a 2nd stage bootloader for RP2040 if you want to access flash or want a program larger than 256 bytes - regardless of the language you use. This is one of the trade-offs of using external SPI flash for program storage on a microcontroller, and is not unique to RP2040 - other flashless micros have similar requirements. We just don't hide them from you in an SDK that only works for one board.
@lambsauce5445
@lambsauce5445 9 місяців Ρ‚ΠΎΠΌΡƒ
Maybe you could do an entire series. As a beginner, I'm not entirely sure where I'd go next from here...
@NishchalGautam
@NishchalGautam 2 місяці Ρ‚ΠΎΠΌΡƒ
Hello there, I was wondering if you could do a basic starter for NodeMCU (ESP8266) with rust
@taylorh140
@taylorh140 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
22.50 KB, seems like a lot for a blinky example.
@jonathan2847
@jonathan2847 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Where you hve `.ok().unwrap()` on lines 67 and 68, I beleive you could remove the `.ok()` and it should result in the exact same behaviour of panicking if something goes wrong (I don't know if something special applies here but that is how it behaves in typical Rust usage)
@tabletopjam4894
@tabletopjam4894 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
now if only i could find a free resource for learning rust
@mikafoxx2717
@mikafoxx2717 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Try typing "cargo docs --book" into your terminal. That's the official rust book and it's quite well written.
@sinushkin
@sinushkin Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Does it handle with Wifi stack, 2 core usage without linux?
@blokhype3074
@blokhype3074 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
i think this is for mac or raspberry pi 4 what do i need for windows to get started
@wertia391
@wertia391 3 місяці Ρ‚ΠΎΠΌΡƒ
Please, do these kind of videos but with embedded C!
@taraskornuta
@taraskornuta 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
And what is the binary size the rust produces compared to do the same application compiled by gcc?
@Dygear
@Dygear 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
There is both a gcc and llvm implementation now. They are almost always around the same +/- a few precent.
@rafaelbachmann7246
@rafaelbachmann7246 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Realistically, a rust binary compiled with default settings will be rather large. But by setting a few options in Cargo.toml you can get it much smaller. Also by avoiding formatting code and using something like defmt you can get it even much lower.
@fammioli
@fammioli 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Watched three minutes of this under the impression that we were talking about rust the video game
@dibyojyotibhattacherjee897
@dibyojyotibhattacherjee897 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Very much awaited series!, although looks a bit verbose, is there any nicer or shorter way!
@JaJakubYT
@JaJakubYT 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Check out videos on my channel. I have 6 videos on Rust embedded and more to come.
@alexloktionoff6833
@alexloktionoff6833 3 місяці Ρ‚ΠΎΠΌΡƒ
Do you have a video about RTIC, how to use both cores of RP2040?
@gideonz74b
@gideonz74b Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
It's a nice video... but how about setting up the environment if you are using a board that you made yourself, running a custom SoC, based on RiscV for example? You are using runners and all, but how do you specify how to connect to the hardware, for which target cargo should emit code, etc? This video only shows how to use someone else's configuration.
@ILsupereroe67
@ILsupereroe67 24 Π΄Π½Ρ– Ρ‚ΠΎΠΌΡƒ
At 12:05 you say if you had activated the watchdog you'd need to feed it within the loop, but isn't the delay implicitly doing that already?
@doctorgreatengineer6834
@doctorgreatengineer6834 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I want to know how HDL like Verilog works inside FPGA. Am i gonna get any video future here?
@LowLevelLearning
@LowLevelLearning 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I plan on doing FPGA content in the future but I still have a lot of work to do, purchases to make. Stay tuned!
@doctorgreatengineer6834
@doctorgreatengineer6834 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@LowLevelLearning thanks a lot
@INeedAttentionEXE
@INeedAttentionEXE Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
I needed to install "elf2uf2-rs" with "cargo install elf2uf2-rs" to get it to work. Idk why it's not already a dependency?
@dabunnisher29
@dabunnisher29 ΠœΡ–ΡΡΡ†ΡŒ Ρ‚ΠΎΠΌΡƒ
I keep getting this when I try to build it: cargo build --release --example blinky error: target `blinky` in package `rp2040-hal` requires the features: `critical-section-impl` Consider enabling them by passing, e.g., `--features="critical-section-impl"` Im assuming I need to adjust my toml file?
@bartoszk.6451
@bartoszk.6451 3 Π΄Π½Ρ– Ρ‚ΠΎΠΌΡƒ
Hi, I got the same problem, just tell the build system to include additional dependencies to support critical sections: cargo build --release --example blinky --features="critical-section-impl" you'll probaly need to install additional components i.e.: rustup target add thumbv6m-none-eabi and cargo install elf2uf2-rs
@dabunnisher29
@dabunnisher29 3 Π΄Π½Ρ– Ρ‚ΠΎΠΌΡƒ
@@bartoszk.6451 YOU ARE AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! That worked. Thank you sooooooo much!!!!!!!!!!!!!!
@Stowy
@Stowy 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
that nice ! but seems like a lot of boiler plate code, would it be possible to not have all of that written all the time ?
@chaddaifouche536
@chaddaifouche536 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Basically, you need all this code to initialize your board properly (the joy of embedded code). On the other hand since most of this doesn't change and the "real" code specific to your purpose here is only a few line, there are templates that already have all the boilerplate and you can just reuse when needed.
@atomatopia1
@atomatopia1 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
And here I was expecting the steam game…
@nathanruben3372
@nathanruben3372 2 місяці Ρ‚ΠΎΠΌΡƒ
I use asdf to manage rust, node, ruby, python and many other langage versions and environments....
@MegaOnerb
@MegaOnerb Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
How to write rust to run on sega genesis console? Is this possible?
@jjmalm
@jjmalm Π”Π΅Π½ΡŒ Ρ‚ΠΎΠΌΡƒ
I'm old enough to remember when we kicked, not fed, watchdogs
@vsevhpme
@vsevhpme Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
How to return to factory settings?
@connorcantrell1883
@connorcantrell1883 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
What is a boot block?
@konstantinnikitin6883
@konstantinnikitin6883 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
I didn't understand anything, but I like it :-)
@Maric18
@Maric18 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
well if rust runs on everything, can someone please help me compile songbird-py on aarch64?
@alerey4363
@alerey4363 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
what are the advantages of rust? is there really a need for this language?
@martijn3151
@martijn3151 2 місяці Ρ‚ΠΎΠΌΡƒ
Doesn’t every byte code compiled language run on everything?
@connorcantrell1883
@connorcantrell1883 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
What is a linker?
@triularity
@triularity 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
But don't you just hate it when you call hal::podbay::Doors::open() and get the error ""I'm sorry Dave, I'm afraid I can't do that"?
@truuumingtruuum6586
@truuumingtruuum6586 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
good luck trying to run exe compiled by latest rust toolchain on windows xp
@Ma1ne2
@Ma1ne2 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I was programming in C++ a lot lately and saw this coming up a lot, but never really understanding why - maybe someone can help me with this: In Minute 7:52 in line 39, we both annotated the type at the variable and at the literal with a postfix. I don't understand why this postfix would be necessary, if we tell the compiler the type by annotating the variable and vice versa. I saw this a lot in C++ too with ul etc. Maybe someone can tell me, why this is a good practice? EDIT: I love this series and I want more!
@markday3145
@markday3145 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You certainly don't need both type annotations. In fact, you probably don't need either of them, since that constant gets passed to a function, and Rust should be able to infer the correct type based on the types of the function's arguments. As for what's good practice, I don't have enough Rust experience to help with that. Coming from a C background, there's a part of me that likes seeing an explicit type where the variable is declared, because my poor human brain does a worse job of type inference than the compiler does. I really like the rust_analyzer plug in for VS Code. It will show the type information it has inferred, displayed inline with the source. Using that plug in, I'm much more comfortable leaving out type declarations and letting the compiler infer them.
@Ma1ne2
@Ma1ne2 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@markday3145 Yeah I'am fully with you on that, it's a great tool to help you remember or even learn what types are there to use in Rust! Unfortunately it can become very long and explicit with more complicated types and make your code less readable than it would need to. Anyway thanks for sharing your experience and stand point coming from a C background, appreciate it :)
@remrevo3944
@remrevo3944 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@markday3145 As far as I know constants in rust have to be always annotated, though the postfix annotation is definitely not needed.
@therealjpster
@therealjpster 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
The first type is required because it's a const. The suffix is redundant and can be removed.
rust runs on EVERYTHING (no operating system, just Rust)
18:10
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 330 тис.
i changed my mind about this language
9:34
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 90 тис.
NO NO NO YES! (40 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:27
PANDA BOI
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 91 ΠΌΠ»Π½
BRAWLER MUTATIONS WILL BREAK THE GAME! - Brawl Talk
09:34
Brawl Stars
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 25 ΠΌΠ»Π½
Rust and Tell Berlin - Simon Hausmann - Graphical UIs with Rust and Slint on a Pico Microcontroller
22:50
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 580 тис.
Rust Runs on EVERYTHING, Including the Arduino | Adventures in Embedded Rust Programming
12:50
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 117 тис.
why are switch statements so HECKIN fast?
11:03
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 349 тис.
everything is open source if you can reverse engineer (try it RIGHT NOW!)
13:56
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 1,2 ΠΌΠ»Π½
This Is How Rust Stops Memory Leaks
5:53
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 152 тис.
I spent six months rewriting everything in Rust
15:11
chris biscardi
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 371 тис.
Hardware Design with the RP2040: Custom PCB Based on the Raspberry Pi Pico | Digi-Key Electronics
53:41
why rust libraries may never exist.
7:26
Low Level Learning
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 207 тис.