TFTP boot and NFS?

I am having some serious problems getting TFTP boot to work. Apparently no problems accessing a zImage or .dtb from other machines on the network. The bone on the other hand plain nuts. Need to investigate further.

1 question. Saveenv appears to be disabled in the current u-boot build. Any reason for this?

How then to clear everything without rebuilding and installing u-boot?

I need to be able to drive u-boot from the command line to see if I can get tftp and bootz to work.

TAIA.

P.S. We’ll leave the NFS side of things for later. That too appears whacked on the B3.

I am having some serious problems getting TFTP boot to work. Apparently no
problems accessing a zImage or .dtb from other machines on the network. The
bone on the other hand plain nuts. Need to investigate further.

1 question. Saveenv appears to be disabled in the current u-boot build. Any
reason for this?

It's disabled as it was causing boot issues on the beaglebone white..

How then to clear everything without rebuilding and installing u-boot?

I need to be able to drive u-boot from the command line to see if I can get
tftp and bootz to work.

TAIA.

P.S. We’ll leave the NFS side of things for later. That too appears whacked
on the B3.

BTW, the default u-boot has a few things already setup for nfs.

To enable it, via (/boot/uEnv.txt) set client_ip to your whish'ed ip address..

client_ip=192.168.(something..)

Next, these are set by default:

For starters, we’d need to see your uEnv.txt file. After that, while it is possible to troubleshoot an issue like this without a serial debug cable( I’ve done it, and it is not any fun ). You’d have to be very meticulous, and know exactly how the process works completely.

Anyway here is a link to a guide I wrote a couple years ago: http://www.embeddedhobbyist.com/2013/06/beaglebone-black-network-boot/

Keep in mind that zImage should now work, so everything pertaining to uImage needs to be changed, or ignored( in the case of mkimage ).

Just a note though . . . You need flash media ( sdcard / eMMC ) anyway, for MLO and uboot.image . . . so I figure what does it hurt to boot the kernel off flash media, and just load the rootfs from NFS ? Anyway, this is what I do now days myself, so have not personally bothered with TFTP boot since I wrote that guide.

Also as a guide . . .

debian@beaglebone:~$ cat /nfs-uEnv.txt
##Rename as: uEnv.txt to boot via nfs

##https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

##SERVER: sudo apt-get install tftpd-hpa
##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa
##SERVER: zImage/.dtb need to be located here:
##SERVER: TFTP_DIRECTORY/zImage
##SERVER: TFTP_DIRECTORY/dtbs/
.dtb

##client_ip needs to be set for u-boot to try booting via nfs

client_ip=192.168.1.101

#u-boot defaults: uncomment and override where needed

#server_ip=192.168.1.100
#gw_ip=192.168.1.1
#netmask=255.255.255.0
#hostname=
#device=eth0
#autoconf=off
#root_dir=/home/userid/targetNFS
#nfs_options=,vers=3
#nfsrootfstype=ext4 rootwait fixrtc

One last thing I just remembered . . . ip_addr has to be defined, and correct in order to use TFTP boot. I talked with Robert about this a long time ago, but do not remember if client_ip is tied to ip_addr or not.

Yeap, client_ip is the magic uEnv.txt variable. That's the hint for
the state loop to run thru the nfs function..

Regards,

Hello William. Thanks.

> For starters, we'd need to see your uEnv.txt file. After that, while it is possible to troubleshoot an issue like this without a serial debug cable( I've done it, and it is not any fun ). You'd > have to be very meticulous, and know exactly how the process works completely.

Serial cable is always in use :slight_smile: Some uEnv and serial spew at end of post. It does not look like it even tries to TFTP zImage+dtb

Anyway here is a link to a guide I wrote a couple years ago: http://www.embeddedhobbyist.com/2013/06/beaglebone-black-network-boot/

Yep. Saw that in my travels. Very useful but a little dated.

Keep in mind that zImage should now work, so everything pertaining to uImage needs to be changed, or ignored( in the case of mkimage ).

Just a note though . . . You *need* flash media ( sdcard / eMMC ) anyway, for MLO and uboot.image . . . so I figure what does it hurt to boot the kernel off flash media, and just load
the rootfs from NFS ? Anyway, this is what I do now days myself, so have not personally bothered with TFTP boot since I wrote that guide.

