07-18-2011 01:03 PM
I have an application where I need to be able to indirectly program the SPI flash (M25PE80-VMN6TP, configured for SPI master serial mode) on a Spartan 6 via JTAG, under control of an app in an embedded microcontroller connected to the JTAG pins.
XAPP974 and XAPP951 make mention of being able to do this via third-party or embedded processor, but neither outlines the JTAG command protocol for enabling erasing and programming of the external SPI flash.
Is there a document that has this information? XAPP974 makes mention of a proprietary JTAG-to-SPI core that must be loaded, but says it is only available in the impact software. How can I accomplish in-system programming of the SPI flash via JTAG from an embedded microcontroller?
07-18-2011 10:57 PM
I'm not aware of any detailed JTAG document from Xilinx for these kinds of tasks. When I was attempting a similar task, I used the device BSDL files, STAPL/SVF streams from impact, and a logic analyzer to get the correct JTAG sequence for flashing an XCF device. If possible, I'd recommend you add another communications channel to the FPGA (a simple serial interface, for instance) that gives you access to the SPI flash pins. Failing that, you might be able to use the JTAG ACE player in XAPP424, and ask Impact to output to an SVF file followed by doing an indirect programming of the PROM. I've used XAPP424 myself for programming platform flash, but not for an indirect SPI PROM, so I'm not certain it's possible.
07-20-2011 02:43 PM
As gbredthauer mentioned you will need to look at the BSDL files for the device commands and also create some SVF files to see what instructions are being sent for say an erase command. However, Xilinx provides an excellent application note (XAPP058) that bascially does exactly what you are looking for, so I think you will find this very useful. The design will play an SVF file on a uprocessor to program a flash via JTAG. Or really you can play any SVF file through the uprocessor to send whatever JTAG instructions you want.