BBB-WIRELESS, TFTP BOOT VIA USB_ETHERNET (RNDIS) – VIRTUALBOX. “THE EASY AND DUMP APPROACH”

Okay, So I received this new beautiful Credit Card size Beaglebone black (BBB) Wireless board as gift from one of my colleague (Thanks buddy). The board is so beautiful and compact that for one moment I thought of not even unpacking it …… but moment gone….. board unpacked. 😜

Figure-1: Beaglebone Back (BBB) Wireless

The board ships with pre-installed Debian distribution in its internal eMMC flash memory. By default the board boots from its internal flash memory when powered on. Its fun to see BBB booting its pre-installed Linux Image BUT being Engineer its more fun to boot the platform/board with your own Linux distribution/Compiled Images. So I compiled the linux components (Kernel, u-boot, FileSystem) and placed them in an external SD-Card. Luckily after few trials, the board booted successfully from external SD-Card on compiled Images.

NOTE: We will cover SD-Card booting and Compiling Linux Binaries  e.g. u-boot, Kernel, Root File System in next article. For now you can get the compiled binaries from here.  

Compiling and booting Linux on any platform is totally fun but tedious job as well. You compile it, copy it to memory (sd-card, eMMC etc.), test it and the process repeats unless the bugs are fixed and requirements are met. Especially if you have to copy binaries to SD-Card …. that plugging and un-plugging  of SD-Card during compilation and Testing is totally shit and annoying.

So to reduce this tedious process of plugging and unplugging, I decided to load Linux kernel and dtb (Device tree binaries) using TFTP (Trivial File Transfer Protocol) [1]. I had this VirtualBox with Linux Lite installed on my Laptop. So I decided to host TFTP server on Virtual Machine (VirtualBox). This is where the fun begun and off-course by fun I mean MESS.  Not only this … the bad news was the new BBB-Wireless doesn’t have any dedicated ETHERNET port. This was a total chaos.

Its time to get help from Internet. Voila, every resource on the Internet combining BBB and TFTP mentions “CONNECT YOUR BBB TO PC VIA RJ-45 ETHERNET CABLE“. Man we don’t have Ethernet Port on the new BBB-Wireless. 😢

WAIT… its not a dead end. “Where there is a well, there is a way”! Indeed there is no Ethernet port but do we have any other interface on the board that can host Network traffic💡? Yes we do have. Its the same USB port through which power is given to the board. USBs can host Network traffic via Microsoft proprietary protocol called RNDIS (Remote Network Driver Interface Specification) [2]. 

So lets load Linux Kernel and .dtb from TFTP server via this RNDIS interface. Note I mentioned Kernel and .dtb only which means the board must already have u-boot either in flash memory or SD-Card Plus it must have RNDIS support (Don’t panic it will most probably be compiled with RNDIS support; if not compile it with “_usbspl_” config file. So Relax its a trivial issue.).

SERVER CONFIGURATION:

Let’s configure TFTP server on the host PC (VirtualBox). Optionally we will install TFTP client to check connection.

  • The following commands installs TFTP server, client and internet Deamon on host Machine.
$ sudo apt-get install xinetd tftpd tftp

Create (if not exists) or Open the file tftp in /etc/xinetd.d/ directory. 

$ sudo vim /etc/xinetd.d/tftp

Put the following configurations in the tftp file and save it.

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /var/lib/tftpboot -s
disable = no
}

Create tftpboot directory in /var/lib/tftpboot as indicated by the  server_args option in the previous step. Also give full read/write access to the directory.

$ sudo mkdir /var/lib/tftpboot

$ sudo chmod -R 777 /var/lib/tftpboot

$ sudo chown -R nobody /var/lib/tftpboot

Start/Restart the xinetd service and verify the status.

$ sudo service xinetd restart       #for newer systems

$ sudo /etc/init.d/xinetd restart   #for older systems

$ sudo /etc/init.d/xinetd status


