Remote Update last binary Build on LPC1768

Remote Update Last Binary Build on LPC1768 (+ GsmClick: Telit GL 864 Quad)

I set up a remote update method of the BIN program (downLoad from an FTP directory).
Every day, at a fixed time, or on order received by SMS, the program visits its FTP directory in search of a new Build.
I had succeeded this step (download on localFileSystem , integrity check) but so far this new build was not taken into account by LPC 1768 after a reboot (true On / Off caused by an external circuit).
The cause was: Build of the same name and same date (2018/01/01)!
I solved the problem by naming the downloaded file 0.BIN, then 1.BIN, then 2.BIN etc …

Algorithm:

  • Determine the name of the new BIN by incrementing the name of the old one.
  • Download the new BUILD under the new name. The name of the file to download is in a file of deposit placed beside him (on the FTP server), and which contains checksums allowing the validation.
  • Check the integrity of this new BUILD (by recalculating the checks in the deposit file)
    • if OK file: the old Build is summed, and the new one will take over
    • if NOK file: we delete the new build, the old one remains in action.
  • sending a report to the FTP server

… and everything works fine !