This PERSIST_SECONDARY_BOOT bit can be set and cleared in software. The software, loaded from selected boot partition, can check and set/clear it as required.
To use the redundant boot feature of the i.MX7 Boot ROM, the HAB image authentication procedure should be implemented, as described in the Section 6.6.13 "High Assurance Boot (HAB)" of the i.MX7Dual Reference Manual document.
If you don't want to use the i.MX7 HAB feature, the most reliable way of updating the firmware seems to use some general software-based approach, e.g. to have a small unchangeable part of primary bootloader code and multiple boot partitions. The primary bootloader should be able to authenticate the boot partitions code/data somehow (e.g. by calculating CRC) and then decide which boot partition code pass the control to.
Have a great day,
Artur
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------