Run Linux on ESP32 - how to run the Linux kernel on an ESP32
Ғылым және технология
For some time, XTENSA versions of the ESP32 are able to run the Linux kernel. This video shows how to compile the kernel, and how to deploy and run it on an ESP32-S3.
Attention: this video has a small mistake. Run the shell script only AFTER all the required components were downloaded.
Пікірлер: 205
Finally, a system without the bloatware
@MrTamhan
10 ай бұрын
Indeed. Oh, the old time of running Linux on a 486...
@benjaminshtark5977
10 ай бұрын
and without apps, really any useful hardware and connectivity and no real world use case :D
@CodingButter
9 ай бұрын
@@benjaminshtark5977well yeah you say that now until there are applications and use cases that make this a huge advancement for iot projects
@EnzoVince
9 ай бұрын
Just send us the prepared clean image
@MrTamhan
9 ай бұрын
Bro, remind me to make a video on software coupling! I am a bit overworked at the moment...email me at tamhan aeht tamoggemon dot com!
This is gold!!, even if I can't think on specific applications at the moment Thanks!!
@jonathanmartins7744
10 ай бұрын
This is really creating gold out of nothing! hehehhe Top tier work!
Nice work! That's finally becoming a thing! You forgot to mention some of the important parts, but they're visible in your traces, the kernel is 6.5.0, only one CPU core is seen (maybe freertos continues to run on the second one?) and the device has 8 MB RAM. Of course this is a large device but at least we can get Linux to run into this! It suddenly opens the way to many more portable applications.
@MrTamhan
9 ай бұрын
Hi, thank you so much for talking back! Tam
Wow! Great work! Thanks for sharing.
Interesting video! Thanks for sharing!
@MrTamhan
10 ай бұрын
It is my pleasure! Please stay around! I try to make more interesting videos...
nice! just a minor nitpick: when I see "ESP32" alone, it usually means the older 2016 SoC's, the newer ones are specifically written with their suffixes, like S3, C3 etc... it is kind of a weird naming scheme by espressif
@MrTamhan
10 ай бұрын
Thank you so much for talking back! AFAIK, this could also work on the old SoC, as it is also XTENSA based!
@fyremoon
10 ай бұрын
@@MrTamhan This depends on whether the cross compiler is optimized for the LX6 microprocessor or the LX7 microprocessor that is featured in the S2 and S3 SoCs. The C3 and H2 SoCs use RISC-V architecture so would likely need a different cross compiler to work.
Very cool. Liked and subscribed.
@MrTamhan
9 ай бұрын
Hello, sorry for my slow reply. Thank you so much for talking back!!! And thanks for the subscription!
this is wild, ill have to try this!
@MrTamhan
9 ай бұрын
Thanks man! All the best of luck!
Cool, can you install/run Python on it (not micropython) ? I will try but mine has only 4mb of sram, not sure that s enough
This guide is very clear, thorough and include problems solving. Superb content. I wonder whether this guide is compatible with both Xtensa LX6 and LX7 variant boards? Is it posible to install linux like this to any RISC-V variant ESP32 boards?
@MrTamhan
9 ай бұрын
Hello, thank you so much for the praise. Sadly, I do not think this will work for the ESP32 RISCV version - the kernel used is for the XTENSA only! Tam
Great job! I'm looking forward to more videos on this topic.
@MrTamhan
9 ай бұрын
Hi, thank you so much for talking back. I try to keep the content interesting - hope you find value!
Tam, excellent presentation. I have a couple of ESP32 boards, I need to look up if any of them is an S3 /C3 something that can run Linux. If they are I will give it a try! Thanks for sharing...
@MrTamhan
9 ай бұрын
Hello, thank you so much for the praise! I hope that it works for you! If not, the Olimex seem to already be back from their vacation!
You are a true hero
@MrTamhan
9 ай бұрын
Thank you, my friend! Glad you like the channel!
This is impressive work. Reminds me of the olden days when I wrote my book. Thanks from Colorado.
@MrTamhan
9 ай бұрын
Hello, pleasure to see a fellow author. May I ask what book you wrote?
@CraigHollabaugh
9 ай бұрын
@@MrTamhan I wrote the first embedded Linux book, in 2001. Embedded Linux: Hardware, Software, and Interfacing, ISBN 978-0672322266 Addison-Wesley, published in 2002. Sold 13K copies, translated into 5 languages. Back then, it was only possible to run Linux with busybox because 1M flash became available from Intel. Kernel 2.1.7 could fit, without modules, and busybox root filesystem in ~800K, leaving 200K for user files. I had a x86, PowerPC and StrongARM SBCs in the book. In today's dollars, that StrongARM board costs $3800. Things have changed so much in the past 22 years, Your ESP32 board is about $4. I've loved seeing the embedded Linux progress over the years: beaglebone, RPI, Android and now your work with ESP32. Thanks for scratching the "can it be done" itch.
@MrTamhan
9 ай бұрын
Oh wow. I am honoured to see you here. If I can do anything which interests you, let me know. Also, if you ever want to write another book, I can get you a placement at a nice Euro publisher. Just email me at tamhan aeht tamoggemon dot com any time!
@CraigHollabaugh
9 ай бұрын
@@MrTamhan Thanks for the offers, I'll keep those in mind. I added you to my contacts, you can delete your reply with email if you want.
@CraigHollabaugh
9 ай бұрын
@@MrTamhan I think it would interesting to know the interrupt latency for your ESP32 kernel. However that requires writing a small kernel module, don't know if this easy nowadays.
That's great, thank you!
@MrTamhan
9 ай бұрын
Thanks man! And please, stay around - lots of other videos coming up!
Hi everyone, i would like to know if i can use archlinux , openbox , or something like this. . Or the terminal only? Bash scripting only? Thank you.
Nice you've got this done. Some feedback...it is hard to see where you 'go' to. Maybe listen to the audio to understand that it's very hard to get what is typed.
Awesome video🎉
@MrTamhan
9 ай бұрын
Thank you! Hope you like the channel, and sorry for my slow reply
@DanelonNicolas
9 ай бұрын
@@MrTamhan I do. will try it this winter
@MrTamhan
9 ай бұрын
Thank you! @@DanelonNicolas
Thanks for the video. Any help on the error when running idf.py monitor: "0x4037c000: esp_wifi_tx_done_cb at cmd.c:?"
@MrTamhan
9 ай бұрын
Hello, is this Linux or generic ESP_IDF? Tam
Blurring the line between micro-controller and a general-purpose CPU.. We could run Linux and BSD on 4Mb or 8Mb of RAM in early 2000s and now we can use these skills on ESP... Not sure if it's a good idea though, what would be the use-case for it?
@MrTamhan
9 ай бұрын
Hello, IMHO the true use case is to reduce software coupling. I am not sure if I did a video on this yet, if not I will soon. Or find the old APress book on Event Driven Programming, from around 2005 or so I think by Ted Faison. Thanks again for talking back!
Awesome! What about SD card support? This would be very helpful on so tiny device. Waiting for the continue.
@DisorderedArray
10 ай бұрын
I'm pretty sure you can just solder an SD card directly to the ESP32 SPI pins and use it like any other SPI device.
@ko5t1k
10 ай бұрын
@@DisorderedArray Yes, but it need to be supported by the Linux. Here is the question
@MrTamhan
9 ай бұрын
Hi, honestly I am not sure. I will need to look into this...
@ko5t1k
9 ай бұрын
@@MrTamhan It will be great add on to the project. Thanks a lot.
Ok, so we have linux but it is highly resource constrained. It's not like we can run docker or do apt get and install whatever we like like a regular linux box. So what are some practical applications (i.e. dependable not barely working) applications where having this is beneficial over RTOS or a single program running on the same hardware?
@justbendev2324
8 ай бұрын
Bro said let's install docker 🤣 This is just a poc that's shows that "running" linux kernel is possible by emulating a risc-v proc but it won't do anything. This chip wasn't made for this.
@hineko_
Ай бұрын
@@justbendev2324 old aqara iot hub has esp32 chip and is running linux on it no problems.
Thank you for your video. I encountered this message "SSP support available in this tool chain, please enable BR2_TOOLCHAIN_EXTERNAL_HAS_SSP" while building. Any help? Thanks!
how it is possible? does esp32-s3 have MMU and MPU? this is full linux kernel or some limited version? does drivers work? i2c? wifi? etc?
@MrTamhan
9 ай бұрын
Hello, sorry for being slow in talking back here. AFAIK, this is an XTENSA port...not sure if it has an MMU
Nice video
It would be cool if it is able to run pi-hole, very useful.
Can I connect to the esp32 via SSH?
the esp32 device from video, have 8mb, and the partistion flash was up to 12mb ? what for esp32 is needet for linux ? 16mb ?
@MrTamhan
7 ай бұрын
Hello, this is the one I used. Sorry, I am not really sure if it works on smaller units - but given that this unit already has almost no memory left, I do not think a smaller SoC can be efficiently used.
Might it be easier (or faster) to set up a docker container for the build environment? You mentioned building a cross compiler for apps, but was one not needed for compiling the kernel?
@ovrskr
10 ай бұрын
perhaps, but on the other hand that's proprietary software and you'd need to learn how to use it
@BinderTronics
10 ай бұрын
@@ovrskr What on earth are you talking about? Docker is open-source, same as virtual-box. You will be done learning and compiled with the tiny bit that you need to compile Linux in docker long before your are done compiling on a VM. + you do not need to faff around with hardware passthrough since you can output the build files directly to the host machine.
@ovrskr
10 ай бұрын
@@BinderTronics both are VM's, its not a big difference in the end
@BinderTronics
10 ай бұрын
@@ovrskr wrong again
@mihaim2
10 ай бұрын
@@ovrskr docker is NOT vm . You can think about docker as ... chroot on steroids
Does wifi and ble work i guess not? How much memory is still left for any processes? And Filesystem mounting possible?
@pfeerick
9 ай бұрын
He mentioned fairly early on about two versions - one with and one without wifi, and I think he ran with the with wifi version... so it would seem like you can at least still have wifi...
@jcmvbkbc
9 ай бұрын
WiFi does work, I didn't try BT. ~2MB RAM of 8 is available right after the boot. Kernel configuration has cramfs, jffs2 and NFS support enabled (and yes, mounting NFS works). Nothing blocks enabling other file system drivers.
Olimex, I remember that name from the early Android hacking scene! He used to release engineering bootloaders for those devices on XDA!
@MrTamhan
9 ай бұрын
Yes man, they went far! It is always a pleasure to see them!
this is genius
@MrTamhan
9 ай бұрын
Thanks man!
I've seen people run Linux on the ESP32 using a RISC-V emulator. Is this running natively?
@MrTamhan
8 ай бұрын
Sorry for my slow reply. Yes, this does not use the RISC V emulator!
Holy crap!! How difficult will it be to develop any practical applications?
@MrTamhan
9 ай бұрын
Hello, thank you so much for talking back! IMHO, this works well with most C / C++ based payloads...one day, I need to make a video on software coupling. In the mean time, may I give you a book recommendation for a book which really helped me?
Is there a mesh network written in python? This thing would probably be able to setup a wifi mesh network and act as repeaters and the like just like the ESP-01 wifi mesh networkZ Very cool...lightweight and powerful!
@MrTamhan
9 ай бұрын
Hi, thank you for talking back. I am not sure if there is one for Linux and Python, but Espressif just announced one for its IDF environment
That’s pretty amazing, but yeah, I wonder how useful it will be. Normally these chips are used for simple things and don’t really need a complex operating system. But I’m open to suggestions 🤔
@MrTamhan
10 ай бұрын
Thank you so much for talking back! This probably is mainly for some kind of MSR job, or a C++ based job...where it eliminates coupling. I need to make a video on software coupling one day...
@MrTamhan
10 ай бұрын
@@user-cs8qq5vt4v thanks man. But the ESP32 is much more low power!
@chlordk
10 ай бұрын
The smallest computer I have with Linux is a Turris Omnia router. So if you need to implement a router or other large software stack it makes a lot of sense with Linux. If you just need multitasking you can have FreeRTOS on your ESP32.
@dankaufman8900
10 ай бұрын
I was looking for something like this to run the hyperion library without buying a raspberry pi. I may try this out :)
@summerWTFE
10 ай бұрын
@@dankaufman8900 I don’t know what that is.
Awesome
@MrTamhan
9 ай бұрын
Thank you so much for talking back!
thx for the video, one thing I would highly recommend, you get a lot of views on this video and the internet is an evil place, pls cut the part from your video where you show your address. I think you can still cut parts from a video after it has already been uploaded.
@MrTamhan
9 ай бұрын
Thank you so much for talking back and being concerned, I really appreciate it. But in my case it is hopeless. I have multiple capital companies in Hungary and Slovakia, and so my address is in the public domain via the company registers. Also, if you ever want to come and visit for a drink -> tamhan@tamoggemon.com and we can hang out!
For future reference. Nobody cares what package the device came in
@Alkatross
10 ай бұрын
I found this to be most interesting.
@MrTamhan
9 ай бұрын
Thanks man!
@MrTamhan
9 ай бұрын
THanks man!
I was gonna ask where are you from, thanks it's written in the package at the beginning of the video. :D
@MrTamhan
9 ай бұрын
If you are in the area, lets smoke one!
@Seu_Lunga
9 ай бұрын
@@MrTamhan Thanks for the invite to smoke, but that's not my area. xD
@MrTamhan
9 ай бұрын
No problem! If you ever are in the area, let us smoke! @@Seu_Lunga
"Step 2: flash the board" whats the command you used here? In your video you skipped this part and showed the last part of the teriminal window
I can not find the esp board you have! Please put URL link so I can click!
@MrTamhan
9 ай бұрын
Hi, sorry for being slow. Please look at www.olimex.com/Products/IoT/ESP32-S3/ESP32-S3-DevKit-Lipo/open-source-hardware
Where are the commands and the script you run? Thanks.
@MrTamhan
9 ай бұрын
Hi Man, they are in the video. Can you do German? Then I can send you a writeup! ANd thanks for watching!
@MikeKranidis
9 ай бұрын
@@MrTamhan yes I can read German. Please do it. Thanks 👍
@MrTamhan
9 ай бұрын
Hello, look here -> www.mikrocontroller.net/topic/559143
awesome I would have 2 or 3 esp32 into the rack
@MrTamhan
9 ай бұрын
Hi, sounds like a cool idea!
niiiice
@MrTamhan
9 ай бұрын
Thank you for talking back, and sorry for being slow in responding!
👏
Now i can visit you and drink a cup of coffee.
@MrTamhan
9 ай бұрын
any time! Friendly people are always welcome at my den. tamhan@tamoggemon.com for scheduling!!!!
It is a working linux environment with practically no storage left..
is it possible to boot windows on it?
@JonitoFischer
9 ай бұрын
I need it desperately to run Edge with 100 tabs open
@MrTamhan
9 ай бұрын
Hi, Windows no. Maybe Windows 3.1 or so, but no real version IMHO
Hello, am I allowed to put this video into another video website? This is very exciting and I will put your origin video url.
@MrTamhan
10 ай бұрын
Where would you like to put it?
@ppp-tx6tl
10 ай бұрын
@@MrTamhan a Chinese website bilibili, where exists a large community of the embedded lovers.
@MrTamhan
9 ай бұрын
Go go go, my friend. And sorry for my slow reply!
Project update?
would be nice to get the github url..
@MrTamhan
9 ай бұрын
Hello, sorry for being slow. Please look at github.com/jcmvbkbc/esp32-linux-build
Candidate for nerves on esp32? Anyone try it?
@MrTamhan
9 ай бұрын
Thanks man! Glad you like it!
Holy crap! This is crazy. Those Olimex guys went viral 🤣🤣🤣. How could they reduce their Linux distro to 4MB or less?
@MrTamhan
9 ай бұрын
Thanks man. But in fact, the real question is: why is Linux now so big...
so fascinated by the solution the problem began to vanish
@MrTamhan
9 ай бұрын
Hello, thank you so much. And sorry for being slow in talking back!
If there is a MMU in the MPU there will be a Linux but this is not a MPU this is MCU. What you are doing is not running Linux on this MCU rather running POSIX compatible a real time OS like RTOS.
I would also like to run Linux on raspberry pico pi
why. everything was fine on the esp
@MrTamhan
9 ай бұрын
Hi, thank you for talking back, and sorry for my slow reply. This is one of these projects where the reason is "so it is done" ;)
@Fahnder99
9 ай бұрын
@@MrTamhan then well, ok.
But its not same as the one you have!!!!!!???
@MrTamhan
9 ай бұрын
Hi, this is the one I used: www.olimex.com/Products/IoT/ESP32-S3/ESP32-S3-DevKit-Lipo/open-source-hardware
"Linux" is NOT an operating system of any kind. Linux is a kernel.
@MrTamhan
9 ай бұрын
Thanks for talking back, my friend!
linuuux
@MrTamhan
9 ай бұрын
Thanks man!
I don’t like smashing my keyboard
@MrTamhan
9 ай бұрын
Hello, thank you so much for talking back! I am kind of old fashioned ;)
Methinks ESP 32 gonna blow up ... and then you can't get a dev board for the love of ...
@MrTamhan
9 ай бұрын
Hi, they are actually thermally quite stable - I run some demanding FFT stuff for a client in series production, in a hot environmewnt (cigar ashtray) and we never had an issue so far. Thanks for talking back also! Tam
RIP spacebar
@MrTamhan
9 ай бұрын
Yes man, old dude and hacking away at the keyboard...but it is now over 15 years old...and works like on day one
@jowelfersa5545
9 ай бұрын
@@MrTamhan modern keyboards are nota like old ones ha ha ha
@MrTamhan
9 ай бұрын
Yes, indeed ;)
One us for enslaving other devices😂
@MrTamhan
9 ай бұрын
From the streets I come, my friend. Thank you so much for talking back.
i guess now everyone knows your address, you'll soon have reason to remark 'why are so many people sending me cookbooks, and all featuring plantain recipes!? oh, this is different... ugh, common plantain'.
@MrTamhan
9 ай бұрын
Thank you so much for talking back and being concerned, I really appreciate it. But in my case it is hopeless. I have multiple capital companies in Hungary and Slovakia, and so my address is in the public domain via the company registers. Also, if you ever want to come and visit for a drink -> tamhan@tamoggemon.com and we can hang out!
@felderup
9 ай бұрын
@@MrTamhan since you didn't seem concerned yourself, i decided to make a joke.
@MrTamhan
9 ай бұрын
Hi, no problem! I was not offended - and my offer of a drink was sincere! Tam
@felderup
9 ай бұрын
@@MrTamhan i think you should try common plantain, it might grow wild near you, tastes like mild spinach.
@MrTamhan
9 ай бұрын
Bro I actually do cook quite a bit. So you motivate me to look at it... @@felderup
Why are you leaking your address? 😳 might be dangerous 😬
@MrTamhan
9 ай бұрын
Thank you so much for talking back and being concerned, I really appreciate it. But in my case it is hopeless. I have multiple capital companies in Hungary and Slovakia, and so my address is in the public domain via the company registers. Also, if you ever want to come and visit for a drink -> tamhan@tamoggemon.com and we can hang out!
The accent of that guy... sounds like german but the looks do not match typical germans.
@MrTamhan
9 ай бұрын
Austrian dude, my friend. Syrian Christian dad, plus a bit ill...plus weird lighting...
ESP32 made in China has the problem of Information security. Maybe it is easy to use EPS32, but security and privacy are the most important.
@MrTamhan
9 ай бұрын
Man, thanks for talking back. But do you really think that the US chips are safer? IMHO, in this field, you can only select WHO spies on you, not whether you get spied on or not...
A whole Ubuntu distro seems like a bit too much for an ESP32. For those boards, busybox with a lightweight kernel and specific kernel modules, maybe the RT module and a few others depending on purpose, and whatever other specific software you wanted (since you require Linux) would be better if you need Linux on it. You could easily do all those using Gentoo, if you don't wanna manually put everything together. If you don't specifically need Linux, FreeRTOS is probably a better choice.
No add ons
@MrTamhan
9 ай бұрын
Hi, which ones do you mean?
any external device?????? hahaha slavery.
stop yelling into the mic your voice is clipping lol
@MrTamhan
10 ай бұрын
Thanks man. I need to redo my mic setup, I know!
@ZombieFartDev
10 ай бұрын
just speak more softly or fix the audio after you record it@@MrTamhan
@MrTamhan
10 ай бұрын
@@ZombieFartDev I will try. Can you suggest a program for audio maybe
@jonathanlevin7660
10 ай бұрын
The easiest free solution is Audacity, which is also FOSS and cross platform. Its great for small things. But if you use video editing software perhaps you can do something in there directly
@Debloper
10 ай бұрын
For audio, only 2.5 things you need to take care of beforehand, rest can be fixed in post-production. 1. The mic shouldn't have heavily distorted frequency response curve (usually not a concern, even with cheap lavs) 2. The amplitudes should not clip for whichever output level you're working with (mic level 1mVpp or line level 1Vpp) 2.5. The ambient noise level is at least -20dB (better if -40dB) away from the gain of sound that you're trying to capture. Once you've taken care of these things, everything else can be tuned/tweaked in a DAW. I'd recommend davinci resolve's fairlight (free, feature rich, cross-platform, AI denoise, comes with the video editing software itself etc), but there are many good options. How much time and energy you'd wanna spend correcting/improving the audio is upto you (there's literally no ceiling to that). But given that your videos are going to convey information, and they're primarily not about entertainment/aesthetics, you shouldn't have to be too worried about that part. I see that you take feedback very positively, which I highly value as a growth-mindset trait. Hopefully it helps; all the best!
Awesome
@MrTamhan
9 ай бұрын
Thank you so much!