You are here

sscanf() function call takes 6% of flash? | Cypress Semiconductor

sscanf() function call takes 6% of flash?

Summary: 2 Replies, Latest post by Bob Marlowe on 13 Feb 2013 01:37 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
EKwok's picture
3 posts

 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?


user_14586677's picture
7646 posts

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.

user_1377889's picture
9249 posts

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


Log in to post new comments.