Vector22

Can't Write to SPI Flash

Recommended Posts

As my first project using the Papilio Pro and LogicStart MegaWing, I made LEDs turn on from the switches. When I use the Papilio Loader 2.8 to write to FPGA, it executes fine and I am able to turn on the LEDs. When I try to write to SPI Flash, however, it times out and displays the following error message:

readusb: Timeout readusb
terminate called after throwing an instance of 'io_exception'

What am I doing wrong?

Full Output:

JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9
Using devlist.txt
JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9

Uploading "C:\Program Files (x86)\Gadget Factory\Papilio Loader\programmer\bscan_spi_xc6slx9.bit". DNA is 0x39bd53c11674cfff
Done.
Programming time 698.6 ms

Programming External Flash Memory with "C:\Users\Jay\Desktop\ISE_Projects\Switches_LEDS\Switches_LEDS.bit".
Found Macronix Flash (Pages=32768, Page Size=256 bytes, 67108864 bits).
Erasing    :
Doing Partial Erase
......Ok
Verifying  :
......Pass
Programming :
......Ok
Verifying  :
Using devlist.txt
......Pass
Done.
SPI execution time 17465.5 ms
USB transactions: Write 6853 read 6684 retries 0
Using devlist.txt
readusb: Timeout readusb
terminate called after throwing an instance of 'io_exception'
 

Share this post


Link to post
Share on other sites

I am also experiencing problem in writing SPI flash of Papilio Pro now, 

nevertheless it was all OK until April 10, a week ago.  

Writing to FPGA is still working correctly. 

 

The full log output on Papilio Loader 2.8 (on Windows 7) is:   

--

JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9
Using devlist.txt
JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9

Uploading "C:\Program Files\Gadget Factory\Papilio Loader\programmer\bscan_spi_xc6slx9.bit". DNA is 0x79c7e6969e763cff
Done.
Programming time 1051.1 ms

Programming External Flash Memory with "C:\FPGA\TimingMeas1\timingmeas1.bit".
Found Macronix Flash (Pages=32768, Page Size=256 bytes, 67108864 bits).
Erasing    :
Doing Partial Erase
......Ok
Verifying  :
...Error in Verify: first byte of data [0x00] ..
Failed (@ Page: 515)
Using devlist.txt
Error occured.
USB transactions: Write 709 read 541 retries 0
JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9

Using devlist.txt
ISC_Done       = 1
ISC_Enabled    = 0
House Cleaning = 1
DONE           = 1
--

 

The strange points of those errors are 

that the page numbers of the error positions are changing every time, like: 

[ The 1st time ]:

    Failed (@ Page: 515)

[ The 2nd time ]:

    Failed (@ Page: 936)

[ The 3rd time ]:

    Failed (@ Page: 257)

 

I hope those errors are not due to broken hardware. 

 

========

[p.s.  (April 22)]  

As far as I found having retried in various ways, it seems Windows 7/10 update around April 10-14 

made bad effects on USB communication, since the log output on Papilio Loader was rarely like:   

--

Programming External Flash Memory with "C:\Users\Desktop\timingmeas1.bit".
Found Macronix Flash (Pages=32768, Page Size=256 bytes, 67108864 bits).
Erasing    :
Doing Partial Erase
....Error: SPI Write Check Status Register [0xFF] mismatch (Wrong device or device not ready)..
..Ok
Verifying  :
Using devlist.txt
.Error in Verify: first byte of data [0x00] ..
Failed (@ Page: 39)
Error occured.
USB transactions: Write 234 read 66 retries 0
JTAG chainpos: 0 Device IDCODE = 0x24001093    Desc: XC6SLX9

Using devlist.txt
ISC_Done       = 1
ISC_Enabled    = 0
House Cleaning = 1
DONE           = 1
--

..., showing the error was caused in "Partial Erase" phase, 

meaning USB communication errors are happening everywhere. 

 

This USB communication bug might be affected by Windows update,

and can be found in an other person's tweet on Apr 14 (in Japanese),

..., meaning there are some strange points in FTDI VCP communication. 

 

My two Papilio Pro boards became unavailable with Papilio Loader now.  

I am wondering if I could use other JTAG tools to write flash without damaging the Papilio Pro boards.

 

Share this post


Link to post
Share on other sites

In my case, the above problems in writing SPI flash of Papilio Pro were solved in August. It seemed to be due to two reasons. 

- Updated Windows 10. - Communication using FTDI USB chip was much improved. (Causing no timeout.)

- Changing USB 2.0 cable connection. -  The noise in USB communication was much reduced when the USB cable was  

   connected to main PC board as directly as possible.

 As a result, no damage was found in my Papilio Pro boards and they are working fine. 

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