|Deletions are marked like this.||Additions are marked like this.|
|Line 86:||Line 86:|
|$ homebrew install dfu-util||$ brew install dfu-util|
Updating the firmware
The firmware of the tinySA can be updated by the user. If your device is functioning well there is no need to upgrade the firmware. A new firmware can add new functionality or even improve performance but if your tinySA is performing well there is no need to upgrade.
Saving your device specific configuration data (optional step)
If you have a new device and you did not change device specific configuration data you can skip this step.
Part of the CONFIG data are the leveloffset for high and low mode as set by LEVEL CAL or ACTUAL LEVEL and the frequency dependent Correction data. These will be reset to factory defaults when you do a clearconfig or when you install a FW with new/changed configuration or setting items. You can list the data using console mode and restore after updating and/or clearconfig.\The correction table is specific for a HW version and newer or older FW's may have a different correction table or you may have improved the correction table values. These are the commands you need to enter at the console prompt and the example responses.
ch> leveloffset leveloffset low -3.0 leveloffset high 100.0 ch> correctioindex frequency value 0 10000 6.0 1 100000 2.8 2 200000 1.6 3 500000 -0.4 4 30000000 0.0 5 140000000 -0. 6 200000000 0.4 7 300000000 3.0 8 330000000 4.0 9 350000000 8.1
A leveloffset of 100.0 implies the level has not yet been calibrated.
The next step is to update the firmware. This can be done either using a .dfu file or using the .bin file. Only one of these updates is needed, not both.
Getting new firmware
New versions of the firmware can be downloaded from [http://athome.kaashoek.com/tinySA/DFU/]] A sub folder contains all the old FW versions so you can go back to a previous version if needed.\Download ether a tinySA_version_number.dfu or tinySA_version_number.bin file to your PC.
Updating the firmware using a DFU file (Windows)
To load the firmware onto the tinySA you need to download the DfuSe tools from st.com.
Extract and install the tool and run DfuSeDemo.
Connect the tinySA to a PC using a USB cable.
Switch the tinySA on and enter DFU mode using the menu.
The tinySA should appear under Available DFU Devices as STM Device in DFU mode and the updating can proceed.
Start by making a backup of your current FW using the Upload Action function of DfuSeDemo. Use Choose to select a target filename for your backup and then hit Upload for creating the backup
Next is to update to the new FW using the Upgrade and Verify Action function of DfuSeDemo. Use Choose to select the new FW file, enable Verify after download and hit Upgrade .
Updating the firmware using a BIN file (not needed if you have already updated using the .DFU file) (Windows AND Linux / MacOS)
Get the tinySA_version_number.bin file from [http://athome.kaashoek.com/tinySA/DFU/]] and also download from there the files with names starting with DFU.
Connect the tinySA with USB, switch the tinySA on and enter DFU mode.
Open a windows command window and go to the folder with the downloaded files and run DFU_LOAD_BIN.bat. The tinySA should now be updating with the ch.bin file using dfu-util-static.exe.
On Linux search for dfu-util for you Linux distribution. Look inside DFU_LOAD_["/BIN/BAT"] for inspiration on how to use dfu-util to load a .bin file.
The Vendor ID (VID) and Product ID (PID) 0483:df11 can be checked here
- 0x0483 0xDF11: STMicroelectronics, STM Device in DFU Mode
# Install dfu-util $ sudo apt install dfu-util $ man dfu-util # Read the manual # flash firmware $ cd 'to firmware download folder' $ dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D tinySA.bin # :leave means to leave DFU mode after flashing (=RESET) # or if it is a tinySA.DFU file $ dfu-util -a 0 -D tinySA.dfu
On MacOS it is similar to Linux (if needed Homebrew Installation):
# Install dfu-util $ brew install dfu-util $ man dfu-util # Read the manual # flash firmware $ cd 'to firmware download folder' $ dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D tinySA.bin # :leave means to leave DFU mode after flashing (=RESET) # or if it is a tinySA.DFU file $ dfu-util -a 0 -D tinySA.dfu dfu-util 0.9 ... DFU mode device DFU version 011a Device returned transfer size 2048 DfuSe interface name: "Internal Flash " file contains 1 DFU images parsing DFU image 1 image for alternate setting 0, (1 elements, total size = 89424) parsing element 1, address = 0x08000000, size = 89416 Download [=========================] 100% 89416 bytes Download done. done parsing DfuSe file
If the upgrade fails and you get a white LCD screen.
If the upgrade fails for some reason (wrong file, power failure) you may get a tinySA that seems to be bricked. Luckily it is impossible to brick the tinySA. Follow these steps to unbrick:
- Switch off.
- Open the case by removing the 4 screws at the back
- Connect the two pcb edge points marked VDD and BOOT0
- Switch on.
- Lcd turns white
- You can disconnect the VDD and BOOT0 if needed
- Connect to PC using the USB cable
- Update firmware
After upgrading the firmware
Once the FW is upgraded reset the tinySA by switching off and on. The normal scanning screen should appear and the tinySA (if still connected) should appear as a serial over USB device in the Windows device manager or as a /dev/tty device under Linux.
The FW maintains a checksum over the config data to detect if the structure of this data has changed with a new FW version. It is however good practice to clear the config data to be absolutely sure no old data remains possibly causing problems. Connect to your tinySA using the serial over USB port using a terminal program such as Tera and issue the clearconfig command.
ch> clearconfig 1234
After clearing the config you can reset the tinySA with the reset command:
ch> reset Performing reset tinySA Shell ch>
Restoring your settings (if previously saved)
To restore the config using the data recorded when saving the configuration above issue these commands at the console prompt where the numbers are replaced by the data saved from your tinySA.
leveloffset low -3.0 leveloffset high 100.0 correction 0 10000 6.0 correction 1 100000 2.8 correction 2 200000 1.6 correction 3 500000 -0.4 correction 4 30000000 0.0 correction 5 140000000 -0.4 correction 6 200000000 0.4 correction 7 300000000 3.0 correction 8 330000000 4.0 correction 9 350000000 8.1 saveconfig