Yes, I certainly understand that. At the moment I'm just trying to make sure I've got 100% control over then environment. And it don't feel that way :slight_smile:

TAIA

----------------------------------------------------uEnv
uname_r=4.1.0-bone9

loadaddr=0x82000000
fdtaddr=0x88000000
rdaddr=0x88080000
  
initrd_high=0xffffffff
fdt_high=0xffffffff

console=ttyO0,115200n8

ipaddr=192.168.1.111
serverip=192.168.1.115
gateway=192.168.1.254
netmask=255.255.255.0

bootdelay=1
bootfile=boot/zImage
fdtfile=boot/dtbs/4.1.0-bone9/am335x-boneblack.dtb
rootpath=/home/jevans/bone/rootfs

netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs rootdelay=10 nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${ipaddr}:${serverip}:${gateway}:${netmask}:${hostname}:eth0:off
netboot=echo ----------BOOTING NFS----------; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
uenvcmd=run netboot

--------------------------------serial (seriously snipped with just a few odd bits-------------------------
cpsw
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
785 bytes read in 17 ms (44.9 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.1.0-bone9 ...
6878968 bytes read in 394 ms (16.7 MiB/s)
loading /boot/boot/dtbs/4.1.0-bone9/am335x-boneblack.dtb ...
** File not found /boot/boot/dtbs/4.1.0-bone9/am335x-boneblack.dtb **
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc] ...
debug: [bootz 0x82000000 - 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x68f6f8 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree

Yeap, client_ip is the magic uEnv.txt variable. That's the hint for the state
loop to run thru the nfs function..

Ah!. Now that makes sense of some of the apparent insanity :slight_smile:

I'm guessing that I'm reading stuff that has slipped out of currency ...

Hello William. Thanks.

> For starters, we'd need to see your uEnv.txt file. After that, while it is possible to troubleshoot an issue like this without a serial debug cable( I've done it, and it is not any fun ). You'd > have to be very meticulous, and know exactly how the process works completely.

Serial cable is always in use :slight_smile: Some uEnv and serial spew at end of post. It does not look like it even tries to TFTP zImage+dtb

Anyway here is a link to a guide I wrote a couple years ago: http://www.embeddedhobbyist.com/2013/06/beaglebone-black-network-boot/

Yep. Saw that in my travels. Very useful but a little dated.

Keep in mind that zImage should now work, so everything pertaining to uImage needs to be changed, or ignored( in the case of mkimage ).

Just a note though . . . You *need* flash media ( sdcard / eMMC ) anyway, for MLO and uboot.image . . . so I figure what does it hurt to boot the kernel off flash media, and just load
the rootfs from NFS ? Anyway, this is what I do now days myself, so have not personally bothered with TFTP boot since I wrote that guide.

Yes, I certainly understand that. At the moment I'm just trying to make sure I've got 100% control over then environment. And it don't feel that way :slight_smile:

TAIA

----------------------------------------------------uEnv
uname_r=4.1.0-bone9

loadaddr=0x82000000
fdtaddr=0x88000000
rdaddr=0x88080000

^^ not needed, defined by default..

initrd_high=0xffffffff
fdt_high=0xffffffff

^^ not needed, defined by default..

console=ttyO0,115200n8

^^ not needed, defined by default..

ipaddr=192.168.1.111
serverip=192.168.1.115
gateway=192.168.1.254
netmask=255.255.255.0

#use:

client_ip=192.168.1.111
server_ip=192.168.1.115
gateway=192.168.1.1

root_dir=/home/jevans/bone/rootfs

bootdelay=1
bootfile=boot/zImage
fdtfile=boot/dtbs/4.1.0-bone9/am335x-boneblack.dtb
rootpath=/home/jevans/bone/rootfs

netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs rootdelay=10 nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${ipaddr}:${serverip}:${gateway}:${netmask}:${hostname}:eth0:off
netboot=echo ----------BOOTING NFS----------; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
uenvcmd=run netboot

# drop these, client_ip defaults to^^^

To sumarize:

#--------------------------------summary, simplified uEnv.txt with uname_r-----
uname_r=4.1.0-bone9

client_ip=192.168.1.111
server_ip=192.168.1.115
gateway=192.168.1.1

root_dir=/home/jevans/bone/rootfs

opps ment: gateway=192.168.1.254

But i think you get the idea..

Regards,