rp2: Use uppercase variant names.

This is to support a future change to add the variant name to the build
directory and therefore should be the same style as the board name.

This only affects the WEACTSTUDIO board. Also standardises on a convention
for naming flash-size variants. Normally we would write e.g. 2MiB, but in
uppercase, it's awkward to write 2MIB, so instead use 2M, 512K, etc for
variant names, but use 2MiB when not constrained by case (e.g. a regular
filename).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2023-08-15 23:12:57 +10:00
parent b5836e7252
commit 45845acf6d
7 changed files with 14 additions and 17 deletions

View File

@ -9,18 +9,15 @@ repository containing information on the board.
## Build notes
Builds can be configured with the `BOARD_VARIANT` parameter. Valid variants
can be displayed with the `query-variant` target. An example:
By default the firmware supports boards with 16MiB flash. This can be
configured using the `BOARD_VARIANT` parameter. The valid options are
`FLASH_2M`, 'FLASH_4M', and 'FLASH_8M'.
```bash
> cd ports/rp2
> make BOARD=WEACTSTUDIO query-variants
VARIANTS: flash_2mb flash_4mb flash_8mb flash_16mb
> make BOARD=WEACTSTUDIO BOARD_VARIANT=flash_8mb submodules all # Build the 8 MiB variant
> make BOARD=WEACTSTUDIO BOARD_VARIANT=FLASH_8M submodules all # Build the 8 MiB variant
```
`flash_16mb` is the default if `BOARD_VARIANT` is not supplied.
## Board-specific modules
The `board` module contains definitions for the onboard LED and user button.

View File

@ -15,9 +15,9 @@
"product": "WeAct Studio RP2040",
"url": "https://github.com/WeActTC/WeActStudio.RP2040CoreBoard",
"variants": {
"flash_2mb": "2 MiB Flash",
"flash_4mb": "4 MiB Flash",
"flash_8mb": "8 MiB Flash"
"FLASH_2MB": "2 MiB Flash",
"FLASH_4MB": "4 MiB Flash",
"FLASH_8MB": "8 MiB Flash"
},
"vendor": "WeAct"
}

View File

@ -8,17 +8,17 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR})
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
# Select the 16MB variant as the default
set(PICO_BOARD "weactstudio_16mb")
set(PICO_BOARD "weactstudio_16MiB")
# Provide different variants for the downloads page
if(MICROPY_BOARD_VARIANT STREQUAL "flash_2mb")
set(PICO_BOARD "weactstudio_2mb")
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_2M")
set(PICO_BOARD "weactstudio_2MiB")
endif()
if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb")
set(PICO_BOARD "weactstudio_4mb")
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_4M")
set(PICO_BOARD "weactstudio_4MiB")
endif()
if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb")
set(PICO_BOARD "weactstudio_8mb")
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_8M")
set(PICO_BOARD "weactstudio_8MiB")
endif()