Cannot update uboot

This is the whole story: I have a problem running my python pexpect script using u-boot v. 2015.04. After any pexpect send call, the scripts is locked to u-boot prompt and doesn’t return to my shell for continue the execution of other flash commands. It doesn’t happen using u-boot v. 2016.11-2.7.3+gf0e4149.

So I would like to update uboot as first step. But I get the error “Unknown command ‘updt_fuse’”:

U-Boot 2015.04 (May 18 2015 - 14:17:54)

CPU:   Freescale i.MX6DL rev1.1 at 792 MHz
Reset cause: POR
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

auto-detected panel vga-rgb
Display: vga-rgb (640x480)
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX6 DualLite 512MB IT V1.0B, Serial# 05085858
Net:   using phy at 0
FEC [PRIME]
Hit any key to stop autoboot:  0 

Colibri iMX6 # run setupdate
reading flash_blk.img
710 bytes read in 13 ms (52.7 KiB/s)
## Executing script at 10800000
reading colibri_imx6/flash_blk.img
4415 bytes read in 22 ms (195.3 KiB/s)
## Executing script at 12000000
enter "run update" to update the entire module

Colibri iMX6 # run update_uboot
reading colibri_imx6/u-boot.imx-spl
365072 bytes read in 38 ms (9.2 MiB/s)
switch to partitions #1, OK
mmc0(part 1) is current device

MMC write: dev # 0, block # 138, count 714 ... 714 blocks written: OK
Unknown command 'updt_fuse' - try 'help'

Here are my u-boot env vars:

arch=arm
baudrate=115200
blkcnt=2ca
board=colibri_imx6
board_name=colibri_imx6
board_rev=010b
boot_file=uImage
bootcmd=run emmcboot ; echo ; echo emmcboot failed ; run nfsboot ; echo ; echo nfsboot failed ; usb start ;setenv stdout serial,vga ; setenv stdin serial,usbkbd
bootdelay=1
check_1=setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1
check_2=setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1
check_3=setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1
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
console=ttymxc0
cp_file_chunk=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}
cpu=armv7
defargs=enable_wait_mode=off galcore.contiguousSize=50331648
dfu_alt_info=u-boot.imx raw 0x2 0x3ff mmcpart 0;boot part 0 1;rootfs part 0 2;uImage fat 0 1;imx6q-colibri-eval-v3.dtb fat 0 1;imx6q-colibri-cam-eval-v3.dtb fat 0 1
drive=1
echo_migrate=echo successfully updated U-Boot, power-cycle and enter \\"run setupdate\\; run migrate\\" to complete update
emmcargs=ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 rootwait
emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} ${setupargs} ${vidargs}; echo Booting from internal eMMC chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} ${boot_file} && bootm ${kernel_addr_r} ${dtbparam}
emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} ${fdt_file} && setenv dtbparam " - ${fdt_addr_r}" && true
ethact=FEC
ethaddr=00:14:2d:4d:9a:a2
ethprime=FEC
fdt_addr_r=0x12000000
fdt_file=imx6dl-colibri-eval-v3.dtb
filesize=59210
incr_decimal=setexpr filenum ${filenum} + 1; setexpr filenrlow1 ${filenum} % 0x100; setexpr filenrlow2 ${filenrlow1} % 0x10; test ${filenrlow1} -eq "9a" && test ${filenrlow2} -ne "9" && setexpr filenum ${filenum} + 0x66; test ${filenrlow1e
interface=mmc
ipaddr=192.168.10.2
kernel_addr_r=0x10800000
loadaddr=0x12000000
migrate=run migrate_configblock; run update_latest; reset
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
migrate_uboot=run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0
migrate_uboot_old=setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1
netmask=255.255.255.0
nfsargs=ip=:::::eth0:on root=/dev/nfs rw netdevwait
nfsboot=run setup; setenv bootargs ${defargs} ${nfsargs} ${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; run nfsdtbload; dhcp ${kernel_addr_r} && bootm ${kernel_addr_r} ${dtbparam}
nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${fdt_file} && setenv dtbparam " - ${fdt_addr_r}" && true
ramdisk_addr_r=0x12100000
sdargs=ip=off root=/dev/mmcblk1p2 rw,noatime rootfstype=ext3 rootwait
sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from SD card in 8bit slot...; run sddtbload; load mmc 1:1 ${kernel_addr_r} ${boot_file} && bootm ${kernel_addr_r} ${dtbparam}
sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} ${fdt_file} && setenv dtbparam " - ${fdt_addr_r}" && true
serial#=05085858
serverip=192.168.10.1
set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
set_nextnum=run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}
setethupdate=tftpboot ${kernel_addr_r} flash_eth.img
setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load ${interface} ${drive}:1 ${kernel_addr_r} flash_blk.img
setup=setenv setupargs fec_mac=${ethaddr} consoleblank=0  no_console_suspend=1 console=tty1 console=${console},${baudrate}n8
setupdate=run setsdupdate || run setusbupdate || run setethupdate; source ${kernel_addr_r}
setusbupdate=usb start && setenv interface usb; setenv drive 0; load ${interface} ${drive}:1 ${kernel_addr_r} flash_blk.img
soc=mx6
splashpos=m,m
uboot_hwpart=1
update=mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1
update_1=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1
update_2=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}
update_3=setenv filesize 4000000; setenv filenum 100; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true
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
update_fdt=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}
update_kernel=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}
update_latest=run update_to_spl; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3
update_new=updt_fuse -n && run update_latest && reset; run update_v2.5b3
update_spl=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}
update_to_spl=mmc dev 0 1; mmc read $loadaddr 8a 1; itest.l *12000000 -ne 56190527 && run update_spl
update_uboot=run update_uboot_bin && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1
update_uboot_bin=load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}
update_v2.4b1=run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate
update_v2.5b3=run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate
vendor=toradex
ver=U-Boot 2015.04 (May 18 2015 - 14:17:54)
vidargs=video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 video=mxcfb1:off fbmem=8M

Any ideas?

If you would update the whole image (e.g. doing run update instead of run update_uboot) it should go through an automatic migration step depending on what U-Boot is currently running being either run migrate_uboot_old resp. run migrate_uboot as can be found here.

Please note that your module is really running an ancient long since no longer supported BSP V2.4 Beta 1 (May 18, 2015).

Ok, I will try using the specific migrate scripts for uboot. I cannot run a full update in automated way because my script stalls after stopping the boot (it seems a weird behaviour related to the old u-boot release). My idea is to put this fix at the begining of my script (as can be found also in your example). After u-boot upgrade all works fine in pexpect dialogs, so I can put more flow controls in my script.

Yes, I know that it is a legacy image, modules came with this preinstalled
image. My final purpose it to develop an automated procedure to load my updated
custom image, indeed.

Thank you for your help!

Ok, I will try using the specific migrate scripts for uboot. I cannot run a full update in automated way because my script stalls after stopping the boot (it seems a weird behaviour related to the old u-boot release). My idea is to put this fix at the begining of my script (as can be found also in your example). After u-boot upgrade all works fine in pexpect dialogs, so I can put more flow controls in my script.

Understood.

Yes, I know that it is a legacy image, modules came with this preinstalled image.

New modules will ship with the Toradex Easy Installer pre-installed.

My final purpose it to develop an automated procedure to load my updated custom image, indeed.

I suggest for you to have a look at the Toradex Easy Installer for the same.

Thank you for your help!

You are very welcome.