Updating Firmware (WA2000 Only)
The WA2000 Wi-Fi/BLE add-on module stores its firmware in its flash memory. The firmware comprises two independent parts:
- The main firmware that implements all the features and functionality required by the wln. object and bt. object.
- The Monitor/Loader (firmware) that assists in upgrading the main firmware of the WA2000.
The wln. object provides a mechanism to update both the main firmware and the Monitor/Loader from within your Tibbo BASIC/C app. The following methods exist exclusively for this purpose:
- wln.setupgraderegion — selects the upgrade target (firmware or Monitor/Loader) and resets an internal flash pointer.
- wln.writeflashpage — sends 128 bytes of the firmware file into the WA2000. Rather than overwriting the target flash area directly, the WA2000 first stores the firmware file in a spare area of its flash. With each invocation of this method, the flash pointer increments.
- wln.upgrade — Initiates copying of the uploaded file (stored in the spare area of the flash) into the target (firmware or Monitor/Loader) area. Returns control back to the app immediately.
- wln.waitforupgradecompletion — blocks until the update process (initiated by wln.upgrade) completes.
There are also two read-only properties that allow you to query the current versions of the main firmware and the Monitor/Loader:
Finally, the following two methods also play a role in the firmware update process:
The primary purpose of these methods have already been explained: wln.getmoduletype detects the Wi-Fi module type and wln.boot boots up the module. During the update process, these two methods play another role: they launch the WA2000 into the execution of either the Monitor/Loader or the main firmware. To be able to update its main firmware, the WA2000 must be executing its Monitor/Loader. This is achieved by calling wln.getmoduletype after resetting the module. To be able to update its Monitor/Loader, the WA2000 must be executing its main firmware. This is achieved by calling wln.boot after resetting the module.
To improve the reliability of the upgrade process, the WA2000 requires your app to calculate and send the checksum of the firmware file.
For assistance updating the firmware of your WA2000, please contact Tibbo Support.
Updating either portion of the firmware make take up to a minute, so be patient.