Disable the Firewall on Virtual Machine (VirtualBox). This is a bad bad bad step but unfortunately I couldn’t make TFTP server respond to external devices on VirtualBox without this step. Never do this on production PC especially if it is connected to INTERNET. That’s why i named it “the dump approach“. 

$ sudo ufw disable

$ sudo ufw status

TESTING TFTP SERVER

Now that we have configured TFTP server, let’s test it on same machine to verify it’s indeed up and running.

  • Create a dummy file say test.txt and place it in the /var/lib/tftpboot directory.
  • From Terminal enter the following command to activate TFTP Client.
$ tftp
  • Connect Client to local machine.
tftp> connect localhost 
  • Request the sample file i.e. test.txt
tftp> get test.txt
  • A message similar to the following will be displayed indicating number of bytes received that subsequently means the TFTP server is indeed up and running. Finally quit the client.
Received N bytes in XYZ seconds.
tftp> quit

  • Copy Linux binaries i.e. uImage + .dtb file (download here) into TFTP directory i.e. /var/lib/tftpboot

Congratulation, you have successfully configured TFTP server on your Virtual machine PC. Now its time to connect BBB and load Kernel and dtb binaries.

BBB -WIRELESS SETUP

Great. Now that everything on host PC side is setup its time to configure BBB for TFTP boot. Connect your BBB via Serial Port to host PC and Power up your board using USB cable to get u-boot Terminal on Serial Port Software e.g. Minicom etc. Figure-2. (More on this in next article if you don’t know how to do it!).

Figure-2: u-boot Terminal

Let’s do few more settings. To establish communication between two PCs, we need to establish a local network. PCs communicate with each other on network via IP addresses. Every network needs a network administrator (DHCP server) that can assign IP address to every existing computers on the network and any new computer that wants to connect to the network. Our application is simple and we don’t want to go into that complexities. So we will manually set BBB and Host IP addresses via u-boot environment variables.

  • In order to set board/host PC IP addresses, enter the following commands in the u-boot terminal shown in Figure-2.
=> setenv ipaddr 192.168.0.2

=> setenv serverip 192.168.0.1
  1. ipaddr: IP address of BBB-Wirelss
  2. serverip: IP address of host PC (VirtualBox in our case)
  • Inform u-boot to use USB-Ethernet interface as active interface for network traffic/operations.
=> setenv ethact usb_ether

Now since USB Ethernet connects directly to Host PC, they both form point-to-point communication with no agent (like DHCP server) to assign IP addresses. As a quick reminder from Network:

  • In point-to-point communication we needs MAC addresses (Link Layer OSI-Model) of machines along with IP addresses (Network Layer OSI-Model) as this is the only you can actually unambiguously address a device that is connected to the same link (e.g., Ethernet). 
  • Let’s assign virtual MAC addresses to BBB USB interface and Host PC adapter.
=> setenv usbnet_devaddr f8:dc:7a:00:00:01
=> setenv usbnet_hostaddr f8:dc:7a:00:00:02

usbnet_devaddr: The virtual MAC address of the device (the board side).
usbnet_hostaddr: The virtual MAC address of the host (the PC side).

Note: These addresses are arbitrary (as Virtual).

  • Virtual Machines are normally slow – as running inside another OS as a process. In VirtualBox, in order to access an external device, it needs to be mentioned explicitly via main menu (see Figure-4). It’s take time to click that Device -> USB -> XYZ device option. In order for u-boot to wait that long for the connection to establish; set timeout variable i.e.  cdc_connect_timeout to some bigger number (Not sure its seconds/milliseconds whatever). 

=> setenv cdc_connect_timeout 500
  • Let’s load the Kernel image into beaglebone internal SD-RAM memory via TFTP protocol.
=> tftpboot 0x82000000 uImage
Figure-3: Establishing connection
  • At this point you should be able to see a new hardware entry into your VirtualBox Devices USB List – Figure-4. Click the device to connect it to VirtualBox.
