I have created a 4 partition image as suggested in the mender documents for the TI Jacinto 6+ board using mender-convert and have added the same to the SD card which is used by the board to boot. While booting I get the following error:
Hit any key to stop autoboot: 0
=> setenv mmcdev 0
=> saveenv
Saving Environment to MMC…
Writing to MMC(1)… done
=> boot
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
290 bytes read in 3 ms (93.8 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc0 …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found /boot/zImage **
** First descriptor is NOT a primary desc on 1:1 **
switch to partitions #0, OK
mmc1(part 0) is current device
** First descriptor is NOT a primary desc on 1:1 **
mmc - MMC sub system
Usage:
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc hwpartition [args…] - does hardware partitioning
arguments (sizes in 512-byte blocks):
[user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
[gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
[check|set|complete] - mode, complete set partitioning completed
WARNING: Partitioning is a write-once setting once it is set to complete.
Power cycling is required to initialize partitions after set to complete.
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize
Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
Change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value
Change the RST_n_FUNCTION field of the specified device
WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr - set DSR register value
mmc - MMC sub system
Usage:
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc hwpartition [args…] - does hardware partitioning
arguments (sizes in 512-byte blocks):
[user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
[gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
[check|set|complete] - mode, complete set partitioning completed
WARNING: Partitioning is a write-once setting once it is set to complete.
Power cycling is required to initialize partitions after set to complete.
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize
Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
Change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value
Change the RST_n_FUNCTION field of the specified device
WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr - set DSR register value
Booting from eMMC …
Wrong Image Format for bootm command
ERROR: can’t get kernel image!
Any help would be appreciated in resolving this issue
That won’t work right out of the box unfortunately. I would suggest to look at the original boot proved to figure out the necessary modifications. Chances are that you’ll have to provide a patched boot loader binary.
I have made changes in U-boot as per the mender documentation(Manual U-Boot integration | Mender documentation)
To be exact the changes I have made in u-boot are in the board specific files under include/configs :
defined CONFIG_BOOTCOUNT_LIMIT
defined CONFIG_BOOTCOUNT_ENV and turned off other CONFIG_BOOTCOUNT_ features
defined CONFIG_ENV_IS_IN_MMC
removed FAT_ENV_*
Added added “run mender_try_to_recover” to bootcmd alongwith “run mender_setup” as the first command
Replaced ${bootpart} with ${mender_uboot_root} in loadimage
Ensured that kernel image is in the /boot directory
I have compiled the u-boot source code with these changes and used the binary along with rootfs files to create a disk image which was given as an input to the mender-convert tool which generated the mender .img file which was written to the SD card with the four required partitions.
On booting from this SD card, boot fails and the log says mender_setup and mender_try_to_recover not defined.
(I am unable to attach the entire log as a text file or add it directly in this post due to the word count limit)
Edit: Adding printenv details
EXPORT table = fef9de60, htab.size = 521, htab.filled = 84, size = 0
Unsorted: n=84
0: fdf35698 ==> emmc_android_boot => setenv eval_bootargs setenv bootargs $bootargs; run eval_bootargs; setenv mmcdev 1; setenv fdt_part 3; setenv boot_part 9; if test $reboot_image = recovery;
1: fdf35710 ==> bootdir => /boot
2: fdf35774 ==> bootm_size => 0x10000000
3: fdf35878 ==> boot_fit => 0
4: fdf35918 ==> loadbootenv => fatload ${mender_uboot_boot} ${loadaddr} ${bootenvfile}
5: fdf35940 ==> ver => U-Boot 2016.05-dirty (Aug 02 2022 - 11:03:00 +0530)
6: fdf359cc ==> dofastboot => 0
7: fdf35a6c ==> netloadimage => tftp ${loadaddr} ${bootfile}
8: fdf35b34 ==> arch => arm
9: fdf35c38 ==> mmcdev => 1
10: fdf35d64 ==> fdtcontroladdr => fdefef18
11: fdf35da0 ==> serial# => 0b0120124c0c0020
12: fdf35ddc ==> machid => fe6
13: fdf35df0 ==> board_name => dra76x
14: fdf35e04 ==> pxefile_addr_r => 0x80100000
15: fdf35f6c ==> importbootenv => echo Importing environment from ${mender_uboot_boot} …; env import -t ${loadaddr} ${filesize}
16: fdf35f94 ==> scriptaddr => 0x80000000
17: fdf35fa8 ==> envboot => mmc dev ${mender_uboot_dev}; if mmc rescan; then echo SD/MMC found on device ${mender_uboot_dev};if run loadbootscript; then run bootscript;else if run loadbooten;
18: fdf35fbc ==> fastboot.userdata_size => unknown
19: fdf36034 ==> dfu_alt_info_qspi => MLO raw 0x0 0x040000;u-boot.img raw 0x040000 0x0100000;u-boot-spl-os raw 0x140000 0x080000;u-boot-env raw 0x1C0000 0x010000;u-boot-env.backup raw 0x1D0000 0
20: fdf360ac ==> ethaddr => f8:36:9b:0c:5f:62
21: fdf360e8 ==> fastboot.board_rev => A.2
22: fdf360fc ==> fdt_addr_r => 0x88000000
23: fdf36138 ==> boot_part => 9
24: fdf36174 ==> dfu_bufsiz => 0x10000
25: fdf361b0 ==> finduuid => part uuid ${mender_uboot_root} uuid
26: fdf361d8 ==> vendor => ti
27: fdf36250 ==> partitions_android => uuid_disk=${uuid_gpt_disk};name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};name=bootloader,size=2304K,uuid=${uuid_gpt_bootloader};name=environm}
28: fdf36278 ==> bootscript => echo Running bootscript from ${mender_uboot_boot} …; source ${loadaddr}
29: fdf362a0 ==> args_mmc => run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
30: fdf36318 ==> baudrate => 115200
31: fdf36430 ==> usbtty => cdc_acm
32: fdf36494 ==> args_fit => setenv bootargs console=${console}
33: fdf365e8 ==> dfu_alt_info_emmc => rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-a1
34: fdf3673c ==> bootcmd => run mender_setup
35: fdf367a0 ==> kernel_addr_r => 0x82000000
36: fdf36944 ==> mmcrootfstype => ext4 rootwait
37: fdf36a20 ==> fit_loadaddr => 0x88000000
38: fdf36a34 ==> fastboot.secure => GP
39: fdf36a5c ==> bootfile => zImage
40: fdf36a84 ==> netloadfdt => tftp ${fdtaddr} ${fdtfile}
41: fdf36ae8 ==> board => dra7xx
42: fdf36b38 ==> stderr => serial@4806a000
43: fdf36b4c ==> bootenvfile => uEnv.txt
44: fdf36b74 ==> vram => 16M
45: fdf36c3c ==> fdtfile => dra76-evm.dtb
46: fdf36d68 ==> netargs => setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
47: fdf36e1c ==> loadaddr => 0x82000000
48: fdf36f84 ==> rdaddr => 0x88080000
49: fdf36f98 ==> bootdelay => 2
50: fdf36fac ==> dfu_alt_info_mmc => boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x201
51: fdf37074 ==> rootpath => /export/rootfs
52: fdf370c4 ==> loadimage => load mmc ${mender_uboot_root} ${loadaddr} ${bootdir}/${bootfile}
53: fdf3713c ==> fdtaddr => 0x88000000
54: fdf371c8 ==> scsidevs => 0
55: fdf371f0 ==> nfsopts => nolock
56: fdf37308 ==> eval_bootargs => setenv bootargs androidboot.serialno=${serial#}
57: fdf3731c ==> stdin => serial@4806a000
58: fdf37330 ==> cpu => armv7
59: fdf37344 ==> partitions => uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
60: fdf373a8 ==> stdout => serial@4806a000
61: fdf373bc ==> devtype => mmc
62: fdf3745c ==> loadfdt => load ${mender_uboot_root} ${fdtaddr} ${bootdir}/${fdtfile}
63: fdf374ac ==> fastboot.cpu => DRA762
64: fdf374c0 ==> ramdisk_addr_r => 0x88080000
65: fdf37510 ==> boot_os => 0
66: fdf3763c ==> update_to_fit => setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
67: fdf376a0 ==> board_rev => A.2
68: fdf378d0 ==> loadfit => run args_fit; bootm ${loadaddr}#${fdtfile};
69: fdf37948 ==> console => ttyO0,115200n8
70: fdf37970 ==> dfu_alt_info_ram => kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
71: fdf37984 ==> soc => omap5
72: fdf37a10 ==> mmcboot => if mmc dev ${mender_uboot_dev}; then setenv devnum ${mender_uboot_dev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mender_uboot_dev};if;
73: fdf37a88 ==> static_ip => ${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
74: fdf37aec ==> fit_bootfile => fitImage.itb
75: fdf37b8c ==> reboot_image => boot
76: fdf37c2c ==> findfdt => if test $board_name = omap5_uevm; then setenv fdtfile omap5-uevm.dtb; fi; if test $board_name = dra7xx; then setenv fdtfile dra7-evm.dtb; fi;if test $board_name =3
78: fdf37c7c ==> loadbootscript => load ${mender_uboot_boot} ${loadaddr} boot.scr
79: fdf37e0c ==> mmcloados => run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then ;
80: fdf37e84 ==> netboot => echo Booting from network …; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
81: fdf37eac ==> bootargs => console=ttyO0,115200n8 root=PARTUUID= rw rootfstype=ext4 rootwait
82: fdf37ee8 ==> bootcount => 1
83: fdf37f24 ==> boot_fdt => try
arch=arm
args_fit=setenv bootargs console=${console}
args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
baudrate=115200
board=dra7xx
board_name=dra76x
board_rev=A.2
boot_fdt=try
boot_fit=0
boot_os=0
boot_part=9
bootargs=console=ttyO0,115200n8 root=PARTUUID= rw rootfstype=ext4 rootwait
bootcmd=run mender_setup
bootcount=1
bootdelay=2
bootdir=/boot
bootenvfile=uEnv.txt
bootfile=zImage
bootm_size=0x10000000
bootscript=echo Running bootscript from ${mender_uboot_boot} …; source ${loadaddr}
console=ttyO0,115200n8
cpu=armv7
devtype=mmc
dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-1
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x17001
dfu_alt_info_qspi=MLO raw 0x0 0x040000;u-boot.img raw 0x040000 0x0100000;u-boot-spl-os raw 0x140000 0x080000;u-boot-env raw 0x1C0000 0x010000;u-boot-env.backup raw 0x1D0000 0x010000;kernel raw 0x1E0000 0
dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
dfu_bufsiz=0x10000
dofastboot=0
emmc_android_boot=setenv eval_bootargs setenv bootargs $bootargs; run eval_bootargs; setenv mmcdev 1; setenv fdt_part 3; setenv boot_part 9; if test $reboot_image = recovery; then setenv boot_part 8; se;
envboot=mmc dev ${mender_uboot_dev}; if mmc rescan; then echo SD/MMC found on device ${mender_uboot_dev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${b;
ethaddr=f8:36:9b:0c:5f:62
eval_bootargs=setenv bootargs androidboot.serialno=${serial#}
fastboot.board_rev=A.2
fastboot.cpu=DRA762
fastboot.secure=GP
fastboot.userdata_size=unknown
fdt_addr_r=0x88000000
fdt_part=3
fdtaddr=0x88000000
fdtcontroladdr=fdefef18
fdtfile=dra76-evm.dtb
findfdt=if test $board_name = omap5_uevm; then setenv fdtfile omap5-uevm.dtb; fi; if test $board_name = dra7xx; then setenv fdtfile dra7-evm.dtb; fi;if test $board_name = dra72x-revc; then setenv fdtfil
finduuid=part uuid ${mender_uboot_root} uuid
fit_bootfile=fitImage.itb
fit_loadaddr=0x88000000
importbootenv=echo Importing environment from ${mender_uboot_boot} …; env import -t ${loadaddr} ${filesize}
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadbootenv=fatload ${mender_uboot_boot} ${loadaddr} ${bootenvfile}
loadbootscript=load ${mender_uboot_boot} ${loadaddr} boot.scr
loadfdt=load ${mender_uboot_root} ${fdtaddr} ${bootdir}/${fdtfile}
loadfit=run args_fit; bootm ${loadaddr}#${fdtfile};
loadimage=load mmc ${mender_uboot_root} ${loadaddr} ${bootdir}/${bootfile}
machid=fe6
mmcboot=if mmc dev ${mender_uboot_dev}; then setenv devnum ${mender_uboot_dev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mender_uboot_dev};if run loadimage; then run loadfdt;
mmcdev=1
mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot ;
mmcrootfstype=ext4 rootwait
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network …; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
netloadfdt=tftp ${fdtaddr} ${fdtfile}
netloadimage=tftp ${loadaddr} ${bootfile}
nfsopts=nolock
partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
partitions_android=uuid_disk=${uuid_gpt_disk};name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};name=bootloader,size=2304K,uuid=${uuid_gpt_bootloader};name=environment,size=256K,uuid=${uuid_gpt}
pxefile_addr_r=0x80100000
ramdisk_addr_r=0x88080000
rdaddr=0x88080000
reboot_image=boot
rootpath=/export/rootfs
scriptaddr=0x80000000
scsidevs=0
serial#=0b0120124c0c0020
soc=omap5
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial@4806a000
stdin=serial@4806a000
stdout=serial@4806a000
update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
usbtty=cdc_acm
vendor=ti
ver=U-Boot 2016.05-dirty (Aug 02 2022 - 11:03:00 +0530)
vram=16M
Environment size: 7386/131068 bytes
Please let me know if you require any further information.