Skip to content

Commit 9662651

Browse files
author
Michael O'Cleirigh
committed
[esp32] Update MICROLITE_C3 board configuration
Also update ci for building esp32 MICROLITE using the new build scripts.
1 parent f57bad1 commit 9662651

25 files changed

+335
-610
lines changed

.github/workflows/build_esp32.yml

Lines changed: 70 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -2,166 +2,100 @@ name: ESP32
22

33
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
44
on:
5-
push:
65
pull_request:
7-
paths-ignore:
8-
- "examples/**"
9-
- "README.md"
10-
- "ci/*unix*.sh"
11-
- ".github/workflows/build_unix.yml"
6+
paths:
7+
- ".github/workflows/build_esp32.yml"
8+
- "micropython-modules/microlite/**"
9+
- "micropython-modules/micropython-camera-driver/**"
10+
1211

1312
jobs:
1413
tensorflow_micropython_esp32_build:
1514
runs-on: ubuntu-latest
16-
1715
steps:
1816
- name: Checkout repository
19-
uses: actions/checkout@v2
20-
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32
21-
run: |
22-
git submodule init
23-
git submodule update --recursive
24-
cd micropython
25-
git submodule update --init lib/axtls
26-
git submodule update --init lib/berkeley-db-1.xx
27-
cd ports/esp32
28-
make BOARD= submodules
29-
cd ../../..
30-
cd tflm_esp_kernels
31-
git submodule update --init components/esp32-camera
32-
git submodule update --init components/esp-nn
33-
- name: Get Cache Keys
34-
# later get this like this: git ls-remote --heads https://github.com/espressif/esp-idf
35-
# this commit is hard-coded in micropython/tools/ci.sh
36-
run: |
37-
IDF_COMMIT=142bb32c50fa9875b8b69fa539a2d59559460d72
38-
echo "esp-idf-commit=$IDF_COMMIT" >> $GITHUB_ENV
39-
TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}')
40-
echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV
41-
# - name: Cache esp-idf
42-
# id: cache-esp-idf
43-
# uses: actions/cache@v2
44-
# env:
45-
# cache-name: cache-esp-idf
46-
# with:
47-
# path: ./esp-idf
48-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.esp-idf-commit }}
49-
- name: Setup IDF
50-
# if: steps.cache-esp-idf.outputs.cache-hit != 'true'
51-
run: |
52-
source ./micropython/tools/ci.sh && ci_esp32_idf50_setup
53-
- name: Cache tflm
54-
id: cache-tflm
55-
uses: actions/cache@v2
56-
env:
57-
cache-name: cache-tflm
58-
with:
59-
path: ./micropython-modules/microlite/tflm
60-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tflm-commit }}
61-
- name: Setup Build for Tensorflow
62-
# if: steps.cache-tflm.outputs.cache-hit != 'true'
63-
run: |
17+
uses: actions/checkout@v4
6418

65-
source ./esp-idf/export.sh
66-
67-
pip3 install Pillow
68-
pip3 install Wave
69-
70-
echo "Regenerating microlite/tfm directory"
71-
rm -rf ./micropython-modules/microlite/tflm
72-
73-
cd ./tensorflow
74-
75-
../micropython-modules/microlite/prepare-tflm-esp.sh
76-
77-
- name: Build micropython cross compiler
19+
- name: Build ESP32-MICROLITE No SPIRAM - 4MB Flash
7820
run: |
79-
source ./esp-idf/export.sh
80-
cd ./micropython
81-
echo "make -C mpy-cross V=1 clean all"
82-
make -C mpy-cross V=1 clean all
83-
84-
- name: Build standard non-psram 4MB Flash firmware
85-
run: |
86-
source ./esp-idf/export.sh
87-
88-
echo "cd ./boards/esp32/MICROLITE"
89-
cd ./boards/esp32/MICROLITE
90-
91-
echo "Building MICROLITE"
92-
rm -rf builds
93-
idf.py clean build
94-
95-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
96-
../../../micropython/ports/esp32
97-
98-
- name: Archive ESP32-MICROLITE firmware
99-
uses: actions/upload-artifact@v2
21+
mv * ..
22+
cd ..
23+
source ./scripts/build.sh && prepare_dependencies
24+
source ./dependencies/micropython/tools/ci.sh && ci_esp32_idf50_setup
25+
echo "BUILDING MICROLITE"
26+
source ./scripts/build.sh && build_esp32 "MICROLITE"
27+
TARGET=$(pwd)/dependencies/micropython/ports/esp32
28+
echo "TARGET=$TARGET"
29+
./scripts/assemble-unified-image-esp.sh $TARGET "MICROLITE"
30+
ls $TARGET/build-MICROLITE
31+
shell: bash
32+
33+
- name: Archive ESP32-MICROLITE No SPIRAM - 4 MB Flash firmware
34+
uses: actions/upload-artifact@v3
10035
with:
10136
name: microlite-esp32-firmware
102-
path: |
103-
boards/esp32/MICROLITE/build/firmware.bin
37+
path: /home/runner/work/tensorflow-micropython-examples/dependencies/micropython/ports/esp32/build-MICROLITE/firmware.bin
10438

