
Dear Ying-Chun Liu,
In message 20220125135535.224061-1-grandpaul@gmail.com you wrote:
I've implemented A/B firmware update based on eMMC hw partitions. Normally we have 2 boot partitions on eMMC. One is active and another is inactive. We can then flash the firmware to the inactive one and make it active.
We have been doing software updates using U-Boot scripts etc. for many, many years. But during that time a large number of restrictions and shortcomings became clear. this is why projects like SWUpdate [1] came into life, and U-Boot supports this only with very basic features:
- watchdog support to reset a hanging system - boot counter to switch to an alternate boot command in case of too many failed boot attempts
That's all. Not more is needed, and not more should be used in U-Boot.
I'm not sure if you know SWUpdate - if not, you should definitely look into it. I strongly recommend not to try to reinvent that wheel - poorly - in U-Boot. We have been there before, and got rid of this approach for a pretty long list of good reasons.
[1] https://sbabic.github.io/swupdate/
Best regards,
Wolfgang Denk