diff options
author | Damien George <damien.p.george@gmail.com> | 2017-07-12 12:51:37 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-07-12 12:51:37 +1000 |
commit | f1d260d878105bfbf25c0bb68da6190e35fc106a (patch) | |
tree | ed97dade2987af46d9114be53cafc0f8092e7cec | |
parent | 12d4fa9b37408ed682e52c3d78ecd6c269a4904a (diff) | |
download | micropython-f1d260d878105bfbf25c0bb68da6190e35fc106a.tar.gz micropython-f1d260d878105bfbf25c0bb68da6190e35fc106a.zip |
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.
-rw-r--r-- | stmhal/boards/ESPRUINO_PICO/mpconfigboard.h | 3 | ||||
-rw-r--r-- | stmhal/boards/ESPRUINO_PICO/mpconfigboard.mk | 3 | ||||
-rw-r--r-- | stmhal/mpconfigport.h | 4 |
3 files changed, 10 insertions, 0 deletions
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) |