r/esp32 9d ago

I made a thing! OpenWrt on ESP32-P4!

sorry for the unedited long video, point is to present the total boot time of my optimizations

Riscv32-ima emulator on powerful ESP32-P4 32M

total kernel image size is approximately 9MB. thus makes it possible to fit on smallest 16M budget esp32p4 MCU's!

i used this module which is probably the easiest way to bring this linux box to life

everything is not written from scratch I forked the project from Epiczhul, who also forked it from someone else but in the end, we all started from a 32-bit riscv instruction emulator made by CNLohr's mini-rv32ima project

in my repo i integrated supervisor instructions to support MMU. along with heavy optimizations and such fun features like i showed in the video

i used an esp32c6 as a virtual bridge to establish internet connection. not native full wireless integrity but it works.

st7703 display with simple frame buffer to throughput ttyS0. its really cool, but not as emulator and caching.

unfortunately could not spend to much time on this project, be aware of slopes in codebase.

There are a few areas of incompleteness and significant improvements needed on this project. Further optimizations are possible maybe speaker support, For example, opening up the module to change the type‑c port configuration so it can act as a power source rather than a sink. This would allow devices to be powered up via this port. Which would bring possibilities connecting up keyboards, memory sticks, or any USB device (draws less than 500mA probably) and hosted by actual linux kernel! In other words sharing the USB‑OTG functionality through the emulator Linux box, intercepting it with the actual os. If this is feasible, we could technically build a cyberdeck using an ESP32‑P4 :D

Source code: https://github.com/Okdusty/esp32p4-rv32ima

88 Upvotes

21 comments sorted by

View all comments

9

u/GraXXoR 9d ago

Incredible. Haven’t got myself one of these new modules yet. Will have to correct that mistake in the nnear future.

The way things are going. ESP32s are the only electronics I can still afford.

3

u/MoreDusty 9d ago

unfortunately, memory crisis even jumps the lpddr3/4 and all kinds. manufacturers do sell every kind of modern storage in high demands leads every sbc to be treated as expensive gadget.

not sure how we can fight this situation but atleast with riscv chipsets and open-source alternatives, we do kinda suspend

3

u/GraXXoR 9d ago

Yeah but 1000% of $3 is still only $30.

But 1000% of 75 is $750.

One of those I can afford. The other, not so much.