Topic : Data Memory Requirements using sprintf

Forum : 8051

Original Post
Post Information Post
October 29, 2007 - 3:55pm
Guest

I have run into xdata memory limitations when using the sprintf function in my application. My micro has 512 bytes of xdata, and my app has 262 bytes of xdata (variables). When I include stdio.h in my project and add a call to sprintf(), I get an address space overflow error. The map file shows that I have 476 bytes of xdata, and it is ignoring my main routine because it requires another 44 bytes of xdata (0x2c).

This suggests that the total xdata requirement would be 520 bytes (476 + 44). Since my original xdata requirement was 262 bytes, that would point to stdio.h/sprintf() using 258 bytes of data(520-262)!

Is this correct or do I have something set up incorrectly? (258 bytes seems excessive)