Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
name: Build Image

on:
# push:
pull_request:
workflow_dispatch:

jobs:
build-artifacts:
runs-on: ubuntu-latest
name: Build Bootloader
steps:
- uses: actions/checkout@v3
name: Checkout submodules
with:
submodules: "recursive"

- name: Prepare esp_driver
working-directory: esp-hosted/esp_hosted_ng/esp/esp_driver
run: |
cmake .

- name: Build esp_driver
working-directory: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter
run: |
. ../esp-idf/export.sh
idf.py set-target esp32s3
cp sdkconfig.defaults.esp32s3 sdkconfig
idf.py build

- name: Upload partition-table.bin
uses: actions/upload-artifact@v3
with:
name: partitions-table
path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin

- name: Upload bootloader.bin
uses: actions/upload-artifact@v3
with:
name: bootloader
path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin

- name: Upload network_adapter.bin
uses: actions/upload-artifact@v3
with:
name: firmware
path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin

# create-release:
# runs-on: ubuntu-latest
# name: Create release
# steps:
# - uses: actions/checkout@v3

- uses: actions/create-release@latest
if: github.ref_type == 'tag'
name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: |
Created automatically on tag creation.
Download all files into the same folder and run ./flash-all.sh script.
Connect ESP32-S3 board to any USB port prior to running script.
draft: false
prerelease: false

- name: Upload partition-table.bin to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: partition-table.bin
asset_path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin

- name: Upload bootloader.bin to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: bootloader.bin
asset_path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin

- name: Upload network_adapter.bin to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: network_adapter.bin
asset_path: esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin

# build-image:
# runs-on: ubuntu-latest
# name: Build Image
# steps:

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: help2man libtool-bin ninja-build
version: 1.0

- uses: actions/checkout@v3
name: Checkout submodules
with:
submodules: "recursive"

- name: Build dynconfig
run: |
make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so

- name: Build crosstoll-NG
working-directory: crosstool-NG
run: |
./bootstrap && ./configure --enable-local && make

- name: Prepare toolchain build
working-directory: crosstool-NG
run: |
./ct-ng xtensa-esp32s3-linux-uclibcfdpic
sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config

- name: Build toolchain
working-directory: crosstool-NG
continue-on-error: true
run: |
CT_PREFIX=`pwd`/builds XTENSA_GNU_CONFIG=`pwd`/../xtensa-dynconfig/esp32s3.so ./ct-ng build --quiet

- name: Upload toolchain build log
uses: actions/upload-artifact@v3
with:
name: toolchain-build.log
path: |
crosstool-NG/build.log
crosstool-NG/.config
if: failure()

- name: Configure buildroot
run: |
make -C buildroot O=`pwd`/build-buildroot-esp32s3 esp32s3_defconfig
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'

- name: Build buildroot
run: |
XTENSA_GNU_CONFIG=`pwd`/xtensa-dynconfig/esp32s3.so make -C buildroot O=`pwd`/build-buildroot-esp32s3

- name: Upload xipImage
uses: actions/upload-artifact@v3
with:
name: xipImage
path: build-buildroot-esp32s3/images/xipImage

- name: Upload rootfs
uses: actions/upload-artifact@v3
with:
name: rootfs.cramfs
path: build-buildroot-esp32s3/images/rootfs.cramfs

- name: Upload etc.jffs2
uses: actions/upload-artifact@v3
with:
name: etc.jffs2
path: build-buildroot-esp32s3/images/etc.jffs2

- name: Upload linux-kernel to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: xipImage
asset_path: build-buildroot-esp32s3/images/xipImage

- name: Upload rootfs.cramfs to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: rootfs.cramfs
asset_path: build-buildroot-esp32s3/images/rootfs.cramfs

- name: Upload etc.jffs2 to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-binary
asset_name: etc.jffs2
asset_path: build-buildroot-esp32s3/images/etc.jffs2

