OpenEmbedded for the Chumby

Resources for running OpenEmbedded on the Chumby Hacker Board

Building a Kernel: Ubuntu Is Not Your Friend

Before you try building a Chumby OpenEmbedded kernel using Ubuntu, I have one bit of advice: Don’t. Use Debian.

I’ve had email from a couple of people indicating they had problems building the Chumby OE kernel under Ubuntu, but until now I’ve not tried it myself. This came up again recently, and I thought I would check it out for myself. I haven’t used Ubuntu much; isn’t it just Debian in OSX clothing? No? Well the Ubuntu website says Debian is ‘the rock upon which Ubuntu is built’, so I assume they are married or something.

Anyway, I tested with Ubuntu 12.04.1 (Precise Pangolin). The first break happens building perl:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| opmini.o: In function `Perl_load_module_nocontext':
| opmini.c:(.text+0xebac): undefined reference to `pthread_getspecific'
| collect2: ld returned 1 exit status
| make: *** [miniperl] Error 1
| + die 'oe_runmake failed'
| + oefatal 'oe_runmake failed'
| + echo FATAL: 'oe_runmake failed'
| FATAL: oe_runmake failed
| + exit 1
NOTE: package perl-native-5.10.1-r10: task do_compile: Failed
ERROR: Function 'do_compile' failed (see /home2/guy/chumby-oe/output-angstrom-.9/work/i686-linux/perl-native-5.10.1-r10/temp/log.do_compile.21907 for further information)
ERROR: Task 2619 (/home2/guy/chumby-oe/openembedded/recipes/perl/perl-native_5.10.1.bb, do_compile) failed with exit code '1'
Waiting for 2 active tasks to finish:
0: m4-native-1.4.14-r0.1 do_install (pid 27991)
1: linux-libc-headers-2.6.32-r5 do_unpack (pid 28489)
Waiting for 1 active tasks to finish:
0: m4-native-1.4.14-r0.1 do_install (pid 27991)
NOTE: package linux-libc-headers-2.6.32-r5: task do_unpack: Succeeded
NOTE: package m4-native-1.4.14-r0.1: task do_install: Succeeded
ERROR: '/home2/guy/chumby-oe/openembedded/recipes/perl/perl-native_5.10.1.bb' failed

I found a discussion of a similar problem on a Gumstix thread which offered the workaround of adding the following line to meta-chumby/conf/site.conf:

1
ASSUME_PROVIDED += "perl-native"

That worked and the build progressed to the next failure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| make[2]: Entering directory `/home2/guy/chumby-oe/output-angstrom-.9/work/i686-linux/openssl-native-1.0.0d-r14.0/openssl-1.0.0d/apps'
| openssl.o: In function `main':
| openssl.c:(.text+0x199): undefined reference to `BIO_s_file'
| openssl.c:(.text+0x1a1): undefined reference to `BIO_new'
| openssl.c:(.text+0x1e1): undefined reference to `BIO_ctrl'
| openssl.c:(.text+0x231): undefined reference to `CRYPTO_dbg_get_options'
| openssl.c:(.text+0x23b): undefined reference to `CRYPTO_dbg_set_options'
| openssl.c:(.text+0x245): undefined reference to `CRYPTO_dbg_free'
| openssl.c:(.text+0x24f): undefined reference to `CRYPTO_dbg_realloc'
| openssl.c:(.text+0x259): undefined reference to `CRYPTO_dbg_malloc'
| openssl.c:(.text+0x261): undefined reference to `CRYPTO_set_mem_debug_functions'
| openssl.c:(.text+0x26d): undefined reference to `CRYPTO_set_mem_debug_options'
| openssl.c:(.text+0x29b): undefined reference to `CRYPTO_set_mem_debug_functions'
| openssl.c:(.text+0x2a7): undefined reference to `CRYPTO_mem_ctrl'
| openssl.c:(.text+0x2b5): undefined reference to `CRYPTO_set_locking_callback'
| openssl.c:(.text+0x2eb): undefined reference to `CRYPTO_set_mem_functions'
| openssl.c:(.text+0x2f0): undefined reference to `ERR_load_crypto_strings'
| openssl.c:(.text+0x2f5): undefined reference to `OPENSSL_add_all_algorithms_noconf'
| openssl.c:(.text+0x2fa): undefined reference to `ENGINE_load_builtin_engines'
| openssl.c:(.text+0x35a): undefined reference to `NCONF_new'

I applied a workaround in gmane.comp.handhelds.openembedded and moved on.

And so on… Initially I thought I would create a project fork to support Ubuntu 12, but after continuing like this with several more breaks I could see no end in sight so I abandoned that idea. Honestly if you are going to put a bunch of work into this project, it would be smarter to port it to the new oe-core framework.

Or just use Debian, okay?

The Chumby Forums Are Gone?

Spoiler alert: no, the forums are not gone. It was back, but it looks like problems with the anti-spam feature are not fully resolved. Thanks to Duane for his hard work getting the forum back up.

Following close on the news that Chumby Industries has stopped trading, today their incredibly useful discussion forum has gone off-line. That’s bad news for folks looking to keep their Chumby alive as the ecosystem shuts down, and for those of us who have been using the forums to collaborate on kernel development and the OpenEmbedded image.

Zurk’s offline firmware is available on sourceforge, and of course my OE resources are still available on github.

