rp2: Add support for building different board configurations.

This change allows to build firmware for different rp2-based boards,
following how it is done in other ports like stm32 and esp32.  So far only
the original Pico and Adafruit Feather RP2040 are added.  Board names
should match (sans case) those in pico-sdk/src/boards/include/boards/.

Usage: Pico firmware can be build either using make as previously (it is
the default board) or by `make BOARD=PICO`.  Feather is built by `make
BOARD=ADAFRUIT_FEATHER_RP2040`.  Only the board name and flash drive size
is set, pin definition is taken from the appropriate pico-sdk board
definition.  Firmware is saved in the directory build-BOARD_NAME.
This commit is contained in:
jahr
2021-04-05 22:57:18 +02:00
committed by Damien George
parent 1be74b94b6
commit 7ca686684e
7 changed files with 39 additions and 3 deletions

View File

@@ -2,11 +2,13 @@
#
# This is a simple wrapper around cmake
BUILD = build
BOARD ?= PICO
BUILD ?= build-$(BOARD)
$(VERBOSE)MAKESILENT = -s
CMAKE_ARGS =
CMAKE_ARGS = -DMICROPY_BOARD=$(BOARD)
ifdef USER_C_MODULES
CMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}