ports/stm32: Disable btree by default.

I don't think this was ever working correctly because it used
untracked malloc's from GC. This feature can be re-enabled per
board but it will require a libc heap from now on.
This commit is contained in:
iabdalkader 2024-12-23 09:38:13 +01:00
parent 527934e8ee
commit 83da61a35c
3 changed files with 8 additions and 29 deletions

View File

@ -142,6 +142,11 @@ MPY_CFLAGS += -DMICROPY_PY_IMU=1
MICROPY_ARGS += MICROPY_PY_IMU=1
endif
ifeq ($(MICROPY_PY_BTREE), 1)
MPY_CFLAGS += -DMICROPY_PY_BTREE=1
MICROPY_ARGS += MICROPY_PY_BTREE=1
endif
ifeq ($(MICROPY_PY_TOF), 1)
MPY_CFLAGS += -DMICROPY_PY_TOF=1
MICROPY_ARGS += MICROPY_PY_TOF=1

View File

@ -374,32 +374,6 @@ soft_reset_exit:
goto soft_reset;
}
#if MICROPY_PY_BTREE
void *malloc(size_t size) {
void *p = gc_alloc(size, false);
if (p == NULL) {
errno = ENOMEM;
}
return p;
}
void free(void *ptr) {
gc_free(ptr);
}
void *calloc(size_t nmemb, size_t size) {
return malloc(nmemb * size);
}
void *realloc(void *ptr, size_t size) {
void *p = gc_realloc(ptr, size, true);
if (p == NULL) {
errno = ENOMEM;
}
return p;
}
#endif
static mp_obj_t pyb_main(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
// Unused.
return mp_const_none;

View File

@ -92,15 +92,13 @@ MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/shared/runtime/
MPY_CFLAGS += -DMICROPY_PY_SSL=1 \
-DMICROPY_SSL_MBEDTLS=1 \
-DMICROPY_STREAMS_POSIX_API=1 \
-DMICROPY_VFS_FAT=1 \
-DMICROPY_PY_BTREE=1
-DMICROPY_VFS_FAT=1
MICROPY_ARGS += STM32LIB_CMSIS_DIR=$(TOP_DIR)/$(CMSIS_DIR) \
STM32LIB_HAL_DIR=$(TOP_DIR)/$(HAL_DIR) \
MICROPY_PY_SSL=1 \
MICROPY_SSL_MBEDTLS=1 \
MICROPY_PY_BTREE=1\
MICROPY_PY_OPENAMP=$(MICROPY_PY_OPENAMP)\
MICROPY_PY_OPENAMP_REMOTEPROC=$(MICROPY_PY_OPENAMP_REMOTEPROC)
@ -354,10 +352,12 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/shared/,\
readline/readline.o \
)
ifeq ($(MICROPY_PY_BTREE), 1)
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/lib/,\
berkeley-db-1.xx/btree/*.o \
berkeley-db-1.xx/mpool/*.o \
)
endif
#------------- mbedtls -------------------#
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/lib/mbedtls/library/*.o)