Florentin von Frankenberg

mc9s12dt256b reentrant sprintf issue

Discussion created by Florentin von Frankenberg on Jan 29, 2009
Latest reply on Jan 29, 2009 by Florentin von Frankenberg
Hi,
 
I am using sprintf to write a 68 char array, and have a 10ms timer interrupt running. I believe the interrupt is interrupting sprintf, and beacuse its not reentrant, crashing. (illegal bp)

I read that there's a way to use a reentrant version of sprintf here:  http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&message.id=1824&query.id=100659#M1824
 
but couldn't make it work. When I add PRINTF.c to the linker files, and -DLIBDEF_REENTRANT_PRINTF to the compiler directives, I get a lot of compiler errors complaining about problems in stdio, and PRINTF.c, starting at the #if reentrant part. I am lost, but hope the solution is simple...

Outcomes