I configured one of my ZipIts to be a serial terminal for the beagleboard.  Like the ZipIt, the beagleboard has Uboot installed.  The flexibility of Uboot allows many different ways to get an image into RAM.  The methods available for the beagleboard require a serial connection.  Both methods outlined will require minicom to be installed on the ZipIt in order to communicate with the beagleboard.  The lrzsz package is also needed, it can sometimes be included in the minicom package, but double check in case it’s not.

z2sid-rc3:~#: apt-get install minicom

z2sid-rc3:~#: apt-get install lrzsz

 

My ZipIt was running z2sid-rc3 with a kernel built using this config in buildroot.

 

Method 1

I first connected the beagleboard to the ZipIt the same way I was connecting it to my laptop.  This setup requires a USB to serial converter, the usb-serial driver and minicom.  Lots of cables, but that’s how the beagleboard is configured by default, out of the box.  First of all, before plugging anything into the ZipIt’s USB, load the usb-serial driver.

z2sid-rc3:~#: modprobe usbserial

The USB hub can now be connected to the ZipIt.  Give the USB devices a second to register, a /dev/ttyUSB0 node will be created.  Attach a minicom session with the following command.

z2sid-rc3:~$: minicom -D /dev/ttyUSB0

 

Method 2

A little investigating and I was able to eliminate most of the wires and the USB hub by using USB serial over the beagle’s OTG port (in the prior setup, the OTG cable was only providing power).  This setup requires a different driver to be running on the ZipIt and the beagleboard’s Uboot environment variables need to be modified.  Start with changing the Uboot enviroment variables.  Enter Uboot and issue the following commands.  Note: this will require the setup from Method 1 in order to get a Uboot prompt on the ZipIt.

OMAP3 beagleboard.org # setenv usbtty cdc_ac

OMAP3 beagleboard.org # saveenv

OMAP3 beagleboard.org # reset

OMAP3 beagleboard.org # setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty; saveenv

At this point Method 1 will no longer work on the beagleboard, as we have changed the stdin and stdout.

1.  Plug the ZipIt into AC power and boot z2sid-rc3.

2.  Load the cdc_acm driver with the following command.

z2sid-rc3:~#: modprobe cdc-acm

3.  Connect the beagleboard’s OTG cable to the ZipIt as shown in the picture for Method 2.

4.  There should be a new /dev/tttyACM0 node present now, attach minicom to it.

z2sid-rc3:~$: minicom -D /dev/ttyACM0

 

 

clonetty

The clonetty utility is needed for keeping minicom alive when plugging and unplugging the beagleboard.  It places a pseudo tty in between the ttyACM0 node and minicom.  The pseudo tty never goes down, and when the ttyACM0 node appears, clonetty takes care of setting up the link automatically.  The utility consists of a single C file and can be compiled with this make file.  I built mine right on z2sidx-rc3.  It’s assumed you have everything setup for Method 2.  These are the steps to set up clonetty and minicom.

1.  Plug the ZipIt into AC power, boot Linux.

2.  Connect the beagleboard’s OTG cable to the ZipIt as shown in the picture for Method 2.

3. Start minicom and configure the options to connect with the beagleboard (i.e. 115200 8N1), save as dfl and quit.

z2sid-rc3:~$: minicom -D /dev/ttyACM0 -o

4.  Start clonetty in the background.

z2sid-rc3:~$: clonetty /dev/ttyACM0 &

3.  Observe the output:

pty: /dev/pts/3
Using /dev/ttyACM0

4.  Attach minicom to the pty that clonetty just created.

z2sid-rc3:~$: minicom -p /dev/pts/3 -o

5.  You should now be able to unplug/plug or reset the beagleboard and the minicom connection will stay up.

 

 

omap-u-boot-utils

The omap-u-boot-utils package has source files needed for communicating with uboot and automating a serial transfer of an image into RAM.  There isn’t much OMAP specific code, the routines should work with any uboot’ed target.  This beagle_kermit.sh script uses the kermit method of serial transfer.  Start clonetty as described above, minicom is not needed.  Change to the directory with the omap-u-boot-utils and execute beagle_kermit.sh.  Note: the ‘port’ variable at the head of the script may need adjustment, it should match the output from clonetty.

z2sid-rc3:~/Uboot_utils$: ./beagle_kermit.sh

 

Links:

http://gitorious.org/clonetty

http://engine12.com/files/clonetty/Makefile

http://engine12.com/files/.config.04052011(usb_serial)

http://elinux.org/U-boot_musb_gadget_support

http://zipit.markamber.co/z2sid_v6_uboot_rc3.tar.bz2

http://code.google.com/p/omap-u-boot-utils/

I’ve been using this script to generate ARM toolchains for baremetal development on a Linux host.

  1. Verify or install the list of utilities noted at the head of the script, they’re needed before starting the build.
  2. Create a folder ‘ARM_tools’ and place the script inside.
  3. Change to the ARM_tools folder and execute ‘./cross.sh’.

All of the packages should download, configure, and compile.  The process will require about 1 Gb of free space on the your drive.  To generate an elf toolchain, edit the script and replace ‘arm-none-eabi’ with ‘arm-elf’.

 

Note: there is a problem with specifying –enable-multilib as a compiler option.  This is enabled by default already, so it’s best not to include it.  The script I’ve linked to has already taken care of the matter.

 

Links:

http://engine12.com/files/cross.sh

http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source

https://github.com/esden/summon-arm-toolchain

© 2016 engine12