MarsRoverFirmware icon indicating copy to clipboard operation
MarsRoverFirmware copied to clipboard

Add functionality to do OTA firmware updates

Open wmmc88 opened this issue 5 years ago • 6 comments

Add ability to do updates over CanBus (may keep it somewhat abstract so it'd work over other interfaces?). this would involve customizing the bootloader and embedding some sort of board id into the flash of each board. This would allow us to iterate code faster (no need to fumble with flashing boards and stuff).

wmmc88 avatar Mar 22 '20 15:03 wmmc88

Honestly this is like super overkill, but i'm gonna do it as a pet side project. probs will make just a seperate script or program to execute the update based off git hash or smth.

wmmc88 avatar Mar 22 '20 15:03 wmmc88

No bootloader mods actually have to be done. https://www.st.com/resource/en/application_note/CD00167594-.pdf

can bootloader is already loaded: https://www.st.com/resource/en/application_note/cd00264321-can-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

wmmc88 avatar Mar 22 '20 16:03 wmmc88

https://www.youtube.com/watch?v=cvKC-4tCRgw

wmmc88 avatar Mar 22 '20 17:03 wmmc88

Yes bootloader is present, we just need to be able to pull the boot0 pin in the right direction (if not already). Should tell EE to add a jumper for this if we need it to be configurable. @lwbantoto

jetkov avatar Apr 27 '20 02:04 jetkov

Of note for the can bootloader:

Once initialized the CAN2 configuration is: 
Baudrate 125 kbps, 11-bit identifier.
Note: CAN1 is clocked during CAN2 
bootloader execution because in CAN1 
manages the communication between 
CAN2 and SRAM

It only works on CAN2.

wmmc88 avatar Apr 27 '20 02:04 wmmc88

@jetkov I dont think we want a jumper. The point of this issue would be to update firmware without needing to touch the boards at all(assume bad accessibility).

I think we can have smth to jump to the bootloader from app. Havent watched it yet, but pretty sure that video linked above has an example of how to do this nicely.

wmmc88 avatar Apr 27 '20 02:04 wmmc88