Raspberry Pi C/C++ Baremetal Programming | Using C to Direct-Register Control Your Raspberry Pi

preview_player
Показать описание
The Raspberry Pi is a fan favorite of makers and embedded developers. In my previous tutorial on Raspberry Pi Baremetal programming, I demonstrated how to use ARM Assembly to perform direct-to-register programming on the RPI 3B+. In this video, I'll show you how to do direct to register programming, but instead of using assembly, well use C to turn an LED on and off via the Raspberry Pi's GPIO Interface.

Subscribe for more videos like this on the Raspberry Pi!

🏫 COURSES 🏫

SOCIALS:

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

Really appreciate the starting point! You might want to mention how to get the SDK or whatever assembler and linker you're using. I'm about to search for it, but a link would have made it easier!

DavesGarage
Автор

Dude that's great!! Could you please tell us more about how these linker files are and how these C compilers work? thanks in advance!

ChandlerKluser
Автор

It’s much easier on ARM to run bare metal is easier than on Intel. I was about to start a series of making a cooperative multitasking OS. But I got a new project, so no time for now.

I wasn’t aware about this header file, when I did my GPIO video I had to deep dive into the documentation.

CallousCoder
Автор

Any plans to work in graphics later on in the series? Btw great series!

packa
Автор

the most difficult for me was linker script and assembly regions explanation.

could u tell me where to find good help to understand how linker scripts work and how arm cpu reads data from linked and compiled file. (assembly start file+C files that contains below in file)

alexroman
Автор

I love low-level programming, thanks for your videos.

meoDomicio
Автор

Is it any timer usage possible instead of empty while loops? Will be also interesting to see. should be more energy efficient.. I suppose

maksimmuruev
Автор

I was searching for gold, but found platinum.
until the end of the video I thought, that u coding for rasbian os😅😅
this is cool staff

zapiton
Автор

Is there a video explaining the process of compiling it all (after installing a tool chain, maybe?) and loading it onto a microSD card? I don't get how to actually make use of this information and get the code running on a Pi.

TooSlowTube
Автор

This is awesome!! Can you make a hello world on hdmi example. Is it even possible using c++?

butterfinger
Автор

Thanks for the simple example. I just make and flashed kernel7.elf to a SD card. put it in RPI3. the LED connected to GPIO21 did not turn on and off.
compile has some warnnings. and check BCM2837 datasheet, the GPIO_BASE is 0x7E20, 0000. not 0x3F20, 0000. Is there anyone meet the same issue?

lxw
Автор

would really love to see this done on a more modern intel/amd x86 cpu.

bryanhutson
Автор

Q: Instead of a loop for delay, is there a high-resolution counter I can use to turn on a GPIO pin, wait, and then turn it off again after 5µS?

hallkbrdz
Автор

Amazing stuff! 👍But when you wrote the 'sleep'-logic I thought, that won't work (8:36), at least not as a 'sleeper'. It looks like a perfect example for a compiler like gcc(with -O2) to optimize the loop out and replace it just with setting i to the value of Thought you should have used 'volatile' keyword for i-variable or -O0. But no, ...too many thoughts 😆, worked as intended... 👍
Really need to try this at home 🤩

dertom
Автор

that's something new, thank you!

ORIofficialchannel
Автор

Why in the linker, start location is . = 0x8000

datbuiquang
Автор

Can I write the write() & read() function in Pi OS?
By that I mean can I access the register using the address mentioned in the datasheet (just like what you do)?
ex. If I want to change the value of BCM2837_GPFSEL2 by point to the address "0x3F200008

benlee
Автор

Where can we go to learn more about linker files?

jeffcauhape
Автор

I'm trying to write assembly in a modular (hopefully) scalable way.... I'd love to see if other people could maintain it.

edgeeffect
Автор

Hi,
I'm assuming this uses the same C/C++ SDK as the RPi Pico right ??

robotboy