Loader Picture

CB2 Loader

Version 1.0

CB2 Loader is a free GUI type program that works with xc3sprog.exe (an open source program) to load bitstream files into the FPGA chip on a  Carte Blanche II card using the USB interface.  It can also load the bitstream into the FPGA from either the external or internal flash memory depending on which position the yellow jumper is set on the Carte Blanche II.  This is the same as powering the Carte Blanche II off and back on.

CB2 Loader can also write a bitstream file to either external or internal flash memory where it will auto load on each power-up.  It can also read the contents from either the internal or external flash memory into a bitstream file.

Why use CB2 Loader?

There are several ways to load bitstream files into the Carte Blanche II card.  If you are developing bitstreams yourself using Xilinx software then part of their ISE Design Suite of tools is iMPACT which can load the Carte Blanche II FPGA.  It can also load the internal flash memory on the FPGA.  But iMPACT has two failings.  It does not support the USB port on the Carte Blanche II.  This means you have to use the JTAG connector with an appropriate (and sometimes expensive) cable.   Also iMPACT does not support loading the external flash memory on the Carte Blanche II.  A better alternative is Papilio Loader which supports the Carte Blanche II USB port.  Papilio Loader works well for loading the FPGA but has some problems with loading the flash memory.  For loading the external flash memory SPI FTDI Flasher works well but it doesn't support flashing the internal flash.  It also requires some set up.

So you end up needing three programs to do everything you want. 

Papilio Loader to do the basic FPGA loading.

iMPACT to load the internal flash memory.

SPI FTDI Flasher to load the external flash memory.

Or you can use xc3sprog which can do all three and does them well.  This should be the way to go but xc3sprog is a console based program that uses a myriad of command line options to get the job done.  That's where CB2 Loader comes in.

CB2 Loader is a simple dialog type Windows program that takes care of the command line stuff for you by working with xc3sprog.  CB2 Loader is designed just for the Carte Blanche II and it keeps track of all the command line options so you don't have to remember them.  Since CB2 Loader automatically runs xc3sprog in the background the two programs work as one.

Installing CB2 Loader 

 

1  The Program Files & Program Files (x86) folders are not good choices for CB2 Loader due to the strict permissions in Windows 10 which cause some loss of functionality.

2  CB2 Loader is designed to use the ftd2xx drivers.  The ftd2xx drivers can be downloaded here if necessary.  CB2 Loader through xc3sprog does attempt to use the old drivers first.  The old drivers may or may not work properly.  That hasn't been tested.

 

Using CB2 Loader

Launching CB2 Loader brings up a dialog window similar to this:

CB2 Loader picture

 

It is important that the Carte Blanche II ports (Devices) are found and displayed in the Information window.  If you see Devices found: 0 displayed then probably the USB cable isn't connected, the Carte Blanche II isn't powered up or the right drivers aren't installed.  After fixing the problem you can click the Refresh button to try again.

You can enter a full path to the bitstream file you want to load or click the  ...  button which allows you to browse to and select the bitstream file.  Once it is selected you will see its path name in the box.  File locations are saved in a drop-down list.

Clicking the Load button (with the FPGA radio button selected) sends the bitstream to the Carte Blanche II's FPGA.  That's it.  The bitstream should be loaded and running.

There is also a Load FPGA from Flash Check Box.  If this box is checked then the  ...  (browse) button and the Bitstream Destination radio buttons are disabled.  Click the Load button and the FPGA will be loaded from the default flash memory chip (internal or external depending on how the jumpers are set in the Carte Blanche II).  The Load FPGA from Flash Check Box overrides the Bitstream Destination settings.

With the External Flash radio button selected any bitstream loaded goes into the external flash memory in the FPGA chip.  This can take a few seconds.  Keep watching the Information box until you see External Flash loaded.

With the Internal Flash radio button selected any bitstream loaded goes into the internal flash memory in the FPGA chip.  This can take a few seconds.  Keep watching the Information box until you see Internal Flash loaded.

Note:  Loading of the internal or external flash is not effected by the position of the jumper on the Carte Blanche II card.  The jumper only effects which flash memory is used to load the FPGA. 

CB2 Loader also has some advanced features.  Checking the Advanced box displays these features:

CB2 Loader Advanced picture


In the Read to file box you can read the contents of either the external or internal flash memory.  The contents are written to a file.

If the External Flash radio button is selected and the Read button pressed the contents are transferred into a file named XFlash.bit.

If the Internal Flash radio button is selected and the Read button pressed the contents are transferred into a file named IFlash.bit.

Both these files are saved to the CB2 Loader folder.

Below the Read to file box there are three checkboxes:

Limitations

License

CB2 Loader is a free program that is distributed under the GNU GENERAL PUBLIC LICENSE.  A copy of the license is included with the CB2 Loader under the name:  COPYING

Source code for CB2 Loader can be found here:  http://noboot.com/charlie/cs/cs_menu-5.html

Also free, xc3sprog is distributed under the same GNU GENERAL PUBLIC LICENSE.

Source code for xc3sprog can be found here: https://sourceforge.net/projects/xc3sprog/

Technical Information

CB2 Loader is a 32 bit program designed for (and tested in) Windows 10 Pro (64 bit) and Windows 10 Enterprise (32 bit).  It may or may not work in older versions of Windows. 

Testing was done with the Carte Blanche II in an Apple IIgs.  It should work with any slotted Apple II or even with the Carte Blanche II on its own with the proper power supply, but these ways have not been tested.

On startup CB2 Loader.exe reads information from the CB2 Loader.ini to initialize the dialog and then checks the connection between the Carte Blanche II card and your PC.  It should find two devices.

With devices found, CB2 Loader waits for user input and when a Load or Read button is pressed xc3sprog.exe is run as a child process.  What functions xc3prog performs are determined by the command-line commands sent by CB2 Loader.  In the cases of Loads to the Flash memory and Reads from Flash memory a special bitstream file is first loaded into the FPGA.  Next a Read or Load is performed and last, if the appropriate boxes are checked, the FPGA is again loaded with the bitstream in the Flash memory or from the 'just read' bitstream file.

Note that xc3prog changes the bitstream headers, so the bitstream file loaded and then read back will not be byte for byte the same but will function the same.

CB2 Loader was written in C, uses the Windows API and was developed using Pelles C for Windows version 8.00.60.

The cb2ext.bit file was written for reading / writing the external flash memory in the Carte Blanche II.

The xc3sprog source code was not altered in any way.

Questions, comments or bug reports can be sent to charlie.a2gs@gmail.com.