105-
- name: Build with psram support and 16MB Flash firmware
106-
run: |
107-
source ./esp-idf/export.sh
39+
# - name: Build with psram support and 16MB Flash firmware
40+
# run: |
41+
# source ./esp-idf/export.sh
10842

109-
echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M"
110-
cd ./boards/esp32/MICROLITE_SPIRAM_16M
43+
# echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M"
44+
# cd ./boards/esp32/MICROLITE_SPIRAM_16M
11145

112-
echo "Building MICROLITE_SPIRAM_16M"
113-
rm -rf build
114-
idf.py clean build
46+
# echo "Building MICROLITE_SPIRAM_16M"
47+
# rm -rf build
48+
# idf.py clean build
11549

116-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
117-
../../../micropython/ports/esp32
50+
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
51+
# ../../../micropython/ports/esp32
11852

119-
- name: Archive ESP32-MICROLITE-SPIRAM-16M firmware
120-
uses: actions/upload-artifact@v2
121-
with:
122-
name: microlite-spiram-16m-esp32-firmware
123-
path: |
124-
boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin
53+
# - name: Archive ESP32-MICROLITE-SPIRAM-16M firmware
54+
# uses: actions/upload-artifact@v2
55+
# with:
56+
# name: microlite-spiram-16m-esp32-firmware
57+
# path: |
58+
# boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin
12559

126-
- name: Build with psram support
127-
run: |
128-
source ./esp-idf/export.sh
60+
# - name: Build with psram support
61+
# run: |
62+
# source ./esp-idf/export.sh
12963

130-
echo "cd ./boards/esp32/MICROLITE_SPIRAM"
131-
cd ./boards/esp32/MICROLITE_SPIRAM
64+
# echo "cd ./boards/esp32/MICROLITE_SPIRAM"
65+
# cd ./boards/esp32/MICROLITE_SPIRAM
13266

133-
echo "Building MICROLITE_SPIRAM"
134-
rm -rf build
135-
idf.py clean build
67+
# echo "Building MICROLITE_SPIRAM"
68+
# rm -rf build
69+
# idf.py clean build
13670

137-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
138-
../../../micropython/ports/esp32
71+
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
72+
# ../../../micropython/ports/esp32
13973

140-
- name: Archive ESP32-MICROLITE-SPIRAM firmware
141-
uses: actions/upload-artifact@v2
142-
with:
143-
name: microlite-spiram-esp32-firmware
144-
path: |
145-
boards/esp32/MICROLITE_SPIRAM/build/firmware.bin
74+
# - name: Archive ESP32-MICROLITE-SPIRAM firmware
75+
# uses: actions/upload-artifact@v2
76+
# with:
77+
# name: microlite-spiram-esp32-firmware
78+
# path: |
79+
# boards/esp32/MICROLITE_SPIRAM/build/firmware.bin
14680

147-
- name: Build MICROLITE_SPIRAM_CAM
148-
run: |
81+
# - name: Build MICROLITE_SPIRAM_CAM
82+
# run: |
14983

150-
source ./esp-idf/export.sh
84+
# source ./esp-idf/export.sh
15185

152-
echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM"
153-
cd ./boards/esp32/MICROLITE_SPIRAM_CAM
86+
# echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM"
87+
# cd ./boards/esp32/MICROLITE_SPIRAM_CAM
15488

155-
echo "Building MICROLITE_SPIRAM_CAM"
156-
rm -rf builds
157-
idf.py clean build
89+
# echo "Building MICROLITE_SPIRAM_CAM"
90+
# rm -rf builds
91+
# idf.py clean build
15892

159-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
160-
../../../micropython/ports/esp32
93+
# ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
94+
# ../../../micropython/ports/esp32
16195

162-
- name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware
163-
uses: actions/upload-artifact@v2
164-
with:
165-
name: microlite-spiram-cam-esp32-firmware
166-
path: |
167-
boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin
96+
# - name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware
97+
# uses: actions/upload-artifact@v2
98+
# with:
99+
# name: microlite-spiram-cam-esp32-firmware
100+
# path: |
101+
# boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin

.github/workflows/build_esp32c3.yml

Lines changed: 23 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2,125 +2,35 @@ name: ESP32 C3
22

33
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
44
on:
5-
push:
65
pull_request:
7-
paths-ignore:
8-
- "examples/**"
9-
- "README.md"
10-
- "ci/*unix*.sh"
11-
- ".github/workflows/build_unix.yml"
6+
paths:
7+
- '.github/workflows/build_esp32c3.yml'
8+
- "micropython-modules/microlite/**"
9+
- "micropython-modules/micropython-camera-driver/**"
1210

