imx8mn: bootcount does not increment

Hi,
When enabling bootcount on the imx8mm-evk like this:
--- a/configs/imx8mm_evk_defconfig +++ b/configs/imx8mm_evk_defconfig @@ -120,3 +120,5 @@ CONFIG_SDP_LOADADDR=0x40400000 CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_IMX_WATCHDOG=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y
It works as expected, and the "bootcount" environment variable gets incremented after a reset.
However, if I try the same on an imx8mn_evk, the "bootcount" variable always stays at 1 and never increments.
Do you happen to have any idea as to why imx8mn behaves differently in this aspect?
Thanks,
Fabio Estevam

Hello Fabio,
On 26.04.24 03:55, Fabio Estevam wrote:
Hi,
When enabling bootcount on the imx8mm-evk like this:
--- a/configs/imx8mm_evk_defconfig +++ b/configs/imx8mm_evk_defconfig @@ -120,3 +120,5 @@ CONFIG_SDP_LOADADDR=0x40400000 CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_IMX_WATCHDOG=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y
No chance for a bootcounter in a register?
It works as expected, and the "bootcount" environment variable gets incremented after a reset.
Good!
However, if I try the same on an imx8mn_evk, the "bootcount" variable always stays at 1 and never increments.
Uff... environment code should be independent from the board...
Do you happen to have any idea as to why imx8mn behaves differently in this aspect?
saveenv works on the board? Does it use protected Environment?
No more ideas ... sorry...
bye, Heiko

Hi Heiko,
On Fri, Apr 26, 2024 at 12:40 AM Heiko Schocher hs@denx.de wrote:
No chance for a bootcounter in a register?
Yes, this is a better approach. I changed it to:
CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_MAGIC=0xB0C40000 CONFIG_SYS_BOOTCOUNT_ADDR=0x30370090 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
and now bootcount increments.
Thanks,
Fabio Estevam

Hi Fabio
On Thu, May 2, 2024 at 2:45 PM Fabio Estevam festevam@gmail.com wrote:
Hi Heiko,
On Fri, Apr 26, 2024 at 12:40 AM Heiko Schocher hs@denx.de wrote:
No chance for a bootcounter in a register?
Yes, this is a better approach. I changed it to:
CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_MAGIC=0xB0C40000 CONFIG_SYS_BOOTCOUNT_ADDR=0x30370090 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
and now bootcount increments.
Maybe you have anyway a bug on the evk when was not incrementing on environment
Michael
Thanks,
Fabio Estevam
participants (3)
-
Fabio Estevam
-
Heiko Schocher
-
Michael Nazzareno Trimarchi