On 28.08.2016 15:05, Benjamin Larsson wrote: > Hi. > >> >> I have serial output on the C8051F330 board RDM6300 working via >> putchar() (see attached code). But whenever I try to use printf(), >> everything gets messed up: Garbage output on the serial line or the >> device resets. > > That is exactly the same behaviour I got on the F330. My code is a mess > but it triggers exactly in the same way. > >> >> I've tried different memeory models and reentrency, but don't see a >> change in behaviour. printf() takes us over 4K of flash, but the >> C8051F330 has 8KB, so we should be ok. >> >> Philipp > > I used my own function to send strings and tried all kinds of tricks but > couldn't get around this issue. The Keil compiler that you get with the > Silabs Simplicity Studio works without any problems for me. Maybe it > would be worth porting your small example to Keil and see the difference > in assembly ? > > MvH > Benjamin Larsson
Actually, printf() does not really reset the device (sfr contents are not reset to their default values after terminating a program via printf()). That means it jumps to the start of main() some other way. Philipp ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user