sprintf, FreeRTOS, Hard Fault and Stack aligment, need explanation
Hello!
I encounter random HardFault when calling sprintf, sscanf from thread context in FreeRTOS. MCU is F446. When called before KernelStart, it works well. Meanwhile, it was working ok, before I`ve rearanged modules and added new structures. I didn`t even used new module yet. Behavior also depends on optimization options.
After surfing over internets, I found this could happen if unaligned stack access is performed. After this point I didn`t understand actual techniques to make it happen. What directives should I put and where? I`m using IAR 8.3
If code insights are needed, I`l put it, but entire project is quite large.
Also, rtos config is included, maybe it has some issues
Hope for you help!
