Skip to content

Commit 68434b4

Browse files
committed
zephyr/mpconfigport_minimal: Use MICROPY_CONFIG_ROM_LEVEL_MINIMUM.
This commit adjusts the configuration of the minimal zephyr build to use MICROPY_CONFIG_ROM_LEVEL_MINIMUM. That's a lot cleaner than explicitly enabling/disabling options. Prior to this change the minimal build for qemu_cortex_m3 had size: Memory region Used Size Region Size %age Used FLASH: 114436 B 256 KB 43.65% RAM: 26320 B 64 KB 40.16% and had the following test results (running using the CI settings, ie `-d basics float --exclude inf_nan_arith`): 352 tests performed (7092 individual testcases) 352 tests passed 254 tests skipped: ... With the changes here the qemu_cortex_m3 size is now: Memory region Used Size Region Size %age Used FLASH: 99428 B 256 KB 37.93% RAM: 26312 B 64 KB 40.15% That's a good decrease of about 15k firmware size. And the test suite still passes with: 342 tests performed (6776 individual testcases) 341 tests passed 265 tests skipped: ... Signed-off-by: Damien George <[email protected]>
1 parent 135c1cc commit 68434b4

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

ports/zephyr/mpconfigport_minimal.h

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,36 @@
3030
// Included here to get basic Zephyr environment (macros, etc.)
3131
#include <zephyr/kernel.h>
3232

33+
// Use the minimum configuration level to get a small but useful system.
34+
#ifndef MICROPY_CONFIG_ROM_LEVEL
35+
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_MINIMUM)
36+
#endif
37+
3338
// Usually passed from Makefile
3439
#ifndef MICROPY_HEAP_SIZE
3540
#define MICROPY_HEAP_SIZE (16 * 1024)
3641
#endif
3742

43+
#define MICROPY_ENABLE_COMPILER (1)
44+
#define MICROPY_ENABLE_EXTERNAL_IMPORT (1)
3845
#define MICROPY_STACK_CHECK (1)
3946
#define MICROPY_ENABLE_GC (1)
4047
#define MICROPY_HELPER_REPL (1)
4148
#define MICROPY_REPL_AUTO_INDENT (1)
4249
#define MICROPY_KBD_EXCEPTION (1)
43-
#define MICROPY_CPYTHON_COMPAT (0)
44-
#define MICROPY_PY_ASYNC_AWAIT (0)
45-
#define MICROPY_PY_ATTRTUPLE (0)
46-
#define MICROPY_PY_BUILTINS_ENUMERATE (0)
47-
#define MICROPY_PY_BUILTINS_FILTER (0)
48-
#define MICROPY_PY_BUILTINS_MIN_MAX (0)
49-
#define MICROPY_PY_BUILTINS_PROPERTY (0)
50-
#define MICROPY_PY_BUILTINS_RANGE_ATTRS (0)
51-
#define MICROPY_PY_BUILTINS_REVERSED (0)
52-
#define MICROPY_PY_BUILTINS_SET (0)
53-
#define MICROPY_PY_BUILTINS_SLICE (0)
54-
#define MICROPY_PY_ARRAY (0)
55-
#define MICROPY_PY_COLLECTIONS (0)
56-
#define MICROPY_PY_CMATH (0)
57-
#define MICROPY_PY_IO (0)
58-
#define MICROPY_PY_STRUCT (0)
59-
#define MICROPY_PY_SYS_MODULES (0)
6050
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
6151
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
6252
#define MICROPY_PY_BUILTINS_COMPLEX (0)
6353

64-
// Saving extra crumbs to make sure binary fits in 128K
65-
#define MICROPY_COMP_CONST_FOLDING (0)
66-
#define MICROPY_COMP_CONST (0)
67-
#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0)
54+
// These features are enabled to get the test suite passing.
55+
#define MICROPY_FULL_CHECKS (1)
56+
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (1)
57+
#define MICROPY_MULTIPLE_INHERITANCE (1)
58+
#define MICROPY_PY_ASSIGN_EXPR (1)
59+
#define MICROPY_PY_BUILTINS_STR_OP_MODULO (1)
60+
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
61+
#define MICROPY_PY_BUILTINS_DICT_FROMKEYS (1)
62+
#define MICROPY_PY_SYS (1)
6863

6964
#ifdef CONFIG_BOARD
7065
#define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD

0 commit comments

Comments
 (0)