summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-09-26 00:53:25 +1000
committerDamien George <damien@micropython.org>2025-10-10 14:49:09 +1100
commit12220b821e5c1a9469fa54309b075e9afd01a9be (patch)
treec9df361ee64d79d8f389f41873850cfbbf734d70
parentcbe137c4b8b6402be95ebe173653f0ea1e9dab66 (diff)
renesas-ra/main: Replace mp_stack_set with mp_cstack_init_with_top.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/renesas-ra/main.c6
-rw-r--r--ports/renesas-ra/mpconfigport.h1
2 files changed, 2 insertions, 5 deletions
diff --git a/ports/renesas-ra/main.c b/ports/renesas-ra/main.c
index cfc4611ec..e0ef5ee19 100644
--- a/ports/renesas-ra/main.c
+++ b/ports/renesas-ra/main.c
@@ -29,7 +29,6 @@
#include <string.h>
#include "py/runtime.h"
-#include "py/stackctrl.h"
#include "py/gc.h"
#include "py/mperrno.h"
#include "py/mphal.h"
@@ -295,11 +294,8 @@ soft_reset:
mp_thread_init();
#endif
- // Stack limit should be less than real stack size, so we have a chance
- // to recover from limit hit. (Limit is measured in bytes.)
// Note: stack control relies on main thread being initialised above
- mp_stack_set_top(&_estack);
- mp_stack_set_limit((char *)&_estack - (char *)&_sstack - 1024);
+ mp_cstack_init_with_top(&_estack, (char *)&_estack - (char *)&_sstack);
// GC init
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);
diff --git a/ports/renesas-ra/mpconfigport.h b/ports/renesas-ra/mpconfigport.h
index 70d38e7d2..946f71e7c 100644
--- a/ports/renesas-ra/mpconfigport.h
+++ b/ports/renesas-ra/mpconfigport.h
@@ -92,6 +92,7 @@
#define MICROPY_TRACKED_ALLOC (MICROPY_SSL_MBEDTLS || MICROPY_BLUETOOTH_BTSTACK)
#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_EMERGENCY_EXCEPTION_BUF_SIZE (0)
#define MICROPY_REPL_INFO (1)