MicroUsb Booting TFTP server/DHCP server setup

Hi,

The romcode for BeagleBone Black USB0 for usb booting, how to setup tftp server on the PC end? such as IP address for tftp server? Can I use 192.168.7.1 for tftp server?
If there is a good reference resource link, please advise.

Thank You,

David

Hi @dzhou, the author of https://github.com/ravikp7/node-beagle-boot wrote his own implementation of tftp.

He used 192.168.6.1 for the server…

For a pure tftp server, i’ve had good luck with tftpd-hpa:

https://packages.debian.org/buster/tftpd-hpa

Regards,

Hi Robert,

When I power BBB with S2 pressed, the USB0 is initiated with NDIS adaptor interface on PC. The NDIS adaptor is automatically assigned with 192.168.3.1. I am trying to set tftp server on the PC using 3.1. But nothing initiates a download from PC to BBB.

If I use 192.168.6.1, after rebooting, it says invalid interface for the NDIS adaptor

Thank you,

David

What OS are you using on your development server?

Regards,

I am using Linux Ubuntu PC and Windows 7 PC as tftp server to download files. The U-boot is compiled with a VirtualBox Debian. But at this point, I want to make sure that downloading u-boot-spl.bin file is initiated through USB0 booting mode.

David

Hi @dzhou, I’m sorry, but using USB with virtualization is going to be nothing but trouble.

I just verified, that Ubuntu 18.04.x works with ravikp7’s directions: (Ubuntu 16.04 is too old, and I have not tried Ubuntu 20.04, but it might be way too new…)

voodoo@zeus:~/node-beagle-boot$ sudo npm start
[sudo] password for voodoo: 

> beagle-boot@1.2.1 start /home/voodoo/node-beagle-boot
> node runServer.js

Choose Option: 
1. Bootloader Server 
2. TCP/IP Proxy Server
1
Bootloader Server started
Connect BeagleBone to get started
{ description: 'ROM ->', complete: 5 }
{ description: 'Interface claimed', complete: 10 }
{ description: 'BOOTP request recieved', complete: 15 }
{ description: 'BOOTP reply done', complete: 20 }
{ description: 'TFTP request recieved', complete: 25 }
{ description: 'u-boot-spl.bin transfer starts', complete: 30 }
{ description: 'ROM TFTP transfer complete', complete: 35 }
{ description: 'SPL ->', complete: 40 }
{ description: 'Interface claimed', complete: 45 }
{ description: 'BOOTP request recieved', complete: 50 }
{ description: 'BOOTP reply done', complete: 55 }
{ description: 'BOOTP request recieved', complete: 60 }
{ description: 'BOOTP reply done', complete: 65 }
{ description: 'TFTP request recieved', complete: 70 }
{ description: 'u-boot.img transfer starts', complete: 75 }
{ description: 'SPL TFTP transfer complete', complete: 80 }

Serial:

CCCCCCC
U-Boot SPL 2018.07-dirty (Jul 30 2018 - 20:03:37 +0530)
Trying to boot from USB eth
Loading Environment from FAT... Card did not respond to voltage select!
** Bad device mmc 0 **
Failed (-5)
usb_ether
Error: usb_ether address not set.

using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC b0:d5:cc:fc:03:fc
HOST MAC de:ad:be:ef:00:00
RNDIS ready
musb-hdrc: peripheral reset irq lost!
high speed config #1: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.1.3 (800 ms)
Using usb_ether device
TFTP from server 192.168.1.9; our IP address is 192.168.1.3
Filename 'u-boot.img'.
Load address: 0x82000000
Loading: #################################################################
	 ###########################
	 26.4 KiB/s
done
Bytes transferred = 469336 (72958 hex)


U-Boot 2018.07-dirty (Jul 30 2018 - 20:03:37 +0530)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... Card did not respond to voltage select!
** Bad device mmc 0 **
Failed (-5)
<ethaddr> not set. Validating first E-fuse MAC
Net:   cpsw, usb_ether
Hit any key to stop autoboot:  0 
UMS: LUN 0, dev 1, hwpart 0, sector 0x0, count 0x720000
\musb-hdrc: peripheral reset irq lost!
voodoo@zeus:~$ journalctl | grep sdb
Jun 29 15:30:08 zeus kernel: sd 6:0:0:0: [sdb] 7471104 512-byte logical blocks: (3.83 GB/3.56 GiB)
Jun 29 15:30:08 zeus kernel: sd 6:0:0:0: [sdb] Write Protect is off
Jun 29 15:30:08 zeus kernel: sd 6:0:0:0: [sdb] Mode Sense: 0f 00 00 00
Jun 29 15:30:08 zeus kernel: sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jun 29 15:30:08 zeus kernel: sd 6:0:0:0: [sdb] Attached SCSI removable disk

So the eMMC on this BBB is now currently mounted on my Ubuntu 18.04.x test machine as /dev/sdb… I can then use https://www.balena.io/etcher/ to install any BeagleBone image on to the drive…

Regards,

Hi Robert,

