From af2231896169bd409324cc99d9a72896b370ee69 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 26 Sep 2025 00:38:07 +1000 Subject: [PATCH] mimxrt/main: Replace mp_stack_set calls with mp_cstack_init_with_top. Signed-off-by: Damien George --- ports/mimxrt/main.c | 4 +--- ports/mimxrt/mpconfigport.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt/main.c b/ports/mimxrt/main.c index 7166171f17..22809916e7 100644 --- a/ports/mimxrt/main.c +++ b/ports/mimxrt/main.c @@ -29,7 +29,6 @@ #include "py/runtime.h" #include "py/gc.h" #include "py/mperrno.h" -#include "py/stackctrl.h" #include "shared/readline/readline.h" #include "shared/runtime/gchelper.h" #include "shared/runtime/pyexec.h" @@ -100,8 +99,7 @@ int main(void) { led_init(); #endif - mp_stack_set_top(&_estack); - mp_stack_set_limit(&_estack - &_sstack - 1024); + mp_cstack_init_with_top(&_estack, &_estack - &_sstack); gc_init(&_gc_heap_start, &_gc_heap_end); mp_init(); diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h index d6694badba..8ad789d933 100644 --- a/ports/mimxrt/mpconfigport.h +++ b/ports/mimxrt/mpconfigport.h @@ -54,6 +54,7 @@ uint32_t trng_random_u32(void); #define MICROPY_TRACKED_ALLOC (MICROPY_SSL_MBEDTLS) #define MICROPY_READER_VFS (1) #define MICROPY_ENABLE_GC (1) +#define MICROPY_STACK_CHECK_MARGIN (1024) #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_SCHEDULER_DEPTH (8)