Tuesday, August 14, 2012

Embedded Development is Only Getting More Interesting

With the perpetual trend of more-processing-power-for-your-buck, the space many folks refer to as "embedded" is just getting more and more interesting on the high end.  Processors like the i.MX from Freescale and boards like the Raspberry Pi (both ARM based) can handle a full operating system (like Linux, for example), as opposed to a basic event loop or traditional RTOS.  In addition to providing developers with more "cool things one can do" by having a full OS running, this also opens up a new development "flow": building directly on the board.  It goes like this:

  • write some code
  • compile-and-link it on the OS running on the board
  • run it!
Where before you would need a toolchain with a cross compiler, these embedded devices are now mature (and powerful) enough to support running their own toolchain directly.  You can also do fun things like rebuilding the board's kernel directly on the board!

Another cool development flow which has also gotten popular over the last 5 years or so: building code for embedded devices within a virtual machine (VM).  This flow follows the "cross compiler" model, in that you use a toolchain running on a development platform of different hardware and/or software than your target, embedded device.  But the twist is that the toolchain is installed in its own OS instance inside a virtual machine.  This is very nice because you can use whatever OS you normally like to use (Linux, Mac OS, Windows) as your "host" OS, and then create a "guest" VM with whatever OS and toolchain you need without affecting the "host" OS.  And there are many available-at-no-cost Virtual Machine programs available, too (I personally use VMPlayer under Windows most of the time).  Many developers used to install two-or-more OSes on their development system and dual/multi-boot between them in order to satisfy the need for having a specific toolchain running in a specific OS for doing embedded development, but the use of virtual machines removes the need for having to reboot: multiple OSes can run simultaneously, making it very easy on a developer to get things done (I can tell you from personal experience that having to stop my development so that I can reboot my laptop just so I can check my Outlook calendar for an upcoming meeting notice is very disruptive).  Also, this development flow isn't just awesome for embedded development, it's great when you need to compile code for a different OS that runs on similar hardware.  For example, I can install a 64-bit FreeBSD VM image on my x86 64-bit Windows 7 laptop, write code and compile it there in the VM, copy the generated executables to a x86 system that is running 64-bit FreeBSD as its OS, and it works great!

Seriously, this is cool stuff...

Wednesday, August 1, 2012

The Pi Has Landed!

Been busy lately, but I got real excited to see my Raspberry Pi show up this week!  Newark/Element14 shipped it from South Carolina, arrived in a plan brown envelope with no additional fanfare other than my anticipation...

The board in all its glory!
I downloaded the "wheezy-raspbian" (Debian based) recommended distro (at least recommended to start with), loaded it onto a SD card, popped that puppy in, connected a USB keyboard and mouse, added a network connection, then added necessary power (micro USB supply) and video (HDMI; hooked that bad boy up to my 46" Sony LCD TV), and fired it up!!!

After the usual Linux (3.2.0 kernel) boot messages (as you can see, they didn't quiesce them for this distro, which allows for easy checking of how things are going during boot), you get a nice little ncurses menu.  This menu allows you to do usual things, like set timezone and keyboard type, but also contains handy options, like expanding the rootfs to fill the SD card (so, in cases like mine where my SD card was much larger than the image I loaded, users can now recoup that free/unused space leftover on the card as usable filesystem space!).

Boot time!  The little LEDs closest to the bottom are the Pi!
After this menu, you get the usual Linux command line.  I was able to see, via ifconfig, that my Raspberry Pi had DHCP'd an IP address from my router and could name-resolve and ping google.com!!!  I then ran startx to get the full UI up!

This distro uses the lightweight LXDE interface, which looks great and handles well.  Preloaded on this distro are several lightweight web browsers and some "fun" programming stuff (like Scratch!).  I had no problem firing up one of the web browsers (Midori) and surfing around.

The UI provides tasty Pi experience!
I'm looking forward to digging a little more into the Pi's capabilities and figuring out how/where I might use mine!  :)