Skip to content

Instantly share code, notes, and snippets.

@jcmvbkbc
Last active April 5, 2025 21:38
Show Gist options
  • Save jcmvbkbc/316e6da728021c8ff670a24e674a35e6 to your computer and use it in GitHub Desktop.
Save jcmvbkbc/316e6da728021c8ff670a24e674a35e6 to your computer and use it in GitHub Desktop.
esp32s3 linux rebuild scripts
Latest versions of these scripts are available in git repository https://github.com/jcmvbkbc/esp32-linux-build
@metanav
Copy link

metanav commented Aug 21, 2023

Hi @jcmvbkbc,

Great job! And, thank you for sharing this script. I am trying to display the console output to an SPI TFT display. I guess I need to write a device driver or I would need to change some configuration?

@jcmvbkbc
Copy link
Author

jcmvbkbc commented Aug 25, 2023

I am trying to display the console output to an SPI TFT display. I need to write a device driver or I would need to change some configuration?

@metanav I think it involves a virtual console driver and either an SPI driver or an IPC driver that would send commands to a renderer implemented in firmware.

@hpsaturn
Copy link

I added an alternative documentation from the Dockerfile that Adafruit did of this Gist:
https://github.com/hpsaturn/esp32s3-linux

@ppescher
Copy link

Hi @jcmvbkbc
I tried your "wifi" script on WSL (Win 11) and got it to build successfully after resolving some missing dependencies.

I loaded the firmware images on a custom board I made with ESP32-S3 ("wroom-1" module, N16R8 variant) and it seems to work great!

As a quick benchmark, I ran a ping test (to Google server and to my PC on the LAN) and I got this results:

--- www.google.com ping statistics ---
3035 packets transmitted, 3022 packets received, 0% packet loss
round-trip min/avg/max = 19.741/35.490/966.684 ms
--- 192.168.24.129 ping statistics ---
1351 packets transmitted, 1345 packets received, 0% packet loss
round-trip min/avg/max = 10.034/22.907/476.367 ms

Pinging back from my Windows PC yields a min/avg/max = 10/77/138 ms

I also tried to see how much download speed I could get, by running "time wget" with a 1GB file and got around 435KiB/s (1e9 bytes in 37m22s). That's about 3.5Mbps!

That's not bad at all considering the amount of overhead involved.

During all these test I got a few messages with GFP_KERNEL ("page allocation failure") but the system never hanged or rebooted.

I have to say I'm quite impressed by what you achieved with this platform. Great work!

@barbiani
Copy link

Hello everybody,

I tried to build the image using both scripts on wsl2 and got errors on the IDF setup.

++ unset WARNING_MSG
++ unset uninstall
++ unset is_idf_path_esp_idf
++ unset is_script_dir_esp_idf
++ unset __realpath
++ unset __main
++ unset __verbose
++ unset __enable_autocomplete
++ unset __cleanup
++ unset __is_dir_esp_idf
++ return 1
+ cd examples/get-started/linux_boot
+ idf.py set-target esp32s3
./rebuild-esp32s3-linux.sh: line 52: idf.py: command not found
+ cp sdkconfig.defaults.esp32s3 sdkconfig
+ idf.py build
./rebuild-esp32s3-linux.sh: line 54: idf.py: command not found
+ read -p 'ready to flash... press enter'
ready to flash... press enter

Looks like it is missing a call to ./install.sh

@hpsaturn
Copy link

only you need remove the hidden directory of your local machine of the IDF. Something like this:

rm -r ~/.espressif

@MoseychukA
Copy link

Thank you very much! Everything worked. But how to install GIT, apt-get and other programs? I want to install DUMP1090 to track aircraft. :-)

@hpsaturn
Copy link

hpsaturn commented Apr 4, 2025

That is impossible for now. All here it's an exploration. This Linux is a ultra reduced version of Linux. The userland here is nothing. Maybe you should explore cross compiling to push your binary. Or you should include your sources of this app in the whole process that we have here.

@MoseychukA
Copy link

It's a good idea - "to include your sources of this app in the whole process that we have here." I need to figure out how to do this. :-).

@MoseychukA
Copy link

Please tell me where to look for a docker file where I can add my information.

@hpsaturn
Copy link

hpsaturn commented Apr 5, 2025

Keep in mind that my DockerFile only helps to the build process. I didn't do nothing.. The docker file uses the complete work of @jcmvbkbc. For this reason, maybe you should looking here:

https://github.com/jcmvbkbc/linux-xtensa

Doing changes, and after that, you could change the DockerFile targeting it to your fork or your repo with your changes. I guess.

Also you could see the complete details for instance in this page, it has a section that describe the process for have your cross compiling tools in your system and push binaries.

https://gojimmypi.github.io/ESP32-S3-Linux/

@jcmvbkbc
Copy link
Author

jcmvbkbc commented Apr 5, 2025

I want to install DUMP1090

There's a buildroot package for it and I just checked that it builds successfully for the esp32s3 linux.

@MoseychukA
Copy link

Can you tell me where to find a link to buildroot DUMP1090? :-).

@jcmvbkbc
Copy link
Author

jcmvbkbc commented Apr 5, 2025

If you're using the script https://github.com/MoseychukA/esp32s3-linux-build/blob/master/rebuild-esp32s3-linux-wifi.sh for building it clones the buildroot here.

@MoseychukA
Copy link

I have little experience in this area. I want to replace Raspberry Pi with ESP32S3 using RTLSDR. :-(

@MoseychukA
Copy link

Ooo! Thank you so much!!

@barbiani
Copy link

barbiani commented Apr 5, 2025

@jcmvbkbc great work you have done. Which tools do you use to develop an application for the final system? I would like to get a lvgl demo running on tft. Then add 3G connectivity.

@jcmvbkbc
Copy link
Author

jcmvbkbc commented Apr 5, 2025

@barbiani LVGL is working in linux for esp32s3, but to use it with a framebuffer you'd need to disable direct mapping with the following change.
The rest of the tools is in the buildroot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment