Hello guys.
I have a CAN node, which runs custom bare metal program on its own. The bare metal program has been developed by me. I’ve implemented and used uavcan library to provide the functionality. The reason that i used bare metal is that AP_Periph + AP_Bootloader do not fit in my MCU’s flash size. It has only 64KBs of flash.
Talking about my bare metal program, i successfully implemented uavcan protocol. My device sets some lights according to the message received and it is also able to get dynamic parameters from cube orange via CAN.
With the setup that I mentioned, my device works correct. But the problem is that apparently I am not able to upgrade the firmware via CAN. I want to be able to upgrade firmware via CAN because all node devices have this capability, and also it is very hard to disassemble it, program it via a computer and put it to location it used to be. I do not wanna disassemble the device. Since device is already connected to CAN bus, i want to add CAN firmware upgrade capability to my device.
Novadays, i am examining the firmware upgrade process of AP_Periph node devices, and this is the main reason which made me share this post. My first question is:
1- How the firmware upgrade via CAN works? I mean how DroneCAN gui tool does it, what is the flow, steps etc.?
According to my reviews, there is a particular message which is sent by serial, and the rest is handled by AP_Bootloader. It looks like drone can sets a parameter in the device, and sends a message to it which says “reboot”. After this, AP_Bootloader checks this parameter and if there is an upgrade, it handles the firmware upgrade loop. Then, it updates this parameter and restarts the device.
The problem is that my device is not connected to serial, so DroneCan GUI can not send serial message. I think I misunderstood this, and i really wanna know the true logic. As I said, i already checked the AP_Periph software components but this is the only thing that i understood. It receives reboot message via serial channel, which is UART. But my device or the other devices are not connected to UART channel, they are all connected to CAN bus. So it has gotta be something about CAN messages that starts upgrade process. Unfortunately i haven’t found it yet, I hope you are gonna help me with this.
My main concern is combining my custom bare metal software with AP_Bootloader. These two can fit in my flash. The only thing i need is understanding the how upgrade process starts and flows. If you give me some clues, recommendations or direct information, I would appreciate it. Finally, i wanna add a final question which is:
2- What do you think about my method? Has it been applied, have you heard about it? If someone could have done it, i really want to talk to that person.
Thank you for your time.