Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® Software > sscanf() function call takes 6% of flash?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



sscanf() function call takes 6% of flash?
Moderator:
JFMD

Post Reply
Follow this topic



sscanf() function call takes 6% of flash?

EKwok posted on 13 Feb 2013 10:46 AM PST
Member
3 Forum 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?

                                 




Re: sscanf() function call takes 6% of flash?

danaaknight posted on 13 Feb 2013 11:27 AM PST
Top Contributor
1773 Forum 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.



Re: sscanf() function call takes 6% of flash?

Bob Marlowe posted on 13 Feb 2013 11:37 AM PST
Top Contributor
1768 Forum 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

Bob






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20