-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Because OpenCV adds ~3MB to the firmware size, any ports that require the storage size to be manually specified (eg. rp2
) need to have variants defined that reduce the storage size to avoid it overlapping with the firmware (causes all kinds of fun problems!).
The current automated firmware build doesn't handle this properly. I have some local changes that fix this, which should be committed to the public MicroPython repo closer to launch, in case it catches attention.
For example, with the XRP Controller, create mpconfigvariant_OPENCV.cmake
:
list(APPEND MICROPY_DEF_BOARD
# Board name
"MICROPY_HW_BOARD_NAME=\"SparkFun XRP Controller (OpenCV)\""
# 8MB (8 * 1024 * 1024)
"MICROPY_HW_FLASH_STORAGE_BYTES=8388608"
)
Then add #ifndef
wrappers in mpconfigboard.h
for MICROPY_HW_BOARD_NAME
and MICROPY_HW_FLASH_STORAGE_BYTES
so the variant can build properly.
After board variants have been defined, Makefile
should have the following added:
# Ensure we're building the OpenCV board variant
MAKE_ARGS += BOARD_VARIANT=OPENCV
And under clean:
and submodules:
, $(MAKE_ARGS)
should be added so the correct directory is selected for those operations.