At the moment the Chumby source files are still available, but given where things seem to be headed, I’ve taken the precaution of taking a snapshot of that server.

So what’s next? If you want to be part of the Chumby community maybe the dormant Chumby Users Group is the place to start. Nope, the Google group appears to be dead, new posts are not being propagated.

Reading Joystick Inputs With GPIO

The Chumby Hacker Board has a 5-way Panasonic EVQQ7(Datasheet) dpad joystick on one corner at SW400. This post explains how to read the state of this switch via the GPIO interface.

Holding the CHB such that the switch is in the south east corner as pictured here, switch A closes when the stick is pushed east, B is south, C is north, D is west and E closes when the stick is depressed. Sad dpad is sad.

The following table lists the signals and pin addresses for each of the switch contacts A-E.

  • A : east : GPMI CE0n : BANK2_PIN28
  • B : south : GPMI WPn : BANK0_PIN23
  • C : north : GPMI WRn : BANK0_PIN24
  • D : west : GPMI RDn : BANK0_PIN25
  • E : down : PWM4 : BANK_1_PIN30 (aka CHUMBY BEND)

Each of these inputs is pulled high, and driven low when the switch is closed. 1nF capacitors on each signal line prevent switch bounce.

To read these inputs using GPIO you must make 3 calls:

  • set the associated pin to GPIO mode,
  • disable output on the pin,
  • read the associated GPIO register to get the value

For example to read switch E using the GPIO library from the Chumby Sampler code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
GPIO gpio;
gpio.open();

// E is on bank1, pin 30

// Set GPIO mode for BANK1_PIN30
// See imx23 Table 37-14
gpio.set(HW_PINCTRL_MUXSEL3_SET, 0x30000000);

// Disable output mode for BANK1_PIN30
// See imx23 Table 37-75
gpio.set(HW_PINCTRL_DOE1_CLR, 0x40000000);

// read the value into bit 0
// See imx23 Table 37-75
// Note that the input is active-low but we invert it below so that
// value_E will be 0 if the switch is open, 1 if the switch is closed.
unsigned int value_E = (gpio.get(HW_PINCTRL_DIN1, 0x40000000) >> 30) ^ 0x1;

Complete sample code for reading the state of all 5 switches is available in the Chumby Sampler.

Using All of the SD Card

Option 1: Set IMAGE_ROOTFS_SIZE Before You Build

The SD card images created by chumby-oe are designed to fit on a 512Mb SD card. The image size is set in chumby-oe/meta-chumby/conf/machine/chumby-falconwing.conf with this line:

1
IMAGE_ROOTFS_SIZE = "450000"

The size is in Kbytes and is set a little smaller than the final card size to allow for overheads like the boot loader.

Option 2: Add a New Partition

You can add a new partition to fill any unused space on your SD card. The default 512Mb disk image contains two partitions:

1
2
3
4
5
6
7
8
9
10
11
12
root@chumby-falconwing:/media/card# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 1018 MB, 1018691584 bytes
1 heads, 16 sectors/track, 124352 cylinders, total 1989632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *           4       32771       16384   53  OnTrack DM6 Aux3
/dev/mmcblk0p2           32772      932771      450000   83  Linux

Using the chumby itself you can add a new partition in the unused space, format it, and mount it. The steps are as follows:

Step 1. Edit the Partition Table

cfdisk is available on the default chumby-oe image, and provides a reasonably friendly interface for adding a partition.

1
cfdisk /dev/mmcblk0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                      cfdisk (util-linux-ng 2.18)

                        Disk Drive: /dev/mmcblk0
                    Size: 1018691584 bytes, 1018 MB
          Heads: 1   Sectors per Track: 16   Cylinders: 124352

Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
mmcblk0p1   Boot, NC    Primary   OnTrack DM6 Aux3                    16.78*
mmcblk0p2               Primary   ext3                               460.80*
                        Pri/Log   Free Space                         541.12*



 [   Help   ]  [   New    ]  [  Print   ]  [   Quit   ]  [  Units   ]
 [  Write   ]
  • Move the cursor to the free space
  • Select New
  • Select Primary
  • Accept the default size (541.11MB for my 1Gb SD card)
  • Select Write
  • Type yes in response to Warning!! This may destroy data on your disk!
  • Select Quit

Step 2. Format the Partition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
root@chumby-falconwing:~# mkfs.ext3 -b 4096 /dev/mmcblk0p3 
mke2fs 1.41.14 (22-Dec-2010)
warning: Unable to get device geometry for /dev/mmcblk0p3
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
33040 inodes, 132107 blocks
6605 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=138412032
5 block groups
32768 blocks per group, 32768 fragments per group
6608 inodes per group
Superblock backups stored on blocks: 
        32768, 98304

Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Step 3. Add the Parition to /etc/fstab

Edit fstab. The example below will mount the new partition as /media/card.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@chumby-falconwing:~# vi /etc/fstab 

# stock fstab - you probably want to override this with a machine specific one

rootfs               /                    auto       defaults              1  1
proc                 /proc                proc       defaults              0  0
devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
usbfs                /proc/bus/usb        usbfs      defaults              0  0
tmpfs                /var/volatile        tmpfs      defaults              0  0
tmpfs                /dev/shm             tmpfs      mode=0777             0  0
tmpfs                /media/ram           tmpfs      defaults              0  0

