boards/fwk_keyboard: Reduce firmware size to below 500KB

Memory region         Used Size  Region Size  %age Used
  FLASH_FIRMWARE:      472304 B       512 KB     90.08%
             RAM:       45952 B       256 KB     17.53%
       SCRATCH_Y:          0 GB         4 KB      0.00%
       SCRATCH_X:          2 KB         4 KB     50.00%

Signed-off-by: Daniel Schaefer <dhs@frame.work>
This commit is contained in:
Daniel Schaefer 2023-08-02 12:07:04 +08:00
parent 6f4d131fc9
commit 74e9ee1d14
2 changed files with 51 additions and 20 deletions

View File

@ -1,26 +1,6 @@
#define MICROPY_HW_BOARD_NAME "Framework Laptop 16 Keyboard (CircuitPython)"
#define MICROPY_HW_MCU_NAME "rp2040"
//#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
// External flash W25Q80DV
#define EXTERNAL_FLASH_QSPI_DUAL
#if QSPI_FLASH_FILESYSTEM
//#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 00)
//#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
//#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
//#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23)
//#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19)
//#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20)
#endif
#define CIRCUITPY_DRIVE_LABEL "CIRCUITPY"
#define CIRCUITPY_BOOT_COUNTER 1
#define FLASH_SIZE (0x100000)
#define FLASH_PAGE_SIZE (0x4000)
#define BOARD_HAS_CRYSTAL 1
#define CIRCUITPY_BOARD_I2C (1)
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO27, .sda = &pin_GPIO26}}
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO27)

View File

@ -11,3 +11,54 @@ QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q80DV"
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IS31FL3731
# Flash is only 1M, reduce firmware to half, so there's space for the CIRCUITPY drive
# Must be accompanied by a linker script change
CFLAGS += -DCIRCUITPY_FIRMWARE_SIZE='(512 * 1024)'
#CIRCUITPY_DISPLAULAB_HAS_USER_MODULEYIO = 1
CIRCUITPY_TOUCHIO = 1
#CIRCUITPY_PWMIO = 1
# Boards hav limited IO, only
# - IS31FL3741/IS31FL3731 LED matrix
# - USB 2.0
# - PWM backlight
# - Capslock LED
#CIRCUITPY_ANALOGIO = 0 # TODO: Might want this
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOBUSIO_I2SOUT = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_AUDIOMIXER = 0
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_AUDIOPWMIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RAINBOWIO = 0
CIRCUITPY_BLEIO_HCI=0
CIRCUITPY_BLEIO=0
CIRCUITPY_PS2IO = 0
CIRCUITPY_MSGPACK = 0
CIRCUITPY_RTC = 1
CIRCUITPY_FRAMEBUFFERIO = 0 # TODO: Might want this
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_TERMINALIO = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_ULAB = 0 # Like numpy for circuitpython
CIRCUITPY_USB_MIDI=0
#CIRCUITPY_BITBANG_APA102 = 0
#CIRCUITPY_BITBANGIO = 1 # Need for I2C
#CIRCUITPY_BITMAPTOOLS = 0
#CIRCUITPY_BUSDEVICE = 1 # TODO: What's this?
#CIRCUITPY_FREQUENCYIO = 0
#CIRCUITPY_I2CTARGET = 1
#CIRCUITPY_NEOPIXEL_WRITE = 0
#CIRCUITPY_NVM = 0
#CIRCUITPY_PIXELBUF = 0
#CIRCUITPY_PULSEIO = 0
#CIRCUITPY_RGBMATRIX = 0
#CIRCUITPY_SAMD = 0
#CIRCUITPY_USB_HID = 0 # TODO: Might want this
#CIRCUITPY_USB_VENDOR = 0 # TODO: Might want this