Apalis IMx6 v1.1C not booting with uboot 2.6b1

Hi Toradex,
I’m unable to boot after updating to uboot version 2.6.1b1 compiled from source code, but when I download and install the precompiled version from your repository it works just fine.

pre-compiled Version: https://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/old/Apalis_iMX6_LinuxImageV2.6.1Beta1_20160929.tar.bz2

Sha1 compiled from source: 46aa70c402efec7d89f6c93531a767a1771e2192.

The output from printenv is the same and the fw_env.config used is:
/dev/mmcblk0boot0 0x1FDE00 0x2000

Thanks in advance

Could you share your boot log for version compiled from source code?

Bootloader wont load once you reset it, so unfortunately there is no boot log.
I can share the instalation log.

Apalis iMX6 # run setupdate
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 2 **
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
reading flash_blk.img
654 bytes read in 23 ms (27.3 KiB/s)
## Executing script at 12000000
reading art-hmi/flash_blk.img
3577 bytes read in 30 ms (116.2 KiB/s)
## Executing script at 12000000
enter "run update" or "run update_it" to update the entire module
Apalis iMX6 # run update_it
reading art-hmi/u-boot-it.imx
400384 bytes read in 58 ms (6.6 MiB/s)
switch to partitions #1, OK
mmc0(part 1) is current device

MMC write: dev # 0, block # 2, count 782 ... 782 blocks written: OK
reading art-hmi/mbr.bin
512 bytes read in 23 ms (21.5 KiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 0, count 1 ... 1 blocks written: OK
reading art-hmi/boot.vfat
16777216 bytes read in 1224 ms (13.1 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 8192, count 32768 ... 32768 blocks written: OK
reading art-hmi/uImage_img1
4587000 bytes read in 360 ms (12.2 MiB/s)
writing uImage_img1
4587000 bytes written
reading art-hmi/imx6q-apalis-art-hmi-img1.dtb
50756 bytes read in 37 ms (1.3 MiB/s)
writing imx6q-apalis-art-hmi-img1.dtb
50756 bytes written
reading art-hmi/root.ext3
67108864 bytes read in 4815 ms (13.3 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 40960, count 131072 ... 131072 blocks written: OK
reading art-hmi/root.ext3
67108864 bytes read in 4927 ms (13 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 172032, count 131072 ... 131072 blocks written: OK
reading art-hmi/root.ext3
67108864 bytes read in 5046 ms (12.7 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 303104, count 131072 ... 131072 blocks written: OK
reading art-hmi/root.ext3
** art-hmi/root.ext3 shorter than offset + len **
62914560 bytes read in 4867 ms (12.3 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 434176, count 122880 ... 122880 blocks written: OK
Booting from internal eMMC chip...
reading imx6q-apalis-art-hmi-img1.dtb
50756 bytes read in 19 ms (2.5 MiB/s)
reading uImage_img1
4587000 bytes read in 141 ms (31 MiB/s)
## Booting kernel from Legacy Image at 11000000 ...
   Image Name:   Linux-4.1.15-v2.6b2+g0ff849d
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4586936 Bytes = 4.4 MiB
   Load Address: 10008000
   Entry Point:  10008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 12000000
   Booting using the fdt blob at 0x12000000
   Loading Kernel Image ... OK
   Using Device Tree in place at 12000000, end 1200f643

Please note that BSP V2.6.1 beta 1 is no longer supported. You may also want to check with our support strategy as documented on our developer website. Please migrate to one of our supported BSPs (e.g. 2.6, 2.7 or 2.8b4) at your earliest convenience.

BTW: You do not seem to be using any of our stock BSPs but rather something custom based on a legacy update script pre-dating even stable 2.6.

I’ve removed our custom patches from it and the problem persists.
I’m going to update to version 2.6/2.7 and see if it works.

Well, you really do not seem to update U-Boot in the eMMC hardware boot area partition which is really what the SoC boot ROM expects due to the way we fuse them on newer modules. Have a look at the following article on our developer website or resp. PCN.

Changing mmc bootbus to 0 2 0 1 seems to do the trick

Sure, just like our regular legacy update scripts would be doing.

So is this the right solution for the legacy update? Will we have any issues in the future, particularly with v1.1B fused?

Yes, using or at least basing on our regular update scripts is definitely advisable.

My custom env is as follows:

test -n ${interface} || setenv interface mmc
test -n ${drive} || setenv drive 1

setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}'

setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'

setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'

setenv migrate_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot${module_type}.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}'

setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'

setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot${module_type}.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && fuse prog -y 0 5 0x00005072 && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0'
setenv update_uboot_it 'setenv module_type -it; run update_uboot'

setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${boot_file} && fatwrite mmc 0:1 ${loadaddr} ${boot_file} ${filesize}'

setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'

setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'

setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
#do it in chunks of 64M to fit into DDR RAM of the smallest module
setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done; true'

setenv echo_v2.4b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.4b1\" to complete update"
setenv echo_v2.4b1-it echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.4b1_it\" to complete update"
setenv migrate_v2.4b1 'run migrate_configblock; run update_new; reset'
setenv migrate_v2.4b1_it 'setenv module_type -it; run migrate_v2.4b1'
setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_v2.4b1${module_type}'

setenv update_new 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
setenv update 'mmc bootbus 0 2 0 1 && run update_new && run legacyboot; run update_v2.4b1'
setenv update_it 'setenv module_type -it; run update'

echo 'enter "run update" or "run update_it" to update the entire module'

setenv fdt_fixup true

Thanks for your environment settings. Is the update process working? If not, just update to supported bsp version and use the regular update scripts provided by Toradex.

Further you could also use Toradex Easy Installer which makes flashing new images very easy.

Yes, it is working now for both 1.1C and 1.1B.
Thanks for the help

Perfect that it works. Thanks for your feedback.