gc_collect() HardFault Handler STM32H7

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kdelport
Posts: 6
Joined: Wed Mar 31, 2021 7:11 am

gc_collect() HardFault Handler STM32H7

Post by kdelport » Tue Jun 08, 2021 8:43 am

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

Post Reply