Some info hint if that can help base on my experiecne with freertos stm32 ac6 (cubemx)
The default stack size (128 or 256) is quite too small, stack of 512+ is not yet enough in some case (use of fatfs lib recurison etc ..)
The default heap size can be problematic as you use printf that can be source of quirck
I had issue with earlier ac6 due to the “0” intial heap relying on later stack break by _sbreak (need for malloc likley required by printf)
but that logic was broken with freertros due to speciific stack for task.
sbreak fail if malloc was called form non main task (cos sp is not the main heap/stack free ram area)
that was causing trouble in cascade hardly making any sense (invalid ptr call hard fault etc ... )