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

  Рет қаралды 344,594

Low Level Learning

Low Level Learning

Күн бұрын

The world of embedded programming is AMAZING. The Raspberry Pi is one of the best platforms to break into embedded development. In this video, we'll program our Raspberry Pi WITHOUT the Linux Kernel. We'll use the Rust build chain to create a custom kernel image that we can use to blink our LED on and off.
You can take this tutorial, create the code for yourself and use it to develop something more advanced! You can use the UART bus, the SPI bus, or maybe even start to write your own operating system.
Video Links:
Linker Script: github.com/lowlevellearning/r...
BCM2837 Datasheet: cs140e.sergio.bz/docs/BCM2837...
🏫 COURSES 🏫
Learn to code in C at lowlevel.academy
🔥 SOCIALS 🔥
Low Level Merch!: www.linktr.ee/lowlevellearning
Follow me on Twitter: / lowleveltweets
Follow me on Twitch: / lowlevellearning
Join me on Discord!: / discord
0:00 Intro
0:36 Board Setup
0:41 Lets Code!
1:30 ARMv7 Target
2:13 no_std
3:37 Don't Panic!
4:30 start location
5:25 linker script
8:15 elf2bin
9:30 TO THE DATASHEET!
13:25 GPIO Code
16:50 Firmware Files
17:57 Outro

