Using Carte Blanche's built in JAT to reprogram the onboard SPI Flash memory

Carte Blanche utilises a Xilinx XC3S Spartan E Series logic device which requires its logic configuration to be programmed each time the FPGA powers up. Carte Blanche's on board Flash is an industry standard SPI type device by SGS-Thomson, called an M25P80, being an 8Mbit device. The FPGA on power up contacts the Flash and attempts to boot three times at 75MHz, before giving up. If a Flash device is found and has been programmed with a valid bitstream, the FPGA will load the design and illuminate the DONE LED, indicating a successful FPGA load. There are several ways to gain access to the SPI flash to reprogram it. With previous FPGA technologies, the only method of programming these devices was to do so via an interface that directly connected to the custom Flash. More recent FPGA devices, such as the Spartan 3E series on Carte Blanche, use standard SPI style devices and are capable of programming their Flash memories in system.

To program your Carte Blanche's memory device using JAT's built-in Flash programmer, use the following steps:

WARNING:Reprogramming Carte Blanche's Flash memory device will replace its current configuration file. If not performed correctly, this can stop your current Carte Blanche design from working, preventing you from reprogramming the Flash again. To recover from this situation, see 'What to do if your Carte Blanche Flash is corrupted' on this page.

Install the "BITSTREAMS" SD card, or the SD card that has the desired .BIT file on it into Carte Blanche's SD slot and power on.

Select the ".BIT" file you wish to write to Carte Blanche's on-board SPI Flash. Make sure you choose a ".BIT" intended for your FPGA device (either a 250E or 500E). Hit <RETURN>

Select the desired .BIT file and hit <RETURN>

You will be prompted if you wish to continue. If you know what you are doing, and you are sure, type "Y" (the "Y" must be a capital).

JAT will then proceed to erase the Flash and commence writing the new configuration to memory. The "V" indicates the data was written and verified correctly.

Power-cycle your Apple to restart the FPGA and confirm the green "DONE" LED on Carte Blanche illuminates. This visual indicator confirms the FPGA loaded the new Bitstream correctly.

Carte Blanche's Flash memory is very robust, but a wrong bitstream, or a bug in a hardware or software design can cause the Flash to be corrupted. If this happens your Carte Blanche will be just like an Apple with all its chips removed. Somewhat useless (the LED's will still look pretty though).

FLASH FIRST AID: You can use this method to recover your Carte Blanche board if you have somehow managed to "trash your Flash". Flash memory can be corrupted in only a few ways; typically, the user downloads the wrong thing, or a user's new program goes rogue, stomping on the flash image. Knowing how to use these tools to get your flash image back into shape is an important skill for anyone interested in developing hardware or software designs for Carte Blanche.

With this approach you need to use a JTAG serial cable to download the JAT program to the FPGA, bypassing the toasted Flash. If your Flash has been squashed and Carte Blanche is unable to program its own Flash, then downloading JAT into the FPGA using JTAG will save the day. In this example I will use Xilinx ISE 10.1 (which can be download from Xilinx for free) and their low cost DLC9LP Platform Cable USB adaptor (this one is from ebay for $10).

Install the "BITSTREAMS" SD card, or the SD card that has the JAT1_XXX .BIT file on it into Carte Blanche's SD slot and plug it into your Apple.

Plug the JTAG leads into CB's header. The JTAG pins are marked on CB's PCB and the cables. Match each of the TDI, TDO TCK ,TMS, GND and REF(3V3) pins for a JTAG connection and power on. The LED on the JTAG adaptor should go green.

Your FPGA should now appear on the screen, otherwise right click to "Initalize Chain...". Right click on the FPGA, select "Assign new file", select "JAT1_250.bit" (a copy from the "BITSTREAMS" SD card).

Now right click again, this time select "Program..."

Your Carte Blanche FPGA should now be programmed and JATv01 back up and running on the Apple IIe's screen. This method only programs the FPGA, not the Flash. So now repeat the first steps in "Using JAT to reprogram your Carte Blanche Flash" to complete the task by writing to the Flash with our desired bitstream (which is usually JAT).