opendps icon indicating copy to clipboard operation
opendps copied to clipboard

Stabilise and improve UART protocol

Open kanflo opened this issue 6 years ago • 4 comments

There are a few design flaws in the current UART upgrade protocol and the use thereof, as mentioned in #191

  1. dpsctl.py does not do do retransmits
  2. As there are no counters in the CMD_UPGRADE_DATAframes, a resent frame might result in device reported CRC error at the end of the upgrade process.

As this leads to changing the boot loader, the following should be added while at it:

  1. There should be protocol support to change the baud rate.
  2. Backwards compatibility should be kept (old/new dpsctlshould be able to upgrade new/old dpsboot for all permutations of 'old' and 'new').

kanflo avatar Oct 26 '19 14:10 kanflo

I guess a new CMD_UPGRADE_DATA2 frame is needed with a counter and dpsctl could start with this one and fall back to CMD_UPGRADE_DATA. The silly thing is that the boot loader does not NAK frames with unknown commands meaning we will need to throw a handful of CMD_UPGRADE_DATA2 at the DPS before falling back the old protocol. Gah!

A boot loader upgrade method should be implemented too for the brave out there.

kanflo avatar Oct 26 '19 14:10 kanflo

It is really a good idea to have some kind of handshake dialogue for the bootloader and to repeat a broken frame. I found (#191) that the device just breaks at some point in communication where the GUI is still running. But I am not quite sure if this is always the same behaviour. I will try to verify this tomorrow.

hseibel12 avatar Oct 27 '19 09:10 hseibel12

BTW has opendps ability to set device address in the serial protocol... I believe that original firmware allows to use multiple devices on single serial line (= they only TX when queried by specific address)

Harvie avatar Nov 22 '19 14:11 Harvie

Any updates on this? I cannot upload firmware due to Error: device reported CRC error.

4nthonylin avatar Sep 25 '20 07:09 4nthonylin