diff mbox series

[U-Boot] Bootcount on raspberry pi 0 w

Message ID 6763c4bf-8103-1a66-2e16-ca98d7217fe3@tmweb.at
State New
Delegated to: Matthias Brugger
Headers show
Series [U-Boot] Bootcount on raspberry pi 0 w | expand

Commit Message

Thomas Mahringer Oct. 3, 2019, 3:26 p.m. UTC

We are using yocto + swupdate and u-boot do deliver software updates for 
our hardware which is based on a raspberry pi zero w.

So far everything seems to be working, however I would like to use 
u-boot's bootcount feature to switch back to the previous version in 
case an upgrade fails to run.

I have tried enabling bootcount with this patch to the config:


However, every time i boot the system bootcount is set to 1

root@raspberrypi0-wifi:~# fw_printenv | grep count

Even if I manually increase bootcount via fw_setenv it gets reset to 1 
after i reboot.

I don't really know where to go from here, could anyone maybe point me 
in the right direction?

best regards
Thomas Mahringer
diff mbox series


diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig
index 39da54c3e7..5e5afe0dd6 100644
--- a/configs/rpi_0_w_defconfig
+++ b/configs/rpi_0_w_defconfig
@@ -20,6 +20,12 @@  CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_EXTRA_ENV_SETTINGS="altbootcmd=if test $rpipart -eq 2; then 
setenv rpipart 3; else; setenv rpipart 2; fi; saveenv;boot\0"