5 Replies Latest reply on Sep 9, 2014 5:56 AM by pseguy

    Slow spi flash write

    pseguy

      Hello

       

      Whatever bloc size (1, 2, 4, 8Ko) I try to write to the spi flash (sflash_write), I get a constant very slow throughput: 13 seconds for each KiB written.

       

      Having a look at spi_flash.c make me think that low level writes are done one byte at a time.

       

      Any advice to increase write throughput would be appreciated.

      Thanks in advance,

      Pascal

        • 1. Re: Slow spi flash write
          arsr

          Most serial flashes have a sector size of 4 KBytes. Which API are you using to write to the serial flash?

           

          > Having a look at spi_flash.c make me think that low level writes are done one byte at a time.

          Is this from your application and did you mean to attach this file here?

          1 of 1 people found this helpful
          • 2. Re: Slow spi flash write
            pseguy

            I use wiced API:  

                           libraries/drivers/spi_flash/spi_flash.h

             

            as 'apps/waf/sflash_write' does.

            Source code in:

                           libraries/drivers/spi_flash/spi_flash.c          

             

            Please look a the function:

                           int sflash_write( const sflash_handle_t* const handle, unsigned long device_address, /*@observer@*/ const void* const data_addr, unsigned int size )

             

            line:

                 unsigned int max_write_size = (unsigned int) 1;

             

            wiced 2.4, 3.0 & 3.1

             

            I think this is the reason why write are very slow.

            • 3. Re: Slow spi flash write
              pseguy

              I realize now this post is in the wrong forum, should be in Wiced Wi-Fi.

              • 4. Re: Slow spi flash write
                mifo

                No problem.  I will go ahead and move it to the correct forum now.

                 

                grga seyhan

                • 5. Re: Slow spi flash write
                  pseguy

                  I've upgraded from Wiced 3.0.0 to 3.1, it's faster and acceptable: 4KB/s, two minutes for a 532KB file.