{"id":72,"date":"2011-04-06T08:50:10","date_gmt":"2011-04-06T15:50:10","guid":{"rendered":"http:\/\/..\/?p=72"},"modified":"2011-04-06T08:50:10","modified_gmt":"2011-04-06T15:50:10","slug":"zipit-as-a-serial-terminal-for-uboot","status":"publish","type":"post","link":"https:\/\/blog.engine12.com\/?p=72","title":{"rendered":"ZipIt as a serial terminal for Uboot"},"content":{"rendered":"<p><span style=\"color: #ff9900\"> <\/span>I configured one of my ZipIts to be a serial terminal for the beagleboard.\u00a0 Like the ZipIt, the beagleboard has Uboot installed.\u00a0 The flexibility of Uboot allows many different ways to get an image into RAM.\u00a0 The methods available for the beagleboard require a serial connection.\u00a0 Both methods outlined will require minicom to be installed on the ZipIt in order to communicate with the beagleboard.\u00a0 The lrzsz package is also needed, it can sometimes be included in the minicom package, but double check in case it&#8217;s not.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~#: <span style=\"color: #ff9900\">apt-get install minicom<\/span><\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~#: <span style=\"color: #ff9900\">apt-get install lrzsz<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>My ZipIt was running <a title=\"z2sid-rc3 for Uboot\" href=\"http:\/\/zipit.markamber.co\/z2sid_v6_uboot_rc3.tar.bz2\">z2sid-rc3<\/a> with a kernel built using this <a title=\"kernel config for USB serial\" href=\"http:\/\/engine12.com\/files\/.config.04052011%28usb_serial%29\">config<\/a> in buildroot.<\/p>\n<p>&nbsp;<\/p>\n<h2>Method 1<\/h2>\n<p><a href=\"..\/wp-content\/uploads\/2011\/04\/zipit_serial_1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignright size-medium wp-image-96\" src=\"..\/wp-content\/uploads\/2011\/04\/zipit_serial_1-300x219.jpg\" alt=\"\" width=\"300\" height=\"219\" \/><\/a>I first connected the beagleboard to the ZipIt the same way I was connecting it to my laptop.\u00a0 This setup requires a USB to serial converter, the usb-serial driver and minicom.\u00a0 Lots of cables, but that&#8217;s how the beagleboard is configured by default, out of the box.\u00a0 First of all, before plugging anything into the ZipIt&#8217;s USB, load the usb-serial driver.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~#:<span style=\"color: #ff9900\"> modprobe usbserial<\/span><\/p>\n<p>The USB hub can now be connected to the ZipIt.\u00a0 Give the USB devices a second to register, a \/dev\/ttyUSB0 node will be created.\u00a0 Attach a minicom session with the following command.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~$: <span style=\"color: #ff9900\">minicom -D \/dev\/ttyUSB0<\/span><\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<h2>Method 2<\/h2>\n<p>A<a href=\"..\/wp-content\/uploads\/2011\/04\/zipit_serial_2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-97 alignright\" src=\"..\/wp-content\/uploads\/2011\/04\/zipit_serial_2-300x182.jpg\" alt=\"\" width=\"300\" height=\"182\" \/><\/a> little investigating and I was able to eliminate most of the wires and the USB hub by using USB serial over the beagle&#8217;s OTG port (in the prior setup, the OTG cable was only providing power).\u00a0 This setup requires a different driver to be running on the ZipIt and the beagleboard&#8217;s Uboot environment variables need to be modified.\u00a0 Start with changing the Uboot enviroment variables.\u00a0 Enter Uboot and issue the following commands.\u00a0 Note: this will require the setup from Method 1 in order to get a Uboot prompt on the ZipIt.<\/p>\n<p style=\"padding-left: 30px\">OMAP3 beagleboard.org # <span style=\"color: #ff9900\">setenv usbtty cdc_ac<\/span><\/p>\n<p style=\"padding-left: 30px\">OMAP3 beagleboard.org # <span style=\"color: #ff9900\">saveenv<\/span><\/p>\n<p style=\"padding-left: 30px\">OMAP3 beagleboard.org # <span style=\"color: #ff9900\">reset<\/span><\/p>\n<p style=\"padding-left: 30px\">OMAP3 beagleboard.org # <span style=\"color: #ff9900\">setenv stdout usbtty;<\/span><span style=\"color: #ff9900\"> setenv stdin usbtty;<\/span><span style=\"color: #ff9900\"> setenv stderr usbtty;<\/span><span style=\"color: #ff9900\"> saveenv<\/span><\/p>\n<p>At this point Method 1 will no longer work on the beagleboard, as we have changed the stdin and stdout.<\/p>\n<p style=\"padding-left: 30px\">1.\u00a0 Plug the ZipIt into AC power and boot <a href=\"http:\/\/zipit.markamber.co\/z2sid_v6_uboot_rc3.tar.bz2\">z2sid-rc3<\/a>.<\/p>\n<p style=\"padding-left: 30px\">2.\u00a0 Load the cdc_acm driver with the following command.<\/p>\n<p style=\"padding-left: 60px\">z2sid-rc3:~#: <span style=\"color: #ff9900\">modprobe cdc-acm<\/span><\/p>\n<p style=\"padding-left: 30px\">3.\u00a0 Connect the beagleboard&#8217;s OTG cable to the ZipIt as shown in the picture for Method 2.<\/p>\n<p style=\"padding-left: 30px\">4.\u00a0 There should be a new \/dev\/tttyACM0 node present now, attach minicom to it.<\/p>\n<p style=\"padding-left: 60px\">z2sid-rc3:~$: <span style=\"color: #ff9900\">minicom -D \/dev\/ttyACM0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>clonetty<\/h3>\n<p>The <a title=\"utuility for tty cloning and virtualization\" href=\"http:\/\/gitorious.org\/clonetty\">clonetty<\/a> utility is needed for keeping minicom alive when plugging and unplugging the beagleboard.\u00a0 It places a pseudo tty in between the ttyACM0 node and minicom.\u00a0 The pseudo tty never goes down, and when the ttyACM0 node appears, clonetty takes care of setting up the link automatically.\u00a0 The utility consists of a single C file and can be compiled with this <a title=\"Makefile for clonetty\" href=\"http:\/\/engine12.com\/files\/clonetty\/Makefile\">make<\/a> file.\u00a0 I built mine right on <a href=\"http:\/\/zipit.markamber.co\/z2sid_v6_uboot_rc3.tar.bz2\">z2sidx-rc3<\/a>.\u00a0 It&#8217;s assumed you have everything setup for Method 2.\u00a0 These are the steps to set up clonetty and minicom.<\/p>\n<p>1.\u00a0 Plug the ZipIt into AC power, boot Linux.<\/p>\n<p>2.\u00a0 Connect the beagleboard&#8217;s OTG cable to the ZipIt as shown in the picture for Method 2.<\/p>\n<p>3. Start minicom and configure the options to connect with the beagleboard (i.e. 115200 8N1), save as dfl and quit.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~$: <span style=\"color: #ff9900\">minicom -D \/dev\/ttyACM0 -o<\/span><\/p>\n<p>4.\u00a0 Start clonetty in the background.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~$: <span style=\"color: #ff9900\">clonetty \/dev\/ttyACM0 &amp;<br \/>\n<\/span><\/p>\n<p>3.\u00a0 Observe the output:<\/p>\n<p style=\"padding-left: 30px\">pty: \/dev\/pts\/3<br \/>\nUsing \/dev\/ttyACM0<\/p>\n<p>4.\u00a0 Attach minicom to the pty that clonetty just created.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~$: <span style=\"color: #ff9900\">minicom -p \/dev\/pts\/3 -o<br \/>\n<\/span><\/p>\n<p>5.\u00a0 You should now be able to unplug\/plug or reset the beagleboard and the minicom connection will stay up.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>omap-u-boot-utils<\/h3>\n<p>The <a title=\"Nishanth' omap-u-boot-utils\" href=\"http:\/\/code.google.com\/p\/omap-u-boot-utils\/\">omap-u-boot-utils<\/a> package has source files needed for communicating with uboot and automating a serial transfer of an image into RAM.\u00a0 There isn&#8217;t much OMAP specific code, the routines should work with any uboot&#8217;ed target.\u00a0 This <a href=\"http:\/\/engine12.com\/files\/beagle_kermit.sh.txt\">beagle_kermit.sh<\/a> script uses the kermit method of serial transfer.\u00a0 Start clonetty as described above, minicom is not needed.\u00a0 Change to the directory with the <a title=\"Nishanth' omap-u-boot-utils\" href=\"http:\/\/code.google.com\/p\/omap-u-boot-utils\/\">omap-u-boot-utils<\/a> and execute <a href=\"http:\/\/engine12.com\/files\/beagle_kermit.sh.txt\">beagle_kermit.sh<\/a>.\u00a0 Note: the &#8216;port&#8217; variable at the head of the script may need adjustment, it should match the output from clonetty.<\/p>\n<p style=\"padding-left: 30px\">z2sid-rc3:~\/Uboot_utils$: <span style=\"color: #ff9900\">.\/beagle_kermit.sh<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Links:<\/p>\n<p><a href=\"http:\/\/gitorious.org\/clonetty\">http:\/\/gitorious.org\/clonetty<\/a><\/p>\n<p><a href=\"http:\/\/engine12.com\/files\/clonetty\/Makefile\">http:\/\/engine12.com\/files\/clonetty\/Makefile<\/a><\/p>\n<p><a href=\"http:\/\/engine12.com\/files\/.config.04052011(usb_serial)\">http:\/\/engine12.com\/files\/.config.04052011(usb_serial)<\/a><\/p>\n<p><a href=\"http:\/\/elinux.org\/U-boot_musb_gadget_support\">http:\/\/elinux.org\/U-boot_musb_gadget_support<\/a><\/p>\n<p><a href=\"http:\/\/zipit.markamber.co\/z2sid_v6_uboot_rc3.tar.bz2\">http:\/\/zipit.markamber.co\/z2sid_v6_uboot_rc3.tar.bz2<\/a><\/p>\n<p><a href=\"http:\/\/code.google.com\/p\/omap-u-boot-utils\/\">http:\/\/code.google.com\/p\/omap-u-boot-utils\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I configured one of my ZipIts to be a serial terminal for the beagleboard.\u00a0 Like the ZipIt, the beagleboard has Uboot installed.\u00a0 The flexibility of Uboot allows many different ways to get an image into RAM.\u00a0 The methods available for the beagleboard require a serial connection.\u00a0 Both methods outlined will require minicom to be installed <a href='https:\/\/blog.engine12.com\/?p=72'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[3,13],"_links":{"self":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/72"}],"collection":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":0,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}