-
Notifications
You must be signed in to change notification settings - Fork 88
261 lines (223 loc) · 10.6 KB
/
build_rp2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
name: RP2
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
on:
push:
paths-ignore:
- 'examples/**'
- 'README.md'
- 'ci/*unix*.sh'
- '.github/workflows/build_unix.yml'
- '.github/workflows/build_esp32.yml'
pull_request:
paths-ignore:
- 'examples/**'
- 'README.md'
- 'ci/*unix*.sh'
- '.github/workflows/build_unix.yml'
- '.github/workflows/build_esp32.yml'
jobs:
tensorflow_micropython_rp2_build:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Pillow & Wave
run: |
pip install Pillow
pip3 install Wave
- name: Checkout repository
uses: actions/checkout@v2
- name: Prepare to Build Tensorflow Micropython Firmware for RP2
run: |
git submodule init
git submodule update --recursive
cd micropython
git submodule update --init lib/pico-sdk lib/tinyusb
cd ..
- name: Get Cache Keys
run: |
TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}')
echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV
- name: Setup GCC ARM
run: |
source ./micropython/tools/ci.sh && ci_rp2_setup
# - name: Cache tflm
# id: cache-tflm
# uses: actions/cache@v2
# env:
# cache-name: cache-rp2-tflm
# 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'
run: |
echo "Regenerating microlite/tfm directory"
rm -rf ./micropython-modules/microlite/tflm
cd ./tensorflow
../micropython-modules/microlite/prepare-tflm-rp2.sh
- name: Build micropython cross compiler
run: |
cd ./micropython
make -C ports/rp2 submodules
echo "make -C mpy-cross V=1 clean all"
make -C mpy-cross V=1 clean all
- name: Build RP2
run: |
cd micropython-modules
ln -s ../micropython-ulab/code ulab
cd ../micropython
# ADAFRUIT_FEATHER_RP2040
cmake -S ports/rp2 -B build-ADAFRUIT_FEATHER_RP2040 -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=ADAFRUIT_FEATHER_RP2040 \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-ADAFRUIT_FEATHER_RP2040
make
cd ..
# ADAFRUIT_ITSYBITSY_RP2040
cmake -S ports/rp2 -B build-ADAFRUIT_ITSYBITSY_RP2040 -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=ADAFRUIT_ITSYBITSY_RP2040 \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-ADAFRUIT_ITSYBITSY_RP2040
make
cd ..
# ADAFRUIT_QTPY_RP2040
cmake -S ports/rp2 -B build-ADAFRUIT_QTPY_RP2040 -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=ADAFRUIT_QTPY_RP2040 \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-ADAFRUIT_QTPY_RP2040
make
cd ..
# PICO
cmake -S ports/rp2 -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-PICO
make
cd ..
# PIMORONI_PICOLIPO_4MB
cmake -S ports/rp2 -B build-PIMORONI_PICOLIPO_4MB -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PIMORONI_PICOLIPO_4MB \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-PIMORONI_PICOLIPO_4MB
make
cd ..
# PIMORONI_PICOLIPO_16MB
cmake -S ports/rp2 -B build-PIMORONI_PICOLIPO_16MB -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PIMORONI_PICOLIPO_16MB \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-PIMORONI_PICOLIPO_16MB
make
cd ..
# PIMORONI_TINY2040
cmake -S ports/rp2 -B build-PIMORONI_TINY2040 -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PIMORONI_TINY2040 \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-PIMORONI_TINY2040
make
cd ..
# SPARKFUN_PROMICRO
cmake -S ports/rp2 -B build-SPARKFUN_PROMICRO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=SPARKFUN_PROMICRO \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-SPARKFUN_PROMICRO
make
cd ..
# SPARKFUN_THINGPLUS
cmake -S ports/rp2 -B build-SPARKFUN_THINGPLUS -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=SPARKFUN_THINGPLUS \
-DUSER_C_MODULES=/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/micropython.cmake
cd build-SPARKFUN_THINGPLUS
make
- name: Archive ADAFRUIT_FEATHER_RP2040 firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-adafruit-feather-rp2040-firmware
path: |
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.elf
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.bin
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.dis
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.elf.map
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.hex
micropython/build-ADAFRUIT_FEATHER_RP2040/firmware.uf2
- name: Archive ADAFRUIT_ITSYBITSY_RP2040 firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-adafruit-itsybitsy-rp2040-firmware
path: |
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.elf
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.bin
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.dis
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.elf.map
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.hex
micropython/build-ADAFRUIT_ITSYBITSY_RP2040/firmware.uf2
- name: Archive ADAFRUIT_QTPY_RP2040 firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-adafruit-qtpy-rp2040-firmware
path: |
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.elf
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.bin
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.dis
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.elf.map
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.hex
micropython/build-ADAFRUIT_QTPY_RP2040/firmware.uf2
- name: Archive PICO firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-pico-firmware
path: |
micropython/build-PICO/firmware.elf
micropython/build-PICO/firmware.bin
micropython/build-PICO/firmware.dis
micropython/build-PICO/firmware.elf.map
micropython/build-PICO/firmware.hex
micropython/build-PICO/firmware.uf2
- name: Archive PIMORONI_PICOLIPO_4MB firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-pimoroni-picolipo-4mb-firmware
path: |
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.elf
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.bin
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.dis
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.elf.map
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.hex
micropython/build-PIMORONI_PICOLIPO_4MB/firmware.uf2
- name: Archive PIMORONI_PICOLIPO_16MB firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-pimoroni-picolipo-16mb-firmware
path: |
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.elf
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.bin
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.dis
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.elf.map
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.hex
micropython/build-PIMORONI_PICOLIPO_16MB/firmware.uf2
- name: Archive PIMORONI_TINY2040 firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-pimoroni-tiny2040-firmware
path: |
micropython/build-PIMORONI_TINY2040/firmware.elf
micropython/build-PIMORONI_TINY2040/firmware.bin
micropython/build-PIMORONI_TINY2040/firmware.dis
micropython/build-PIMORONI_TINY2040/firmware.elf.map
micropython/build-PIMORONI_TINY2040/firmware.hex
micropython/build-PIMORONI_TINY2040/firmware.uf2
- name: Archive SPARKFUN_PROMICRO firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-sparkfun_promicro-firmware
path: |
micropython/build-SPARKFUN_PROMICRO/firmware.elf
micropython/build-SPARKFUN_PROMICRO/firmware.bin
micropython/build-SPARKFUN_PROMICRO/firmware.dis
micropython/build-SPARKFUN_PROMICRO/firmware.elf.map
micropython/build-SPARKFUN_PROMICRO/firmware.hex
micropython/build-SPARKFUN_PROMICRO/firmware.uf2
- name: Archive SPARKFUN_THINGPLUS firmware
uses: actions/upload-artifact@v4
with:
name: microlite-rp2-sparkfun_thingplus-firmware
path: |
micropython/build-SPARKFUN_THINGPLUS/firmware.elf
micropython/build-SPARKFUN_THINGPLUS/firmware.bin
micropython/build-SPARKFUN_THINGPLUS/firmware.dis
micropython/build-SPARKFUN_THINGPLUS/firmware.elf.map
micropython/build-SPARKFUN_THINGPLUS/firmware.hex
micropython/build-SPARKFUN_THINGPLUS/firmware.uf2