# add this line to mount the new partition at /media/card
/dev/mmcblk0p3       /media/card          auto       defaults,sync         0  2

Step 4. Mount the Partition

1
root@chumby-falconwing:/media/card# mount -a

Option 3: Expand the Partition to Fill the Disk

This is possible by - use cfdisk resize partition 2 to fill the disk - use resize2fs to expand the ext3 partition to fill the partition

You cannot run this procedure while the device is mounted, so you will need to run this process on another machine (or on a USB SD adaptor on your chumby).

Chumby Hacker Board Illustrated

Note that connection labels correspond to the identifiers on the Version 1.0 schematics.

Front of Board

Chumby Hackers Board Front

JP300

5VDC Power : Requires a regulated 5VDC power supply, positive tip, 3.5mm OD, 1.4mm ID barrel jack (aka a 3.8mm or 4mm connector).

Schematics indicate 2A peak. According to AdaFruit the power draw for the subsystems is roughly:

  • 300 mA for the base hardware (processor, RAM, SD card),
  • 200 mA for the USB hub (not including power to the USB devices),
  • 300 mA for a speaker plugged into the 2W output,
  • 500 mA max for charging a Lipoly battery.

P100

Li-poly battery connector : JST B3B-EH-A connector.

If powering from a Li-poly, USB0 will be powered, 1 and 2 will not.
There is a fourth USB connection on the GPIO header which is also powered by the Li-poly boost system. ref

P102

Serial JTAG header - 0.1” male header (DNP)

  • Pin 1 : 3.3v
  • Pin 2 : DEBUG
  • Pin 3 : PSWITCH
  • Pin 4 : GND

P104

Rotary Quadrature Encoder (no connector, solder points only)

  • Pin 1 : ROTARYA
  • Pin 2 : GND
  • Pin 3 : ROTARYB

P200

9x2 header : USB, I2C and GPMI

The following signals are available (by pin number)

Bottom Row, Left to Right

  • 1 - 5V
  • 3 - USBC1 N
  • 5 - USBC1 P
  • 7 - GND
  • 9 - Vid to Ext
  • 10 - i2C SCL
  • 11 - i2C SDA
  • 15 - 3.3V
  • 17 - LCD XP
  • 19 - LCD YP
  • 21 - LCD XM
  • 23 - LCD YM
  • 25 - HOST TO CP UART

Top Row, Left to Right

  • 2 - GPMI D00
  • 4 - GPMI D01
  • 6 - GPMI D02
  • 8 - GPMI D03
  • 10 - GPMI D04
  • 12 - GPMI D05
  • 14 - GPMI D07
  • 16 - GPMI D06
  • 18 - OSC TO FM
  • 20 - PWM2
  • 22 - CHUMBY BEND
  • 26 - CP TO HOST UART

P400

LRADC1 : Low Resolution Analog to Digital Converter

  • Pin 1 : LRADC1 (CPU)
  • Pin 2 : connected to pin 39 of P401 (why?)

P401

22x2 Header, LCD Connector

Top Row, Right to Left

  • 1 : GND
  • 3 : LCD T B1
  • 5 : LCD T B3
  • 7 : LCD T B5
  • 9 : LCD T G0
  • 11 : LCD T G2
  • 13 : LCD T G4
  • 15 : GND
  • 17 : LCD T R1
  • 19 : LCD T R3
  • 21 : LCD T R5
  • 23 : LCD VSYNC T
  • 25 : LCD DOTCLK
  • 27 : LCD ENABLE T
  • 29 : LED A
  • 31 : LCD WR E
  • 33 : LCD CS
  • 35 : LINE1 INL
  • 37 : GND
  • 39 : LRADC1 EXT
  • 41 : LCD XP
  • 43 : LCD XM

Bottom Row, Right to Left

  • 2 : LCD T B0
  • 4 : LCD T B2
  • 6 : LCD T B4
  • 8 : GND
  • 10 : LCD T G1
  • 12 : LCD T G3
  • 14 : LCD T G5
  • 16 : LCD T R0
  • 18 : LCD T R2
  • 20 : LCD T R4
  • 22 : P 3.3V
  • 24 : LCD HSYNC T
  • 26 : GND
  • 28 : LCD RESET
  • 30 : LED K
  • 32 : LCD RS
  • 34 : LCD DET
  • 36 : LINE1 INR
  • 38 : VDDA
  • 40 : LRADC0
  • 42 : LCD YP
  • 44 : LCD YM

P406

PWM2 : Pulse Width Modulation

  • Pin 1 : GND
  • Pin 2 : PWM2 (CPU)

P500

USB2 : USB Type A Female

P503

USB1 : USB Type A Female (is this really USB4?)

Note that the power to this port (and P500?) is software controlled and may be off at power-up. It can be enabled as explained here.

SW400

DPad switch type EVQQ7. The Data sheet is available. Sample code is available.

  • A : GPMI CE0n : BANK2_PIN28
  • B : GPMI WPn : BANK0_PIN23
  • C : GPMI WRn : BANK0_PIN24
  • D : GPMI RDn : BANK0_PIN25
  • E : PWM4 : BANK_1_PIN30 (aka CHUMBY BEND)

Accelerometer

A Freescale MMA7455L 3-axis accelerometer with adjustable sensitivity from +-2G to +-8G is accessible over I2C at device address 0x1D.

The Datasheet is available, sample code is available.

Schematic

