Page 1 of 1

gc_collect() HardFault Handler STM32H7

Posted: Tue Jun 08, 2021 8:43 am
by kdelport
Hello everyone,

To summary, my project run on a STM32H743. MicroPython is implemented as static library on a C application. In this application, I use FreeRTOS.

When, I use gc.collect(), my apllication go inHardault_Handler() due to a bug int the function gc_collect_root() in the function gc_helper_collect_regs_and_stack().

In addition, when I comment gc_helper_collect_regs_and_stack() in the funtion gc_collect(), gc_collect works

Code: Select all

void gc_collect(void) {
    gc_collect_start();
    //gc_helper_collect_regs_and_stack();
    // trace root pointers from any threads
//    #if MICROPY_PY_THREAD
//    mp_thread_gc_others();
//    #endif
    gc_collect_end();
}
It works but my memory is not completely cleaned and therefore continues to fill up

Do you have any solution to solve my problem with gc_helper_collect_regs_and_stack() ?

Thanks for any help

Kévin