Hello,
I am having trouble printing float values to the console.
The following code demonstrates this:
void main(void)
{
printf("Hello World!\n");
printf( "One int %i\n", 10);
printf( "Two ints %i, %i\n" , 10, 20);
printf( "Two hexas %i, %x\n" , 0xabcd, 0x3a3a);
printf( "One float %f\n", 2.5);
All is well until the pringtf statement with the %f format specifier is reached. Then the program just hangs and the debugger is lost as to where the program counter is, so I can trace the error only as far as the call to printf with the f specifier. Something similar happens with vsprintf, but I guess that is jusat a wrapper around printf.
I have:
floating point enabled with --float_support=VFPv3D16 and have set --printf_support=full
I can carry out floating point oprations so I assume this is correct.
I have read the note in the compiler manual (p161, section 7.2 The C I/O Functions) and set the heap to 8 * the BUFSIZ (2048 bytes) but this has no affect on my printing problem.
I have --gcc set so as to use variable arguments, apart from that all is pretty will as per the example Hello World code supplied with the USB TMS570 Devlopment Kit.
I suspect it is something trivial but I have run out of ideas. Any suggestions?
Thanks for any help.
Steve