Green LEDs

The 4 green LEDs are connected to the following GPIO pins:

  • GPMI_D00
  • GPMI_D01
  • GPMI_D02
  • GPMI_D03

Importantly, before any of the LEDs can be used, the transistor on GPMI_RDY0 must be turned on to ground the LEDs.

Sample code is available.

Schematic

Reading the Accelerometer With I²C

The CHB has an on-board Freescale MMA7455L 3-axis accelerometer, datasheet here, which can be accessed over the I²C bus. Not long after the Chumby Hackers Board was released Adafruit published a tutorial explaining how to access the accelerometer over i2c.

I’ve added some i2c tools to the OpenEmbedded image, so as well as compiling the tools in the Adafruit tutorial, you can use the packaged i2c tools (i2cdetect, i2cget, i2cset, i2c) to talk to the accelerometer.

i2cdetect

The i2cdetect tool will give you information about the i2c bus device:

1
2
root@chumby-falconwing:~# i2cdetect -l
i2c-0   i2c             378x I2C adapter                        I2C adapter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@chumby-falconwing:~# i2cdetect -F 0
Functionalities implemented by /dev/i2c-0:
I2C                              yes
SMBus Quick Command              no
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

Enable the Accelerometer

The accelerometer is at bus address $1d (decimal 29). The Adafruit tutorial explains that i2c encodes 7-bit addresses in the high 7 bits, so we shift this up 1 bit giving an effective address of 58.

Register $16 (decimal 22) controls the mode of the accelerometer and at power-up it is in standby mode. The lower two bits set the mode as follows:

  • 00 : standby mode
  • 01 : measurement mode
  • 10 : level detection mode
  • 11 : pulse detection mode

The next two bits define the sensitivity:

  • 00 : 8g range, 16 LSB/g
  • 01 : 2g range, 64 LSB/g
  • 10 : 4g range, 32 LSB/g

So put it into measurement mode, 2g range, we write 0000 0101 binary (5 decimal) to register $16 (decimal 22) at bus address 58.

1
root@chumby-falconwing:~# i2c 58 wb 22 5

The easiest way to read the accelerometer data is to use the mma7455.c example from the Adafruit tutorial. For convenience you can download the file from here.

Save that file as mma7455.c, and Compile it as follows:

1
root@chumby-falconwing:~# gcc -o mma7455 mma7455.c

When you run the compiled binary, you should see something like this:

1
2
3
4
5
6
7
8
9
root@chumby-falconwing:~# ./mma7455
X = -5  Y = -15 Z = 67
X = -6  Y = -15 Z = 65
X = -6  Y = -15 Z = 65
X = -6  Y = -15 Z = 65
X = -6  Y = -15 Z = 65
X = -6  Y = -15 Z = 65
X = -5  Y = -15 Z = 68
X = -5  Y = -15 Z = 68

Now pick up the device and wave it at your office-mates. Watch the numbers change. Say woo-hoo.

Building a Development Image

The standard “chumby-starter-image” we’ve been building with the OE toolchain doesn’t include a development environment for compiling and linking on the device itself. In response to this question in the forums I’ve added a new recipe file “chumby-dev-image” which bakes in the compiler and linker and friends by incorporating the OE task-native-sdk package. This in turn pulls in these packages:

  • gcc-symlinks
  • g++-symlinks
  • cpp
  • cpp-symlinks
  • binutils-symlinks
  • make
  • virtual-libc-dev
  • task-proper-tools
  • perl-modules
  • flex
  • flex-dev
  • bison
  • gawk
  • sed
  • grep
  • autoconf
  • automake
  • make
  • patch
  • patchutils
  • diffstat
  • diffutils
  • libstdc++-dev
  • libtool
  • libtool-dev
  • libltdl-dev
  • pkgconfig

I have a feeling most people will probably prefer this image over the old chumby-starter-image, so I’ve made chumby-dev-image the default make target. You can change the default target by modifying this line in the Makefile: export CHUMBY_IMAGE:=chumby-dev-image.

And Another Thing

It turns out that we also need to add libgcc-dev to the list of packages. Without it libgcc_s.so will not be created and you will see errors like this when you compile:

1
2
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

By adding the libgcc-dev package, we get /usr/lib/libgcc_s.so, which interestingly is an ld script file with the following contents:

1
2
3
4
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library.  */
GROUP ( libgcc_s.so.1 libgcc.a )

OpenEmbedded 2.6.28 Boot Log

This is the boot log from the very first boot of the 2.6.28 kernel created by merging the Falconwing source as released by Chumby with the subsequent changes to the 2.6.28 source tree as provided by Freescale.

