File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -348,9 +348,9 @@ const char *pbsys_main_get_application_version_hash(void) {
348348// Runs MicroPython with the given program data.
349349void pbsys_main_run_program (pbsys_main_program_t * program ) {
350350
351+ #if PBDRV_CONFIG_STACK_EMBEDDED
351352 // Stack limit should be less than real stack size, so we have a chance
352353 // to recover from limit hit. (Limit is measured in bytes.)
353- // Note: stack control relies on main thread being initialised above
354354 char * stack_start ;
355355 char * stack_end ;
356356 pbdrv_stack_get_info (& stack_start , & stack_end );
@@ -361,6 +361,9 @@ void pbsys_main_run_program(pbsys_main_program_t *program) {
361361 mp_stack_ctrl_init ();
362362 #endif
363363 mp_stack_set_limit (MP_STATE_THREAD (stack_top ) - stack_start - 1024 );
364+ #else
365+ mp_cstack_init_with_sp_here (1024 * 1024 );
366+ #endif
364367
365368 // MicroPython heap is the free RAM after program data.
366369 gc_init (program -> user_ram_start , program -> user_ram_end );
You can’t perform that action at this time.
0 commit comments