Memory Allocation Hangs in CMSIS RTOS Threads, FPU Enabled, and Memory Allocation for sprintf func
Hi Community,
I'm currently facing a critical issue in my STM32 project involving FreeRTOS tasks, FPU (Floating-Point Unit) usage, and memory allocation for floating-point formatting. This problem has emerged after enabling FPU support and configuring project properties to accommodate floating-point operations.
Problem Overview:
My application relies heavily on FreeRTOS for task management, and recently I enabled FPU support to facilitate floating-point operations. However, upon attempting to format floating-point values with sprintf within FreeRTOS tasks, I encountered memory allocation hangs and failures. These issues occur consistently when utilizing memory allocation functions such as `malloc`, particularly within tasks involving floating-point formatting.
1. FPU Configuration: I've ensured that FPU support is properly enabled in my STM32 project, and I've configured project properties to accommodate floating-point operations.
2. Memory Allocation Hangs: The application hangs or encounters failures at memory allocation functions such as `pvPortMalloc` or `malloc`, specifically when attempting to format floating-point values within FreeRTOS tasks.
3. STM32_LOCK_BLOCK(): The application gets stuck at the `STM32_LOCK_BLOCK()` instruction within `__retarget_lock_init_recursive`, with the comment indicating /*Unable to allocate memory*/.
Have anyone encountered similar challenges with memory allocation in FPU-enabled STM32 projects, particularly when involving floating-point formatting with sprintf/snprintf within FreeRTOS tasks ?
Thank you.