This code was built using SHA 767e8235a616106a4b4142dbe8abd3a57a98bfea

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
�Loading SD image...
Reading 0x00000800 bytes from offset 0x0000b800 to destination 0x45a00000
Skipping 2944 chunks
Reading 0x00034800 bytes from offset 0x0000f800 to destination 0x40808000
Skipping 3968 chunks
Jumping to address 0x40808000:
0x00000000  0f 00 a0 e1 08 00 40 e2  02 0a 40 e2 08 10 9f e5  |......@...@.....|
0x00000010  00 00 81 e5 02 00 00 eb  d8 04 00 eb 20 80 80 40  |............ ..@|
0x00000020  11 b1 11 c1 14 00 9f e5  14 10 9f e5 00 20 a0 e3  |............. ..|
0x00000030  04 20 80 e4 01 00 50 e1  fc ff ff 3a 0e f0 a0 e1  |. ....P....:....|
0x00000040  c0 6d 82 40 20 6e 82 40  0e f0 a0 e1 0e f0 a0 e1  |.m.@ n.@........|
0x00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0x00000060  04 b0 2d e5 00 b0 8d e2  14 d0 4d e2 64 30 9f e5  |..-.......M.d0..|
0x00000070  00 30 93 e5 08 30 0b e5  58 30 9f e5 00 20 a0 e3  |.0...0..X0... ..|
0x00000080  00 20 83 e5 50 30 9f e5  0c 30 0b e5 4c 30 9f e5  |. ..P0...0..L0..|
0x00000090  0c 20 1b e5 3f 20 02 e2  00 20 83 e5 40 30 9f e5  |. ..? ... ..@0..|
0x000000a0  0c 20 1b e5 22 23 a0 e1  00 20 83 e5 70 30 a0 e3  |. .."#... ..p0..|
0x000000b0  10 30 0b e5 2c 30 9f e5  10 20 1b e5 00 20 83 e5  |.0..,0... ... ..|
0x000000c0  10 30 9f e5 08 20 1b e5  00 20 83 e5 00 d0 8b e2  |.0... ... ......|
0x000000d0  00 08 bd e8 1e ff 2f e1  30 00 07 80 41 03 00 00  |....../.0...A...|
0x000000e0  28 00 07 80 24 00 07 80  2c 00 07 80 00 48 2d e9  |(...$...,....H-.|
0x000000f0  04 b0 8d e2 08 d0 4d e2  90 30 9f e5 05 26 a0 e3  |......M..0...&..|
0x00000100  00 20 83 e5 88 30 9f e5  0a 26 a0 e3 00 20 83 e5  |. ...0...&... ..|
0x00000110  80 30 9f e5 00 20 a0 e3  00 20 83 e5 78 30 9f e5  |.0... ... ..x0..|
0x00000120  00 20 a0 e3 00 20 83 e5  cc ff ff eb 6c 30 9f e5  |. ... ......l0..|
0x00000130  00 30 93 e5 08 30 0b e5  08 30 1b e5 10 30 c3 e3  |.0...0...0...0..|
0x00000140  08 30 0b e5 54 30 9f e5  08 20 1b e5 00 20 83 e5  |.0..T0... ... ..|
0x00000150  4c 30 9f e5 08 30 0b e5  38 30 9f e5 08 20 1b e5  |L0...0..80... ..|
0x00000160  00 20 83 e5 34 30 9f e5  00 30 93 e5 08 30 0b e5  |. ..40...0...0..|
0x00000170  08 30 1b e5 10 30 c3 e3  08 30 0b e5 1c 30 9f e5  |.0...0...0...0..|
0x00000180  08 20 1b e5 00 20 83 e5  04 d0 4b e2 00 88 bd e8  |. ... ....K.....|
0x00000190  38 81 01 80 34 81 01 80  30 00 07 80 38 00 07 80  |8...4...0...8...|
0x000001a0  2c 00 07 80 01 03 00 00  04 b0 2d e5 00 b0 8d e2  |,.........-.....|
0x000001b0  00 00 a0 e1 18 30 9f e5  00 30 93 e5 80 30 03 e2  |.....0...0...0..|
0x000001c0  00 00 53 e3 fa ff ff 0a  00 d0 8b e2 00 08 bd e8  |..S.............|
0x000001d0  1e ff 2f e1 18 00 07 80  00 48 2d e9 04 b0 8d e2  |../......H-.....|
0x000001e0  ec 30 9f e5 03 30 8f e0  03 00 a0 e1 5e 00 00 eb  |.0...0......^...|
0x000001f0  e0 30 9f e5 00 30 93 e5  03 00 a0 e1 bd 00 00 eb  |.0...0..........|

Go!
Hardware version: 0x00000009
Screen pressed: 0
Setting up LCD to point at 0x44844000
Setting up LCD to point at 0x44844000
Reading 0x00000800 bytes from offset 0x0000b800 to destination 0x45a00000
Skipping 2944 chunks
Read 0 chunks.  Trying again...
    Comparing block [boot] with img1...
    Comparing block [img1] with img1... Found!
Reading 0x00025800 bytes from offset 0x00044000 to destination 0x44844000
Skipping 17408 chunks
Read 0 chunks.  Trying again...

boot> shell



Chumby bootloader console v1.0
Booting in 2 seconds...
Press any key to enter shell... 0

boot> regutil -w HW_EMI_CTRL 0x1c574040
Setting 0x80020000: 0x1c884040 -> 0x1c574040 ok

boot> regutil -w HW_POWER_BATTMONITOR 0x01ec0414
Setting 0x800440e0: 0x01c30600 -> 0x01ec0414 ok

boot> regutil -w HW_POWER_5VCTRL_CLR 0x00000080
Setting 0x80044018: 0x0403f193 -> 0x0403f113 ok

boot> regutil -w HW_POWER_MINPWR_SET 0x00001000
Setting 0x80044024: 0x00000040 -> 0x00001040 ok

boot> regutil -w HW_PINCTRL_MUXSEL1_SET 0x03300000
Setting 0x80018114: 0x0fffffff -> 0x0fffffff ok

boot> regutil -w HW_PINCTRL_DOUT0_CLR 0x24000000
Setting 0x80018508: 0x00000000 -> 0x00000000 ok

boot> regutil -w HW_PINCTRL_DOE0_SET 0x24000000
Setting 0x80018704: 0x00000000 -> 0x24000000 ok

boot> regutil -w HW_PINCTRL_DOUT0_CLR 0x24000000
Setting 0x80018508: 0x00000000 -> 0x00000000 ok

boot> regutil -w HW_PINCTRL_DOUT0_SET 0x20000000
Setting 0x80018504: 0x00000000 -> 0x20000000 ok

boot> regutil -w HW_PINCTRL_DOUT0_SET 0x04000000
Setting 0x80018504: 0x20000000 -> 0x24000000 ok

boot> 
    Comparing block [boot] with img2...
    Comparing block [img1] with img2...
    Comparing block [img2] with img2... Found!
Reading 0x00025800 bytes from offset 0x00069800 to destination 0x44844000
Skipping 27008 chunks
Read 0 chunks.  Trying again...

boot> load krnA 0x40008000
    Comparing block [boot] with krnA...
    Comparing block [img1] with krnA...
    Comparing block [img2] with krnA...
    Comparing block [img3] with krnA...
    Comparing block [img4] with krnA...
    Comparing block [img5] with krnA...
    Comparing block [krnA] with krnA... Found!
Reading 0x00400000 bytes from offset 0x000ff800 to destination 0x40008000
Skipping 65408 chunks
Read 0 chunks.  Trying again...

boot> linux 0x40008000 "console=ttyAM0,115200 root=/dev/mmcblk0p2 rw rootwait chumbyrev=** ssp1=mmc sysrq_always_enabled logo.brand=BBBBBBBBBBBB"
Going to run linux at offset 0x40008000 with cmdline console=ttyAM0,115200 root=/dev/mmcblk0p2 rw rootwait chumbyrev=09 ssp1=mmc sysrq_always_enabled logo.brand=chumby
Uncompressing Linux................................................................................................................................................. done, booting the kernel.
[    0.000000] Linux version 2.6.28-chumby (guy@vdebian) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #4 PREEMPT Thu Feb 16 22:31:05 EST 2012
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: STMP378X
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyAM0,115200 root=/dev/mmcblk0p2 rw rootwait chumbyrev=09 ssp1=mmc sysrq_always_enabled logo.brand=chumby
[    0.000000] Detected chumby version 9 (from str 09)
[    0.000000] debug: sysrq always enabled.
[    0.000000] Unknown boot option `logo.brand=chumby': ignoring
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [ttyAM0] enabled
[    0.010000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.010000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.020000] Memory: 64MB = 64MB total
[    0.030000] Memory: 59820KB available (4220K code, 704K data, 116K init)
[    0.030000] SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.040000] Calibrating delay loop... 226.91 BogoMIPS (lpj=1134592)
[    0.280000] Security Framework initialized
[    0.280000] Mount-cache hash table entries: 512
[    0.280000] CPU: Testing write buffer coherency: ok
[    0.290000] net_namespace: 708 bytes
[    0.300000] regulator: core version 0.5
[    0.300000] NET: Registered protocol family 16
[    0.310000] regulator: vddd: 800 <--> 1575 mV fast normal 
[    0.310000] regulator: vddd_bo: 800 <--> 1575 mV fast normal 
[    0.320000] regulator: vdda: 1500 <--> 2275 mV fast normal 
[    0.320000] regulator: vddio: 2800 <--> 3575 mV fast normal 
[    0.330000] regulator: overall_current: 0 <--> 2147483 mA fast normal 
[    0.330000] regulator: stmp3xxx-fb-1: 0 <--> 2147483 mA fast normal 
[    0.340000] regulator: stmp3xxx-bl-1: 0 <--> 2147483 mA fast normal 
[    0.340000] regulator: stmp3xxx_ts-1: 0 <--> 2147483 mA fast normal 
[    0.350000] regulator: stmp37xx-dbguart-1: 0 <--> 2147483 mA fast normal 
[    0.350000] regulator: stmp3xxx_wdt-1: 0 <--> 2147483 mA fast normal 
[    0.360000] regulator: stmp3xxx-rtc-1: 0 <--> 2147483 mA fast normal 
[    0.360000] regulator: stmp3xxx-rotdec-1: 0 <--> 2147483 mA fast normal 
[    0.370000] regulator: i2c_stmp-1: 0 <--> 2147483 mA fast normal 
[    0.370000] regulator: stmp3xxx-persistent-1: 0 <--> 2147483 mA fast normal 
[    0.380000] regulator: stmp3xxx-dcp-1: 0 <--> 2147483 mA fast normal 
[    0.380000] regulator: stmp3xxx-battery-1: 0 <--> 2147483 mA fast normal 
[    0.390000] regulator: mmc_ssp-1: 0 <--> 2147483 mA fast normal 
[    0.390000] regulator: mmc_ssp-2: 0 <--> 2147483 mA fast normal 
[    0.400000] regulator: charger-1: 0 <--> 2147483 mA fast normal 
[    0.400000] regulator: power-test-1: 0 <--> 2147483 mA fast normal 
[    0.410000] regulator: cpufreq-1: 0 <--> 2147483 mA fast normal 
[    0.410000] stmp378x_devb.c - stmp378x_devb_init():353 - Adding 13 platform-specific devices
[    0.420000] Initialized chumby GPIO IRQ router
[    0.430000] chumbyfbfw.c - chumbyfwfb_probe():1255 - resolution 720x480, bpp 2
[    0.440000] chumbyfbfw.c - get_max_memsize():1060 - get_max_memsize: mem_size now 1382400 (720 x 480 x 16)
[    0.440000] chumbyfbfw.c - get_max_memsize():1060 - get_max_memsize: mem_size now 1382400 (320 x 240 x 16)
[    0.450000] chumbyfbfw.c - get_max_memsize():1060 - get_max_memsize: mem_size now 1658880 (720 x 576 x 16)
[    0.450000] chumbyfbfw.c - chumbyfwfb_probe():1268 - memory to allocate for screen: 1658880
[    0.460000] chumbyfbfw.c - chumbyfwfb_probe():1277 - allocated screen at ff600000:0x43a00000
[    0.470000] chumbyfbfw.c - chumbyfwfb_probe():1326 - memory to allocate for plane 0: 1658880
[    0.480000] chumbyfbfw.c - chumbyfwfb_probe():1336 - allocated at ff795000:0x43c00000
[    0.490000] chumbyfbfw.c - chumbyfwfb_probe():1326 - memory to allocate for plane 1: 1658880
[    0.500000] chumbyfbfw.c - chumbyfwfb_probe():1336 - allocated at ff92a000:0x43e00000
[    0.510000] chumbyfbfw.c - chumbyfwfb_probe():1326 - memory to allocate for plane 2: 307200
[    0.510000] chumbyfbfw.c - chumbyfwfb_probe():1336 - allocated at ffabf000:0x43880000
[    0.520000] Going to copy splash image from 44844000 (153600 bytes) to ff600000 (not 43a00000)
[    0.530000] chumbyfbfw.c - pxp_setup():1124 - Pointing S0 at 43c00000
[    0.540000] stmp37xx-dbguart.0: ttyAM0 at MMIO 0xf0070000 (irq = 0) is a Debug UART
[    0.550000] usbcore: registered new interface driver usbfs
[    0.550000] usbcore: registered new interface driver hub
[    0.560000] usbcore: registered new device driver usb
[    0.600000] NET: Registered protocol family 2
[    0.690000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.700000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.700000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.710000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.720000] TCP reno registered
[    0.750000] NET: Registered protocol family 1
[    0.750000] usb: DR gadget (utmi) registered
[    0.770000] ashmem: initialized
[    0.770000] Registering unionfs 2.5.2 (for 2.6.28.10)
[    0.780000] NTFS driver 2.1.29 [Flags: R/O].
[    0.780000] fuse init (API version 7.10)
[    0.790000] msgmni has been set to 116
[    0.800000] alg: No test for stdrng (krng)
[    0.810000] cryptodev: driver loaded.
[    0.810000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.820000] io scheduler noop registered (default)
[    0.850000] logger: created 64K log 'log_main'
[    0.850000] logger: created 256K log 'log_events'
[    0.860000] logger: created 64K log 'log_radio'
[    0.870000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.870000] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
[    0.880000] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
[    2.010000] fsl-ehci fsl-ehci.0: irq 11, io mem 0x80080000
[    2.030000] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
[    2.030000] usb usb1: configuration #1 chosen from 1 choice
[    2.040000] hub 1-0:1.0: USB hub found
[    2.040000] hub 1-0:1.0: 1 port detected
[    2.050000] Chumby bend sensor driver version 2.3-Falconwing initializing (scross@chumby.com)...
[    2.060000] input: bend-sensor as /devices/platform/bend-sensor/input/input0
[    2.100000] input: STMP3XXX touchscreen as /devices/virtual/input/input1
[    2.100000] input: stmp3xxx-rotdec as /devices/virtual/input/input2
[    2.110000] STMP3xxx RTC driver v1.0 hardware v2.0.0
[    2.120000] stmp3xxx-rtc stmp3xxx-rtc: rtc core: registered stmp3xxx-rtc as rtc0
[    2.120000] i2c /dev entries driver
[    2.140000] ddi_bc_Init: success
[    2.150000] stmp3xxx-battery stmp3xxx-battery.0: bc_sm_restart: no battery present
[    2.150000] power/linux.c - bc_sm_restart():987 - Returning from sm_restart()
[    2.280000] stmp3xxx-dcp stmp3xxx-dcp: DCP crypto enabled.!
[    2.280000] Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
[    2.290000] ASoC version 0.13.2
[    2.290000] STMP378X ADC/DAC Audio Codec 0.1
[    2.300000] asoc: stmp378x adc/dac <-> stmp3xxx adc/dac mapping ok
[    2.310000] ALSA device list:
[    2.320000]   #0: STMP3780 Devb (stmp378x adc/dac)
[    2.320000] oprofile: using timer interrupt.
[    2.330000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    2.330000] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
[    2.340000] nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
[    2.350000] sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
[    2.360000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.370000] arp_tables: (C) 2002 David S. Miller
[    2.370000] TCP cubic registered
[    2.380000] NET: Registered protocol family 17
[    2.380000] RPC: Registered udp transport module.
[    2.390000] RPC: Registered tcp transport module.
[    2.390000] stmp3xxx-rtc stmp3xxx-rtc: setting system clock to 1970-01-01 00:00:13 UTC (13)
[    2.400000] Waiting for root device /dev/mmcblk0p2...
[    2.430000] mmc0: new SD card at address 0002
[    2.440000] usb 1-1: new high speed USB device using fsl-ehci and address 2
[    2.440000] mmcblk0: mmc0:0002 00000 971 MiB 
[    2.450000]  mmcblk0: p1 p2
[    2.520000] NILFS: Can't find nilfs on dev mmcblk0p2.
[    2.520000] EXT3-fs warning: feature flags set on rev 0 fs, running e2fsck is recommended
[    2.540000] kjournald starting.  Commit interval 5 seconds
[    2.540000] EXT3-fs warning (device mmcblk0p2): ext3_update_dynamic_rev: updating to rev 1 because of new feature flag, running e2fsck is recommended
[    2.590000] usb 1-1: configuration #1 chosen from 1 choice
[    2.590000] EXT3 FS on mmcblk0p2, internal journal
[    2.600000] EXT3-fs: mounted filesystem with ordered data mode.
[    2.600000] VFS: Mounted root (ext3 filesystem).
[    2.610000] Freeing init memory: 116K
[    2.610000] hub 1-1:1.0: USB hub found
[    2.620000] hub 1-1:1.0: config failed, hub has too many ports! (err -19)
INIT: version 2.86 booting
Please wait: booting...
Starting udev
[    6.160000] mice: PS/2 mouse device common for all mice
Remounting root file system...
Caching udev devnodes
Populating dev cache
ALSA: Restoring mixer settings...
No state is present for card Devb
/usr/sbin/alsactl: parse:1655: Unable to open file '/usr/share/alsa/init/00main': No such file or directory
No state is present for card Devb
Configuring update-modules.
Configuring ppp.
Configuring ppp-dialin.
Configuring e2fsprogs.
update-alternatives: Error: cannot register alternative chattr to /usr/bin/chattr since it is already registered to /bin/chattr
update-alternatives: Linking //sbin/uuidd to uuidd.util-linux-ng
Configuring dbus.
 Adding system startup for /etc/init.d/dbus-1.
Configuring angstrom-libc-fixup-hack.
Configuring libnss-mdns.
Configuring avahi-daemon.
 Adding system startup for /etc/init.d/avahi-daemon.
Configuring avahi-autoipd.
[   17.610000] NET: Registered protocol family 10
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
done.
Starting portmap daemon: portmap.
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
Thu Feb 16 23:57:00 UTC 2012
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Creating Dropbear SSH server RSA host key.
Will output 1024 bit rsa secret key to '/etc/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwDMAHLVuprK4TDNbqQwmR5TX2J9gTzW+6m9M+hEDqzihheHcmhiNi9lRdj2SRqg3OXMIFwdboT9RtJt2rxFtjJsA4GuSPOzGHa5sDq4uH2KfVtbnVlyHilF0HgpiGaN0UFbm72A/ocra3HmJf/MIJj7ImTuLihUV6zlet3GfSi9I7tX root@chumby-falconwing
Fingerprint: md5 83:9c:8d:c8:c5:fa:d5:c9:ee:92:78:21:9c:2e:e7:40
Starting Dropbear SSH server: dropbear.
Starting syslogd/klogd: done
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
   ...done.

.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution chumby-falconwing ttyAM0

Angstrom v20120216 chumby-falconwing ttyAM0

chumby-falconwing login: 

To help identify the differences between this kernel and the stock Chumby kernel, here is the boot log diffed against the stock boot log.

Installing a Kernel Image With OSX

Insert the microSD in the SD adaptor and insert it into the SD slot on your Mac. You will get a popup warning saying The disk you inserted was not readable by this computer. Click Ignore.

Use diskutil to find the device name. Look for the 1GB disk with 4 Linux partitions. If you missed the instructions above and clicked Eject instead, it will not be listed here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *1.0 GB     disk0
   1:                       0x53                         150.2 MB   disk0s1
   2:                      Linux                         128.0 MB   disk0s2
   3:                      Linux                         128.0 MB   disk0s3
   4:                      Linux                         128.0 MB   disk0s5
   5:                      Linux                         614.5 MB   disk0s6
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Macintosh HD            319.7 GB   disk1s2

In my case this identifies the device as /dev/disk0. Unmount the disk.

1
2
$ diskutil unmountDisk /dev/disk0
Unmount of all volumes on disk0 was successful

Copy the ROM image to the SD as follows:

1
sudo dd if=rom-chumby-falconwing-chumby-starter-image.img of=/dev/disk0 bs=8m

Be patient, this takes a while… like 6 and a half minutes in my case. Perhaps you would like to amuse youself by looking at pictures of cats?

Chumby Serial Console Under OSX

This assumes you already have

To determine the device name:

1
2
3
$ ls /dev/tty.*
/dev/tty.Bluetooth-Modem        /dev/tty.iphone-SerialPort1
/dev/tty.Bluetooth-PDA-Sync     /dev/tty.usbserial-FTF7VKP4

The device name starting with tty.usbserial is the one we are looking for.

To make a connection using screen at 152000 baud:

1
screen /dev/tty.usbserial-FTF7VKP4 115200

You should now have a full-screen console. To exit, type ctrl-a ctrl-k. When you are asked Really kill this window [y/n] type y.