Figure-4: RNDIS Device connection
  • Once you connect the device, a moment later you should see that beautiful terminal screen (see Figure-5) indicating loading Kernel Image (uImage) from TFTP server.  
Figure-5: TFTP boot
  • Similarly load the .dtb file using the same previous method i.e.
=> tftpboot 0x82000000 am335x-boneblack.dtb

Congratulations You successfully loaded Linux binaries using your TFTP Server. See you in the next tutorial….

REFERENCES:

[1] – Trivial File Transfer Protocol

[2] – USB RNDIS



122 thoughts on “BBB-WIRELESS, TFTP BOOT VIA USB_ETHERNET (RNDIS) – VIRTUALBOX. “THE EASY AND DUMP APPROACH””

  • I was wondering if you ever considered changing the layout of your
    site? Its very well written; I love what youve got to say.

    But maybe you could a little more in the
    way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images.
    Maybe you could space it out better? asmr 0mniartist

  • I’ve been browsing on-line greater than 3 hours
    lately, yet I by no means discovered any fascinating article like yours.
    It is lovely value sufficient for me. In my view, if all web owners and bloggers made just right content as you did, the internet will be much more helpful than ever before.
    asmr 0mniartist

  • Does your blog have a contact page? I’m having trouble locating it but, I’d like to send you an email.

    I’ve got some creative ideas for your blog you might be interested in hearing.
    Either way, great blog and I look forward to seeing it expand over time.

  • Hey There. I found your blog the use of msn. This is an extremely neatly written article.
    I’ll be sure to bookmark it and return to learn extra of your
    useful information. Thanks for the post. I’ll certainly comeback.

  • Just desire to say your article is as surprising.
    The clarity in your post is simply nice and i could assume you’re an expert on this subject.
    Well with your permission allow me to grab your RSS feed
    to keep updated with forthcoming post. Thanks a million and please carry on the rewarding work.

  • I have been browsing online more than 3 hours today, yet I never found any
    interesting article like yours. It is pretty worth enough for me.
    Personally, if all web owners and bloggers made good content as you did, the
    net will be much more useful than ever before.

  • scoliosis
    Hey just wanted to give you a brief heads up and let you know a few of
    the pictures aren’t loading correctly. I’m not sure why but I think
    its a linking issue. I’ve tried it in two different browsers and both show the same outcome.
    scoliosis

  • scoliosis
    I am really enjoying the theme/design of your site.
    Do you ever run into any internet browser compatibility problems?
    A few of my blog visitors have complained about my site not
    working correctly in Explorer but looks great in Chrome.
    Do you have any tips to help fix this issue? scoliosis

  • Wow that was unusual. I just wrote an very long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say superb blog!

  • Hi there are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do
    you need any html coding expertise to make your
    own blog? Any help would be greatly appreciated!

  • Attractive section of content. I just stumbled upon your web site and in accession capital to assert that
    I acquire in fact enjoyed account your blog posts.
    Any way I’ll be subscribing to your feeds and even I achievement you access consistently rapidly.

  • of course like your website however you need to test the spelling on several
    of your posts. Several of them are rife with spelling
    issues and I to find it very bothersome to inform the truth however I’ll surely come again again.

  • When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get
    several e-mails with the same comment. Is there any way you can remove people from that
    service? Appreciate it!

  • I’m extremely impressed with your writing skills and also with the
    layout on your weblog. Is this a paid theme
    or did you customize it yourself? Either way keep up the excellent quality writing,
    it is rare to see a great blog like this one these days.

  • You’re so cool! I don’t think I have read through a single
    thing like that before. So nice to discover another person with a few original
    thoughts on this subject. Seriously.. thanks for starting this up.
    This web site is something that is needed on the internet, someone with some originality!

  • Currently it seems like Movable Type is the best blogging platform available right now.
    (from what I’ve read) Is that what you are using on your blog?

  • Howdy! I realize this is somewhat off-topic however I needed to ask.
    Does running a well-established blog such as yours require a
    lot of work? I’m brand new to operating a blog
    but I do write in my diary every day. I’d like to start a blog so I will be able to share my personal experience and feelings online.
    Please let me know if you have any kind of recommendations or tips for new aspiring bloggers.

    Appreciate it!

  • Have you ever considered creating an e-book or guest authoring on other blogs?
    I have a blog centered on the same topics you discuss and would really like to have you share some stories/information. I know my viewers
    would value your work. If you are even remotely interested,
    feel free to send me an e-mail.

  • This is the perfect web site for anyone who really wants to understand this topic.
    You know so much its almost hard to argue with you (not that I really
    will need to…HaHa). You certainly put a new spin on a subject which has been written about for many years.
    Wonderful stuff, just great!

  • Hey there would you mind letting me know which hosting company you’re utilizing?

    I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot faster then most.

    Can you recommend a good web hosting provider at a reasonable price?
    Cheers, I appreciate it!

  • I really like your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to construct my own blog and would like to find out where u got this from.
    many thanks

  • Greetings from Ohio! I’m bored to death at work so I decided to
    browse your site on my iphone during lunch break. I really like the
    knowledge you provide here and can’t wait to take a look when I get home.

    I’m surprised at how quick your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyways, fantastic blog!

  • Does your site have a contact page? I’m having trouble locating it but,
    I’d like to shoot you an e-mail. I’ve got some recommendations for your blog you might be
    interested in hearing. Either way, great site and I look forward to seeing it grow over
    time.

  • Great article! This is the type of information that are supposed to
    be shared across the net. Shame on Google for now not positioning this submit upper!
    Come on over and consult with my web site . Thanks =)

  • No matter if some one searches for his essential thing,
    therefore he/she wishes to be available that in detail,
    therefore that thing is maintained over here.

  • It’s perfect time to make some plans for the
    longer term and it is time to be happy. I’ve learn this submit and if I may I wish to recommend you
    few fascinating things or suggestions. Maybe you could write subsequent articles regarding this article.
    I wish to read more things about it!

  • Great beat ! I wish to apprentice while you amend your web site, how
    could i subscribe for a blog website? The account helped me a
    appropriate deal. I were a little bit acquainted of this your broadcast offered vibrant clear concept

  • Having read this I believed it was rather informative.

    I appreciate you spending some time and effort to put this content together.
    I once again find myself personally spending a lot of time
    both reading and commenting. But so what, it was still worthwhile!

  • Have you ever considered publishing an e-book or guest
    authoring on other websites? I have a blog based on the same information you discuss and would really like to have you share some stories/information. I know my readers would appreciate your work.
    If you are even remotely interested, feel free to shoot me an e mail.

  • I simply could not go away your web site prior to suggesting that I really loved the usual information a person provide in your guests? Is gonna be back steadily in order to check out new posts.

  • Great goods from you, man. I have understand your stuff previous to
    and you’re just extremely fantastic. I actually like what you’ve acquired here,
    certainly like what you are saying and the way in which you
    say it. You make it enjoyable and you still care for to keep it wise.
    I can not wait to read much more from you. This is actually a terrific site.

  • I blog quite often and I genuinely appreciate your content.
    Your article has really peaked my interest. I will book mark your blog and keep
    checking for new information about once per week. I opted in for your RSS feed too.

  • I’m not that much of a internet reader to be honest but your blogs really nice,
    keep it up! I’ll go ahead and bookmark your website to come back
    later on. All the best

  • I simply couldn’t leave your website prior to suggesting that I extremely loved the usual info a person provide on your guests? Is gonna be again frequently in order to investigate cross-check new posts.

  • I like the helpful info you provide in your articles. I will bookmark your blog and check again here frequently.

    I’m quite certain I’ll learn lots of new stuff right here!

    Best of luck for the next!

  • Oh my goodness! Incredible article dude! Thanks, However I am having problems with your RSS.
    I don’t understand the reason why I am unable to join it.
    Is there anyone else having identical RSS problems?
    Anybody who knows the answer can you kindly respond? Thanks!!

  • Very good blog! Do you have any tips for aspiring writers?

    I’m planning to start my own site soon but I’m a
    little lost on everything. Would you advise starting with a free platform like WordPress or go for a paid option? There are so many options out there
    that I’m totally confused .. Any recommendations?
    Thanks!

  • Howdy! I understand this is somewhat off-topic but I had to ask.
    Does running a well-established blog like yours
    require a lot of work? I’m completely new to running a
    blog but I do write in my diary everyday. I’d like to start
    a blog so I will be able to share my experience
    and feelings online. Please let me know if you
    have any kind of suggestions or tips for brand new aspiring blog owners.
    Thankyou!

  • Please let me know if you’re looking for a writer
    for your site. You have some really great posts and I
    think I would be a good asset. If you ever want to take some
    of the load off, I’d love to write some
    content for your blog in exchange for a link back to mine.

    Please send me an email if interested. Kudos!

  • Magnificent items from you, man. I have remember your stuff
    prior to and you’re simply too excellent.

    I really like what you have acquired right here, certainly like
    what you’re saying and the way in which you assert it.
    You make it enjoyable and you still take care of to keep it wise.

    I can not wait to read much more from you. This is actually a terrific web site.
    scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

  • Hey there! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a good read. Thank you for sharing!

  • Youre so cool! I dont suppose Ive read anything like this before. So nice to find somebody with some original thoughts on this subject. realy thank you for starting this up. this website is something that is needed on the web, someone with a little originality. useful job for bringing something new to the internet!

  • There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game. Both boys and girls feel the impact of just a moment?s pleasure, for the rest of their lives.

  • This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want?HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

  • There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game. Both boys and girls feel the impact of just a moment?s pleasure, for the rest of their lives.

  • There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game. Both boys and girls feel the impact of just a moment?s pleasure, for the rest of their lives.

  • Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I?d prefer to use some with the content on my blog whether you don?t mind. Natually I?ll give you a link on your web blog. Thanks for sharing.

  • Hello there! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us beneficial information to work on. You have done a wonderful job!

  • Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but instead of that, this is wonderful blog. A great read. I will certainly be back.

  • I journal sometimes and also I seriously appreciate your content. This amazing article has certainly actually peaked my passion. I am going to book mark your web page as well as keep checking for all new information regarding when a week. I opted in for your RSS feed as well.

  • I?m impressed, I must say. Really rarely do I encounter a blog that?s both educative and entertaining, and let me tell you, you have hit the nail on the head. Your idea is outstanding; the issue is something that not enough people are speaking intelligently about. I am very happy that I stumbled across this in my search for something relating to this.

  • Hi there! Someone in my Facebook group shared this site with us so I came to give it a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to my followers! Terrific blog and superb design and style.

  • Good day! I know this is kinda off topic however I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa? My website addresses a lot of the same topics as yours and I think we could greatly benefit from each other. If you’re interested feel free to send me an e-mail. I look forward to hearing from you! Superb blog by the way!

  • Hi, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam responses? If so how do you reduce it, any plugin or anything you can suggest? I get so much lately it’s driving me insane so any assistance is very much appreciated.

  • I journal typically and also I very seriously respect your material. This awesome post has truly actually peaked my interest. I am likely going to book mark your online site and keep checking for all new facts concerning as soon as a week. I opted in for your RSS feed likewise.

  • Hello! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in exchanging links or maybe guest authoring a blog article or vice-versa? My blog goes over a lot of the same subjects as yours and I think we could greatly benefit from each other. If you’re interested feel free to shoot me an e-mail. I look forward to hearing from you! Terrific blog by the way!

  • Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know. The style and design look great though! Hope you get the issue fixed soon. Kudos

Leave a Reply

Your email address will not be published. Required fields are marked *