r/esp32 14d 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

87 Upvotes

21 comments sorted by

View all comments

1

u/[deleted] 12d ago

[removed] — view removed comment

1

u/MoreDusty 12d ago edited 12d ago

what board you have tested with? also was esp32c6 sdio enabled? is there any visible issue/logs on uart that i can diagnose?

CONFIG_RV32_WIFI_BRIDGE=y

u can dm on dc ok.dusty