Jump to content
  • 0

CMOD S6 Spi Flash access problem


topcat63

Question

I was able to program the SPI flash on my CMOD S6. I could load FPGA images without any problems using Impact with ISE 14.7. All of a sudden I can no longer communicate to the SPI flash anymore.  I can't get the ID CODE, which returns all 0's whenever I try programming the SPI flash I get errors whenever I try to do anything to the SPI flash. 

I can program the FPGA with the JTAG. Any help appreciated ?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Build a design that then allows you to program the flash?  Here's an example project where I did just that. 

  • The project actually contains two top levels that I would choose between.  There's the alternate top level, which I used to program the flash and examine I/Os, and the normal top level which I used for my ultimate design.
  • Once both projects were built, I would load the first with JTAG onto the board.
  • Once the alternate top level was loaded onto the board, I could then load a bit file into flash.  This also loaded the software I needed for my homegrown CPU, the ZipCPU.
  • If I wanted, I could then load the normal top level bit file via JTAG as well.  This was useful if the project design changed, but the CPU instructions did not.

The flash controller had two parts to it.  One part allowed me to read from the flash, whereas a second interface allowed me to write arbitrary commands to the flash.  You can read more about the design approach here if you would like.

A serial port interface allowed me access to read and write values on the bus from external to the FPGA.  This meant that I could write a small piece of flash control software for that purpose.  The actual program that drove this controller was one I called zipload.  This not only loaded the bitfile provided to it, but would also decompose and read an ELF file in order to place the design at the right flash address.

One of the things I learned along the way was that it was easy to get the flash out of sync with the hardware controller.  This meant that the controller required a way to return the flash to its basic SPI based configuration no matter what mode it was in.  If the controller ever gets out of sync, you can usually recover it by powering down the board and starting both up again.

I also learned that there are special write protect registers within the flash.  Some of these can be set only once and never cleared.  You should be able to look up the data sheet for your flash and then read these registers.  If the write protect is truly set internally, then you may need a new flash chip.  (Might be easier to get a new board.)  Read the registers, check the data sheet, and adjust as appropriate.

Just my two cents.

Dan

Link to comment
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
×
×
  • Create New...