You should also check to see if the thread stack size is enough for sprintf, as it can use quite a lot of stack (as well as using the heap). In threadx on Synergy, the HW stack monitor is enabled (in SSP 1.1.0), if the stack pointer goes outside the RAM area defined for the threadx stack, then an NMI interrupt occurs. If you look in synergy/ssp/src/bsp/mcu/s7g2/bsp_group_irq.c for the NMI interrupt handler, at the bottom of the file is the section for the MPU stack Error interrupt :- if (1 == R_ICU- NMISR_b.SPEST) { /** MPU Stack Error interrupt is requested. */ bsp_group_irq_call(BSP_GRP_IRQ_MPU_STACK); /** Clear MPU Stack error flag. */ R_ICU- NMICLR_b.SPECLR = 1; } So you can set a breakpoint at this point of the code, to see if a MPU Stack Error interrupt occurs. Also, consider using newlib nano, as the RAM requirements for newlib nano are much reduced, but there are some limitations:- community.arm.com/.../shrink-your-mcu-code-size-with-gcc-arm-embedded-47 If you want to use newlib nano with the GNU toolchain, you can enable it in the properties for the project, under C/C++ Build- Settings- Tool Settings- Cross ARM C Linker- Miscellaneous, tick the boxes "Use newlib-nano", and "Use float with nano printf"
↧