uavcan.protocol.file.BeginFirmwareUpdate

Hello, now my UAVCAN node received this message and implemented a jump to the bootloader. Now how should I handle the firmware upgrade? Is it possible to call uavcan.protocol.file.Read directly, but I think it is There should be no response information, I am not sure how the whole process is, ask for help. Thank you!!

Please read this: https://uavcan.org/Specification/6._Application_level_functions/#firmware-update

Also this: https://uavcan.org/Implementations/Libuavcan/Tutorials/11._Firmware_update/ The tutorial is for libuavcan, not libcanard, but the general principles are the same so you can use it as a high-level reference.

The Kocherga protocol module implements the UAVCAN bootloader protocol: https://github.com/Zubax/kocherga/blob/master/kocherga_uavcan.hpp (and it is built on Libcanard!)

thank you

Continuing the discussion from uavcan.protocol.file.BeginFirmwareUpdate:

I have another problem now. When I receive a lot of data, I can’t enter onTransferReceived. For example, when I receive the information of the file, I can’t confirm what the problem is.

You might be losing frames to RX queue overrun. If you’re using STM32, this might be relevant:

Yes, it is this problem that has been resolved. I need to send a message to the file service after I get and update, or I can directly convert the state of the UAVCAN node from SOFTWARE_UPDATE to OPERATIONAL.

How to verify the uavcan protocol file transfer part, I have not found relevant information at present, I feel that the transmission process is prone to errors.

The updatee can just switch its published mode to OPERATIONAL, no additional steps are required.

Unrelated: you can’t send a “message” to a service, these are opposite concepts. You can send either a service request or a service response, there is no such thing as “service message”.

Either:

  1. Embed a CRC into your file and check it. This works if the file is a firmware image (you probably need a CRC there anyway regardless of UAVCAN).
  2. Use a separate hash file as described here (the linked definition is for UAVCAN v1 but it is istill applicable to v0):

Thank you for your help, I have implemented the above functions.