You've booted Linux on an ESP32-S3 and now you want to add some customization. You can do that with the menuconfig tool in /buildroot. This lets you select options to include in your kernel and filesystem. After running menuconfig, you'll rebuild the files and upload them to the ESP32-S3 partition tables so that you can boot into your new Linux image.
First you'll clean up the previously compiled files by running make clean
in the /buildroot directory.
cd /app/build/buildroot make clean
Next, you'll run some commands to rebuild the filesystem and kernel. You're essentially re-running commands manually that are performed in the Dockerfile. First, you'll go up one level in the directory with:
cd ..
Then you'll clean
the previous compilation run with:
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 clean
Run the following commands to prep the .config file. This file contains all of the build settings.
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 esp32s3wifi_defconfig buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic' buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
Then you'll enter the menuconfig
tool with:
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 menuconfig
This opens a GUI tool that you can navigate with the arrow keys on your keyboard.
Start by going to Target options and making sure that the image is being built for the correct target.
- Target Architecture: Xtensa
- Target Architecture Variant: Dynamic Xtensa processor configuration
- Target Architecture Endianness: Little endian
- (*) MMU support
- Target Binary Format: ELF
Navigate to the System configuration menu. On this page, you'll edit the hostname and welcome banner.
Select System hostname and enter the hostname that you would like for your system to have. Highlight OK and hit enter to confirm.
Select the System banner and enter the custom welcome message you'd like to see when you log into the system. Highlight OK and hit enter to confirm.
Select Save on the main GUI. This will open a dialog box showing that you are saving to the .config file. Select OK to confirm.
Now you'll use make
to compile all of the build settings and build the filesystem and kernel files.
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 [ -f build/build-xtensa-2023.02-fdpic-esp32s3/images/xipImage -a -f build/build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs ] || exit 1
You'll move the files to the /release folder with:
cd build cp build-xtensa-2023.02-fdpic-esp32s3/images/xipImage release cp build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs release
You'll move the files from Docker to your local filesystem by opening a terminal on your local system, navigating to the directory where you want the files to be and entering:
docker cp YOUR-CONTAINER-NAME-HERE:/app/build/release bin_files
This is the same step that you did earlier with the unmodified files. Next, you'll flash the xipImage and rootfs.cramfs files using parttool.py in the ESP-IDF as described on the Upload Files page.
Log into the ESP32-S3 over serial to see your Linux system in action. If all went well, you should be greeted with your custom welcome message and hostname.
Text editor powered by tinymce.