Boot Kernel from TFTP and Rootfs from NFS: "Wrong Image Format for bootm command ERROR: can't get kernel image!"

I setup tftpd and nfs server as explained here.

Then I copied the image and device tree to /tftproot:

sudo cp oe-core/deploy/images/colibri-t30/u-boot-dtb-tegra-colibri-t30-v2015.04-v2.6.1b1+gitAUTOINC+46aa70c402-r0.bin /tftproot/u-boot-dtb-tegra.bin
sudo cp oe-core/deploy/images/colibri-t30/uImage--3.1.10+gitrd2f03874e7b3c7c173dc6977f8df5232515ad282-V2.6.1b1-colibri-t30-20161109133943.bin /tftproot/uImage

And I extracted the root fs to /nfsroot

cd /nfsroot/
sudo tar xvf ~/oe-core/deploy/images/colibri-t30/Colibri_T30_LinuxImage.rootfs.tar.bz2

What I did not do is configuring the dhcp server, instead I set up a custom netboot command:

setenv netboot 'usb start; run setup; echo Booting from net ...; run netargs; tftp ${image}; if tftp ${fdt_addr_r} ${fdt_file}; then bootm ${kernel_addr_r} - ${fdt_addr_r}; else echo WARN: Cannot load the DT; fi; bootm;'
setenv netargs 'setenv bootargs console=${console},${baudrate} ${smp} root=/dev/nfs ip=${ipaddr} nfsroot=${serverip}:${nfsroot},v3,tcp'
setenv fdt_file 'u-boot-dtb-tegra.bin'
setenv image 'uImage'
setenv serverip '172.16.4.190'

But the command fails because it does not accept the image:

Colibri T30 # run netboot
Booting from net ...
Using asx0 device
TFTP from server 172.16.4.190; our IP address is 172.16.20.7
Filename 'uImage'.
Load address: 0x80408000
Loading: T ##################################################  4.1 MiB
         709 KiB/s
done
Bytes transferred = 4293072 (4181d0 hex)
Using asx0 device
TFTP from server 172.16.4.190; our IP address is 172.16.20.7
Filename 'u-boot-dtb-tegra.bin'.
Load address: 0x82000000
Loading: ##################################################  431.3 KiB
         7.3 MiB/s
done
Bytes transferred = 441692 (6bd5c hex)
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Did I copy and specify the wrong image and dtb file? Or is something wrong with my netboot command? Or did I miss something else?

Did I copy and specify the wrong image and dtb file?

Our downstream BSP based on Linux kernel 3.1.10 from NVIDIA’s L4T R16.5 does not use any device tree aka dtb file at all.

Or is something wrong with my netboot command? Or did I miss something else?

Without a device tree you would boot as follows: bootm ${kernel_addr_r} - or just bootm ${kernel_addr_r}.

BTW: Your nfsroot probably also needs fixing resp. above I do not see where you defined one at all.

Please also have a look at the following article on our developer website.

To make life easier, I setup a development network as explained here.

My DHCP setting are:

subnet 192.168.10.0 netmask 255.255.255.0 {
        default-lease-time              86400;
        max-lease-time                  86400;
        option broadcast-address        192.168.10.255;
        option domain-name              "colibri.net";
        option domain-name-servers      ns1.example.org;
        option ip-forwarding            off;
        option routers                  192.168.10.1;
        option subnet-mask              255.255.255.0;
        interface                       enp0s8;
        range                           192.168.10.32 192.168.10.254;
}
#MAC address dependent IP assignment, used for the toradex target device
host eval {
        filename                        "uImage";
        fixed-address                   192.168.10.2;
        hardware ethernet               00:0e:c6:8f:7c:d1;
        next-server                     192.168.10.1;
        option host-name                "colibri1";
        option root-path                "192.168.10.1:/nfsroot,wsize=1024,rsize=1024,v3";
}

The image is there:

ls -hl /tftproot/
total 4.2M
-rw-r--r--. 1 root root 4.1M Nov 15 14:49 uImage

But nfsboot is looking for a *.dtb file anyway:

Colibri T30 # run nfsboot
Booting via DHCP/TFTP/NFS...
Using asx0 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'tegra30-colibri-eval-v3.dtb'.
Load address: 0x82000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.10.33 (7993 ms)
Using asx0 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.33
Filename 'tegra30-colibri-eval-v3.dtb'.
Load address: 0x81000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...

@marcel.tx

Any further suggestions on how to get this working?

Yes, sorry. Your DHCP setup is probably not linking to the proper MAC address (e.g. you get an IP address ending in .33 instead of .2) so no boot file name is reported and as a consequence U-Boot keeps looking for the *.dtb file. Have a look at ethaddr e.g. using bdinfo command.

@marcel.tx, you are right - the MAC was wrong. Seems like I changed it unintendedly.

To enable booting via TFTP and NFS without a special DHCP server setup and thus without a special development network I set the environment variables below:

setenv serverip 172.16.4.190
setenv netboot 'usb start; run setup; setenv bootargs ${defargs} ${nfsargs} ${setupargs} ${vidargs} nfsroot=${serverip}:/nfsroot,v3,tcp; echo Booting from net ...; dhcp uImage; bootm;'
saveenv

Now I can boot using

run netboot

And in my development network run nfsboot still works.