Homepage GitHub

Multiple issues during Firmware Update via GUI with libcanard on MCU


(Sturla Lange) #1

Hello,

I am working on an application that requires that a firmware update is possible. The procedure in terms of UAVCAN messages is roughly:

  1. Updater (GUI) requests update (uavcan.protocol.file.BeginFirmwareUpdate) from updatee (MCU), updatee responds and saves path.

  2. Updatee requests file info (uavcan.protocol.file.GetInfo) with the path as attribute, updater responds and updatee checks if the file fits in its memory.

  3. Update reads file (uavcan.protocol.file.Read) into memory.

In the first part the path length seems to be missing. path.len is always 0. To work around this temporarily I have hardcoded the filename. This gets me to step 2.

In step 3 the data.len is always 0 as well. This I can work around by calculating the number of packages required for the file size given by step 2. The offset in the request does not get higher than 1 unless I edit file_Read.c which was generated by the dsdl compiler and change the saturation macro or skip it all together.

Any ideas on what might be going on here?

Best regards,
Sturla


(Pavel Kirienko) #2

Tail array optimization. This is considered to be a mistake so it will be removed in UAVCAN v1.0.


(Sturla Lange) #3

Thank you for the quick reply. TAO seems a logical explanation for the missing length of dynamic arrays.

For future reference I see after looking through the commits on github that my problem with the saturation macro has been fixed here.