Hello! I am getting constant ADC value through SPI when I add a debug message using UART on STM32F205 with CMSIS RTOS.
We have interfaced CS5532 using SPI which is initialized in continuous conversion mode. We read the ADC count in a task being called every 160 ms. When I add following statements in the task, the ADC count read from CS5532 becomes constant.
sprintf(Debug,",%ld,%f,%d\n\r",ADC_Sum,CurrentWt,StableFlag);
uart0Puts(Debug);
Removing above code solves the problem. I have also noticed that adding/removing similar debug messages in/from other parts of code also creates same problem. I commented similar statements from a function that is not getting called with current settings in EEPROM. This also caused same problem. The code works fine when no such debug message is used. I also checked the stack usage using ST Link debugger and found it to be within limits. Any kind insights on how to approach this problem would really be helpful. Thank you.
