This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCSv4 (4.2.4) Usage of printf ( ) and sscanf ( ) and SafeRTOS - causes FaultISR ( ) "crash"

Hi,

I'm currently porting a previously written embedded platform to for the LM3S9B96 Stellaris CPU (on a custom board), and am attempting to avoid having to write separate sscanf() routines.  Browsing this forum, I found hints to use the included usprintf( ) functions supplied in the Stellarisware utilities, which works for me.  However, no nifty sscanf()  routines were supplied (that I have yet found).  

We're using CCSv4 4.2.4 and using the ROM SafeRTOS scheduler and have been unable to tweak the stack settings to permit me to use the printf() or scanf() libraries successfully without vectoring to the FaultISR() error handler.  

Hopefully an answer will emerge that will save me from spending hours converting thousands of sscanf() statements to a home-brew solution. 

I am puzzled that the TI toolchain does not provide a nice printf()/scanf() formatter as do IAR and others.

 

  • For the printf and friends functions, we supply a version that uses less memory, but at the cost of fewer features.  We never did the same thing for scanf and friends.  I filed SDSCM00041420 in the SDOWP system to request that this be added.  Feel free to track that request with the SDOWP link in my sig below.

    Thanks and regards,

    -George

  • Regardless of the availability of the space-saving modules, I was able to get the built-in printf () and scanf () routines from CCSV4 4.2.4 working together with SafeRTOS.  Still would be nice to have a configurable sscanf () (and friends) module.  So it does work, and is compatible with SafeRTOS.
  • SafeRTOS has a known errata with functions like printf() and scanf() and task stack alignment.  These functions require 8-byte task stack alignment (stacks used with the Cortex-M3, whether main stack or a task stack should be 8-byte aligned regardless of printf() or scanf() being used) - so make sure the stack area that you are creating for each task is 8-byte aligned.  SafeRTOS is errantly only checking for 4-byte alignment upon task creation.  You can look at this post on the LM3S9B96 forum: http://support.highintegritysystems.com/entries/20455841-stack-size for further information.