From f1d260d878105bfbf25c0bb68da6190e35fc106a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jul 2017 12:51:37 +1000 Subject: [PATCH] stmhal: Reduce size of ESPRUINO_PICO build so it fits in flash. The default frozen modules are no longer included (but users can still specify their own via FROZEN_MPY_DIR), complex numbers are disabled and so are the native, viper and asm_thumb emitters. Users needing these features can tune the build to disable other things. --- stmhal/boards/ESPRUINO_PICO/mpconfigboard.h | 3 +++ stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk | 3 +++ stmhal/mpconfigport.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h index e84822957d..d065180d8a 100644 --- a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h +++ b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.h @@ -1,6 +1,9 @@ #define MICROPY_HW_BOARD_NAME "Espruino Pico" #define MICROPY_HW_MCU_NAME "STM32F401CD" +#define MICROPY_EMIT_THUMB (0) +#define MICROPY_EMIT_INLINE_THUMB (0) +#define MICROPY_PY_BUILTINS_COMPLEX (0) #define MICROPY_PY_USOCKET (0) #define MICROPY_PY_NETWORK (0) diff --git a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk index 4c44022c32..d531a594a1 100644 --- a/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk +++ b/stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk @@ -2,3 +2,6 @@ MCU_SERIES = f4 CMSIS_MCU = STM32F401xE AF_FILE = boards/stm32f401_af.csv LD_FILE = boards/stm32f401xd.ld + +# Don't include default frozen modules because MCU is tight on flash space +FROZEN_MPY_DIR ?= diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 96a330d139..d3ce11e02d 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -39,8 +39,12 @@ // emitters #define MICROPY_PERSISTENT_CODE_LOAD (1) +#ifndef MICROPY_EMIT_THUMB #define MICROPY_EMIT_THUMB (1) +#endif +#ifndef MICROPY_EMIT_INLINE_THUMB #define MICROPY_EMIT_INLINE_THUMB (1) +#endif // compiler configuration #define MICROPY_COMP_MODULE_CONST (1)