Sterling
Sterling
DIIDevHeads IoT Integration Server
Created by Sterling on 6/12/2024 in #middleware-and-os
Encountering hardfaults in FreeRTOS v10.3.0 on a Microchip PIC32 while using vsnprintf or sprin
Hi guys, I'm encountering hardfaults in FreeRTOS v10.3.0 on a Microchip PIC32 while using vsnprintf or sprintf functions. I suspect stack corruption, as I'm using static memory allocation no malloc with a pre-allocated buffer char _log_buffer[128]. I've tried different printf implementations newlib, newlib nano, tinyprintf without success. I tried troubleshooting with these: ~Verified thread stack alignment. ~Ruled out dynamic allocation issues by mocking malloc/calloc/realloc/free. Are there any recommended techniques to confirm stack corruption specifically related to printf calls in FreeRTOS? With static memory allocation, what are some effective ways to debug the stack pointer behavior during these hardfaults? @Middleware & OS
5 replies