|
38 | 38 | // Options to control how MicroPython is built
|
39 | 39 | // ===========================================
|
40 | 40 |
|
| 41 | +#define MICROPY_HW_BOARD_NAME "Sipeed_board" |
| 42 | +#define MICROPY_HW_MCU_NAME "Kendryte-K210" |
| 43 | +#define MICROPY_PY_SYS_PLATFORM "K210/FreeRTOS" |
| 44 | +#define MICROPY_PY_LOBO_VERSION "1.11.5" |
| 45 | +#define MICROPY_PY_LOBO_VERSION_NUM (0x011105) |
| 46 | + |
41 | 47 | /*
|
42 | 48 | Several basic configurations can be selected for build:
|
43 | 49 | -------------------------------------------------------
|
|
46 | 52 | 3. Two MicroPython instances with PyStack enabled
|
47 | 53 | 4. Two MicroPython instances without PyStack enabled
|
48 | 54 | -------------------------------------------------------
|
| 55 | +
|
| 56 | + The following options are configurable on runtime from MicroPython: |
| 57 | + ------------------------------------------------------------------- |
| 58 | + - running two MPy instances |
| 59 | + - using PyStack |
| 60 | + - heap size |
| 61 | + - PyStack size |
| 62 | + - MicroPython task(s) stack size |
| 63 | + - default CPU frequency |
| 64 | + - default REPL baudrate |
| 65 | + - boot menu pin |
| 66 | + - default log level |
| 67 | + - MicroPython VM divisor |
49 | 68 | */
|
50 | 69 |
|
51 | 70 | //---------------------------------------------------------------------------
|
|
64 | 83 | #define MICROPY_K210_KPU_USED (0)
|
65 | 84 |
|
66 | 85 | // sqlite3 module uses ~416 KB of code (and SRAM) space
|
67 |
| -#define MICROPY_PY_USE_SQLITE (1) |
| 86 | +#define MICROPY_PY_USE_SQLITE (0) |
68 | 87 |
|
69 | 88 | //---- K210 Memory usage -------------------------------------------------------------------------------------
|
70 | 89 | // MicroPython heap is allocated from FreeRTOS heap which is allocated at system start
|
|
97 | 116 | // including MicroPython heap and PyStack
|
98 | 117 | #define FREE_RTOS_TOTAL_HEAP_SIZE (( size_t )(K210_SRAM_SIZE - FIRMWARE_SIZE - RESERVED_FOR_SYSTEM))
|
99 | 118 | // === Reserved size of FreeRTOS heap
|
100 |
| -#define MICRO_PY_FREE_RTOS_RESERVED (3*256*1024) |
| 119 | +#define MICRO_PY_FREE_RTOS_RESERVED (7*128*1024) |
101 | 120 | // === FreeRTOS heap used for MicroPython heap
|
102 | 121 | #define MICRO_PY_MAX_HEAP_SIZE (FREE_RTOS_TOTAL_HEAP_SIZE - MICRO_PY_FREE_RTOS_RESERVED)
|
| 122 | +#define MICRO_PY_MIN_HEAP_SIZE (128*1024) |
103 | 123 | #if MICROPY_USE_TWO_MAIN_TASKS
|
104 | 124 | #define MICROPY_HEAP_SIZE (MICRO_PY_MAX_HEAP_SIZE * 5 / 8)
|
105 | 125 | #define MICROPY_HEAP_SIZE2 (MICRO_PY_MAX_HEAP_SIZE * 3 / 8)
|
106 | 126 | #else
|
107 | 127 | #define MICROPY_HEAP_SIZE (MICRO_PY_MAX_HEAP_SIZE)
|
108 | 128 | #define MICROPY_HEAP_SIZE2 (0)
|
109 | 129 | #endif
|
| 130 | + |
| 131 | +// === MicroPython main task stack size in bytes === |
| 132 | +#define MICROPY_TASK_STACK_RESERVED (512) |
| 133 | +#define MICROPY_TASK_STACK_SIZE (32 * 1024) |
| 134 | +// === MicroPython main task stack size in stack_type units (64-bits) === |
| 135 | +#define MICROPY_TASK_STACK_LEN (MICROPY_TASK_STACK_SIZE / sizeof(StackType_t)) |
| 136 | + |
| 137 | +#define MICRO_PY_MIN_PYSTACK_SIZE (2*1024) |
| 138 | +#define MICRO_PY_MAX_PYSTACK_SIZE (32*1024) |
| 139 | +#if MICROPY_ENABLE_PYSTACK |
| 140 | +#define MICROPY_PYSTACK_SIZE (4096) |
| 141 | +#else |
| 142 | +#define MICROPY_PYSTACK_SIZE (0) |
| 143 | +#endif |
110 | 144 | //------------------------------------------------------------------------------------------------------------
|
111 | 145 |
|
112 | 146 |
|
@@ -185,18 +219,6 @@ extern void vm_loop_hook();
|
185 | 219 | #define MICROPY_THREAD_STACK_SIZE (2048) // default thread stack size in STACK UNITS (8 bytes)
|
186 | 220 | #define MICROPY_TASK_PRIORITY (8) // default thread priority
|
187 | 221 |
|
188 |
| -// === MicroPython main task stack size in bytes === |
189 |
| -#define MICROPY_TASK_STACK_RESERVED (512) |
190 |
| -#define MICROPY_TASK_STACK_SIZE (32 * 1024) |
191 |
| -// === MicroPython main task stack size in stack_type units (64-bits) === |
192 |
| -#define MICROPY_TASK_STACK_LEN (MICROPY_TASK_STACK_SIZE / sizeof(StackType_t)) |
193 |
| - |
194 |
| -#if MICROPY_ENABLE_PYSTACK |
195 |
| -#define MICROPY_PYSTACK_SIZE (4096) |
196 |
| -#else |
197 |
| -#define MICROPY_PYSTACK_SIZE (0) |
198 |
| -#endif |
199 |
| - |
200 | 222 | // === Buffer size for UART used as RELP standard input/output ===
|
201 | 223 | #define MICRO_PY_UARTHS_BUFFER_SIZE (1280)
|
202 | 224 |
|
@@ -593,12 +615,6 @@ extern const struct _mp_obj_module_t mp_module_usqlite3;
|
593 | 615 | #define MICROPY_PY_MACHINE (1)
|
594 | 616 | #define MICROPY_PY_MACHINE_PIN_MAKE_NEW mp_pin_make_new
|
595 | 617 |
|
596 |
| -#define MICROPY_HW_BOARD_NAME "Sipeed_board" |
597 |
| -#define MICROPY_HW_MCU_NAME "Kendryte-K210" |
598 |
| -#define MICROPY_PY_SYS_PLATFORM "K210/FreeRTOS" |
599 |
| -#define MICROPY_PY_LOBO_VERSION "1.11.4" |
600 |
| -#define MICROPY_PY_LOBO_VERSION_NUM (0x011104) |
601 |
| - |
602 | 618 | #define MP_STATE_PORT MP_STATE_VM
|
603 | 619 |
|
604 | 620 | #define MICROPY_PORT_ROOT_POINTERS \
|
|
0 commit comments