From 5de52d8cf266f3f18323b8fa3ae6c878c5b3fd52 Mon Sep 17 00:00:00 2001 From: campbellsan Date: Sun, 15 May 2022 20:01:45 +0100 Subject: [PATCH] Reduce size of mpy flash filesystem to make room for lvgl (#52) * Reduce size of mpy flash filesystem to make room for lvgl * Add troubleshooting advice to RP2 ReadMe * Add troubleshooting advice to root ReadMe Co-authored-by: Derek Campbell --- README.md | 5 +++++ ports/rp2/README.md | 8 ++++++++ ports/rp2/boards/PICO/mpconfigboard.h | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f9b9b85b7..7a965601a 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,11 @@ This port uses [Micropython infrastructure for C modules](https://docs.micropyth 5. `make -j -C mpy-cross` 6. `make -j -C ports/rp2 BOARD=PICO USER_C_MODULES=../../lib/lv_bindings/bindings.cmake` +#### Troubleshooting + +If you experience unstable behaviour, it is worth checking the value of *MICROPY_HW_FLASH_STORAGE_BASE* against the value of *__flash_binary_end* from the firmware.elf.map file. +If the storage base is lower than the binary end, parts of the firmware will be overwritten when the micropython filesystem is initialised. + ## Super Simple Example First, LVGL needs to be imported and initialized diff --git a/ports/rp2/README.md b/ports/rp2/README.md index 5836ac0cd..4b929c25c 100644 --- a/ports/rp2/README.md +++ b/ports/rp2/README.md @@ -99,3 +99,11 @@ sm.active(1) ``` See the `examples/rp2/` directory for further example code. + +### Troubleshooting + +If you experience unstable behaviour, it is worth checking the value of +*MICROPY_HW_FLASH_STORAGE_BASE* against the value of *__flash_binary_end* +from the firmware.elf.map file. If the storage base is lower than the +binary end, parts of the firmware will be overwritten when the micro- +python filesystem is initialised. diff --git a/ports/rp2/boards/PICO/mpconfigboard.h b/ports/rp2/boards/PICO/mpconfigboard.h index e6623374d..634590eb7 100644 --- a/ports/rp2/boards/PICO/mpconfigboard.h +++ b/ports/rp2/boards/PICO/mpconfigboard.h @@ -1,3 +1,6 @@ // Board and hardware specific configuration #define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" -#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) +// Modified from MPY origin to reduce flash storage to accommodate larger program flash requirement +// of lvgl and its bindings. Developers should review this setting when adding additional features +#define MICROPY_HW_FLASH_STORAGE_BYTES (1024 * 1024) +