2025-12-11 3:37 AM - last edited on 2025-12-11 3:41 AM by Andrew Neil
Hi everyone,
we applied the ST FWU reference solution on our own platform based on the STM32MP157F.
The solution was taken and adapted from the ST Yocto layer meta-st-ota (https://github.com/PRG-MPU-CUST/meta-st-ota).
When performing consecutive updates using the ST FWU reference implementation (TF-A FWU metadata + RAUC + post-install.sh + rauc-mark-good.service), the FWU rollback boot counter keeps decreasing across successful updates.
Expectation: after each successful boot of a newly updated bank (and rauc-mark-good.service finishing successfully), the FWU boot counter should be reset to the initial value (4 in this setup).
Actual: the FWU boot counter is decremented (4 → 3 → 2) with each update cycle, even though the system was marked good.
This suggests that the rollback counter is not being reset by the rauc-mark-good integration in the ST FWU reference solution.
(full log is attached, including metadata content printed in hexa after each step)
Boot fresh image (Bank A active).
Observe TFA logs: TF-A selects bank 0 (A).
INFO: Use primary FWU-Metadata
INFO: Try load metadata id=12...
NOTICE: Active index: 0, bank state: 252
NOTICE: Selecting to boot from bank 0
Simulate first update in Linux (A → B)
On bank A:
Then reboot:
First boot after first update (Bank B active)
Observe TF-A logs:
In Linux, rauc-mark-good runs and succeeds:
-> Expectation here: bootcount should now be reset back to 4 (for next update).
Simulate second consecutive update in Linux (B → A)
On bank B:
Then reboot:
Second boot after second update (Bank A active)
TF-A logs now show that the bootcounter decreased:
In Linux, again rauc-mark-good runs and reports success:
Simulate third update (A → B)
On bank A:
Output:
Then reboot:
Third boot after third update (Bank B active)
TF-A logs:
After each successful boot of a newly updated bank and successful execution of rauc-mark-good.service, the FWU boot counter for that bank is reset to the initial value 4.