Hi
I am trying to make changes to the environment variables, so that when the device boots it start be checking if it can download an image via the tftpboot. if an image is available it downloads image, save it and boot from it.
if no image is available it boot from the image already on the device.
I have this working on a 8devices Lima module but I would also like it to be working on 8devices Habanero module.
I have tried doing the same on the Habanero by doing the "if-statment" in the "check" (See Lima environment below) but is seems that the Habanero does not know the "imi" is.
I am not sure what the "imi" do, but I assume it do a check on the memory.
So does anyone have an idea on how to do this on the Habanero module?
Lima environment variables set to be:
bootargs=
baudrate=115200
ethaddr=0x00:0xaa:0xbb:
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
production=no
ftp_img=0x81000000 fw.bin
ftp_mem_addr=81000000
check=if imi $ftp_mem_addr; then run recov_img; else bootm 0x9f0c0000; fi
bootcmd=tftpboot $ftp_img; run check;
boot_old=bootm 0x9f0c0000
flash_addr=0xC0000
ftp_erase=sf erase $flash_addr +${filesize};
recov_img=run ftp_erase; run ftp_write; run boot_old;
ftp_write=sf write 0x81000000 0xC0000 ${filesize};
ipaddr=192.168.2.100
serverip=192.168.2.254
netretry=once
bootdelay=2
Habanero environment variables defualt:
usbboot - boot from USB device
version - print monitor, compiler and linker version
(IPQ40xx) # printenv
args_common=rootfstype=squashfs
baudrate=115200
boot0=usb_boot_file
boot1=echo Booting from partition: ${partname}
boot2=nand device 2
boot3=nboot firmware
boot4=bootm
bootcmd=run setup && run bootlinux
bootdelay=1
bootlinux=run boot0 boot1 boot2 boot3 boot4 || reset
do_recovery=run rec1 rec2 rec3 rec4; reset
ethact=eth0
flash_type=0
ipaddr=192.168.2.100
machid=9000040
mtdparts=mtdparts=nand2:0x1E40000@0x1C0000(firmware)
rec1=echo Doing firmware recovery!
rec2=sleep 2 && tftpboot ${tftp_loadaddr} ${recovery_file}
rec3=nand device 2 && nand erase.part firmware
rec4=nand write ${fileaddr} firmware ${filesize}
recovery_file=fwupdate.bin
serverip=192.168.2.254
setup=partname=1 && setenv bootargs ${args_common}
stderr=serial
stdin=serial
stdout=serial
tftp_loadaddr=0x84000000
Habanero environment variables with tftpboot check try:
args_common=rootfstype=squashfs
baudrate=115200
boot0=usb_boot_file
boot1=echo Booting from partition: ${partname}
boot2=nand device 2
boot3=nboot firmware
boot4=bootm
bootcmd=sleep 2 && tftpboot ${tftp_loadaddr} ${recovery_file}; run check;
bootdelay=1
bootlinux=run boot0 boot1 boot2 boot3 boot4 || reset
check=if imi ${tftp_loadaddr}; then run do_recovery; else run setup && run bootlinux; fi
do_recovery=run rec1 rec3 rec4; reset
ethact=eth0
flash_type=0
ftp_img=0x84000000 miwire-fw.bin
ipaddr=192.168.2.100
machid=9000040
mtdparts=mtdparts=nand2:0x1E40000@0x1C0000(firmware)
rec1=echo Doing firmware recovery!
rec2=sleep 2 && tftpboot ${tftp_loadaddr} ${recovery_file}
rec3=nand device 2 && nand erase.part firmware
rec4=nand write ${fileaddr} firmware ${filesize}
recovery_file=fwupdate.bin
serverip=192.168.2.254
setup=partname=1 && setenv bootargs ${args_common}
stderr=serial
stdin=serial
stdout=serial
tftp_loadaddr=0x84000000