-
Notifications
You must be signed in to change notification settings - Fork 1.5k
espressif: fix MCUBoot OTA on Espressif devices. #16735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Seems we have an error building |
|
@fdcavalcanti this error happen in many pr(e.g. this pr and #16734) recently: please fix it. |
811e8ca to
f07e51b
Compare
|
@fdcavalcanti please update https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#mcuboot-update-agent to include the steps you included here. This will make life easier for those is testing it. |
Fixes partitions for MCUBoot usage. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Adds support for e-fuse on ESP32S2 and fixes a gitignore issue. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Adds partitions required for MCUBoot usage and a sample defconfig. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Updates MCUBoot documentation and usage example. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Do you mean the link to the video? |
|
@fdcavalcanti please fix the conflict |
f07e51b to
463506d
Compare
No, I mean the Testing steps that you included here. This way users could test it locally |
It's still there, just linked to a different section: here |
Summary
Adds partitions required for MCUBoot usage and a sample defconfig.
Adds support for e-fuse on ESP32S2 and fixes a gitignore issue.
Fixes partitions for MCUBoot usage.
This PR modifies SPI Flash and E-Fuse related code to support OTA using MCUBoot.
Impact
Testing
This example is valid for any of the SoCs affected. Tested on all of them and also CI tested.
Building
Part 1:
First build the default mcuboot_update_agent config. This image defaults to the primary slot and already comes with Wi-Fi settings enabled.
./tools/configure.sh esp32-devkitc:mcuboot_update_agentmake bootloadermakeVerify it boots ok and the message This is MCUBoot Update Agent image appears before Nuttshell is ready.
Connect to Wi-Fi:
Keep the board as is and move to part 2.
Part 2:
On menuconfig, change MCUBoot target slot to the 2nd slot and modify the MOTD as a mean to verify the new image is being used:
Apply the changes with
make olddefconfigand rebuild withmake.This will build a binary with secondary slot as target and a custom MOTD.
Running
At this point the board is already connected to Wi-Fi and has the primary image flashed. To execute OTA, create a simple HTTP server on the NuttX directory so we can access the binary remotely:
On the board, execute the update agent, setting the IP address to the one on the host machine:
Wait until image is transferred and the board should reboot automatically:
Nuttshell should now show the new MOTD:
At this point, the image is loaded but not confirmed. To make sure it won't rollback to the previous image, you must confirm with mcuboot_confirm and reboot the board. The OTA is now complete.