MAKE magazine has a nice write-up of several of the popular micro controllers, prototyping and hobby boards out there. 36 of them in total. Of course, that covers only a fraction of all the brands, models and variations. That list runs much much longer.
Posts tagged ·
chroot allows you to “run a command or interactive shell with special root directory”, as the man page says. However, it is assumed that the second level root directory is built for the same CPU architecture. This causes a problem if you want to chroot into an ARM based image, for the Raspberry Pi, let’s say. qemu-arm-static, some “voodoo” and several tricks come to the rescue. The process is documented well at Sentry’s Tech Blog, and the original seems to be by Darrin Hodges.
After downloading and unzipping the image, it has to be mounted. There are a few ways to go about this, but I found the easiest was to use plain old mount with an offset. The typical RPi image file is a full disk image, as opposed to a single partition or ISO though. We are after the second partition, which in our case starts at sector 122880. (See this discussion for how to find the correct starting sector using fdisk).
mount -o loop,offset=$(( 512 * 122880 )) 2014-01-07-wheezy-raspbian.img /mnt/rpi
Next we’ll copy a statically built QEMU binary for ARM to the mounted image. You might need to install QEMU on the host system first. Furthermore, we need to mount or bind the special system directories from the host to the chroot.
apt-get install qemu-user-static
cp /usr/bin/qemu-arm-static /mnt/rpi/usr/bin/
mount -o bind /dev /mnt/rpi/dev
mount -o bind /proc /mnt/rpi/proc
mount -o bind /sys /mnt/rpi/sys
Next comes the magic. This registers the ARM executable format with the QEMU static binary. Thus, the path to qemu-arm-static has to match where it is located on the host and slave systems (as far as I understand).
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
Finally, it’s time for the moment of truth:
Linux hrb 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 armv7l GNU/Linux
In some cases, the error “qemu: uncaught target signal 4 (Illegal instruction) – core dumped” occurs. User kinsa notes here that the lines of the file ld.so.preload (i.e. on the slave, /mnt/rpi/etc/ld.so.preload) has to be commented out (with a # in front).
Congratulations, you now have an ARM based chroot. What to do with it? Maybe install a few “missing” packages before copying over to one or more SD cards, set up the users, modify passwords, etc. Or take advantage of the CPU and memory of the host system or compile from source.
apt-get install htop tree ipython ipython3 gnuplot
As a final note, when done, you want to clean up the mount points.
Just tested a HDMI to VGA adapter for the RPi with my old CRT 1024×768 monitor. It works great! This was the “HD2V04 HDMI to VGA + 3.5mm Audio Jack Converter Adapter Box“ from DealExtreme, at $21.70. The VGA port was a bit tight, so I had to make sure it was properly connected. Also, the monitor did not display anything before a cold restart of the Pi. It comes only with a USB power cable, to it means a wall wart or powered USB hub is required. (It should go without saying that you don’t want to power it off the Pi itself).
Some notes on building XBMC from source on the Raspberry Pi: I started with the Raspbian 2013-09-25-wheezy image from here. After basic setup, I switched to CLI only, set the GPU memory to 16 MB, logged in over SSH, and started a screen session. A remote session is preferred, since there will be a lot of coping back and forth between the RPi and your desktop.
For the most, I followed these instructions, with a few modifications: First, the boot files to set GPU memory are not there in the Raspbian distribution I had installed. Instead, I used raspi-config to set the memory split. Secondly, the large one-liner apt-get install of all the dev packages (step 4 in the instructions) did not work very well. It gave dependency conflicts with the mesa packages. I found myself splitting up that line into many chunks, which then worked fine. Finally, a few packages were missing, and I had to run configure several times to figure that out. In the end, I also installed these:
apt-get install dh-autoreconf gawk gperf zip ccache
For a successful build, I had to modify the search path of a header file. There are a few ways to go about that, as discussed here. I used this solution:
sudo sed -i 's/#include "vchost_config.h"/#include "linux\/vchost_config.h"/' /usr/include/interface/vmcs_host/vcgencmd.h
That took me as far as a working XBMC setup, however videos are not playing. With MPlayer there is no problem, but XBMC just gives a black screen. I will have to investigate further.
There’s a similar set of instructions here.
A few months back I bought a couple of cheap USB WiFi adapters from DealExtreme. Today I finally got around to try them on the Raspberry Pi. Of the three adapters, two works both on a Fedora 17 64 bits based desktop as well as on the RPi. Notice that they both seem to contain the same chip, and indeed reports the same vendor and product ID. The last, the EDUP device, does detect available WiFi networks, but usually does not establish a connection (the very last time I tried, it suddenly did). I suspect it might be a USB power issue, since it also “crashed” the USB hub on the desktop, causing the keyboard and mouse to temporarily disconnect. Here are some notes which might be related. Of the three, the one with antenna is fastest at establishing the connection, but the other small adapter also gives good transfer speed; around 3.6 Mb/s seen today, but I expect it can go faster.
The H recently wrote about the AlaMode board which lets you use Arudino compatible shields with the Raspberry Pi. The board connects to the GPIO headers of the RPi, and exposes the familiar pin-set of the Arudino Uno on top. The AlaMode board also contains a real time clock, which it can provide as an add-on to the RPi which as none.
In fact, from the picture, it looks like the board is a full fledged Arudino itself, with an Atmel 328P chip on top. It should mean that you can program it on-board, directly from the RPi.
The board is selling for $45, but is out-of-stock at SeeedStudio.
The $25/35 Raspberry Pi matchbox computer finally launched today, after much anticipation, impatience and extremely clever marketing. In the last few days, their web servers have been overwhelmed by the people hitting re-fresh to know when the device will go on sale. When it finally did, both distributor web sites melted. The 10k units produced were sold out before lunch.
So, if you’re like me, and did not get a device this time around, you might want to join the support group over at Slashdot. There you will find people crying like kids who missed Santa. If it was kids, that would be one thing, but some of these crying guys actually have jobs. Amazing. Then there was one guy who had missed the weekly, or almost daily articles and didn’t know what this stampede was about. I guess he didn’t get one either.
Well, there will be more of these devices, and then some bugs might even be ironed out.
Chris Tyler has published a video demonstrating Fedora running on the ARM based Raspberry Pi. This looks very promising, and the Fedora project is working actively to support several ARM based systems.
A few days ago, Raspberry Pi announced that they had gotten Quake 3 running on their ARM computer. Furthermore, their FAQ estimates the networked model will cost $35 and be released at the end of this year. There is also an interview in the Guardian.
- 700MHz ARM11
- 128MB or 256MB of SDRAM
- OpenGL ES 2.0
- 1080p30 H.264 high-profile decode
- Composite and HDMI video output
- USB 2.0
- SD/MMC/SDIO memory card slot
- General-purpose I/O
- Optional integrated 2-port USB hub and 10/100 Ethernet controller
- Open software (Ubuntu, Iceweasel, KOffice, Python)
- The device is powered by an external AC adapter, and the Model A consumes around 1W at full load.
- The device should run well off 4xAA cells.