You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leka is an interactive educational toy. It contains a complex firmware called LekaOS. As with any kind of software, LekaOS will need to be updated in the future to add new features to the product, improve existing ones and fix bugs.
To do so, LekaOS must to provide a way to update the firmware without breaking the robot.
The Mission
Develop a bootloader to handle the firmware update process
Constraints
Mbed OS based
check firmware integrity
roll back in case of failure
prevent infinite reboot loop
Technical description
Leka's PCB contains 3 external memories:
1st one contains the factory firmware and is read only. It is flashed during manufacturing and is used to put the product back to factory settings
2nd one contains the current firmware used by the robot
3rd one will be used to store the new version available before updating
LekaOS is not executed from external memory, thus a new update needs to be written to the MCU flash.
The process is as follow:
LekaOS is running normally
the iPad app send a command saying that it will send a new firmware update
LekaOS reads the incoming update and writes it to the available external flash
LekaOS checks the firmware is not corrupt and is signed and provided by APF France handicap
LekaOS reboots
the bootloader starts first, checks again that the new update is suitable
if the update is suitable, the bootloader writes it to the MCU flash, checks it was written correctly and then starts the program
if it is not the bootloader starts the current firmware
Steps
1. TTHW (Time To Hello World) & Bootloader
As a first step, we need to better understand the concepts behind a bootloader.
- read the documentation
- read the documentation, again
- follow the Mbed Bootoader Example to create a very simple bootloader to just print something while it runs (you might need to add delays to see the text from the terminal)
- play with the addresses, get a better understanding of what works and what doesn't, don't be afraid to break things
- get a clear view and document the process using Mbed CLI (not the online compiler nor Mbed Studio)
2. TTHW & New Firmware Storage
The second step focuses on the other side of the mission, storing the new firmware in flash. For simplicity, we will upload the new firmware through USB.
- create two very simple Mbed OS programs to blink a LED at different speed (every 2 seconds vs. every 500 ms)
- store the .hex and .bin safely
- find out which one is needed to the update
- create the Mbed OS update program that will listen to incoming data and store them in the flash memory
- check that data written on flash are the same than the ones sent via USB
- find a way to safely send the new firmware from the computer using Python, Ruby, or whatever language your confortable using. This tool will take the .hex or .bin as input
3. Deep Dive Bootloader & Firmware Update
In the previous steps we learned how to make a bootloader and how to store a new firmware image. In this third step, we will put the two together and update the firmware.
- create a bootloader to read the external flash memory
- write something to the external flash memory and read it from the bootloader to make sure it works
- update the bootloader to write to the MCU flash
- flash the board with one of the two program created in step 2
- when the board is running, send via USB the other one to be stored in external flash memory
- reboot the board so that the bootloader can read the external flash and write the new firmware using Flash IAP
Mission - Leka Bootloader & Firmware Update
Introduction
Leka is an interactive educational toy. It contains a complex firmware called LekaOS. As with any kind of software, LekaOS will need to be updated in the future to add new features to the product, improve existing ones and fix bugs.
To do so, LekaOS must to provide a way to update the firmware without breaking the robot.
The Mission
Constraints
Technical description
Leka's PCB contains 3 external memories:
LekaOS is not executed from external memory, thus a new update needs to be written to the MCU flash.
The process is as follow:
Steps
1. TTHW (Time To Hello World) & Bootloader
As a first step, we need to better understand the concepts behind a bootloader.
2. TTHW & New Firmware Storage
The second step focuses on the other side of the mission, storing the new firmware in flash. For simplicity, we will upload the new firmware through USB.
.hex
and.bin
safely.hex
or.bin
as input3. Deep Dive Bootloader & Firmware Update
In the previous steps we learned how to make a bootloader and how to store a new firmware image. In this third step, we will put the two together and update the firmware.
Resources
The text was updated successfully, but these errors were encountered: