If you use snprintf(...) in a task and end up in the hardFault_Handler, your stack size could be the problem. Increase it and try again.