How did you measure the time of page programs?
I assume you instrumented a software timer like below, correct?
ForEach 256byte in 64KBuffer
SPITransfer Page_PROGRAM + 256 bytes
WaitForOperation(); // Wait for chip to not be busy
If yes, I recommend to measure the times for each step individually to identify the bottle neck.
Typically, transferring 256 bytes page data can contain system level (i.e., SPI host controller side) overhead and impact whole write throughput.
If the FT4222H supports Quad Page Program (QPP) command (0x32) and you don’t use it now, QPP command can improve transfer rate a little.
Takahiro, thanks for answering.
Yes I implemented a software timer.
> Typically, transferring 256 bytes page data can contain system level (i.e., SPI host controller side) overhead and impact whole write throughput.
Yes it seems that waiting for 256 bytes page to be written is the big issue.
>If the FT4222H supports Quad Page Program (QPP) command (0x32) and you don’t use it now, QPP command can improve transfer rate a little.
I do not think Quad mode would give me a 4 x increase, because the issue is not the transfer time, but the time to wait once the data has been sent to the NOR FLASH.
I am going to experiment with some NAND Flash with SPI interface, TOHISBA offer one that has a 4k buffer.
I may get better write speed.
I do not know if cypress offer NAND Flash with SPI interface?
1 of 1 people found this helpful
At this point, Cypress does not offer SPI NAND devices.
As per your original question, I think you may want to investigate the 1400ms program time per 64KB sector. The typical program time in S25FL128S for a 256B page is only 250us. In S25FL127S, it is 395us. That means for the full 64KB sector, it should take typical 64ms in FL128S, and 101ms in FL127S. Note that this does not include the data transfer time.
Therefore, I wonder if the measured 1400ms program time for one sector was mainly due to data transfer time. If you are running at 40MHz clock, the transfer time should not take that long, unless there are a lot of gaps in between data bytes. In such a case, you may want to look into optimizing the controller to minimize the gaps to achieve better performance. Moreover, as Takahiro suggested, you may use QPP command to transfer data in Quad IO format so the transfer time is less.
If you can provide a logic analyzer trace for a program operation, we can help analyze it.
Zhi, thanks for your answer. I will later re start my testing.
As far I remember the issue was not to send the page of 256 byte for writing, but was after to wait for the FLASH chip to be ready to complete the write operation.