-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[esp32] Update MICROLITE_C3 board configuration
Also update ci for building esp32 MICROLITE using the new build scripts.
- Loading branch information
Michael O'Cleirigh
committed
Sep 9, 2023
1 parent
f57bad1
commit 7e6e0ac
Showing
18 changed files
with
152 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,164 +4,131 @@ name: ESP32 | |
on: | ||
push: | ||
pull_request: | ||
paths-ignore: | ||
- "examples/**" | ||
- "README.md" | ||
- "ci/*unix*.sh" | ||
- ".github/workflows/build_unix.yml" | ||
paths: | ||
- ".github/workflows/build_esp32.yml" | ||
- "micropython-modules/microlite/**" | ||
- "micropython-modules/micropython-camera-driver/**" | ||
|
||
|
||
jobs: | ||
tensorflow_micropython_esp32_build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32 | ||
run: | | ||
git submodule init | ||
git submodule update --recursive | ||
cd micropython | ||
git submodule update --init lib/axtls | ||
git submodule update --init lib/berkeley-db-1.xx | ||
cd ports/esp32 | ||
make BOARD= submodules | ||
cd ../../.. | ||
cd tflm_esp_kernels | ||
git submodule update --init components/esp32-camera | ||
git submodule update --init components/esp-nn | ||
- name: Get Cache Keys | ||
# later get this like this: git ls-remote --heads https://github.com/espressif/esp-idf | ||
# this commit is hard-coded in micropython/tools/ci.sh | ||
run: | | ||
IDF_COMMIT=142bb32c50fa9875b8b69fa539a2d59559460d72 | ||
echo "esp-idf-commit=$IDF_COMMIT" >> $GITHUB_ENV | ||
TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}') | ||
echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV | ||
# - name: Cache esp-idf | ||
# id: cache-esp-idf | ||
# uses: actions/cache@v2 | ||
# env: | ||
# cache-name: cache-esp-idf | ||
# with: | ||
# path: ./esp-idf | ||
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.esp-idf-commit }} | ||
- name: Setup IDF | ||
# if: steps.cache-esp-idf.outputs.cache-hit != 'true' | ||
run: | | ||
source ./micropython/tools/ci.sh && ci_esp32_idf50_setup | ||
- name: Cache tflm | ||
id: cache-tflm | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-tflm | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Setup cmake | ||
uses: jwlawson/[email protected] | ||
with: | ||
path: ./micropython-modules/microlite/tflm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tflm-commit }} | ||
- name: Setup Build for Tensorflow | ||
# if: steps.cache-tflm.outputs.cache-hit != 'true' | ||
cmake-version: '3.18.4' | ||
- name: Get Date | ||
id: get-date | ||
run: | | ||
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | ||
shell: bash | ||
# - uses: actions/cache@v3 | ||
# id: cache | ||
# with: | ||
# path: | | ||
# dependencies/** | ||
# esp-idf/** | ||
# key: ${{ steps.get-date.outputs.date }} | ||
|
||
source ./esp-idf/export.sh | ||
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32 | ||
# if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
python --version | ||
cmake --version | ||
pip3 install Pillow | ||
pip3 install Wave | ||
echo "Regenerating microlite/tfm directory" | ||
rm -rf ./micropython-modules/microlite/tflm | ||
cd ./tensorflow | ||
../micropython-modules/microlite/prepare-tflm-esp.sh | ||
- name: Build micropython cross compiler | ||
run: | | ||
source ./scripts/build.sh && prepare_dependencies | ||
source ./dependencies/micropython/tools/ci.sh && ci_esp32_idf50_setup | ||
source ./esp-idf/export.sh | ||
cd ./micropython | ||
echo "make -C mpy-cross V=1 clean all" | ||
make -C mpy-cross V=1 clean all | ||
- name: Build standard non-psram 4MB Flash firmware | ||
run: | | ||
source ./esp-idf/export.sh | ||
echo "cd ./boards/esp32/MICROLITE" | ||
cd ./boards/esp32/MICROLITE | ||
echo "Building MICROLITE" | ||
rm -rf builds | ||
idf.py clean build | ||
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
../../../micropython/ports/esp32 | ||
echo "BUILDING MICROLITE" | ||
source ./scripts/build.sh && build_esp32 "MICROLITE" | ||
./scripts/assemble-unified-image-esp.sh ./dependencies/micropython "MICROLITE" | ||
shell: bash | ||
|
||
# - name: Build standard non-psram 4MB Flash firmware | ||
# run: | | ||
# pip3 install Pillow | ||
# pip3 install Wave | ||
# rm -rf ./dependencies/micropython/ports/esp32/build-MICROLITE | ||
# source ./esp-idf/export.sh | ||
# source ./scripts/build.sh && build_esp32 "MICROLITE" | ||
# ./scripts/assemble-unified-image-esp.sh ./dependencies/micropython/ports/esp32 "MICROLITE" | ||
# shell: bash | ||
|
||
- name: Archive ESP32-MICROLITE firmware | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: microlite-esp32-firmware | ||
path: | | ||
boards/esp32/MICROLITE/build/firmware.bin | ||
dependencies/micropython/build-MICROLITE/firmware.bin | ||
- name: Build with psram support and 16MB Flash firmware | ||
run: | | ||
source ./esp-idf/export.sh | ||
# - name: Build with psram support and 16MB Flash firmware | ||
# run: | | ||
# source ./esp-idf/export.sh | ||
|
||
echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M" | ||
cd ./boards/esp32/MICROLITE_SPIRAM_16M | ||
# echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M" | ||
# cd ./boards/esp32/MICROLITE_SPIRAM_16M | ||
|
||
echo "Building MICROLITE_SPIRAM_16M" | ||
rm -rf build | ||
idf.py clean build | ||
# echo "Building MICROLITE_SPIRAM_16M" | ||
# rm -rf build | ||
# idf.py clean build | ||
|
||
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
../../../micropython/ports/esp32 | ||
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
# ../../../micropython/ports/esp32 | ||
|
||
- name: Archive ESP32-MICROLITE-SPIRAM-16M firmware | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: microlite-spiram-16m-esp32-firmware | ||
path: | | ||
boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin | ||
# - name: Archive ESP32-MICROLITE-SPIRAM-16M firmware | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: microlite-spiram-16m-esp32-firmware | ||
# path: | | ||
# boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin | ||
|
||
- name: Build with psram support | ||
run: | | ||
source ./esp-idf/export.sh | ||
# - name: Build with psram support | ||
# run: | | ||
# source ./esp-idf/export.sh | ||
|
||
echo "cd ./boards/esp32/MICROLITE_SPIRAM" | ||
cd ./boards/esp32/MICROLITE_SPIRAM | ||
# echo "cd ./boards/esp32/MICROLITE_SPIRAM" | ||
# cd ./boards/esp32/MICROLITE_SPIRAM | ||
|
||
echo "Building MICROLITE_SPIRAM" | ||
rm -rf build | ||
idf.py clean build | ||
# echo "Building MICROLITE_SPIRAM" | ||
# rm -rf build | ||
# idf.py clean build | ||
|
||
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
../../../micropython/ports/esp32 | ||
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
# ../../../micropython/ports/esp32 | ||
|
||
- name: Archive ESP32-MICROLITE-SPIRAM firmware | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: microlite-spiram-esp32-firmware | ||
path: | | ||
boards/esp32/MICROLITE_SPIRAM/build/firmware.bin | ||
# - name: Archive ESP32-MICROLITE-SPIRAM firmware | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: microlite-spiram-esp32-firmware | ||
# path: | | ||
# boards/esp32/MICROLITE_SPIRAM/build/firmware.bin | ||
|
||
- name: Build MICROLITE_SPIRAM_CAM | ||
run: | | ||
# - name: Build MICROLITE_SPIRAM_CAM | ||
# run: | | ||
|
||
source ./esp-idf/export.sh | ||
# source ./esp-idf/export.sh | ||
|
||
echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM" | ||
cd ./boards/esp32/MICROLITE_SPIRAM_CAM | ||
# echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM" | ||
# cd ./boards/esp32/MICROLITE_SPIRAM_CAM | ||
|
||
echo "Building MICROLITE_SPIRAM_CAM" | ||
rm -rf builds | ||
idf.py clean build | ||
# echo "Building MICROLITE_SPIRAM_CAM" | ||
# rm -rf builds | ||
# idf.py clean build | ||
|
||
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
../../../micropython/ports/esp32 | ||
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ | ||
# ../../../micropython/ports/esp32 | ||
|
||
- name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: microlite-spiram-cam-esp32-firmware | ||
path: | | ||
boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin | ||
# - name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: microlite-spiram-cam-esp32-firmware | ||
# path: | | ||
# boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The following files are firmware images that should work on most | ||
ESP32-C3-based boards with 4MiB of flash, including WROOM and MINI modules, | ||
that use the revision 3 silicon (or newer). | ||
|
||
USB serial/JTAG support is enabled on pin 18 and 19. Note that this | ||
is not a full USB stack, the C3 just provides a CDC/ACM class serial | ||
and JTAG interface. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
set (IDF_TARGET esp32c3) | ||
set(IDF_TARGET esp32c3) | ||
|
||
set(SDKCONFIG_DEFAULTS | ||
${MICROPY_PORT_DIR}/boards/sdkconfig.base | ||
${MICROPY_PORT_DIR}/boards/sdkconfig.ble | ||
${MICROPY_BOARD_DIR}/sdkconfig.partition | ||
|
||
boards/sdkconfig.base | ||
boards/sdkconfig.ble | ||
boards/ESP32_GENERIC_C3/sdkconfig.c3usb | ||
../../../../boards/esp32/MICROLITE_C3/sdkconfig.partition | ||
) | ||
|
||
message (STATUS "mpconfigboard.cmake: PROJECT_DIR=${PROJECT_DIR}") | ||
|
||
set(USER_C_MODULES | ||
${PROJECT_DIR}/micropython-modules/micropython.cmake | ||
${CMAKE_CURRENT_LIST_DIR}/../../../micropython-modules/micropython.cmake | ||
) | ||
|
||
if(NOT MICROPY_FROZEN_MANIFEST) | ||
set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) | ||
endif() | ||
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../dependencies/tflite-micro-esp-examples/components/esp-tflite-micro) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash. | ||
|
||
#define MICROPY_HW_BOARD_NAME "ESP32C3 module (microlite)" | ||
#define MICROPY_HW_MCU_NAME "ESP32C3" | ||
#define MICROPY_HW_BOARD_NAME "Microlite ESP32C3 module" | ||
#define MICROPY_HW_MCU_NAME "Microlite ESP32C3" | ||
|
||
#define MICROPY_HW_ENABLE_SDCARD (0) | ||
#define MICROPY_PY_MACHINE_DAC (0) | ||
// TODO: early esp-idf's didn't support i2s. check if this still applies | ||
#define MICROPY_PY_MACHINE_I2S (0) | ||
|
||
// Enable UART REPL for modules that have an external USB-UART and don't use native USB. | ||
#define MICROPY_HW_ENABLE_UART_REPL (1) |
Oops, something went wrong.