Skip to content

Commit 00e7176

Browse files
committed
stmhal/main: Use _estack value to initialise stack extents.
1 parent 882ec01 commit 00e7176

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stmhal/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ int main(void) {
508508
// Stack limit should be less than real stack size, so we have a chance
509509
// to recover from limit hit. (Limit is measured in bytes.)
510510
// Note: stack control relies on main thread being initialised above
511-
mp_stack_ctrl_init();
512-
mp_stack_set_limit((char*)&_ram_end - (char*)&_heap_end - 1024);
511+
mp_stack_set_top(&_estack);
512+
mp_stack_set_limit((char*)&_estack - (char*)&_heap_end - 1024);
513513

514514
// GC init
515515
gc_init(&_heap_start, &_heap_end);

0 commit comments

Comments
 (0)