sscanf() function call takes 6% of flash?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 I am using the Creator 2.2 and target for PSoC5LP.  

   

When commented out sscanf() function, the compiler stated Flash used: 30440 of 262144 byte (11.6%);

   

with sscanf() in use, the Flash used is: 46022 (17.6%); an increase of 6%.

   

Is this correct?

   

Also, with sccanf() in use, the compiler has the following Warning:

   

 _IO functions "_close' used.

   

                        "_lseek' used

   

                       "_read" used

   

                     "_write" used.

   

Any concerns here?

0 Likes
2 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Different compilers have different granularity of library optimization.

   

eg. the # of APIs pulled in for a given type, like stirng, math, I/O, etc..

   

Additionally some API's have an interdepenancy on other parts of a

   

library, again compiler dependent.

   

 

   

So in short that could explain the seemingly large increase. You will

   

notice the same effect when you do floating point.

   

 

   

You might check your optimization settings to make sure you are at max,

   

if not debugging.

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Usually something as complex as scanf needs some help from other libraries like stdio and string which will increase the amount of needed flash. The good news is that the next library as printf for instance will go with some lesser blowing-up the flash.

   

The experiences we all made are that at the beginning of a project the amount of flash used rapidly increases but the increase flattens soon, so do not worry right now.

   

Happy coding

   

Bob

0 Likes