"printf" BUG

All questions related to the configuration tool and groundstation

Moderator: lukasz

"printf" BUG

Postby bogdan » Mon May 23, 2011 7:44 am

I think I found a serious bug in the "printf" function used for telemetry and LOG data transfer (at least in C30 v3.01 of the compiler):
Sending an int using %d descriptor takes a very long time. My workaround was to convert the integer to float (or double) and use %.0f descriptor. It's about 5 times faster (maybe more).
Can anyone confirm this in later versions of the compiler ?

Bogdan
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: "printf" BUG

Postby Tom » Mon May 23, 2011 1:45 pm

Holy smokes!

I heared on the forum that version 3.23 (?) uses the Hi-Tech-C compiler libraries, which has a lot of impact on RAM usage (and speed).

How did you test this?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: "printf" BUG

Postby bogdan » Mon May 23, 2011 3:57 pm

I am sending 200kB of data from the external flash to the computer via the dsPIC. I send strings of 6 variables, 3 int and 3 float using printf. At one time I sent only floats and I observed it finished the data a lot faster.
bogdan
 
Posts: 8
Joined: Mon Feb 28, 2011 8:52 am

Re: "printf" BUG

Postby Tom » Mon May 23, 2011 4:05 pm

Ok, since all telemetry data is sent using printf, this is something I should investigate

In the gluon code there is also a custom function to print an integer to uart1. I suppose it should be a lot faster than any printf-variant:
http://code.google.com/p/gluonpilot/sou ... _csv.c#768
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium


Return to Software

Who is online

Users browsing this forum: No registered users and 8 guests

cron