VGSM-II Firmware Upgrade
From VoiSmart Open Source Wiki
Introduction
The vGSM-II card is based on a programmable logic chip (FPGA) which implements most of the card's interfacing between the GSM modules and the host system. This chip gathers its programming from a flash memory chip physically installed on the card. If bugs in this programming are found or new features need to be implemented, a new program needs to be programmed onto the flash memory.
This document describes the upgrading procedure and the precautions that need to be taken.
Step-by-step procedure
Step 1: Download the latest software
The latest software revision is needed because it contains the latest firmware and the proper tools to program it on the card. Of course if you already are running the latest revision you may skip steps fromo 1 to 4.
Most recent firmware is [distributed] in the vstuff package in the vgsm2_firmware/ directory.
Open the README file contained within that directory and read the changelog and check that the firmware changes are really needed. If not, upgrading the firmware will not bring you any hidden benefit and the risk to render the vGSM-II card useless by failing a useless upgrade will not be worth it.
Step 2: Compile and install the software package
This step is needed in order to have the latest modules running and the latest vgsmctl program installed.
Step 3: Stop Asterisk and all the clients that may be using the vGSM-II card.
Step 4: remove the old modules and insert the new ones
The following steps should do the trick:
rmmod vgsm2 rmmod ks-userport rmmod ks-softswitch rmmod kstreamer modprobe vgsm2 modprobe kstreamer
Step 5: Run vgsmctl fw_upgrade
*** WARNING : BE SURE THAT POWER CANNOT FAIL AND DO NOT REBOOT OR HALT OR DO ANYTHING ON THE SYSTEM DURING THE UPDATE ***
Here is a sample output of a vgsmctl run:
# vgsmctl -d /dev/vgsm2_card0 fw_upgrade vgsm2_firmware/vgsm2-2.8.0.fw ############################ WARNING ############################### If firmware programming is interrupted by any means the flash memory WILL be corrupted. If possible retry another programming session, otherwise the hardware will need to be factory reprogrammed with the related costs. Please don't attempt firmware programming unless specifically instructed. #################################################################### Firmware size: 250021 bytes CRC: 0x05b1025e Checksum: 0x0053 Current version running: 2.6.2 Version to program: 2.8.0 Are you sure? (Y/n): y Updating firmware (this may take a while)... WRITE: 0x00000/0x3d085 Firmware has been SUCCESSFULLY programmed When possible 'rmmod vgsm2' to activate reconfiguration and reboot
Is something fails in the process please DO NOT reboot or turn off your machine, if the flash memory's contents are invalid the FPGA will attempt to reload the invalid configuration and will halt in error. At that point a factory reprogramming will be the only way to restore the card's functionality.
Step 6: Reload the firmware
When ready to reload the new firmware you should stop any client application and rmmod vgsm2, this will trigger the FPGA reconfiguration. After reloading the firmware, howerver, the card's PCI parameters would remain uninitialized by the operating system, thus you need to reboot to make the operating system rescan the PCI bus.
Step 7: Reboot
Actually a PCI rescan would be enough but I have yet to find a kernel which properly implements fake hotplug removal and rescan :^)
If rmmod didn't work you need to power-off the machine and restart it for activating the new firmware. Reboot without powering off won't work.

