Run linux on esp32
Post by timl12332 » Fri Aug 10, 2018 11:24 am
I recently read that there are ESP32 modules with 4MB and I heard even 8MB ram. This made me wonder if we can run Linux?
Now I know Linux needs a MMU, but I thought older Linux versions(3.x?) that had the UClinux changes integrated and thus can compile without MMU.
Is it maybe interesting for someone to try?
Or would it at least be possible?
Re: Run linux on the ESP32?
Post by username » Fri Aug 10, 2018 1:28 pm
You’d be stretching yourself to thin in doing so, not to mention what real gain would you get by doing so.
For just a few more bucks you can get a Allwinner H2+, Quad-core Cortex-A7 that is meant to run it
https://www.friendlyarm.com/index.php?r . uct_id=197
kolban Posts: 1683 Joined: Mon Nov 16, 2015 4:43 pm Location: Texas, USA
Re: Run linux on the ESP32?
Post by kolban » Fri Aug 10, 2018 2:45 pm
. for technical completeness, the ESP32 does indeed have an MMU as well as hardware assistance for process instance isolation of memory.
Re: Run linux on the ESP32?
Post by timl12332 » Fri Aug 10, 2018 2:56 pm
kolban wrote: . for technical completeness, the ESP32 does indeed have an MMU as well as hardware assistance for process instance isolation of memory.
I thought that one was not complete enough for Linux?
But what is it needed for anyway? Is it just preventing a process from modifying another process’s ram?(Hacking or something)
kolban Posts: 1683 Joined: Mon Nov 16, 2015 4:43 pm Location: Texas, USA
Re: Run linux on the ESP32?
Post by kolban » Fri Aug 10, 2018 9:06 pm
Typically memory isolation is used for robustness. In a privileged address space (ESP32 default), an error in an application or subroutine or task could merrily step all over the memory of other applications. By leveraging process isolation, one adds an extra degree of resiliency to a solution. Assuming an application is composed of multiple coarse grained components, each of those components could be insulated and isolated from the others so a logic error in one component would have that much more resiliency from interfering with the operation of another. While security is a possible utilization, historically, memory isolation between processes was designed for robustness and form simplifcation of the overall environment in which applications run.
Re: Run linux on the ESP32?
Post by timl12332 » Fri Aug 10, 2018 9:13 pm
kolban wrote: Typically memory isolation is used for robustness. In a privileged address space (ESP32 default), an error in an application or subroutine or task could merrily step all over the memory of other applications. By leveraging process isolation, one adds an extra degree of resiliency to a solution. Assuming an application is composed of multiple coarse grained components, each of those components could be insulated and isolated from the others so a logic error in one component would have that much more resiliency from interfering with the operation of another. While security is a possible utilization, historically, memory isolation between processes was designed for robustness and form simplifcation of the overall environment in which applications run.
That’s interesting. So if I e.g. am writing outside of an array, into another process. The MMU(if active) would just terminate the process? Or reset the ESP?
Also I did some research on MMU’s, and one thing I read was that it gives each process it’s own memory space. Is that correct?
If so, does this mean, I could load precompiled programs from an SD, into memory. Give a process a memory space(using the MMU), and have multiple programs running?
As I would love to turn an ESP into some mini PC, developing my own mini OS.
kolban Posts: 1683 Joined: Mon Nov 16, 2015 4:43 pm Location: Texas, USA
Re: Run linux on the ESP32?
Post by kolban » Fri Aug 10, 2018 11:31 pm
There is a super detailed ESP32 manual called the ESP32 Technical Reference. In chapter «26 — PID/MPU/MMU» there are descriptions of the hardware support for these areas of functions. What I would suggest is to have a good slow read of that section and see how much of it makes sense. I had to read it multiple times and am still novice level.
Re: Run linux on the ESP32?
Post by Deouss » Sat Aug 11, 2018 1:41 am
I must admit I also don’t understand quite well how exactly memory management looks like.
What I found out is that it is all done by special memory mapping tables that assign certain context of the process to addressees.
I don’t understand why PSRAM space cannot be executed by CPU — is it because MPU disallows it meaning the addresses don’t exist in the tables or they have forbidden access flags assigned. This is supposed to be more straightforward.
Re: Run linux on the ESP32?
Post by timl12332 » Sat Aug 11, 2018 10:52 am
kolban wrote: There is a super detailed ESP32 manual called the ESP32 Technical Reference. In chapter «26 — PID/MPU/MMU» there are descriptions of the hardware support for these areas of functions. What I would suggest is to have a good slow read of that section and see how much of it makes sense. I had to read it multiple times and am still novice level.
Deouss wrote: I must admit I also don’t understand quite well how exactly memory management looks like.
What I found out is that it is all done by special memory mapping tables that assign certain context of the process to addressees.
I don’t understand why PSRAM space cannot be executed by CPU — is it because MPU disallows it meaning the addresses don’t exist in the tables or they have forbidden access flags assigned. This is supposed to be more straightforward.
PSRAM can’t contain executable instructions? That’s unfortunate. Would have been useful for making a little OS that can load programs into ram and execute them.
Re: Run linux on the ESP32?
Post by suhanko » Tue Dec 03, 2019 2:28 pm
Run linux on esp32
Hackaday notes Dror Gluska’s work on running Linux an an ESP32 microcontroller.
I’ve been playing with the idea of running Linux on ESP32 since the first days I’ve met its more robust module, the WROVER-B, on paper it seem possible since its a dual core 240Mhz and has 16MB flash and 8MB RAM, compared to our antique machines that could run Linux, it seems like a beast.
Doing some research on it, I’ve understood that its MMU is insufficient for running Linux on it. during the past few years I’ve been looking into it to see if anyone else found the time to implement it and eventually I’ve decided its going to be a good opportunity to learn a bit more about RISCV and Buildroot. Two subjects I’ve been putting off for longer than I’d like to admit.
I’ve decided to start with something rather to write it all from scratch, which I didn’t have time or energy to do for this project, I’ve looked into QEMU emulation for RISCV but taking this project apart and getting only a few components out of it to run on an embedded system seemed like too much work. Eventually I’ve found out about Fabrice Bellard’s TinyEMU (demo).
Check out the video below, Dror’s post for all the details and the Hackaday article.
Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards
Adafruit is on Mastodon, join in! adafruit.com/mastodon
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.
Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord
CircuitPython – The easiest way to program microcontrollers – CircuitPython.org
Maker Business — “Packaging” chips in the US
Wearables — No-brainer method for putting LEDs in costumes
Python for Microcontrollers — Python on Microcontrollers Newsletter: CircuitPython 8.2.0 Stable Released, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi
Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!
EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey
New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — JP’s Product Pick of the Week 7/11/23 STEMMA Audio Amp 2.5W PAM8302 @adafruit @johnedgarpark #adafruit #newproductpick
Get the only spam-free daily newsletter about wearables, running a «maker business», electronic tips and more! Subscribe at AdafruitDaily.com !
No Comments
Sorry, the comment form is closed at this time.
Comments Off on Running Linux on an ESP32 #ESP32 #Espressif #Linux @Hackaday @DrorGluska
“Propel, propel, propel your craft softly down liquid solution. Ecstatically, ecstatically, ecstatically, ecstatically, existence is simply illusion”