BeagleBone Black USB port Boot

Hi,

I have BeagleBone Black, board_rev=BWA5. In the document, Boot Modes: BBB can boot from USB Port. I am not clear that the USB port refers to which USB. There is micro USB port as USB client and there is USB host ( device as storage). Does it boot from micro USB port? And this port is also used as USB Ethernet under Debian. Does that mean it is booting as tftp?

Thank you,

David

Hi @dzhou, correct, this is done over the micro USB port.

This procedure is complex, and has multiple stages. It’s best to just quote the GSOC author who got this working:

  • The AM335x ROM when in USB boot mode exposes a RNDIS interface to the PC and waits to TFTP a binary blob that it executes. That binary blob is the SPL
  • Once the SPL runs it applies the same proceure as the ROM and TFTPs U-Boot
  • Again U-Boot applies the same thinking and TFTPs a FIT(flatten image tree) which includes a Kernel, Ramdisk and the DTB
  • U-Boot runs this FIT and boots the Kernel
  • When the kernel starts the init script exports the eMMC using the g_mass_storage kernel module as an USB stick to the Linux so it can be flashed

Regards,

Robert,

Thank you for your prompt reply.
I have downloaded source code from BBBlfs, but I have hard time to recompile. I tried on Debian (my virtualbox) and Ubuntu 16.04. Both are not successful. The main reason was some c_8.h (couldn’t remember the system include name exactly at this point). I believe it is a matter of cross compiler toll setup issue. Haven’t spent time on this, yet.

Regards,
David

Here is a newer version of that idea:

Today, once you get into u-boot, you can pretty much do everything that one would need to program the eeprom and eMMC. You don’t need to boot into the full Linux kernel just to program the eeprom and eMMC.

Regards,

Robert,

BTW: I have a different question.
I have downloaded source code for rebuilding Debian. You are the author of he script to create Bootable Image for SD Card.

  1. I saw there is setup_sdcard.sh, which creates 2 partitions: (ID.txt MLO, and u-boot.img), and the other is NTFS. My question is for tftp (or Usb client port boot), it needs u-boot.bin, etc. I don’t see yhr u-boot.bin is created in the deploy folder. How to create the bin and other necessary for tftp booting?
  2. You have patch to create setup_usb.sh from setup_sdcard.sh. I “was hesitated” to create such setup_usb.sh. Because anything wrong in the script will give me much trouble. And also, I found the line number and code lines in the patch file don’t match. Maybe there is a version issue of the files I downloaded. I am not sure do you have a setup_usb.sh and tested working?

Regards,
David

setup_sdcard.sh is highly configurable, it supports many boards with varying u-boot configurations. Thus u-boot is not shipped, but instead downloaded based on the specific board/configuration.

There is a setup_sdcard.sh option to allow you to specify a local version, which you can specify your self. (run with --help)

https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-Bootloader:U-Boot

USB boot requires a very specific u-boot configuration, a version that i currently do not build.

Sorry, i don’t recognize any “setup_usb.sh” script in my personal github account, can you clarify.

Regards,

Hi Robert,

Finally, I found the original web page related to edit setup_sdcard.sh:

(In section : Diffs for setup_sdcard.sh and uEnv.txt )

It is my mistake that it is from someone else.

But, I guess it has the similar issue to generate image for booting from USB driver with your setup_sdcard.sh, am I right? The images generated from setup_sdcard.sh only for booting from sd card.

Thank you,

David

Hi @dzhou ,

Oh this isn’t a pure USB boot. It still relies on U-Boot to be on microSD/eMMC. Instead of u-boot loading the kernel/device-tree from the microSD/eMMC it calls “usb load” (instead of “mmc load”) to load the kernel/device-tree from the usb media.

Once you boot up into an image with the microSD/eMMC, you can run this script to copy the rootfs to a usb flash drive…

Regards,

Hi Robert,

Thank you for the script file. I have just built Starterware on my Linux machine. I am going to test out. I’ll take some time to digest your files.
I am thinking to load a version of customized uboot through JTag. Then with this uboot, to boot a version of debian kernel into RAM (from USB drive), and then flash eMMC from USB stick. I think it should be doable. Please advise if it cannot be done by that way.

Regards,

David