39 Replies Latest reply on Jun 14, 2012 5:34 PM by morgaine

    Combining BeagleBone and Raspberry Pi

    morgaine

      Well I finally couldn't wait any longer for an ARM Linux board (my Pi isn't due until the end of June), so I bought a BeagleBone.

       

      (This post is about technology.  I am not interested in "A is better than B" arguments.  Horses for courses.)

       

      It's a very nice board, much more like an Arduino in concept than a Pi -- the two rows of female headers give it that feel.  Farnell provided their usual (in my experience so far) perfect quality of service and delivered it the very next day --- http://uk.farnell.com/circuitco/bb-bone-000/kit-dev-beaglebone-cortex-a8/dp/2063627

       

      The power design is particularly noteworthy, given our recent discussions about polyfuses.  The BeagleBone uses a TPS65217B power management IC (PMIC) to generate stable supply voltages regardless of input power, which can come from a barrel connector or from the mini-USB.

       

      The mini-USB itself deserves a mention, as it's impressively multi-functional.  In addition to being an alternative source of power, it provides a front-end two-port USB client-side hub --- this is entirely unrelated to the separate host-mode USB type A socket which is also available.  One port of this hub goes directly to the TI AM3359 SoC, while the other port connects to a dual-port FT2232H USB-to-serial converter to provide user-host communications (Linux console by default) and JTAG debugging simultaneously.

       

      The SoC USB connection to the front-end hub works in one of two modes which can be toggled at will at any time:  it either presents the SD card as a mountable USB storage device to the host, or it provides an Ethernet-over-USB networking interface which yields an extremely simple quick-start.  (This is additional to the BeagleBone's normal 10/100 Ethernet interface, which is directly implemented in the SoC rather than hanging off USB.)  It all worked immediately using my Gentoo machine as host, providing full IPv4 and IPv6 connectivity out of the box.

       

      Which brings me to BeagleBone and Raspberry Pi.  These two devices are very different, enjoying different strengths and suffering different weaknesses, and their most appropriate applications would naturally fall in different areas because of these differences.  I'm interested in how the best features of each could be combined to provide better functionality than either does alone.

       

      I already have one idea in this area.

       

      The BeagleBone doesn't provide an on-board graphics interface (despite its SoC containing a PowerVR GPU), and as a result, if you want direct graphics you have to buy a "DVI-D cape" containing the interface circuitry ("cape" == BeagleBone daughterboard).  The trouble is, that cape costs more than a Pi Model B!!!!

       

      Which of course provides an ideal opportunity to combine BeagleBone and Pi, since the Pi could handle the graphics side while the BeagleBone does most of the computing which suits its Cortex-A8 nicely.  I'm currently thinking what the best way to achieve this might be, but one simple way is available out of the box since X11 is inherently a networked protocol.

       

      This is obviously just the beginning, and I'm quite excited to see where this combination might lead.

       

      Morgaine.

        • Re: Combining BeagleBone and Raspberry Pi
          morgaine

          PS. Just a hint at one possible way of combining them for graphics, beyond ordinary X11 networking:

           

          It's very feasible to link BeagleBone and Pi boards through SPI and/or I2C and turn each board into a coprocessor for the other --- the Pi a graphics and media coprocessor, and the BeagleBone a more powerful compute engine and communications + I/O coprocessor.

           

          We complain about the Pi's GPU being closed, but if you regard that backend as a black box and turn the whole Pi into a coprocessor, the Pi then becomes the "virtual GPU" for the BeagleBone and you can make it as user-programmable as you want.  OpenCL could be implemented on the Pi's CPU to add to the OpenCL kernels on the BeagleBone.  OpenCL is designed for such heterogenous computing environments.

           

          There's no shortage of interesting possibilities in this area.

           

          Morgaine.

            • Re: Combining BeagleBone and Raspberry Pi
              John Beetem

              BeagleBone is a very nice design.  I got to chat with its hardware designer Gerald Coley last March at the Embedded System Conference in San Jose, California.  He said it was a pain in the neck to place and route everything so that it could fit in an Altoids box (hint, hint).

               

              While BBone is considerably more expensive than RasPi -- mostly because BBone is manufactured in the USA in relatively small lots -- it's incredibly flexible.  Yes, it costs a lot to get a DVI-D cape, but since BBone brings out the full LCD parallel bus you can also do a VGA cape (I don't know if this is available or just in the works) or a very cute 7" LCD touch screen -- BBone plugs into the back of this so you have a nifty little touch screen console.  One of my favorite BBone capes is Special Computing's FPGA cape, with a Xilinx Spartan-3A XC3S200A.  Looks like design is almost complete, but yet to ship.  Gerald says he keeps nagging its designer to finish it up.

                • Re: Combining BeagleBone and Raspberry Pi
                  morgaine

                  John Beetem wrote:

                   

                  While BBone is considerably more expensive than RasPi

                   

                   

                  On the price front, it's important to point out that the price of BeagleBone includes the pre-loaded 4GB SD card, whereas the Pi's price does not, so the real difference is a bit less than at first glance.  That's a point of direct non-contentious price comparison, hopefully.

                   

                  Other than that, the only thing I can say about the BeagleBone's $89 is that at that price it cannot possibly become the worldwide phenomenon that the Pi has become.  $25 is a magic point.  Even the Pi Model B's $35 is riding the coat tails of success created by that magic "$25" headline.

                   

                  I was actually expecting TI to react to the Pi media blizzard by announcing a "BeagleBite" --- an even further cutdown version of the Beagle line, singlemindedly focused on price.  After all, they can't be happy (as an ARM licensee) that their competitor Broadcom is getting all the limelight and appears to be well positioned into creating a monopoly in education.  No sign of such a TI response yet though.

                   

                   

                  One of my favorite BBone capes is Special Computing's FPGA cape, with a Xilinx Spartan-3A XC3S200A.  Looks like design is almost complete, but yet to ship.  Gerald says he keeps nagging its designer to finish it up.

                   

                  I'm very interested in that!  As long as the price doesn't make the tail wag the dog (gotta love Beagle puns), I'm looking forward to further news about it.

                   

                  Morgaine.

              • Re: Combining BeagleBone and Raspberry Pi
                Drew Fustini

                Thanks for the perspective on the BeagleBone and, wow, that is a very interesting point about the Pi being cheaper than the DVI cape.

                 

                BTW, what do you think of adding a BeagleBone group?  I've wanted to post about it before but wasn't sure what was the best fit.  Embedded Linux or Open Source Hardware are probably the closest.  I have one on the way so will be posting more, and it sounds like you have some interesting ideas, too.

                  • Re: Combining BeagleBone and Raspberry Pi
                    morgaine

                    @Drew: I don't know.  Creating per-product groups is somewhat instinctive, but part of me worries about it because so much of what we do is to combine products and interoperate between them.  That's how we achieve the best functionality.

                     

                    Plus, individual groups tends to feed the fanbois ... you can imagine how discussing the BeagleBone would go down on the Raspberry Pi forums.  In fact, one of the RPF admins threatened to lock a thread in which we had mentioned the Allwinner A10 .... go figure.  Fanbois live on a different planet to engineers.  And power corrupts, so when fanbois are also admins, balanced engineering discussion doesn't even get in through the door.

                     

                    Not an issue on Element 14, thank the FSM.   Engineering FTW.

                     

                    There is also the fact that the BeagleBone community is a bit ill-disposed to new forums --- see https://groups.google.com/forum/?fromgroups#!topic/beagleboard/j_rybEhIRY8  .  I'm not too sure why, but it's probably that the community is small enough that fragmentation is actually a real issue.  Grrrr ... I wish the BeagleBone cost $35 so there would be millions of them around.

                     

                    Morgaine.

                    • Re: Combining BeagleBone and Raspberry Pi
                      John Beetem

                      BTW, what do you think of adding a BeagleBone group?  I've wanted to post about it before but wasn't sure what was the best fit.  Embedded Linux or Open Source Hardware are probably the closest.  I have one on the way so will be posting more, and it sounds like you have some interesting ideas, too.

                      I'd avoid an element14 BeagleBone group at this time... there doesn't seem to be enough of a critical mass, and Google's BeagleBoard group (which includes BeagleBone) is a good place for general Beagle questions.  I've been a member since August 2008.  Most of the software questions with BeagleBoard are also relevant to BeagleBone, and I expect a lot of members have both.

                       

                      I'd keep posting BeagleBone related things here with some sort of real or made-up connection to RasPi.  If somebody complains, revisit.

                       

                      If you're new to BeagleBone, there's an interesting and sometimes amusing thread there about competition between RasPi and Beagle: "Can TI compete with Raspberry Pi?"  Here's a link to the thread, centered at a classic joke I adapted to the RasPi availability situation.  One nasty feature of Google Groups threads: if 60 days pass without a post, the thread can no longer be updated.

                        • Re: Combining BeagleBone and Raspberry Pi
                          morgaine

                          @Drew: Although my earlier suggestion was roughly in line with John's on an Element 14 BeagleBone group not being particularly useful at this time, there is a small reason pointing in the other direction too.  As I'm sure others have noticed, the BeagleBoard group and IRC channel is occasionally a bit fanboiish, although not to the level of comedy of RPF.  This sometimes makes discussions a bit tense and negative when talking about other ARM manufacturers.

                           

                          I rather doubt that my current interest in making the Pi handle graphics for my BeagleBone would go down very well in the official Beagle places, particularly since one vocal member there may be responsible for the DVI-D cape.   So, an E14 BeagleBone group might at some time become useful as an alternative place with a more broadminded focus than the official places.

                           

                          For now though, since Pi is part of my picture, this discussion fits in perfectly right here, so I have no personal need for a separate forum at this time.  If others do, I think I'll be neutral, and happy either way.

                           

                           

                          Morgaine.

                      • Re: Combining BeagleBone and Raspberry Pi
                        pholynyk

                        Back to the original topic for a bit... I think if you want to use the RasPi and BB as coprocessors you will need a fairly high bandwidth message passing connection. I think that will mean using the Ethernet rather than I2C or SPI, even with all the E'net overhead. You'd really like a parallel bus, (memory bus?) but then you could just implement QNX as an Asymmetrical MultiProcessor OS (I love QNX, a great synchronus message passing micro-kernel OS).

                         

                        So using the RasPi as an X-display is a really quick and dirty approach that should probably work right out of the shipping box(envelope?). And I don't even need a BeagleBone to test it - I can make my TV a remote display for my desktop Linux box. Lean back and relax, ahhh!

                         

                        I'm not familiar with OpenCL, so I don't know how much data needs to be passed to make good things happen. I guess I should go off and Google it...

                          • Re: Combining BeagleBone and Raspberry Pi
                            morgaine

                            @Phil: As the engineering mantra says,

                             

                            • "What you don''t measure, you don't really know, even when you think you do."

                             

                            So my approach would be to first implement coprocessor interfaces using existing pathways, be they SPI, I2C, Ethernet or USB, then to instrument those pathways, and finally to let the numbers speak and tell us where the bottlenecks are.  Then we'll know whether there is any point in optimizing the data paths, and where.

                             

                            If there is a major comms bottleneck for common workloads then that's not too hard to solve with dual-ported RAM sitting at the coprocessor boundary, or more ambitiously with scatter-gather controllers on each side to avoid copying data altogether.  Not rocket science, but admittedly a lot of work.

                             

                            Morgaine.

                          • Re: Combining BeagleBone and Raspberry Pi
                            morgaine

                            This client-mode USB port and hub on the front-end of the BeagleBone is really an exceptional idea, makes the board amazingly flexible as I described in the opening post.

                             

                            It makes me wonder whether some ambitious Pi hacker could route the unconnected pins of the Pi's micro-USB power socket through level translators to the Pi's GPIO header, and bit-bang up a client-mode USB interface for the Pi.

                              • Re: Combining BeagleBone and Raspberry Pi
                                John Beetem

                                This client-mode USB port and hub on the front-end of the BeagleBone is really an exceptional idea, makes the board amazingly flexible as I described in the opening post.

                                 

                                It makes me wonder whether some ambitious Pi hacker could route the unconnected pins of the Pi's micro-USB power socket through level translators to the Pi's GPIO header, and bit-bang up a client-mode USB interface for the Pi.

                                Looking at the hardware alone, it seems to me that the best way for RasPi to talk to BeagleBone (or BeagleBoard) is to use one of RasPi's host ports to talk to Beagle through its USB device (or OTG) port.  With Ethernet you're going through the USB-to-Ethernet conversion in the RasPi's LAN9512.  If you use USB directly you've eliminated the middleman and can use full USB bandwidth.  (Peak USB 2.0 data rate = 480 Mb/s.  "Peak data rate is a guarantee from the manufacturer that you won't go faster than this.")

                                 

                                The difficulty, of course, is the software.  I don't know how difficult it is to write suitable host and device USB interface code.  My 1-2 year plan includes learning how to write my own USB software, in user space code and/or bare metal embedded.  The plan does not include becoming a Linux kernel guru.

                              • Re: Combining BeagleBone and Raspberry Pi
                                morgaine

                                I've mentioned "Combining BeagleBone and RaspBerry Pi" on my elinux.org wiki page and linked it to here.   Not really expecting any feedback, but you never know.

                                 

                                The BeagleBone wiki page is in a sorry state though -- basically it was initially seeded back in January, and since then not much else has happened other than someone adding advertising.  I spent a few hours today improving it, but it could do with some extra help.   http://elinux.org/BeagleBone

                                 

                                The Raspberry Pi wiki page in contrast is a seething cauldron of activity!  http://elinux.org/RaspberryPiBoard

                                 

                                Morgaine.

                                  • Re: Combining BeagleBone and Raspberry Pi
                                    mgburr

                                    @Morgaine: now you've got me thinking in another direction.  I have both in house at the moment, but was looking at ways to set them up as a cluster and possibly link them with my Renesas board that's also Linux capable.  I was looking that the PI's ability to handle the graphics, but use the power from the bbone and SH7264 to give me a little more umph for the backend.  I did the roadtest for the A3, and like the layout, but commented about the lack of video also.  Also happened to get a shot of the two side by side so people could compare the different layout asthetics. 

                                     

                                    Thanks for the idea, will have to start looking down that rabbit hole :-)

                                      • Re: Combining BeagleBone and Raspberry Pi
                                        morgaine

                                        @Michael: I don't know that Renesas board nor the microcontroller line -- a brief look at some PDFs suggests that it's somewhat similar to an ARM Cortex-M4 like the STM32F4 and roughly the same speed too.  Its most effective application in a BeagleBone-Pi cluster would therefore probably be realtime interfacing, which is how I intend to use my STM32F4-Discovery boards.

                                         

                                        I'm really looking forward to this combination of boards.  They seem to be highly complementary, each making up for the other's deficiencies.

                                         

                                        Morgaine.

                                          • Re: Combining BeagleBone and Raspberry Pi
                                            mgburr

                                            I just aquired the STM32L152-EVALSTM32L152-EVAL kit from a local rep, he's working on getting me another ST board to work with. 

                                             

                                            The SH7264 Dev board had a uClinux distro for Europe only.  I was able to get that and install it, it's not bad for a bottom end linux interface.  I was dropped into the Renesas line with the current job direction and had a chance to aquire one of the kits.  But I was thinking the same thing with it.  The inherant minuses with the chip make it a great cluster controller option, which would make more cycles available to the PI and bbone. 

                                             

                                            I hadn't looked at using the STM32 for that though, might be something else I need to look at :-) First things first, make the PI a print server for the 3d printer. :-)

                                              • Re: Combining BeagleBone and Raspberry Pi
                                                morgaine

                                                Michael Burr wrote:

                                                 

                                                First things first, make the PI a print server for the 3d printer. :-)

                                                 

                                                Oh you too, huh?

                                                 

                                                Sadly I got distracted by all these nice new boards and my Shapercube assembly is languishing.  I must try and give it a little more priority, especially since I'll be needing it to print cases and fittings for these boards anyway.  And the Pi should be here in 3 weeks, so lack of time will only get worse.

                                                 

                                                Morgaine.

                                                  • Re: Combining BeagleBone and Raspberry Pi
                                                    mgburr

                                                    I posted a comment on your thread about that in the Forums at RPI.  I agree with you that it should be able to handle the communications across a network and send them to the controller.  I would like to do it so I don't have to rebuild my aging/dying desktop. :-/ 

                                                     

                                                    Can't see why we should be able to make a router for "SD Card" info, to take the input from ethernet, and route it out the USB, which most printers are run from.

                                                     

                                                    Just a thought though. 

                                                     

                                                    Need to get my Printrbot here and built first though ;-)

                                            • Re: Combining BeagleBone and Raspberry Pi
                                              morgaine

                                              New item of note on the BeagleBone wiki page, a pinouts section -- http://elinux.org/BeagleBone#Expansion_Connectors

                                              • Re: Combining BeagleBone and Raspberry Pi
                                                pegwag

                                                Morgaine & All

                                                I must say . . . I'm in awe of you! I am new at the Linux game and have been having a blast with getting everything working. Such a joy when it comes together. I am wondering what you have in mind with the Pi & Beagle deal. I get the graphics processing part but to what end? Sorry if that sound below your league. I'm just curious what testing or end result you've got in mind. I've dealt with PC's on an enterprise level for over 20 years and have, due to getting a Raspi, become quite smitten with the entire electronics aspect. I can see spending the next 20 years with this side of the house! I would appreciate a brief overview of what you have in mind!

                                                Thanks

                                                Peg

                                                  • Re: Combining BeagleBone and Raspberry Pi
                                                    morgaine

                                                    Hi Peg!

                                                     

                                                    The simple answer is:  the BeagleBone uses an ARM Cortex-A8 so it's substantially faster than the Pi, but it has no on-board graphics output.  In contrast, the Pi's ARM11 CPU is substantially slower than the BeagleBone, but the board provides very good graphics and media output.

                                                     

                                                    So, combining them would seem to be a marriage made in heaven.

                                                     

                                                    PS. It's also worth noting that the Pi's VideoCore GPU takes over some of the 256MB system RAM for itself, which leaves depressingly little for Linux.  Making the faster BeagleBone run most application programs while the Pi just handles their graphics output and window management therefore makes sense on memory grounds too.

                                                     

                                                    Morgaine.

                                                • Re: Combining BeagleBone and Raspberry Pi
                                                  morgaine

                                                  Because of the dreadful 8k polls per second that the Broadcom SoC has to perform to handle the external USB and Ethernet, it occurs to me that the most effective way to combine a graphics-handling Pi with the BeagleBone is to use a Pi Model A, so that USB is handled properly by interrupt hardware on the Broadcom SoC.

                                                   

                                                  The X11 traffic can then be sent to the Pi through the built-in USB channel using Ethernet-over-USB networking, which the BeagleBone provides out of the box anyway to give beginners a fast and simple QuickStart experience.  Since there are no Model A boards in the wild yet, I'll have to use the less efficient Model B for now, but it's a goal to keep in mind for the future.

                                                   

                                                  Morgaine.

                                                    • Re: Combining BeagleBone and Raspberry Pi
                                                      morgaine

                                                      Apparently the issue is caused by the Broadcom SoC itself, not by SMSC's LAN9512 device .  From a snippet that jbeale quoted in another thread:

                                                       

                                                      jbeale wrote (quoting the Foundation's dom):

                                                      Yes, the USB hardware is "dumb" and needs to be told what

                                                      to do (by the core) every frame. More advanced USB hardware

                                                      blocks would handle the simple responses in hardware, and so

                                                      produce less load on the CPU (esp. when idle).

                                                       

                                                      So, given that tjhe dumb USB controller on the SoC would have fewer things to poll on a Model A because the LAN9512 is not present and there would be no need for 12Mbit/s operation in this application, we could decrease the USB poll rate on a Model A to a low rate suitable for X11 transfers through Ethernet-over-USB

                                                       

                                                      SMSC suggests a slow poll rate of every 4ms for Hi-Speed operation in their LAN9512 datasheet, but we can reduce the rate further as it's mostly a tradeoff between latency and bandwidth efficiency I think.  Combining a reduced polling rate with a better USB host driver will hopefully compensate for the SoC's Synopsys USB core being "dumb" as stated.

                                                       

                                                      Morgaine.

                                                        • Re: Combining BeagleBone and Raspberry Pi
                                                          morgaine

                                                          Hmmm, no, that's not going to work because USB doesn't have Ethernet-like jumbo frame capability, its frames are limited to 1024 bytes at Hi-Speed.  So, it seems that there's a showstopper on trading off response latency for polling efficiency.  Bah.

                                                           

                                                          Since we can't do that, I guess we have to look at the timing demands imposed by multiple 1024-byte chunks of X11 data wanting to be transferred over to the Pi using Ethernet-over-USB at an instantaneous peak rate of 480Mbit/s.  Just to get a feel for the numbers, let's ignore all issues of encapsulation, signaling, and protocol stacks.

                                                           

                                                          That frame transfer seems to take about 17 microseconds for the raw data transfer down the wire considering only the peak rate, so if such chunks of data were sent in a continuous stream then we would have to poll at around 58KHz to avoid gaps where nothing is happening.  This may not even be possible, but even if it were possible then the Pi's dumb USB controller would be slugged to death by it using the existing driver.

                                                           

                                                          So, "it's not that simple".  We'll have to do lots of measurements and see where this goes.

                                                            • Re: Combining BeagleBone and Raspberry Pi
                                                              shirro

                                                              I have a Freescale imx53 QSB sitting next to my Pi. It has a USB OTG and I have run a network connection between the two (CDC ECM - don't have EEM in my antiquated kernel for the imx) and tried running NBD for swap and have yet to try using a usb storage driver which might be a bit more efficient. I mainly use it to compile for the Pi as I have it running Raspbian in a chroot and the faster cpu, extra ram and sata hard disk make things run a bit faster than the Pi. I can imagine them bundled up in a box together with the imx doing compiles courtesy of distcc and providing some of its 1G ram as swap.

                                                               

                                                              I think using a second arm board as a "coprocessor" for the Pi is an interesting idea but the status of the Pi's USB does put a damper on it. Another option is to use the Pi as a "graphics card" for another arm board as the Pi's videocore is pretty decent. I can imagine remote controlling a stack of Pi's bolted onto HD displays.