Skip to content

Commit 26925da

Browse files
committed
Fix build workflow
update to increase factory partition size for sparkfun iot redboard Uncomment redvision submodule update Misc fixes to redvision build script
1 parent 27bab25 commit 26925da

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

.github/workflows/ports_sparkfun.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
defaults:
1515
run:
16-
working-directory: 'micropython repo'
16+
working-directory: 'micropython'
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
20-
path: 'micropython repo'
20+
path: 'micropython'
2121
- name: Install RP2 package
2222
run: source tools/ci.sh && ci_rp2_setup
2323
# - name: Install mimxrt package # Currently redundant since it does the same arm setup as rp2, but in future if these diverge, uncomment this...
@@ -34,7 +34,7 @@ jobs:
3434
- name: Upload Release Assets
3535
uses: shogo82148/actions-upload-release-asset@v1
3636
with:
37-
asset_path: "micropython repo/sparkfun_release/*"
37+
asset_path: "micropython/sparkfun_release/*"
3838
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
upload_url: ${{ github.event.release.upload_url }}
4040

ports/esp32/boards/SPARKFUN_IOT_REDBOARD_ESP32/mpconfigboard.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set(SDKCONFIG_DEFAULTS
22
boards/sdkconfig.base
33
boards/sdkconfig.ble
44
boards/sdkconfig.240mhz
5+
boards/SPARKFUN_IOT_REDBOARD_ESP32/sdkconfig.base-sparkfun-plus
56
)
67

78
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Use the base "plus" paritition table - for larger images
2+
CONFIG_PARTITION_TABLE_CUSTOM=y
3+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiBplusplus.csv"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This partition table is for devices with 4MiB or more of flash.
2+
# The first 2MiB is used for bootloader, nvs, phy_init and firmware.
3+
# The remaining flash is for the user filesystem(s).
4+
5+
# Notes: the offset of the partition table itself is set in
6+
# $IDF_PATH/components/partition_table/Kconfig.projbuild.
7+
# Name, Type, SubType, Offset, Size, Flags
8+
nvs, data, nvs, 0x9000, 0x6000,
9+
phy_init, data, phy, 0xf000, 0x1000,
10+
factory, app, factory, 0x10000, 0x1FF000,

sparkfun_build.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,23 @@ function build_for_port {
151151
fi
152152
echo "Building $(basename $board)"
153153

154+
# Construct make arguments
154155
BOARD_TO_BUILD=${SPARKFUN_PREFIX}${board#$SPARKFUN_BOARD_PREFIX}
155-
make ${MAKEOPTS} -C ports/${TARGET_PORT_NAME} BOARD=$BOARD_TO_BUILD BOARD_VARIANT=$BOARD_VARIANT FROZEN_MANIFEST=$FROZEN_MANIFEST USER_C_MODULES=$USER_C_MODULES clean
156-
make ${MAKEOPTS} -C ports/${TARGET_PORT_NAME} BOARD=$BOARD_TO_BUILD BOARD_VARIANT=$BOARD_VARIANT FROZEN_MANIFEST=$FROZEN_MANIFEST USER_C_MODULES=$USER_C_MODULES submodules
157-
make ${MAKEOPTS} -C ports/${TARGET_PORT_NAME} BOARD=$BOARD_TO_BUILD BOARD_VARIANT=$BOARD_VARIANT FROZEN_MANIFEST=$FROZEN_MANIFEST USER_C_MODULES=$USER_C_MODULES
156+
MAKE_ARGS="-C ports/${TARGET_PORT_NAME} BOARD=$BOARD_TO_BUILD"
157+
if [ -n "$BOARD_VARIANT" ]; then
158+
MAKE_ARGS+=" BOARD_VARIANT=${BOARD_VARIANT}"
159+
fi
160+
if [ -n "$FROZEN_MANIFEST" ]; then
161+
MAKE_ARGS+=" FROZEN_MANIFEST=${FROZEN_MANIFEST}"
162+
fi
163+
if [ -n "$USER_C_MODULES" ]; then
164+
MAKE_ARGS+=" USER_C_MODULES=${USER_C_MODULES}"
165+
fi
166+
echo "MAKE_ARGS: ${MAKE_ARGS}"
167+
168+
make ${MAKE_ARGS} ${MAKEOPTS} clean
169+
make ${MAKE_ARGS} ${MAKEOPTS} submodules
170+
make ${MAKE_ARGS} ${MAKEOPTS}
158171
done
159172
}
160173

@@ -302,17 +315,23 @@ function build_micropython_red_vision_rp2 {
302315
# https://stackoverflow.com/a/246128/4783963
303316
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
304317
if [ -n "$GITHUB_WORKSPACE" ]; then
305-
export PICO_SDK_PATH="$GITHUB_WORKSPACE/lib/pico-sdk"
318+
export PICO_SDK_PATH="$GITHUB_WORKSPACE/micropython/lib/pico-sdk"
306319
else
307320
export PICO_SDK_PATH="$SCRIPT_DIR/lib/pico-sdk"
308321
fi
309322

310323
# Clone the Red Vision submodule
311-
# git submodule update --init --recursive lib/red_vision
324+
git submodule update --init --recursive lib/red_vision
325+
326+
# Clone the Pico SDK submodule
327+
git submodule update --init --recursive lib/pico-sdk
312328

313329
# Build OpenCV
314330
make -C lib/red_vision/micropython-opencv PLATFORM=rp2350 --no-print-directory ${MAKEOPTS}
315331

332+
# install freezefs if not already installed
333+
pip install freezefs
334+
316335
# Archive the examples directory
317336
python3 -m freezefs lib/red_vision/red_vision_examples lib/red_vision/extract_red_vision_examples.py --on-import=extract --compress --overwrite always
318337

@@ -420,7 +439,7 @@ function build_sparkfun {
420439
# Copy all mimxrt teensy binary files to the output directory
421440
copy_all_for_prefix ${OUTPUT_DIRECTORY} "ports/mimxrt" "build-TEENSY" "firmware" "elf" "${OUTPUT_FILE_PREFIX}TEENSY_" true
422441

423-
Remove all builds to prepare for Red Vision build
442+
# Remove all builds to prepare for Red Vision build
424443
delete_build_directories_for_port esp32
425444
delete_build_directories_for_port rp2
426445
delete_build_directories_for_port mimxrt

0 commit comments

Comments
 (0)