- name: Upload flash-all.sh to release
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/x-sh
asset_name: flash-all.sh
asset_path: output/flash-all.sh
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
autoconf-2.71/
autoconf-2.71.tar.xz
build-buildroot-esp32s3/
output/*.bin
output/xipImage
output/rootfs.cramfs
output/etc.jffs2
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[submodule "xtensa-dynconfig"]
path = xtensa-dynconfig
url = https://github.com/jcmvbkbc/xtensa-dynconfig
branch = original
[submodule "config-esp32s3"]
path = esp32s3
url = https://github.com/jcmvbkbc/config-esp32s3
branch = master
[submodule "crosstool-NG"]
path = crosstool-NG
url = https://github.com/jcmvbkbc/crosstool-NG.git
branch = xtensa-fdpic
[submodule "buildroot"]
path = buildroot
url = https://github.com/jcmvbkbc/buildroot
branch = xtensa-2023.08-fdpic
[submodule "esp-hosted"]
path = esp-hosted
url = https://github.com/jcmvbkbc/esp-hosted
branch = ipc
[submodule "esp-idf"]
path = esp-idf
url = https://github.com/jcmvbkbc/esp-idf
branch = linux-5.0.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}"
}
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git.ignoredRepositories": [
"./esp-idf"
],
"git.autoRepositoryDetection": "openEditors"
}
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ESP32-S3 Linux Build scripts and Web Installer

This is a set of build scripts and web installer for [Linux on ESP32-S3](http://wiki.osll.ru/doku.php/etc:users:jcmvbkbc:linux-xtensa:esp32s3).

[Visit web-installer page](https://anabolyc.github.io/esp32-linux-build/)

## Disclaimer

I'm not the author of this code. [Max Filippov](https://github.com/jcmvbkbc) is. But I admired his work so much, so I decided to add by 5 cents to it. Specifically

- Added submodules for better dependencies tracking and better build stability
- Added build pipeline, so anyone would have a reference build
- Added release pipeline, so if you don't fancy building it yourself, can just pick up binaries
- Finally, added web-installer, so you can flash to your ESP32-S3 board it with no tools but modern browser

Hope that will help others to follow authors steps.

## Links

- [Docs](http://wiki.osll.ru/doku.php/etc:users:jcmvbkbc:linux-xtensa:esp32s3)
- [Write-up](https://habr.com/en/articles/736408/) (Russian)
- [Write-up](https://gojimmypi.github.io/ESP32-S3-Linux/) (English)

## Code references

- [xtensa-dynconfig](https://github.com/jcmvbkbc/xtensa-dynconfig/tree/original)
- [config-esp32s3](https://github.com/jcmvbkbc/config-esp32s3)
- [esp-idf](https://github.com/jcmvbkbc/esp-idf/tree/linux-5.0.1)
- [linux-xtensa](https://github.com/jcmvbkbc/linux-xtensa/tree/xtensa-6.4-esp32)
- [binutils-gdb-xtensa](https://github.com/jcmvbkbc/binutils-gdb-xtensa/tree/xtensa-2.40-fdpic)
- [gcc-xtensa](https://github.com/jcmvbkbc/gcc-xtensa/tree/xtensa-14-fdpic)
- [uclibc-ng-xtensa](https://github.com/jcmvbkbc/uclibc-ng-xtensa/tree/xtensa-fdpic)
- [buildroot](https://github.com/jcmvbkbc/buildroot/tree/xtensa-2023.08-fdpic)
- [crosstool-NG](https://github.com/jcmvbkbc/crosstool-NG/tree/xtensa-fdpic)

## Demo

![Screencast](/docs/img/Screencast%20from%2028.10.2023%2021:54:48.gif)
1 change: 1 addition & 0 deletions buildroot
Submodule buildroot added at 1529ad
1 change: 1 addition & 0 deletions crosstool-NG
Submodule crosstool-NG added at c29b56
22 changes: 22 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ESP32-S3 Linux Installer

This is a demo installer website for [Linux on ESP32-S3](http://wiki.osll.ru/doku.php/etc:users:jcmvbkbc:linux-xtensa:esp32s3).

[Visit web-installer page](https://anabolyc.github.io/esp32-linux-build/)

## Requirements

<ul>
<li>ESP32-S3 SoC, <a href="https://github.com/wuxx/nanoESP32-S3">this board</a> for example</li>
<li>8MB Flash (-N8)</li>
<li>8MB PSRAM (-R8)</li>
</ul>

## Notes

<p>Some boards require manual download mode triggering, by pressing resetting the board while pressing IO0 button </p>
<p>If your board has two USB ports, you might need to use both. One for flashing, other to see Linux serial output</p>

## Demo

![Screencast](img/Screencast%20from%2028.10.2023%2021:54:48.gif)
Binary file added docs/firmware/bootloader.bin
Binary file not shown.
Binary file added docs/firmware/etc.jffs2
Binary file not shown.
Binary file added docs/firmware/network_adapter.bin
Binary file not shown.
Binary file added docs/firmware/partition-table.bin
Binary file not shown.
Binary file added docs/firmware/rootfs.cramfs
Binary file not shown.
Binary file added docs/firmware/xipImage
Binary file not shown.
Binary file added docs/img/Screencast from 28.10.2023 21:54:48.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading