Slow spi flash write

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

cross mob
Anonymous
Not applicable

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

0 Likes
1 Solution
Anonymous
Not applicable

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

View solution in original post

5 Replies
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

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?

Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes

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

gangi seyhan

0 Likes
Anonymous
Not applicable

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