nexdome / Firmware

NexDome Dome and Shutter Motor Kit Firmware
https://www.nexdome.com
Other
3 stars 6 forks source link

Improve firmware settings integrity check #10

Closed NameOfTheDragon closed 4 years ago

NameOfTheDragon commented 4 years ago

@NameOfTheDragon commented on Wed Oct 02 2019

On power-up, the firmware loads settings from EEPROM and performs an integrity check on the data. If the integrity check fails, then default settings are loaded.

In specific circumstances, EEPROM can be corrupted in a way that still allows it to pass integrity checks. In this situation, the device will behave erratically. Symptoms reported include the user needing to press the rocker switch repeatedly to get the dome/shutter to move.

The specific circumstances that lead to this corruption are when the user has upgraded to V3 firmware, downgraded to V2, then upgraded to V3 again. This happened a few times during alpha testing but should not be a problem post-release.

Workaround

  1. Download the EEClear.hex firmware image from the GitHub repository and drop it into C:\Nexdome-Firmware
  2. Open the driver SetupDialog and use the firmware update utility to uploed the EEClear.hex image. This will immediately clear the settings from EEPROM.
  3. Upload the normal operating firmware and continue to use the software as normal.

Proposed solution

Write the integrity check 'fingerprint' at the start of the settings instead of at the end. Then the 'fingerprint' will be the first thing to be overwritten instead of the last.