2 Replies Latest reply on Feb 13, 2013 1:37 PM by user_1377889

    sscanf() function call takes 6% of flash?

    eric.kwok

       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?

        • 1. Re: sscanf() function call takes 6% of flash?
          user_14586677

          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.

          • 2. Re: sscanf() function call takes 6% of flash?
            user_1377889

            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