I don't know if it helps your issue, but your question has "recursive" and "size of the stack" - and that really helped me a lot thanks!.
Im running FreeRTOS on STM32F1 series.
I also have a recursive function. Mine has programmed limits on its depth, but it was still causing the HardFault_Handler to execute.
I fixed it by increasing the stack size on the FreeRTOS thread. In this case form 128 to 256.
osThreadDef(Handle, StartHandler, osPriorityBelowNormal, 0, 256);
I was able to make the setting the the CubeMx configuration as well.
Retrieving data ...