My Ubuntu 16.04 is also used to bitbake Yocto for other products with iMX SOM. I have very reluctant to update into a newer version, because it is very possibly I cannot bitbake yocto.
I will digest the useful information you posted tomorrow.
Thank you for your help.

David

Hi @dzhou, it helps to have a large collection of SATA/SSD drives, and just a swap caddie in your development machine.

I just got Ubuntu 16.04 working, the only thing you need to do is install a 3rd party version of nodejs and remove ubuntu’s default version as it’s too old.

sudo apt-get update
sudo apt-get install build-essential libudev-dev libpcap0.8-dev curl git

sudo apt-get purge nodejs npm

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

sudo apt-get install nodejs

voodoo@zeus:~$ nodejs --version
v8.17.0

git clone https://github.com/ravikp7/node-beagle-boot.git
cd ./node-beagle-boot/
npm install
sudo npm start


Regards,

Hi Robert,

I tried the nodejs in my virtualbox with Debian. It seems working but not finished.:

beagle-boot@1.2.1 start /home/dzhou/BeagleBoneBW/BareMetal/node-beagle-boot
node runServer.js

Choose Option:

  1. Bootloader Server
  2. TCP/IP Proxy Server
    1
    Bootloader Server started
    Connect BeagleBone to get started
    { description: ‘ROM ->’, complete: 5 }
    { description: ‘Interface claimed’, complete: 10 }
    { description: ‘BOOTP request recieved’, complete: 15 }
    { description: ‘BOOTP reply done’, complete: 20 }
    { description: ‘TFTP request recieved’, complete: 25 }
    { description: ‘u-boot-spl.bin transfer starts’, complete: 30 }
    { description: ‘ROM TFTP transfer complete’, complete: 35 }

On the UART terminal:
U-Boot SPL 2018.07-dirty (Jul 30 2018 - 20:03:37 +0530)
Trying to boot from USB eth
Loading Environment from FAT… Card did not respond to voltage select!
** Bad device mmc 0 **
Failed (-5)
usb_ether
Error: usb_ether address not set

======================
I was wandering where is the folder location that the nodejs downloads u-boot-spl.bin from?
And how to specify the file names to be downloaded?

Thank you,
David

Well, the u-boot-spl.bin and u-boot.img files are under the bin folder of the nodejs installation. It seems to me the u-boot-spl.bin is looking for micro SD for booting uEnv,txt file. It stops there, I guess.

Thank you,
David

Hi @dzhou, retry with-out VirtualBox or any Virtualization software. Anytime low level USB is involved with Virtualization, tons of problems exist, thus no open source developer today will ever touch it to debug.

Regards,

Hi Robert,

I tried on the Linux Ubuntu (16.04). I installed nodejs. Everything seems ok. The nodejs window shows the last line of message as "SPL TFTP transfer completed, …80}

There is a popup Window on Linux which show rootfs. But the UART serial monitor windows (through console debug port of BBBw), it keeps displaying ‘/’ ‘|’ ‘’, ‘|’ … (One character per line with carriage return). It doesn’t stop and cannot be stopped. I have waited for very long time.

Best Regards,

David

That’s expected, u-boot is running a “USB” Flash Drive application, the Window “pop-up” is your eMMC on the BBBw. So use https://www.balena.io/etcher/ or dd to write your *.img file to the new drive.

Then use “ctrl-c” to kill it from the serial console.

Regards,

Sorry, could you please explain a bit more on the “dd to write your *.img file to the new driver”.

I had created a usb stick written or created by “Balena Eecher”. It was plugged into the USB host port (USB1) on the BBBw. But it seems to me nothing is happening. What is the file format and an example image file name for *.img? A SD card flasher will work as USB flasher?

Q: The image to be written to a USB stick ( using dd or Etcher), what is the format of the image? I mean as eflasher or normal sd card bootable image? I assume a sd card flasher image. I am wandering it can be used for USB stick. I don;t find any USB flasher pre-build image for BBBw.

Thank you,

David

No, you don’t need a secondary USB Flash drive plugged in the BBBw.

The “node-beagle-boot” project, boot’s up a “blank” BBBw eMMC, into a “USB Flash Drive”… That “drive” window that popped up in Ubuntu is the eMMC on the BBBw. So use “Balena Etcher” to write you custom RootFs to the eMMC.

Remember you have a custom OSD335x board with a blank i2c eeprom, so none of my “Factory” images will work for you. You can try:

https://rcn-ee.net/rootfs/bb.org/testing/2020-07-06/buster-console/BBB-blank-debian-10.4-console-armhf-2020-07-06-1gb.img.xz

But I don’t think it’ll work, so it’s going to be up to you to program your custom version of u-boot.

In that case, these same rules will apply to your “u-boot, usb mounted” eMMC: https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-SetupmicroSDcard

Regards,

Hi Robert,

I flashed eMMC using Etcher. I am using BBBw dev board for testing, so at this point, all prebuild images are ok.

I will try your version, later.

Very cool tool (nodejs), much easier way to flash eMMC through usb. Thank you a lot for your help!

Best Regards,

David