Setup
Connect the BBB to the PC through the USB. The BBB shows up as a new device. You can open START.htm and follow the instructions.
Under Linux you don’t need to install any driver, but it is useful to use the provided script to setup udev rules. The script need execution privileges. You need to copy the file /media/pezzino/boot/Drivers/Linux/FTDI/mkudevrule.sh under another directory and add x privilege.
pezzino@samarcanda:/media/pezzino/boot/Drivers/Linux/FTDI$ cp mkudevrule.sh ~/ pezzino@samarcanda:/media/pezzino/boot/Drivers/Linux/FTDI$ cd ~ pezzino@samarcanda:~$ chmod +x mkudevrule.sh pezzino@samarcanda:~$ sudo ./mkudevrule.sh [sudo] password for pezzino:
BBB uses also a USB to virtual Ethernet in order to access the web server at http://192.168.7.2, you need to set up correctly your network, you can use ifconfig to get the correct MAC address.
pezzino@samarcanda:~$ ifconfig -a eth2 Link encap:Ethernet HWaddr d0:5f:b8:a1:cd:f0 inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 inet6 addr: fe80::d25f:b8ff:fea1:cdf0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:41 errors:0 dropped:0 overruns:0 frame:0 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7492 (7.4 KB) TX bytes:23168 (23.1 KB)
BBB capabilities
The Bonescript library runs in Node.JS. You can run it directly on the board using the ‘node’ interpreter or the Cloud9 IDE that invokes the ‘node’ interpreter. You can also run it using the bonescript.js script within your browser via remote procedure calls using Socket.io and served up by the web server running on your BeagleBoard.
That’s really impressive. Connect to Clou9 IDE server at http://192.168.7.2:3000
Serial port
Pin number 1 is marked with a dot on J1 connector.
Board Wire Function Pin 1.....Black.....Ground Pin 4.....Green.....Receive Pin 5.....White....Transmit
[ 3235.749508] usb 2-1.3: new full-speed USB device number 5 using ehci-pci [ 3235.842843] usb 2-1.3: New USB device found, idVendor=067b, idProduct=2303 [ 3235.842851] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 3235.842856] usb 2-1.3: Product: USB-Serial Controller [ 3235.842860] usb 2-1.3: Manufacturer: Prolific Technology Inc. [ 3236.493676] [UFW BLOCK] IN=wlan0 OUT= MAC= SRC=2a02:120b:2c38:d9d0:7939:af56:0cf4:fa0e DST=ff02:0000:0000:0000:0000:0 [ 3237.493662] usbcore: registered new interface driver usbserial [ 3237.493703] usbcore: registered new interface driver usbserial_generic [ 3237.493735] usbserial: USB Serial support registered for generic [ 3237.515320] usbcore: registered new interface driver pl2303 [ 3237.515349] usbserial: USB Serial support registered for pl2303 [ 3237.515384] pl2303 2-1.3:1.0: pl2303 converter detected [ 3237.518917] usb 2-1.3: pl2303 converter now attached to ttyUSB0
Baud 115,200 Bits 8 Parity N Stop Bits 1 Handshake None
The serial port will be mounted under /dev/ttyACM0
Minicom (Ctrl+A and then O to set up the port, Ctrl+A and Q to quit):
Debian GNU/Linux 7 beaglebone ttyGS0 default username:password is [debian:temppwd] Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian The IP Address for usb0 is: 192.168.7.2 beaglebone login: root Password: Login incorrect beaglebone login: root Last login: Wed Apr 23 20:21:18 UTC 2014 on ttyO0 Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@beaglebone:~#
The password for root is blank.
Cross development
Under Eclipse Luna install:
Luna - http://download.eclipse.org/releases/luna Mobile and Device Development C/C++ GCC Cross Compiler Support Remote System Explorer End-User Runtime C/C++ Remote Launch (Requires RSE Remote System Explorer)
See RSE help page.
Install toolchain:
sudo apt-get install gcc-arm-linux-gnueabihf sudo apt-get install g++-arm-linux-gnueabihf
New -> C Project, choose cross GCC.
Cross compiler prefix: arm-linux-gnueabihf-
RSE, define new connection, ssh only, host name: 192.168.7.2, finish.
Run, Run configurations, C/C++ Remote Application, right click, new…
Connection -> BBBlack, change remote absolute path (NOTE: this is the complete path of the executable, not only the containing directory! e.g. /root/demo/BBBHelloC). The first time you need to add the exec permission (e.g. chmod +x BBBHelloC). You can also add commands that need to run before the application starts.
Debugging
The toolchain that get installed with my Ubuntu (14.10) doesn’t contain gdb. Most instructions found on the net suggest to install gdb-multiarch to talk to the remote gdb server, but it didn’t worked for me. I’ve tried to use arm-none-eabi-gdb, it starts the debugging process but eventually you get an error.
On the BBB you can check the version of the gdb server:
root@beaglebone:~/demo# gdbserver --version GNU gdbserver (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. gdbserver is free software, covered by the GNU General Public License. This gdbserver was configured as "arm-linux-gnueabihf"
In the end I’ve downloaded the precompiled toolchain from linaro (the gnueabihf version), and manually installed their gdb.
Right click on project, Debug As, Debug configurations, under debugger tab change gdb to arm-linux-gnueabihf-gdb.
Network
/etc/network/interfaces:
iface usb0 inet static address 192.168.7.2 netmask 255.255.255.0 network 192.168.7.0 gateway 192.168.7.1 auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 gateway 192.168.1.1
Conclusion
So, beaglebone black is a cheap device that let you play with many different technologies related to Linux embedded development.
- Node.js
- Cloud9 IDE
- Yocto
- Linux device tree
- PCB design (new cape)
- PRUs
- …