Guest manni

Writing to the SPI FLASH on Linux

Recommended Posts

Guest manni

Hi,

i can't write to the SPI FLASH on my Papilio One using papilioloader and bscan_spi_xc3s500e.bit from current svn on Linux (Ubuntu 11.04):

-------

manni@pc3:~/FPGA$ sudo papilioloader -v -f ASCIITable_Quickstart-Papilio_One_500K.bit -b bscan_spi_xc3s500e.bit -sa -r

Using devlist.txt

JTAG chainpos: 0 Device IDCODE = 0x41c22093    Desc: XC3S500E

Uploading "bscan_spi_xc3s500e.bit". Done.

Programming time 178.5 ms

Programming External Flash Memory with "ASCIITable_Quickstart-Papilio_One_500K.bit".

Uknown Flash Manufacturer

Error: SPI Status Register [0x00] mismatch (Wrong device or device not ready)..

Error occured.

USB transactions: Write 61 read 4 retries 4

manni@pc3:~/FPGA$

-------

I can load bitfiles to the FPGA and they work as expected. Some weeks ago i was able to write to the SPI FLASH on Windows XP but i can't try that currently. It does not make a difference if devlist.txt exists or not.

Any hints?

Manni

Share this post


Link to post
Share on other sites

Hello Manni,

There might be a chance you got a version out of SVN that we were trying to speed up. I'm working on getting the code moved over to github and will be verifying with a board here to make sure it works ok under Linux.

https://github.com/GadgetFactory/Papilio-Loader

I'll post more information after I verify the code.

Jack.

Share this post


Link to post
Share on other sites

It works fine for me on Lucid Lynx, without having to mess with configuration files. I compiled butterflyprog from subversion source, change log says it was version 1.5 11/17/2010.

Btw, it is *very* slow, so i understand why Jack would risk breaking it trying to make it faster...  (less than a second for a live programming, around a minute for a rom update)

Hope this helps,

Ben

Share this post


Link to post
Share on other sites

Yes,

We need to optimize the code, the Atmel chip takes less than 4 seconds to do a full SPI Flash write. The SST chip uses a different algorithm and I had to add some long pauses to get it to reliably program. We should be able to get the SST chip to program in less than 4 seconds too.

Jack.

Share this post


Link to post
Share on other sites

Excellent! You found what I was working on before I got a chance to send you the message.  :)

I was also working on a Linux Virtual Machine just in case it was not working still.

One question though, how is the speed of writing to SPI Flash? Is it around 1-2 minutes or is it much longer?

When I ran a SPI Flash under a Linux Virtual Machine I ran time on it and it reported that it took 24 minutes to finish!

Is anyone else seeing horrible times like this?

Thanks,

Jack.

Share this post


Link to post
Share on other sites

When I ran a SPI Flash under a Linux Virtual Machine I ran time on it and it reported that it took 24 minutes to finish!

Is anyone else seeing horrible times like this?

does it depend on the size of the design ?

in that case, the time I gave is not relevant (I tried only with a small one) I can try with a more important one if you think this can help (~283k for the bit file, for around 25% of the 500k slices)

Share this post


Link to post
Share on other sites
Guest manni

Hi Jack,

on my pc it takes about 48 seconds to write a .bit-file to the FLASH. From what I have seen this time is independent of the design.


manni@pc3:~/FPGA$ sudo papilio-prog -v -f LED_TEST1.bit -b bscan_spi_xc3s500e.bit -sa -r
Using devlist.txt
JTAG chainpos: 0 Device IDCODE = 0x41c22093    Desc: XC3S500E

Uploading "bscan_spi_xc3s500e.bit". Done.
Programming time 178.4 ms

Programming External Flash Memory with "LED_TEST1.bit".
Found SST Flash (Pages=2048, Page Size=264 bytes, 4325376 bits).
Erasing    :
Ok
Verifying  :
Verifying  :
Verifying  :
Pass
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Programming :
Finished Programming
Ok
Verifying  :
Verifying  :
Verifying  :
Pass
Done.
SPI execution time 48169.6 ms
USB transactions: Write 145079 read 145021 retries 41247
manni@pc3:~/FPGA$

I know that it should be possible to make this much faster, but for me, it's ok, because for the few times I want to progamm the FLASH it does not make such a difference.

Manni

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now