1311
jobs:
14-
tensorflow_micropython_esp32_c3_build:
12+
tensorflow_micropython_esp32c3_build:
1513
runs-on: ubuntu-latest
16-
1714
steps:
1815
- name: Checkout repository
19-
uses: actions/checkout@v2
20-
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32
21-
run: |
22-
git submodule init
23-
git submodule update --recursive
24-
cd micropython
25-
git submodule update --init lib/axtls
26-
git submodule update --init lib/berkeley-db-1.xx
27-
cd ports/esp32
28-
make BOARD= submodules
29-
cd ../../..
30-
cd tflm_esp_kernels
31-
git submodule update --init components/esp32-camera
32-
git submodule update --init components/esp-nn
33-
- name: Get Cache Keys
34-
# later get this like this: git ls-remote --heads https://github.com/espressif/esp-idf
35-
# this commit is hard-coded in micropython/tools/ci.sh
36-
run: |
37-
IDF_COMMIT=142bb32c50fa9875b8b69fa539a2d59559460d72
38-
echo "esp-idf-commit=$IDF_COMMIT" >> $GITHUB_ENV
39-
TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}')
40-
echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV
41-
# - name: Cache esp-idf
42-
# id: cache-esp-idf
43-
# uses: actions/cache@v2
44-
# env:
45-
# cache-name: cache-esp-idf
46-
# with:
47-
# path: ./esp-idf
48-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.esp-idf-commit }}
49-
- name: Setup IDF
50-
# if: steps.cache-esp-idf.outputs.cache-hit != 'true'
51-
run: |
52-
source ./micropython/tools/ci.sh && ci_esp32_idf44_setup
53-
- name: Cache tflm
54-
id: cache-tflm
55-
uses: actions/cache@v2
56-
env:
57-
cache-name: cache-tflm
58-
with:
59-
path: ./micropython-modules/microlite/tflm
60-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tflm-commit }}
61-
- name: Setup Build for Tensorflow
62-
# if: steps.cache-tflm.outputs.cache-hit != 'true'
63-
run: |
64-
65-
source ./esp-idf/export.sh
66-
67-
pip3 install Pillow
68-
pip3 install Wave
69-
70-
echo "Regenerating microlite/tfm directory"
71-
rm -rf ./micropython-modules/microlite/tflm
72-
73-
cd ./tensorflow
74-
75-
../micropython-modules/microlite/prepare-tflm-esp.sh
76-
77-
- name: Build micropython cross compiler
78-
run: |
79-
source ./esp-idf/export.sh
80-
cd ./micropython
81-
echo "make -C mpy-cross V=1 clean all"
82-
make -C mpy-cross V=1 clean all
16+
uses: actions/checkout@v4
8317

84-
- name: Build ESP32-MICROLITE_C3
18+
- name: Build ESP32 MICROLITE_C3 No SPIRAM - 4MB Flash
8519
run: |
86-
87-
source ./esp-idf/export.sh
88-
89-
echo "cd ./boards/esp32/MICROLITE_C3"
90-
cd ./boards/esp32/MICROLITE_C3
91-
92-
echo "Building ESP32-MICROLITE_C3"
93-
rm -rf builds
94-
idf.py clean build
95-
96-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
97-
../../../micropython/ports/esp32
98-
99-
- name: Archive ESP32-MICROLITE_C3 firmware
100-
uses: actions/upload-artifact@v2
101-
with:
102-
name: microlite-esp32c3-firmware
103-
path: |
104-
boards/esp32/MICROLITE_C3/build/firmware.bin
105-
106-
- name: Build ESP32-MICROLITE_C3_USB
107-
run: |
108-
109-
source ./esp-idf/export.sh
110-
111-
echo "cd ./boards/esp32/MICROLITE_C3_USB"
112-
cd ./boards/esp32/MICROLITE_C3_USB
113-
114-
echo "Building ESP32 MICROLITE_C3_USB"
115-
rm -rf builds
116-
idf.py clean build
117-
118-
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
119-
../../../micropython/ports/esp32
120-
121-
- name: Archive ESP32-MICROLITE_C3_USB firmware
122-
uses: actions/upload-artifact@v2
20+
mv * ..
21+
cd ..
22+
source ./scripts/build.sh && prepare_dependencies
23+
source ./dependencies/micropython/tools/ci.sh && ci_esp32_idf50_setup
24+
echo "BUILDING MICROLITE_C3"
25+
source ./scripts/build.sh && build_esp32 "MICROLITE_C3"
26+
TARGET=$(pwd)/dependencies/micropython/ports/esp32
27+
echo "TARGET=$TARGET"
28+
./scripts/assemble-unified-image-esp.sh $TARGET "MICROLITE_C3"
29+
ls $TARGET/build-MICROLITE_C3
30+
shell: bash
31+
32+
- name: Archive ESP32-MICROLITE_C3 No SPIRAM - 4 MB Flash firmware
33+
uses: actions/upload-artifact@v3
12334
with:
124-
name: microlite-esp32c3-usb-firmware
125-
path: |
126-
boards/esp32/MICROLITE_C3_USB/build/firmware.bin
35+
name: microlite-esp32-firmware
36+
path: /home/runner/work/tensorflow-micropython-examples/dependencies/micropython/ports/esp32/build-MICROLITE_C3/firmware.bin

0 commit comments

Comments
 (0)