Skip to content

Create OpenCV Board Variants #29

@sfe-SparkFro

Description

@sfe-SparkFro

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions