Gentoo Archives: gentoo-embedded

From: meino.cramer@×××.de
To: Gentoo <gentoo-embedded@l.g.o>
Subject: [gentoo-embedded] Gentoo on a Arietta G25
Date: Sat, 06 Dec 2014 18:38:36
Message-Id: 20141206183831.GB4624@solfire
1 Hi,
2
3 recently I bought a great little Linux board: Arietta G25
4 (http://www.acmesystems.it/arietta)
5
6 Since I like Gentoo I installed it instead of the provided Debian
7 system. The system I used to compile the kernel is -- of course -- a
8 Gentoo -- Linux PC.
9
10 ****************************************************************** NO
11 WARNING: THE BOARD CAN *NOT* BE BRICKED. THE WORST CASE WHICH COULD
12 HAPPEN IS THE NEED TO EDIT THE SDCARD WITH A DIFFERENT SYSTEM. YOU
13 HAVE NOT BE WARNED! I WILL NOT TAKE ANY RESPONSIBILITY FOR ANY LUCK
14 WHICH MAY HAPPEN TO YOU! ITS YOUR SUCCESS - NOT MINE!
15 ****************************************************************** ;)
16
17 These were the ingredients: Crosscompiler toolchain take from here
18 (scroll a little down)
19 https://eewiki.net/display/linuxonarm/AT91SAM9x5 Since Robert Nelson
20 (the author of the pages above as far as I know and the maintainer of
21 all Beaglebone systems) told me, it would be better to take a vanilla
22 Linux 3.18.rc7 right from Linus desktop (so to speak) I got that from:
23 git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
24
25 With the kernel 3.17.x kernel I got strange clock (RTC) drift problems
26 far beyond the normal drifts (several minutes/hours) and I couldn't
27 poweroff the system - it always reboots.
28
29 This does not happen with the Debian system and Linux 3.16.1. though.
30
31 Free Electrons put a lot of work into the mainline kernel (3.18...)
32 for AT91 systems, which the Arietta is one of.
33
34 With that kernel, now reboot doesn't work instead - it always poweroff
35 (a "better" ...hrmmm... feature for a battery powered system though)
36
37 The clock drift problem went away -- if the original configuration by
38 Acmesystems is used. I changed some things and it is there again. I
39 am on the way to track that down to a certain configuration item...but
40 this will take some time...even with a drifting clock at hand.
41
42 The original configuration was taken from Acmesystems site:
43 http://www.acmesystems.it/www/binary_repository/Arietta-30nov2014/acme-arietta_defconfig
44
45 The Devicetree dts-file was taken from here:
46 http://www.acmesystems.it/www/binary_repository/Arietta-30nov2014/acme-arietta.dts
47
48 The bootloader was build as described here:
49 http://www.acmesystems.it/compile_at91bootstrap (Newest sources are
50 here: https://github.com/tanzilli/at91bootstrap)
51
52 The original AT91Bootstrap loader by ATMEL seems not to work for this
53 board.
54
55 Finally the Gentoo stage3 rootfs was taken from here:
56 http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv5tel/
57 (or a more recent incarnation of it)
58
59 HowTo:
60
61 1) Create a SD-Card with two partitions: 50MB (or less for people who
62 dont want to experiment with different kernel
63 versions/configurations) with an FAT16 filesystem. The rest of the
64 space of the SDcard is used for a second partition with an ext4
65 filesystem.
66
67 2) Install the crosscompiler toolchain on your Gentoo box.
68
69 3) git clone the kernel (about 2Gigs of stuff!)
70
71 4) While git is pulling the kernel sources compile the bootloader and
72 put it on the first partition as decribed by Acmesystems.
73
74 5) If you dont want to fiddle around with the dtc you can click
75 together the pin configuration for your Arietta here:
76 http://www.acmesystems.it/pinout_arietta and download the compiled
77 dtb file then.
78
79 6) Put the dtb file onto the first partition too.
80
81 7) Now: Kernel Backery time! :) Compile the kernel as described here:
82 http://www.acmesystems.it/compile_linux_3_16 but use the kernel
83 sources of Linux 3.18.rc7 (or later). Put the kernel image (called
84 zImage) onto the first partition.
85 Dont forget to copy the modules onto the rootfs, if step8) is done!
86
87 8) Uncompress the stage3 archive onto the second partition. Do this as
88 root and mount the SDcard as root also. Do the usual Gentoo
89 configuration steps as described in the Gentoo handbook. The
90 Arietta Board does Ethernet over USB so you need appropiate drivers
91 for your PC also. For me, these does the trick: usbnet cdc_subset
92 cdc_eem cdc_ether udc_core libcomposite usb_f_rndis u_ether. These
93 may or may not too much modules...but with these it works...;)
94
95 I am currently using static IP-adresses for my Arietta. Up to this
96 moment I haven't figured out how to use dhcp/d properly or this board.
97 If you will do...please post your solution. For the moment I
98 suggest to configure static IP-adresses too.
99
100
101 9) sync and unmount the SDcard.
102
103 10) Put the SDcard into your Arietta Board and boot it.
104
105 11) ssh into your board.
106
107 12) TADA!
108
109 The Arietta is powered by an AT91SAM9G25 CPU. This is neither a 3.6GHz
110 horse nor a 6 core starship but a 400MHz single core processor --
111 which is more than enough for a board of this kind.
112
113 That means: The upcoming time of populating the board with all
114 needed/wanted application not being part of the stage3 archive will be
115 an exercise of patience.
116
117 On the other hand: This great little board uses only one and a half
118 spark of electric energy. And: It really doesnt matter whether the
119 board does its compile task over three hours at night or seven hours.
120 The result is the same in both cases: Next morning its ready! In this
121 context 'emerge <ebuild> -f' becomes handy! No need to run the DSL
122 modem/WLAN router or whatever over night!
123
124 Why not to use a separate partition as swap device?
125
126 The amount of writes to a SD card are limited. I am not sure, whether
127 writes to a spearate swap partition will be handled by the SD card
128 logic (anti-wear out algorthm) the same way as it is true for writes
129 to files. But I know, that this algorithm is working for files. And:
130 Swapping on a SDcard is always the slowest of all worst cases of
131 swapping which may occur in general. So I put a swapfile on the root
132 partition and used that as a last resort swap device (the Arietta is
133 available with 128 MB and 256 MB RAM. For Gentoo -- since it is self
134 compiling - I suggest the 256 MB version.)
135
136 Why not crosscompiling the applications on your PC? I tried
137 crosscompiling applications on my PC for my Beaglebone Black embedded
138 systems and failed in different ways: I tried distcc and plain cross
139 compiling.
140 Often it works but it fails too often to be used.
141 In most cases the application sources were not written for being
142 "compatible" to crosscompiling. Once in a sudden the cross compiler
143 was instructed by the sources to take the headers of the underlying
144 64bit AMD PC instead of the 32bit ARM system. Or: For compiling
145 the sources you need a second tool/preprozessor like 'moc'
146 for QTx applications. This confuses the process on a regular basis.
147 I quit that. I want to compile and not but hunt bugs.
148 Compiling on the Arietta is not the fastest thing which may happen on
149 planet earth and breaking the light barrier is something totally
150 different....but compiling on the Arietta works. And it works (at
151 least for me) far better than crosscompiling.
152
153 Crosscompiling the kernel is a different thing, because the kernel
154 is "selfcontained" it does not (and is not allowed to) use any sources
155 from outside its own source tree. So crosscompiling the kernel is a
156 harmless task.
157
158 I am no native english speaker. Therefore I put all typos and wrong
159 uses of the English language under the GPL. Herewith you are allowed
160 to make copies of these typos and errors and make your own version of
161 them or even improve them.
162 The author take no responsibility for any harm or happiness with may
163 or may not result directly or indirectly from reading and using
164 these instructions.
165 Have fun!
166
167 I am always interested in suggestions, corrections or anything else
168 regarding this topic.
169
170 HTH!
171 Best regards,
172 Meino

Replies

Subject Author
Re: [gentoo-embedded] Gentoo on a Arietta G25 wireless <wireless@×××××××××××.com>