Programming

How to re-program both firmware and software, in case upgrade is needed.

Programming

Programming is done via the USB port, by sending either a software or firmware file.  These files are freely available on the website. You should be reasonably technically competent to do this.
On a Windows computer, you should use the Windows Utility - though you may use the terminal program method if you want to.  On Linux and Apple computers, use the terminal program method. You do not need to register with Dropbox to download the files, or accept their cookies.  You can shutdown the sign-up window, and then download the zip file.
For all methods, you need to do the following:
1] Download the "Latest Production Files", using the link below.



sfr11021104.zip
2] Unzip the files into a specific directory (maybe SFRProg).
3] Check that there are 9 files in the directory, including firmware.txt and software.txt

Devices in Windows

In the Devices and Printers pane in Windows, StaRFIshrail should appear as an Unspecified device.  The drivers should be automatically installed when you plug the hub in on a USB port, as the USB chip used is a standard FTDI USB bridge. The first time you plug in the Hub you should make sure you are on line, as Windows can then search for the installation files if they are not already on your computer. If you are intending to use the Terminal program method, you can see the COM port assigned to StaRFIshrail by double clicking on the StaRFIshrail logo, and then selecting the "Hardware" tab.  You should see a line that says USB Serial Port(COMx), where x is the number of the COM port Windows has assigned to StaRFIshrail.  Make a note of this.

Programming using Windows Utility

This method is the preferred way of programming, but is only available on Windows computers. You do not need to set up the Baud rate, port number etc. 
  1. Plug the USB cable between the Windows computer and the hub, and then check that the computer is seeing the hub by looking at "Devices and Printers" pane - there should be an unspecified device named StaRFIshrail.
  2. Set the OPT switch on the hub to position "F".
  3. Using Windows Explorer, navigate to the directory containing the unzipped files.
  4. Double click on the "setup.bat" files, and this will start running the Windows Utility.
  5. You should see a window pop up as shown on the left. The text under "Progress" may not appear as shown - this is not relevant for programming.

Programming the Firmware and Software

  1. Press the "Firmware" button, and the firmware file will start to load.  You will see the progress as shown on the left. When all 336kB has loaded, you will see a message saying "FPGA programmed", which means the firmware update has been completed.
  2. To update the software, press the "Software" button.  The legend will show "Program Micro" and the number of kB sent - this will be much quicker than the firmware update, and will complete when  "Micro Programmed" is shown.
  3. You should now either re-power the hub, or press the "REBOOT" button, which should "click".  After a re-power or REBOOT, within a few seconds the red RUN led will start to flash, indicating all is well. If the RUN led does not flash, go to the Recovery paragraph below
  4. The line under "Progress" will now show a slowly rotating list of the internal state of the hub, including IP address, MAC address, readers attached etc.
  5. Switch the OPT switch back to the user position you want it in.

Programming Method using Terminal window

Connect the USB cable between your computer and the USB port on the Hub.  If this is the first time you are doing this, then makes sure your computer is on-line.  The computer should automatically find the driver for the USB FT234X chip.  You need to have a terminal program installed - Tera Term is the recommended program, which is available as a free download, but you can use which ever terminal program you wish.
Set the OPT switch to position "F".
The USB serial port should be configured as 115,200 baud, 8 bit, no parity, 1 stop bit.  For terminal programs other than TeraTerm, the procedure may be slightly different, but all you need to do to reprogram the firmware is to send the file firmware.txt, and to reprogram the software send the file software.txt.
The detailed instructions below are for TeraTerm.

Set Up Serial Port

Set the OPT switch to position "F".
Go to File>New Connection, and select the "Serial" radio button, and the COM port that the StaRFIshrail device is on.  In this case, as seen on the left, the COM port is COM5.  Then press "OK".

Set up Serial Rate

Go to Setup>Serial port, and set as on the left, Baud rate 115200, Data 8 bit, Parity none, Stop 1 bit, Flow control none, and then press "OK"

Send File

Go to File>Send file, and then navigate to where the unzipped files are,  Choose firmware.txt to reprogram the firmware, and then press "Open".  The file will start to transfer, and you will see what is shown on the left.  The overlay window shows the files progress, and the TeraTerm window behind also shows messages coming back from the hub.  When the overlay window disappears, and the message in the TeraTerm window say "FPGA programmed", then the operation is complete.  To reprogram the software, do the same procedure, but choose software.txt as the send file.  In this case, the finish message on the TeraTerm window is "Micro Programmed".
After finishing the programming, either press the REBOOT switch, or re-power for the update to take effect.  The red RUN led should flash - if it does not, see Recovery Paragraph below.

Check the Update

On the TeraTerm window, as seen on the left, the status of the hub will be shown.  These lines trickle through, so you may need to wait a minute or so before all the status lines are shown.  The Software and Firmware version should match those in the file that you downloaded.  The other lines give you status of the hub.  Note that if you want to find the status of the hub at any time, you can just switch the OPT switch to position "F", and connect TeraTerm.  This may be useful to find out the IP address the hub is set to, or to check that readers are attached.  After you have checked, shut down TeraTerm, and switch the OPT switch back to its previous position.

Recovery

Although extremely rare, it is possible for the programming to go wrong, maybe due to a data error in the serial communications, or even a power down or glitch during programming. Under these circumstances, there is a recovery process, so the hub can never be turned into a "brick" or a "toaster"!.
To recover, do the following.
  1. Un-power the hub.
  2. Put a link in the "REC" position as shown on the left.
  3. Power up the hub.  If the red RUN led now flashes, then the problem is with the firmware. If the red RUN led does not flash, then the problem is with the software (though it may be with the firmware as well).
  4. Take the link out of the "REC" position.
  5. Reprogram the firmware and software as above.
  6. Un-power the hub and re-power the hub. and everything should be back to normal, with the latest software and firmware installed.
  7. If you get into difficulty, please contact us!

Further information

When the hub is powered up, the programming file for the Xilinx - known as the firmware - is transferred from a non-volatile memory into the Xilinx.  The Xilinx has volatile configuration memory, which means when it is powered down, it looses its memory. There are two sets of non-volatile memory for starting the Xilinx - one is able to be programmed by the user, by doing the firmware update, and the other has been programmed at time of manufacture, and can never be changed - this is the recovery memory.  If the "REC" link is in, the Xilinx will power up with the factory programmed memory - this will not be the latest version, but it sufficient to allow the updatable firmware memory to be programmed.The programming file for the Atmel microprocessor - known as the software - is held in non-volatile memory in the Atmel processor itself.
The firmware programming file, firmware.txt, and the software programming file, software.txt will always have the same name, whatever version these are on.  This is to do with the way the Windows utility works.  However, you may save previous versions of these files, and if you have a look at the files with a program such as Notepad, you will see the version number on the second line.



Downloads

Below are archived downloads, of previous versions of firmware and software, and also those used in development.  

sfr11021104.zip