Giter Club home page Giter Club logo

esp32s3-linux-docker's Introduction

Build the ESP32 and ESP32-S3 Linux Kernel

FOR ESP32 SWITCH TO ESP32 BRANCH!!!

Based on the Max Filippov ESP32-S3 Kernel Linux Build Scripts and the Antonio Docker Container with a few modifications to make it work for me.

You will need:

Check This Wiki Page to see what is working.

Build Instructions

sudo docker build -t esp32s3-linux .

Build time lasts for around an hour to be completed, you will have a 20GB docker image with the binaries needed to flash the ESP32.

Identify in your computer where is the serial port to the ESP32-S3, I will suppose it will by /dev/ttyACM0:

# give device access (ownership) to you current user
sudo chown $USER /dev/ttyACM0

Mount a container with the image you have just built from Dockerfile:

sudo docker run -it esp32s3-linux

Copy the container ID (let us suppose it is 78bdc7c38626) and copy the generated binaries to your native environment:

sudo docker cp 78bdc7c38626:/app/build/build-buildroot-esp32s3/images/ .
sudo docker cp 78bdc7c38626:/app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin ./images
sudo docker cp 78bdc7c38626:/app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin ./images
sudo docker cp 78bdc7c38626:/app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin ./images

You may now delete the docker image and container, you won't need it anymore (if you don't want to cross compile any application).

Flash Instructions

First Method

This method copies the binaries from container to main system environment (outside docker), and then flashes using native esp-idf.

Activate esp-idf environment wherever it have been installed, I will suppose it is installed in /opt/esp-idf:

. /opt/esp-idf/export.sh

Then navigate to images folder and run:

esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 921600 --before=default_reset --after=hard_reset write_flash 0x0 bootloader.bin 0x10000 network_adapter.bin 0x8000 partition-table.bin
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name linux  --input xipImage
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name rootfs --input rootfs.cramfs
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name etc --input etc.jffs2

Second Method

This method installs esp-idf inside docker container, it will requires to passthrough serial device to the running docker container in order to flash.

Supposing your USB to UART adapter is listed in your PC as /dev/ttyACM0, run the docker image giving access to it:

sudo docker run --device=/dev/ttyACM0 -it esp32s3-linux

Install esp-idf inside the container, then activate the environment:

/app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/esp-idf/install.sh
source /app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/esp-idf/export.sh

Then flash the images:

esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 921600 --before=default_reset --after=hard_reset write_flash 0x0 ./build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin 0x10000 ./build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin 0x8000 ./build/esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name linux  --input ./build/build-buildroot-esp32s3/images/xipImage
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name rootfs --input ./build/build-buildroot-esp32s3/images/rootfs.cramfs
parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name etc --input ./build/build-buildroot-esp32s3/images/etc.jffs2

Access Linux Shell from UART adapter

You will be able to access shell through serial monitor, you can use any application like putty, minicom, screen, Arduino...

minicom -D /dev/ttyACM0 -b 115200

press RST button on ESP32-S3 and enjoy!

esp32s3-linux-docker's People

Contributors

chandlerkluser avatar chandler-kluser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.