How to set boot count in U-boot for NXP iMX.6 Dual and Dual lite?

Pratik Rajyaguru pratik.rajyaguru at
Tue Mar 10 08:14:57 CET 2020

Hello All,

I want to set boot count to 5 for iMX.6 to set attempt counter, in case of failures at boot time. I am using both Dual and Dual lite modules.

U-boot source code reference: Freescale's U-Boot 2014.04.
As I checked, CONFIG_BOOTCOUNT_LIMIT MACRO can be used to configure attempt counter, in case of failures at boot time. Then alternative booting command can be configured, if counter is exceeded.

I have enabled CONFIG_BOOTCOUNT_LIMIT MACRO in u-boot file include/configs/mx6_common.h.
I received error as mentioned below.

common/built-in.o: In function `process_boot_delay':
<path>/uboot/build_uboot/common/main.c:340: undefined reference to `bootcount_load'
<path>/uboot/build_uboot/common/main.c:342: undefined reference to `bootcount_store'

Can someone please guide me through expected procedure to configure / build u-boot with boot count?
Any insight / alternative approach suggestion will be highly useful.

Thanks in advance,
Pratik Rajyaguru

More information about the U-Boot mailing list