Пікірлер: 375
@LowLevelLearning
@LowLevelLearning Жыл бұрын
wanna get good at programming? check out lowlevel.academy and use code THREADS20 for 20% off lifetime access. or dont. im not a cop
@SportSync_official
@SportSync_official Жыл бұрын
Please do another tutorial on this stuff. It's really interesting.
@kkgt6591
@kkgt6591 Жыл бұрын
Can you please Zoom in on the code. It's not readable on mobile screen.
@orangehatmusic225
@orangehatmusic225 Жыл бұрын
100% disagree with your opening statement. The Rasberry pi is now impossible to buy. What should cost $50 is now selling for $190. All of you illegal rom downloading boi's who wanted emulation jacked up the prices. Way to go pirate. Way to ruin it for everyone else.
@kennethbeal
@kennethbeal Жыл бұрын
@@orangehatmusic225 Lockdowns had *nothing* to do with it? Seems a little short-sighted there; chips of all types were affected, including the car my dad wanted to buy. Pirates STEAL ITEMS. Like Assange recently said, he didn't steal anything; he made a copy. Verbs matter. Ever hear "Possession is nine tenths of the law"? When people copy software, the original possessor does not lose their possession. It's more like lighting a candle from another candle. Separately, the esp32 is like $5, a 240x240 color screen is another $5, and PictoBlox is like MIT's Scratch, for the smaller devices. Or the Orange Pi, for $117. So: I 100% disagree with your 100% disagreement. :)
@UltimatePerfection
@UltimatePerfection 2 ай бұрын
Rust really runs on everything, even on my local iron river bridge!
@rorybninetythree
@rorybninetythree Жыл бұрын
I knew literally nothing about embedded systems and barely anything about Rust 18 minutes ago, and now it feels like it's a very acheivable thing to learn thanks to this demonstration. You're clearly a gifted teacher, fantastic video.
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Welcome aboard!
@chillbro2275
@chillbro2275 6 ай бұрын
@@LowLevelLearning no pun intended :D haha
@niaei
@niaei 3 ай бұрын
Now you can update your resume. :)
@ben_sch
@ben_sch 3 ай бұрын
Same here. I have a background in web dev, but allost everything was new to me here. Yet, I‘ve understood pretty much everything and learned a ton. But honestly speaking, I will probably never learn this type of low-level programming. Just seems way too much effort to get something done when there are easier albeit less efficient tools/languages to use. Nice to be able to peek into this world though
@atdit
@atdit Жыл бұрын
The great thing about your videos is the pace and "constant" narration. It feels like there isn't a single second in the video where you're not explaining what you're currently doing. That makes it very easy to not lose focus and attention as a viewer
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Wow, thanks!
@matzeb.ausv.1380
@matzeb.ausv.1380 Жыл бұрын
very true
@kylarosborne698
@kylarosborne698 Жыл бұрын
@@LowLevelLearning I agree. You really talk about every detail which is so important. The viewer has no questions, and you make no assumptions about what the viewer knows. I hope to watch more like this in the future :D
@jnth2
@jnth2 Жыл бұрын
Really like that you use documentation as a reference to explain. Lots of tutorials skip the fact that documentation is there to help.
@kennethbeal
@kennethbeal Жыл бұрын
It's awesome that he does that, agreed! Just a few videos of this nature and we're downloading helicopter flight manuals between words of dialogue! :) (Matrix reference; as we age, our references get stale, like moldy bread one can use to cure disease or have interesting visions with.)
@saeidakbari6303
@saeidakbari6303 Жыл бұрын
The amount of effort on this video to make it only 18 min is insane if you are a bit familiar with embedded system, thanks for it LLL
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Much appreciated!
@reo101
@reo101 Жыл бұрын
You can make a `build.rs` file like this ```rust fn main() { println!("cargo:rerun-if-changed=./linker.ld"); } ``` to hint to cargo that a change in that file should also result in a rebuild
@byronhambly
@byronhambly Жыл бұрын
Great suggestion, I think you also need to set that build script in the Cargo.toml mainfest of your crate
@TheBendixSA
@TheBendixSA Жыл бұрын
So glad I found this channel, I have been writing code for a long time and wanted to jump into some low level stuff to improve my wider understanding esp. embedded systems etc. You cover fundamentals so well and easily digestible. Thanks for this!
@megumin4625
@megumin4625 Жыл бұрын
13:39 I would hope nobody would be mad. Unsafe code is basically the only way this can be done. It's just a fact. There's a reason rust has the unsafe keyword, because it's sometimes needed. :) Also, thanks for the video. It's very enlightening!
@devrim-oguz
@devrim-oguz 3 ай бұрын
It is just same as writing C inside rust with more wording of course.
@TheSast
@TheSast 3 ай бұрын
​@@devrim-oguz unsafe rust is not C
@Gramini
@Gramini 3 ай бұрын
Could probably be abstracted into a safe interface (or however it's called). Like a struct (with the PIN number) with methods or even plain functions (one for turning a hard-coded PIN on and the other for turning it off). But in the end the unsafe has be be somewhere.
@tsclly2377
@tsclly2377 3 ай бұрын
Safe code is slower code, as there has to be a lot of hash inserts and checks and when you are processing movement, electrical spikes and wave forms, a lot of interrupts that are happening in the higher kilohertz range, such as signal processing, your program isn't gong to be looking at the web directly and should reject anything unexpected.
@TheSast
@TheSast 3 ай бұрын
@@tsclly2377 safe code is not slower than unsafe code
@nicholasfrillman42
@nicholasfrillman42 Жыл бұрын
I am absolutely watching your channel from now on.This is the most I have ever learned from a programming video. I've been trying to learn how to be a low level developer for years. Since high school. WOW. It's quick. It's on point. And I can follow it. I love how you just filled in several gaps learning in only a few minutes. I could have stayed in college, and I am not knocking anyone who does, but I have a short attention span. Thanks for this. Don't even remember how I stumbled here.
@dbznt
@dbznt Жыл бұрын
Thanks for Everything you do LLL, Seriously your videos have invigorated my spirit and inspired me to learn more about computer systems and lower level langs. C and Go are becoming my favorite languages to write my code. I'm gonna try writing some rust today!. Thanks again! Keep up the great work!
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Wow, thank you! I'm so happy to hear the videos inspire you :)
@BR-lx7py
@BR-lx7py Жыл бұрын
@@LowLevelLearning Haha, that's interesting because my takeaway was that low level programming is so different that I know less about it than I thought :). I could probably follow along, but I'm SOL the second something goes wrong.
@ChefKissInc
@ChefKissInc Жыл бұрын
The panic handler function is for Rust panics. Not hardware faults. And #[panic_handler] is not called an option, it's called an attribute.
@marcuskissinger3842
@marcuskissinger3842 2 ай бұрын
Calm down buddy
@ChefKissInc
@ChefKissInc 2 ай бұрын
@@marcuskissinger3842 Not sure where the impression I wasn't calm when writing that came from, I just have a neutral tone.
@marcuskissinger3842
@marcuskissinger3842 2 ай бұрын
@@ChefKissInc yeah but just relax
@casperes0912
@casperes0912 3 ай бұрын
I started working on an operating system in rust. I never went that far with it but it works. Can boot both legacy bios mode and modern efi style. Though only in qemu on efi. Don’t have video output properly working on any real efi hardware I have. But with bios boot it works with a text mode console. Boots into long mode and all but no memory protection
@otm3107
@otm3107 Жыл бұрын
With all the soft soft tutorials that exist on YT, yours just created that "light bulb illumination" mont in my head. Thanks for taking the
@34tttttaa
@34tttttaa Жыл бұрын
Such high quality content, thank you! Hoping in the future you can find the time to create a whole course on embedded Rust, I'd sign up in a heartbeat.
@josefaguilar2955
@josefaguilar2955 Жыл бұрын
Absolutely killing it with how you're presenting. I'm not really a fan of Rust but I couldn't stop watching.
@Nitiiii11
@Nitiiii11 8 ай бұрын
Thanks man, it took some adjustments to make it run in u-boot on a cortex-a9, but I figured it out eventually. Very helpful tutorial.
@tadmikowsky7520
@tadmikowsky7520 Жыл бұрын
Excellent vid man. Been a while since I've done any embedded programming. Very cool seeing how to do this low-level stuff on a pi 😎👍
@odanabunaga2505
@odanabunaga2505 Ай бұрын
as a recovering TS dev I'm watching this in complete awe! Thanks for explaining what you're doing, it leaves me with hope ;)
@Dygear
@Dygear Жыл бұрын
Thanks!
@LowLevelLearning
@LowLevelLearning Жыл бұрын
MARK! My guy. Thank you so much for this generous Super Thanks. I hope this video helped you in your embedded development journey.
@rVnikov
@rVnikov Жыл бұрын
Superb quality by all means. Instant subscribe without a moment of hesitation.
@SandhanSarma
@SandhanSarma Жыл бұрын
Fantastic video, very very informative. Hope to see more content on RUST for embedded systems from Low Level Learning
@LowLevelLearning
@LowLevelLearning Жыл бұрын
More to come!
@appelnonsurtaxe
@appelnonsurtaxe Ай бұрын
I really like how you explain not only how to do things, but how to look for things yourself (e.g. the broadcom datasheet or the rpi firmware). I already have a bit of experience in embedded programming but I'm sure this helps beginners a lot. And more importantly, it makes the whole field feel less magic and scary than just saying "this address controls this LED because I know it".
@TimothyChapman
@TimothyChapman Жыл бұрын
You should configure the internal timers to trigger an interrupt every millisecond to increment a counter. Then reference that counter to to get more precise timing on when the LEDs turn on and off.
@JimTheScientist
@JimTheScientist 19 күн бұрын
osdev mindset
@mrrolandlawrence
@mrrolandlawrence Жыл бұрын
Wow seeing arm assembler at the end there really took me back to my assembler days of programming the first acorn risc machines…
@wulfy23
@wulfy23 Жыл бұрын
thankyou. someone who shows the meat of a topic, no fluff and just the right amount of fat. great contribution. cheers.
@ElZero010
@ElZero010 Жыл бұрын
this is incredible, thanks for sharing this knowledge
@inteluhdgaming1524
@inteluhdgaming1524 Жыл бұрын
Very nice and well explained. Every tNice tutorialng is crystal clear and easily understandable.
@justinlee8328
@justinlee8328 Жыл бұрын
the absolute best programming video I've seen in years
@himanipku22
@himanipku22 Жыл бұрын
Fantastic video! Really wish they covered this in my software engineering degree. No time to learn like the present!
@rhamses
@rhamses Ай бұрын
I just found the channel and I loved the video. One thing that it makes me thing was: if is it possible to build a kernel with Rust, then running appa on top of it would be possible too. The possibilities to embed are endless
@matheusbona_
@matheusbona_ Ай бұрын
Amazing content! Congrats dude!
@joetkeshub
@joetkeshub 11 сағат бұрын
Great tuto! Thank you! You just earned a new satisfied subscriber ;)
@samjohn1063
@samjohn1063 Жыл бұрын
Good video thank you , updated visual studio and everything worked. I'm really glad I found a working crack
@klebleonard
@klebleonard Жыл бұрын
This is reallz interesting. What are your plans on next courses for your platform? Will the current mini course get updates and more content?
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Current mini course will probably stay in its current state while I work on the full AVR course. Thanks for watching!
@sc0or
@sc0or 3 ай бұрын
Nice. Finally no more annoying unavoidable Linux boot log messages in a console. Just a pure code and an awesome blinking ;)
@baileytownsend1341
@baileytownsend1341 Жыл бұрын
Me as a web developer trying to learn more low level programming during most of this, "Funny words magic man." But really great video, and has helped me a ton.
@user-kf3rm3gd5j
@user-kf3rm3gd5j 3 ай бұрын
This was really interesting. It would be great to see 2 things: 1) A list of references of sources you read to understand each part of this problem including the tools to generate the image that was capable of being loaded into the PI. i.e. a learning path. 2) An approach where you halted the processor putting it into a low power mode until the hardware timer triggered an interrupt allowing you to advance the state of the LED. The spinning for a delay makes this a bad start outside of proving that something could be done.
@ibressa
@ibressa Жыл бұрын
Love your stuff! Big help!
@DCODev
@DCODev Жыл бұрын
Excellent tutorial and information. Thank you for sharing. Just gained a new subscriber! Thanks again!
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Thanks for the sub!
@DCODev
@DCODev Жыл бұрын
@@LowLevelLearning my pleasure!
@marcovitale8808
@marcovitale8808 Жыл бұрын
Amazing content, thank you!
@LowLevelLearning
@LowLevelLearning Жыл бұрын
My pleasure!
@mariogeier6172
@mariogeier6172 Жыл бұрын
Thank you for the well made video! Which command can I use on windows to extract the binary from the elf file? I use the Visual Studio C++ Build Tools.
@herbertwestiron
@herbertwestiron Жыл бұрын
Great video but can you please increase the font size of visual studio code? It's hard to read code. Thanks.
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Yeah I'm sorry I realized this after I uploaded. I edit on a 4K monitor, didn't realize it was so small on YT.
@ahmetkocabyk1555
@ahmetkocabyk1555 Жыл бұрын
WOW!!!! This video is very helpful!!
@nathan12581
@nathan12581 Жыл бұрын
Would love more videos on baremetal kernel programming in rust. Maybe stepping slightly into OS programming ?
@bitsnbytes7514
@bitsnbytes7514 Жыл бұрын
Hohoho... there are so many things I like about this video. If this is anything to go by, I'm gonna make time and binge watch tf out of this channel.
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Welcome!
@beratakcay2017
@beratakcay2017 Жыл бұрын
You are a living god among n, a legend worthy of praise. What you've uploaded here, will echo into eternity!
@youtubepooppismo5284
@youtubepooppismo5284 Жыл бұрын
Great video 10/10 clear and interesting
@Brando56894
@Brando56894 Жыл бұрын
I just started watching your videos yesterday and in every one you've had full facial hair, the beanie and glasses. Then this one autoplays and I'm like "wait...is this the same guy?" you look so different without all of those "modifiers" haha
@lucabrescia6817
@lucabrescia6817 Жыл бұрын
Amazing content dude!
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Glad you liked it
@GeinponemYT
@GeinponemYT 2 ай бұрын
Awesome video! I always assumed it would be extremely difficult to get Rust running on bare metal, but this makes it seem pretty easy (I bet it took you a while to figure all of this out though, so thanks for the great tutorial). One question though: how would one integrate some sort of a filesystem into this? Say I want to store files on the RasPi and access them from within Rust. Is this possible (maybe by partitioning the storage device beforehand...)?
@joemarc0
@joemarc0 3 ай бұрын
this was soooo useful, thanks
@phenanrithe
@phenanrithe Жыл бұрын
Very interesting, thanks! The Pi is already very beefy to learn embedded programming, at least it makes it very comfortable. Anyway, I'm wondering if they'll even be able to produce the 3 model again, I'm not optimistic. It would be a shame, so much fun things to do with it.
@willi1978
@willi1978 Жыл бұрын
this is very cool. embedded programming is very interesting but so far i didn't dare to try it yet
@jorgezuniga3956
@jorgezuniga3956 Жыл бұрын
I wish RPi 4s were $35 once again...
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Same :(
@nicholasbicholas
@nicholasbicholas Жыл бұрын
Thanks for such a great introduction! My one question is just about the naming? Is _start convention or arbitrary? Should the entrypoint always be prefixed by an underscore? Is the name main forbidden?
@LowLevelLearning
@LowLevelLearning Жыл бұрын
_start is the Linux convention for the entry point to a binary. Not a requirement to call it that, although some compilers expect it
@steffanjansenvanvuuren3257
@steffanjansenvanvuuren3257 Жыл бұрын
Great Video, I wrote a Synth app in C#, I started coding it on a Microcontroller, but had to move it to my PC for speed etc.etc. Now I want to implement it on a Raspberry Pi. What would you recommend?
@hichaeretaqua
@hichaeretaqua Жыл бұрын
Can you increase the font size in vscode? Its pretty hard to read. The font size in the terminal is very good
@KresnaPermana
@KresnaPermana Жыл бұрын
love the video,this is what i want to try with rust! can we get more bare metal like this on another device? arduino maybe? thank you
@ProtoByte
@ProtoByte Жыл бұрын
I would love to see you setup and use Rust within an STMCube or MPLABX IDE development environment. Also curious if those IDE's could support ICD with Rust. I could use Rust professionally if I knew how to do that.
@thebiomicroguy
@thebiomicroguy Жыл бұрын
I have grasped many info from explanation. Some of them were completely new to me. I'll appreciate if you were able to zoom just to the area where lines of code are written, specially the IDE. Thanks,,
@solorideventures3084
@solorideventures3084 Жыл бұрын
I was surprised how understandable tNice tutorials tutorial is, thanks!
@job4753
@job4753 Жыл бұрын
Heyyy would cross compiling through cross-rs also work? In my experience at least for cross compiling from windows to linux distros it is way easier to use cross
@hupa1a
@hupa1a Жыл бұрын
Great one!
@grimonce
@grimonce Жыл бұрын
That's what we did on the university, but I was never good enough to actually get a job in embedded, so I just write Python stuff... Good luck to anyone pursuing this as a career choice. This is however a great hobby and great for home automation, maybe starting your startup...
@becelli
@becelli Жыл бұрын
Hey! Awesome video. As a viewer, I'd like to suggest increasing the font size (zooming the UI) to be clearer to read in small screens. Furthermore, as a concept in video making, it's better to avoid non-flat color elements like your transparent/medium opacity terminal. The video encoder has to sacrifice quality in texts (code) to embrace all details on screen (the diverse details in your wallpaper)
@LowLevelLearning
@LowLevelLearning Жыл бұрын
I realized after I rendered and uploaded that the font quality wasn't great :(. I'm transitioning my videos to 4K in the future to avoid this. Thanks for watching!
@AbelShields
@AbelShields Жыл бұрын
Actually, if its static then it doesn't detract any quality at all - Tom Scott did a great video about video quality, bit rate, and moving vs stationary details.
@Aurora12488
@Aurora12488 Жыл бұрын
​@@AbelShields Agreed, translucency is perfectly fine when static, which in this case 99.999% of the time it is; potentially even more 9s when considering the video is 60fps and the proportion of the screen that updates is quite small. The encoder/decoder will *absolutely not choke* on this sort of content. To the video encoder, there is no difference here between a terminal with a translucent background, and a terminal with an opaque, washed out background image. Translucency only matters due to the complexity of attempting to compress something that is changing in extremely unpredictable ways, which translucent objects overlapping and moving on top of a moving background tend to cause. I really like the flair the translucent terminal gives; please don't change it​ @Low Level Learning ! Though of course, please go to 4K to make the text nice and crisp :)
@becelli
@becelli Жыл бұрын
You were right guys. I forgot about it. Thanks for the correction!
@keithprice1950
@keithprice1950 Жыл бұрын
It seems like Rust is really gaining momentum at the moment. I've switched from learning web dev with JavaScript to focusing now solely on Rust, not for any particular field, I just want to really get to grips with Rust. I'm taking a gamble but it feels like a really good investment.
@PejmanRezaei-qv9lt
@PejmanRezaei-qv9lt 2 ай бұрын
nice content. thanks
@fieldlab4
@fieldlab4 Жыл бұрын
Impressive! BTW, Ada RTOS has always been able to do this if you can get it all supported.
@minirop
@minirop Жыл бұрын
I don't do rust, but still super useful information. I just got a pico W to do bare metal programming (and learning "properly" ARM assembly at the same time). next step is using a hardware timer instead of a loop?
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Hardware timer/interrupt would be a good alternative way to do this. Good luck with your Pico W! I'm still waiting on mine :(
@Vishal-zr3rg
@Vishal-zr3rg Жыл бұрын
Hey! I'm trying to call Rust Functions from C environment using the static library generation in Rust for the Cortex-M0+ target which is thumbv6m-none-eabi in Rust...The Linker in the C environment always throws some missing sections error like "section .ARM.exidx.text._start isn't included by the sections map". When i add this section..it throws more and more sections continuously. Appreciate any help
@pimesonhadron
@pimesonhadron 3 ай бұрын
Thank you so much for this video - that’s really cool! I have done something similar in C++ but to see this in Rust is awesome! A follow up question if that’s okay please: let’s say you wanted to write a Rust application to run on Linux on a RPi 3B, what would you prefer: using the /dev/gpio* interface, or actually tweaking memory mapped addresses? What does the Rust code look like there: obviously you don’t need to bother with no_main right? Would love to see an example - if you or anyone has done it please.
@peterarnt
@peterarnt Жыл бұрын
If I'm not mistaken, your project uses only a single core on the Rpi 3. The BCM2837 processor has 4 cores. Is there a RUST HAL crate that facilitates usage of the all cores in parallel?
@nicosummer9020
@nicosummer9020 Жыл бұрын
Awesome video ! Thank you for spending the time to produce them for us ✨ slightly off topic question, say I want to compile for a Linux server, how may I configure the cargo target ?
@longdao953
@longdao953 Жыл бұрын
Thank you!
@jarvenpaajani8105
@jarvenpaajani8105 Жыл бұрын
Wait a minute, how did you figure out how many nop's you needed? Really good work, totally earned my subscription!
@Gramini
@Gramini 3 ай бұрын
It's just an arbitrary amount. NOP = no operation, which is used to make the program sleep. If it's blinking too fast, make it more. If it's too slow, reduce the number.
@brandongunnarson7483
@brandongunnarson7483 Жыл бұрын
I have no idea what I just watched but I enjoyed it
@zach9940
@zach9940 Жыл бұрын
Using `global_asm` to change the link section of a function is not supported (since top-level items may be reordered arbitrarily, so it might not apply to what you want it to. The intended way to change the section a function is in is with the link_section attribute, e.g. #[link_section = ".text._start"] pub extern "C" fn _start() { loop {} }
@TobyMole
@TobyMole Жыл бұрын
Interesting info! Though I'm not sure how this qualifies as a custom kennel?
@ironman5034
@ironman5034 Жыл бұрын
Wow, am impressed
@devrim-oguz
@devrim-oguz 3 ай бұрын
The CPU must be running very slow for us to see that LED blink that slowly. 50000 nop operations is nothing for a modern CPU, and we shouldn’t be able to see the LED normally if it ran at the full speed.
@SqueakyNeb
@SqueakyNeb 10 күн бұрын
Yeah that should be flashing at like 10KHz or thereabouts. ???
@chetana9802
@chetana9802 Жыл бұрын
this was so cool
@procyonq
@procyonq Жыл бұрын
Thanks for the fantastic tutorial! Could you show a good example of controlling GPIO without "unsafe"?
@jovianarsenic6893
@jovianarsenic6893 Жыл бұрын
I don’t think you can, since you’re writing to uninitialised memory addresses, a massive safe rust nono
@edgeeffect
@edgeeffect Жыл бұрын
@@jovianarsenic6893 I'm pretty sure they do it in a safe way in some of the STM32 crates.... but I could be mistaken.
@Grstearns
@Grstearns Жыл бұрын
While not totally unsafe, but definitely more safe, you should wrap only the unsafe parts of the code. Have small subroutines that are entirely unsafe and call them from safe code. Pin-enable, pin-on, and pin-off (maybe the no-op if that requires unsafe as well) should all be their own functions that get called by the main loop which would realistically also be calling some kind of computational code that you definitely want to be checked
@rory_o
@rory_o Жыл бұрын
I was wondering this myself. There must be a way without using unsafe blocks. I know they’re trying to use rust in the Linux kernel, and kernel device work is almost all about writing bits to raw pointers. Surely rust in the kernel isn’t just all unsafe blocks.
@DocWilco
@DocWilco Жыл бұрын
​@@Grstearns this is exactly how you're supposed to do unsafe code. Make it as small as possible so that it's easy to read and verify (by humans) that it does only the thing it's supposed to do.
@wickeddubz
@wickeddubz Жыл бұрын
Never in my life i haven’t seen so unexpected transition, “let’s blink LED with your own kernel”
@hydejel3647
@hydejel3647 Жыл бұрын
nice setup btw
@user-oz5hi1px7e
@user-oz5hi1px7e 4 ай бұрын
was just curious, can't we add output_format(binary) in the linkerscript instead of following 18:20
@caretchara
@caretchara Жыл бұрын
You should honestly start a udemy or something alike. You're a natural teacher!
@jwbowen
@jwbowen Жыл бұрын
I was wondering what I was going to do with my three day weekend :)
@LowLevelLearning
@LowLevelLearning Жыл бұрын
Not a bad way to spend your time!
@Andrew-rc3vh
@Andrew-rc3vh Жыл бұрын
I'll give it a gold star for devising the most complicated way so far to flash and LED with a microcontroller. One wonders how many lines of code does it take to add two and two. More than the number of electricians to fit a lightbulb I'd say.
@gplusplus314
@gplusplus314 Жыл бұрын
I didn’t know where to ask, so I figured I’d try in a KZfaq comment. Do you think you could do a video on various career paths that can be taken as a low level programmer? I have tons of experience doing high level things, but I’m considering a career shift.
@samgilliam7593
@samgilliam7593 2 ай бұрын
Can someone explain the syntax he used for assigning the values to the memory addresses? Im just getting into this stuff and I am confused as to why bit shifting is necessary and what its actually doing there
@Noliv3
@Noliv3 Жыл бұрын
screen in the top left, look at where it says program and click on where it says “aggressive te” and change it to “analog app 1 te”
@donmarvino
@donmarvino 2 ай бұрын
I was trying this on a raspi zero v1.3 (because that's one I have lying around) But it's not booting properly (7 green flashes) I figured it probably wouldn't work but I'd just try. Where would I even start to figure out the changes I should make?
@Scriabinfan593
@Scriabinfan593 8 ай бұрын
How do you learn this information starting at 2:14? This just feels like some sort of esoteric knowledge that one has to dig really deep to find. Not at all intuitive. But then again maybe I feel like this because of my limited knowledge of computer hardware.
@morgan0
@morgan0 Жыл бұрын
would be cool to see you do some embedded nim
@uuu12343
@uuu12343 Жыл бұрын
Unironically an actually good rust tutorial in general lmao
@NoorquackerInd
@NoorquackerInd Жыл бұрын
This is insane. I can't believe it didn't take _that_ much work to make this work in Rust
@chillbro2275
@chillbro2275 6 ай бұрын
The most work comes in figuring out what you need to do. Scouring documentation, and elsewhere for the key information is an absolute pain.
@randaldavis8976
@randaldavis8976 Жыл бұрын
cool, I think I will look at doing a Forth in Rust.
@miriamramstudio3982
@miriamramstudio3982 Жыл бұрын
Impressive!
@petomni
@petomni Жыл бұрын
If set 0 pulls it low, does clear pull it high? If so, then why is there also a set 1? Thanks for the great video!
@grimonce
@grimonce Жыл бұрын
Would be cool if you explained how you came up with the number 50000 (like a word about the built-in clock).
@gardendado1999
@gardendado1999 Жыл бұрын
It's an incremental counter, imagine a for loop that does nothing but counts i from 0 to 50000 then exits, basically every timer is built like that, to count time you need a frequency clock to time ratio if you want to count seconds precisely.
Fixing HORRIBLE Embedded Rust So You Don’t Have To
11:14
Low Level Learning
Рет қаралды 99 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 279 М.
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 19 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 39 МЛН
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 71 МЛН
everything is open source if you can reverse engineer (try it RIGHT NOW!)
13:56
Low Level Learning
Рет қаралды 1,2 МЛН
This is NVIDIA’s new GPU
12:58
Linus Tech Tips
Рет қаралды 309 М.
The C Programming Language is Over 50 Years Old, So Today I Learned Rust
8:14
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 85 М.
Meet the new SBC Linux Cluster King!
31:05
Jeff Geerling
Рет қаралды 248 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 963 М.
rust runs on EVERYTHING (no operating system, just Rust)
14:29
Low Level Learning
Рет қаралды 206 М.
Apple Wanted this DESTROYED...
54:04
dosdude1
Рет қаралды 479 М.
Why i think C++ is better than rust
32:48
ThePrimeTime
Рет қаралды 268 М.
МОЖНО ЛИ заряжать AirPods в чехле 🧐😱🧐 #airpods #applewatch #dyson
0:22
Apple_calls РЕПЛИКА №1 В РФ
Рет қаралды 22 М.
Выложил СВОЙ АЙФОН НА АВИТО #shorts
0:42
Дмитрий Левандовский
Рет қаралды 1,6 МЛН
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 832 М.
Обзор игрового компьютера Макса 2в1
23:34