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

preview_player
Показать описание
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 🏫

LINKS:

SOCIALS:

Рекомендации по теме
Комментарии
Автор

My Raspberry Pi Pico fell to a bucket of water during doing some plant watering project, I'm pretty sure it runs Rust now...

slidrek
Автор

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.

Dygear
Автор

Please keep up with the low level Rust videos. That's one reason why I chose Rust for learning!

alemartinezz
Автор

What an era to live in. When such content is available

keylanoslokj
Автор

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

santaclause
Автор

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!

test
Автор

"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(...).

kingderderder
Автор

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 :))

mydearaniryx
Автор

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

kenworks
Автор

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

SandwichMitGurke
Автор

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!

apocalypseio
Автор

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)

bspringer
Автор

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.

fotnite_
Автор

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.

harrytsang
Автор

Man, this is incredible, thanks YouTube that show you in recommendations, you explaining every fucking line code, just amazing, keep creating tutorial like this, thanks

actr
Автор

Oh this Rust series is going to be great...

MrAnandml
Автор

Thanks, don't forget the link to the embedded Rust doc page as you promised !

johnknight
Автор

Loved this, people like you make this world a better place !!!

herrxerex
Автор

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 :)

frostifish
Автор

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?

TobyMole