Saturday, June 29, 2013

Mount eMMC partition on BeagleBone Black

Create a mount point

    mkdir -p /mnt/emmcfat

Mount FAT partition

    mount -t vfat /dev/mmcblk0p1 /mnt/emmcfat





Friday, June 28, 2013

Build the Kernel for BeagleBone Black

Following these instructions:
http://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-LinuxKernel

Upgrade distro "device-tree-compiler" package
Build/Install:
wget -c https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh
chmod +x dtc.sh
./dtc.sh
Verify:
:~$ /usr/local/bin/dtc -v
Version: DTC 1.3.0-g1ea7e802

Linux Build Script:

git clone git://github.com/RobertCNelson/linux-dev.git
cd linux-dev/
For Mainline v3.8.x
git checkout origin/am33x-v3.8 -b tmp
Run Build Script:
./build_kernel.sh
The kernel zImage and modules will be under the deploy directory.

Built me a zImage file.  Need to convert to uImage:


Using the "/boot/uboot/zImage": 

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 
-n kernel -d ./zImage ./uImage 

Tuesday, June 25, 2013

BeagleBone Black build environment

I have decided to learn to build the BBB from scratch as a learning exercise.  Here are my steps to that end:

  1. Install VMWare for virtual machine (I daily use Mac OSX and Windows 7 -- not Linux). 
  2. Download Ubuntu (choose Ubuntu 13.04, 64 bit).


Monday, June 24, 2013

Kernel messages overflowing on the BBB

The USB gadget support build into the latest Angstrom kernel (as of the 6-6-2013 version), had debugging enabled in it's configuration.  This causes the following 7 messages to repeat in the logs:

[ 8732.441147] gen_ndis_query_resp: RNDIS_OID_GEN_RCV_NO_BUFFER
[ 8732.444806]  gadget: rndis reqa1.01 v0000 i0000 l4096
[ 8732.445090]  gadget: rndis req21.00 v0000 i0000 l36
[ 8732.448797]  gadget: rndis reqa1.01 v0000 i0000 l4096
[ 8732.449226]  gadget: rndis req21.00 v0000 i0000 l36
[ 8732.452790]  gadget: rndis reqa1.01 v0000 i0000 l4096
[ 8732.453162]  gadget: rndis req21.00 v0000 i0000 l36

This "SPAM" makes the log nearly unusable if you are watching for something else important.

The particular configuration item is:  CONFIG_USB_GADGET_DEBUG=y

Robert Nelson confirms my suspicion here (eewiki.net) and indicates that the next build will have this configuration changed.

I am not aware of any way to correct this short of rebuilding the kernel.  I think I can wait for Robert...  :-)

Friday, June 21, 2013

BeagleBone Black Progress Notes

The BBB is fairly new, the tools and software are a work in progress.  It's easy to get distracted chasing down a problem or feature that I want to make work, and forget what I have done or plan on working on next.  

GOALS

CONNECTIVITY

  • Console port, Serial
  • USB port to Host, SSH via Gadget Ethernet
  • USB Internet from Host to BBB
  • Direct Ethernet port to BBB
  • WiFi

I2C

  • Wire LED display (Adafruit I2C backpack 7 Segment Display)
  • Validate via command line
  • Install I2C library for JavaScript environment
  • Validate connectivity thru library
  • Create library for display
NODE
  • Create Node app to update LED display

Turns out that order very much matters, and it's pretty easy to get sucked into a side task and loose track.

PROCESS

1. Download and install updated Angstrom Image (2013-6-6 eMMC flasher image) via card.

2. Configure Windows 7 USB Internet Sharing (see blog entry)

3. Update System

4. Test I2C from Command Line

5. Configure NPM

6. Install I2C Node Module






Thursday, June 20, 2013

Windows 7 Internet Sharing for BeagleBone Black

I wish I better understood WHY this was necessary.  

At one point my BBB "just worked".  When it was plugged into my desktop computer via USB (Windows 7 machine) the BBB had internet connectivity just fine.  After working to solve other issues it stopped.  In any case, it works again with the following steps:


On the Windows 7 computer:

  •     Control Panel -> Network and Internet -> Network Connections
  •     Right-click your internet connection, Properties, Sharing Tab
  •     Click "Allow other network users to connect thru this computer's Internet connection"
  •     Select the BeagleBone Black's network connection under "Home networking connection:"
  •     Click OK.

    Here's the trick:  when I did this, Windows assigned a static IP to the BBB connection.  Why?  No idea.  
    You have to go back to that connection and reset it to DHCP.

  •     Control Panel -> Network and Internet -> Network Connections
  •     Right-click the BeagleBone Black's connection, Properties
  •     Click Internet Protocol Version 4 (TCP/IPv4), Click Properties
  •     Click "Optain an IP address automatically"
  •     Click "Obtain DNS server address automatically"
  •     Click OK.  Click CLOSE.

On the BBB:

This makes the BBB route internet traffic thru the host (Windows 7 in this case) and DNS thru Google's DNS Servers (8.8.8.8).  

    route add default gw 192.168.7.1
    echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Try It:

    ping www.google.com

Make it Persistant:

To make this "stick" after a reboot of the BBB, you need to add these commands to the ethernet startup script on the BBB (/usr/bin/g-ether-load.sh).  

NOTE:   You CANNOT simply add these commands to the bottom of that script file.  They must go  before the udhcpd starts.  It does not return control to the script so adding them at the bottom of the file does nothing for you.  My script file now looks like this:

    /sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252
    /sbin/route add default gw 192.168.7.1
    echo 'nameserver 8.8.8.8' >> /etc/resolv.conf


    /usr/sbin/udhcpd -f -S /etc/udhcpd.conf


IT WORKS!


A big thanks to robert@rplural.net who got me moving in the right direction.  Read his description of the parallel steps for a Linux host!

    

Wednesday, June 12, 2013

Updating BeagleBone Black System


These commands update the BeagleBone Black system files. 

Remember to replace the kernel version number show with an 'x', with the one shown during the upgrade.  This forces the kernel upgrade to occur.  If not done, you can lock up the BBB causing a rewrite of the eMMC to be required.

opkg update
opkg upgrade
opkg --force-overwrite install kernel-image-3.8.x