Archive

Archive for the ‘Uncategorized’ Category

Building Angstrom for the mini2440 with Fedora 15

November 28th, 2011 2 comments

Here’s a quick update for anyone struggling with building Angstrom for the mini2440 on Fedora 15 (probably also relevant for F14).

If you’re using BusError’s original repo then follow the OE instructions as normal, then you can use this guide if you want. As mentioned you’ll need to downgrade patch. I also had to downgrade make due to some incompatibility.

yum downgrade patch --releasever=12

yum downgrade make --releasever=13

At first i had some error about the GPG key so i downloaded them for F13 and F12 from here. You can install them like this, for example:

rpm --import E8E40FDE.txt

Then, you’re good to bake.

If you want something bleeding edge you’ll need to get your hands dirty, OE has changed a lot recently!

Categories: Uncategorized Tags:

CAT3626 RGB LED Driver + Qt Embedded 4.6 on the Mini2440

March 29th, 2010 10 comments

The CAT3626 is a nice little I2C device from ON Semiconductor. It comes in a 14 pin TQFN package which is probably the most difficult thing i’ve ever soldered! Each pad is separated from it’s neighbour by about 100 micrometers! To make matters even more difficult there’s a ground pad right in the middle for sinking heat away. Really you should get some sort of breakout board or reflow it but that would be boring! Here’s a picture of the device before soldering:

…and here’s the finished product! The LED is 10mm diffuse with a common anode and a maximum current rating of 20mA per channel.  As soon as i’d soldered the wires to the CAT3626 i glued it to the board with epoxy, threaded the wires through the holes and then glued those down with more epoxy. After that i realised i’d forgotten where pin 1 had gone so i had to scrape the glue off the top of the chip!

The wire coming through the hole in the middle of this picture is soldered to the CAT3626 and acts as a crude heat sink. In practice it seems to work well enough although i probably should have used copper. I pulled the ceramics from an old projector i had lying around. Not the neatest job but it works fine!

After I’d built that i tested it quickly using I2C tools and then wrote a kernel driver.  The CAT3626 allows a maximum of 32mA per channel regulated in steps of 0.5mA. Unfortunately because my LED can take a maximum of 20mA per channel i can only generate ~64,000 colours. To make matters worse the light intensity is not in general a linear function of the input current so the achievable fade sequences are not as nice as those done with PWM but they still look pretty good. Here’s a video!


YouTube DirektCAT3626 RGB LED Driver

Categories: Uncategorized Tags: ,

Chameleon 135 for the Mini2440

March 28th, 2010 No comments

Thanks to www.andahammer.com both Will and I now have the Chameleon 135 enclosure for the Mini2440.  I’ve been working on a li-ion charger and once that’s finished we should be ready for some field testing. It takes a little while to get the holes drilled in the right place but once it’s screwed together the case is extremely sturdy. There’s loads of room inside for additional wiring :)

You can get the Chameleon from www.andahammer.com.

Categories: Uncategorized Tags:

New hardware!

November 2nd, 2009 4 comments

After breaking the z-axis connection on my first device I ordered a new KXPS5 accelerometer from crodnet on ebay. I really recommend this seller, he’s very cheap and sends things rapidly.

I quickly knocked together a circuit on veroboard and hooked up the base of a transistor to the freefall / motion interrupt pin to check it was working. It is remarkably sensitive, the LED flicks on if i drop my pen at one end of my desk when the device is at the other! I was quite pleased that everything was working well so i hooked it up to the I2C bus using the cable kit kindly supplied by www.andahammer.com. Using I2C tools i was able to set registers and read acceleration vectors without any trouble so i’m pretty sure everything is working well. I was a bit worried about exceeding the bus capacitance at first.

DSC_0069

DSC_0068

It turns out that i can still use the old device if i rely on the internal low pass filter. I was thinking of doing this anyway and using a Kalman filter to process the output. First i need to write a device driver so i’ve rapidly being trying to learn C. So far i’ve got a very basic kernel module up and running on the mini2440 :)

Building Angstrom

November 1st, 2009 27 comments

I’ve been meaning to put this up for a while. Providing nothing goes wrong the whole process is actually very easy! This is basically a rehash of the Angstrom webpage so you might prefer to follow that taking notes of the minor deviations below:

export OETREE="/home/doug/OE"
mkdir -p ${OETREE}

cd ${OETREE}
git clone git://git.openembedded.org/openembedded.git openembedded
cd openembedded
git checkout origin/stable/2009 -b stable/2009

To update the OE metadata simply:

cd ${OETREE}/openembedded
git pull

Now make the suggested script source-me.txt changing OETREE to suit your needs:

export OETREE="/home/doug/OE"

BBPATH=${OETREE}/:${OETREE}/build/:${OETREE}/openembedded/
PKGDIR=${OETREE}/build/
DL_DIR=${OETREE}/downloads
echo Setting up dev env for Ångström

if [ -z ${ORG_PATH} ] ; then
ORG_PATH=${PATH}
export ORG_PATH
fi

if [ -z ${ORG_LD_LIBRARY_PATH} ] ; then
ORG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
export ORG_LD_LIBRARY_PATH
fi

PATH=${OETREE}/openembedded/bitbake/bin:${ORG_PATH}

cd $PKGDIR

LD_LIBRARY_PATH=
export PATH LD_LIBRARY_PATH BBPATH
export LANG=C
export BB_ENV_EXTRAWHITE="MACHINE DISTRO OETREE ANGSTROM_MODE ANGSTROMLIBC LIBC"

echo "Altered environment for OE Development"

I also had to set:

sudo sysctl vm.mmap_min_addr=0

Then setup local.conf:

mkdir -p ${OETREE}/build/conf
cp ${OETREE}/openembedded/contrib/angstrom/local.conf ${OETREE}/build/conf/

Now edit ${OETREE}/build/conf/local.conf and add this to the end:

MACHINE = "mini2440"

Now download the mini2440 config file from openembedded. Put this in:

${OETREE}/openembedded/conf/machine/

Now source the source-me.txt, go to the OE tree, check it’s up to date

source source-me.txt

cd ${OETREE}/openembedded

git pull - -rebase

Now build the images, you can build all of them or just one. I used the base image for running Qt but i also built the gpe image which worked nicely if you need it.

bitbake base-image ; bitbake console-image ; bitbake  x11-image ; bitbake gpe-image

Be prepared to saturate your internet connection, wait a long time and take up a lot of disk space!

The result ends up in:

${OETREE}/angstrom-dev/deploy/glibc/images/mini2440

You should have the image(s) in .jffs2 for flashing and .tar.gz for mounting using NFS.

Categories: Uncategorized Tags: , , ,

Mini2440 cable kit and soldering LGA14!

October 19th, 2009 No comments

The very kind people at www.andahammer.com were generous enough to send me a mini2440 cable kit! This will be much easier than chopping up 2.5″ IDE connectors! The kit has all the connections you could ever need and will certainly make things much easier!

DSCF1279-1-1

After getting the DS1621 thermometer working on the I2C bus i now on plan on connecting something more complicated and very small! They probably won’t recommend it in the data sheet but you can solder LGA14 using a normal iron and some enamelled wire. My first attempt is below. Unfortunately i started with much thicker wire which subsequently pulled a pad off but the thinner 0.15mm stuff is fairly easy. Checking the connections with a multimeter revealed no short circuits.

DSCF1281-1-1

The plan is try this again with the same device (without breaking it!) and then solder it to some veroboard to which i’ll connect one of my new cables :)

Categories: Uncategorized Tags:

Compiling the kernel with DS1621 support

October 17th, 2009 No comments

After building the temperature sensing I2C circuit i posted about before i compiled a kernel for the mini2440 which supported the DS1621 temperature sensor. Thanks to the existing kernel support this was remarkably easy.

All i had to do was edit /mini2440_defconfig in …/kernel/mini2440/arch/arm/configs and change line 1039 to:

CONFIG_SENSORS_DS1621=y

I compiled the kernel using the script i posted here interrupting the process after the git clones to change the line above and then allowing it to continue. I then booted the mini2440 and the sensor module was immediately available under:

/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0048

In this directory you have the following:

root@mini2440:/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0048# ls
alarms           name             temp1_max        uevent
driver           power            temp1_max_alarm
hwmon            subsystem        temp1_min
modalias         temp1_input      temp1_min_alarm

The output on the DS1621 is controlled by the temp1_min and temp1_max thresholds. By default it goes high when temp1_input < temp1_min. You can view the temperature by reading temp1_input and you can adjust temp1_min and temp1_max by echoing the required threshold to the file, for example:

root@mini2440:/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0048# cat temp1_input
26500
echo 27000 &gt; temp1_min

In this configuration the DS1621 output is high and drives the base of my transistor which switches on an LED. As soon as i heat the sensor the temperature goes above temp1_min the LED turns off.

Although i have no purpose for this circuit it serves as a proof of concept for installing I2C devices on the mini2440.

Here’s another pic with the power light on but the output off:

DSC_0052

SMD on veroboard was never meant to look nice!

Categories: Uncategorized Tags: ,

Cross compiling Qt-embedded 4.5.3

October 9th, 2009 46 comments

Cross compiling Qt was actually very easy. I used the same machine described in the mini2440 kernel post.  If you have a vanilla install of Fedora 11  it’s more than likely you’ll get some errors due to missing packages so check the list i posted if you can’t figure out which ones you need. This is what i did:

  1. Download the Qt source from Trolltech
  2. Untar the archive somewhere, i simply used the desktop
  3. Edit the file mkspecs/qws/linux-arm-g++/qmake.conf according to your toolchain. I have attached mine here as an example. I used the toolchain from OpenEmbedded.
  4. Now run the following commands within the Qt directory:
  • ./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix /usr/local/Qt -qt-mouse-tslib -little-endian
  • gmake -j 2 (or however many CPUs you have)
  • sudo gmake install

The resulting ~74MB  will be located in /usr/local/Qt. At first i ran the library from an SD card using a system wide link but later i used NFS.

I ran the library using BusError’s mini2440 kernel and an Angstrom base image I cross compiled using OpenEmbedded apriori. In my next post i’ll describe how to compile Angstrom Linux for this purpose which also provides the toolchain i used here. Finally when i get access to my mini2440 i’ll explain how to use the examples and setup the touch screen which was a little fiddly.

Big thanks to Cor for his post on building Qt which i’ve relied on heavily here.

Controlling the mini2440 system LEDs and the EEPROM

October 1st, 2009 No comments

This is pretty trivial but i thought i’d post it just incase. Using the mini2440 kernel by BusError the system LEDs are registered under /sys/devices/platform/s3c24xxled.X, where X is the LED number. LEDs 1-4 are located on the system board and LED 5 is the backlight. To control the devices you can do the following:

cd /sys/devices/platform/s3c24xx_led.5/leds/backlight

echo 0 > brightness #turns the backlight off

echo 255 > brightness #turns the backlight on

You can also choose from one of the available triggers, for example..

root@mini2440:/sys/devices/platform/s3c24xx_led.5/leds/backlight# cat trigger
none nand-disk mmc0 timer heartbeat [backlight] gpio default-on
root@mini2440:/sys/devices/platform/s3c24xx_led.5/leds/backlight# echo heartbeat > trigger

Will make your backlight flash on and off like crazy!

Unfortunately there is no PWM control to manage the brightness. This would have been really nice.

The EEPROM can be controlled in a similar way. You can access it in:

/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0050

Data can be written by using the following command:

echo whatever you want > eeprom

The just do the following to read the memory:

cat eeprom

Categories: Uncategorized Tags:

Compiling the mini2440 kernel

September 30th, 2009 3 comments

Thanks to BusError there is a mini2440 kernel available here:

http://code.google.com/p/mini2440/

It took me a little while to get it to compile and i thought i’d post a guide to help anyone else having trouble. Compilation was done using Fedora 11. I used the livecd to install and added some packages afterwards. The main ones are those recommended for openembedded. The page to look at is here:

http://wiki.openembedded.net/index.php/OEandYourDistro

I used:

su -c "yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel glibc-static \
gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools \
gcc gcc-c++ help2man perl-ExtUtils-MakeMaker"

At first the build generated various errors which were resolved by installing more packages. Unfortunately I do not remember which ones but i’ve attached a list of all packages i currently have installed in case you get stuck. In each case simply googling the error resulted in a post advising to install a particular package. After that everything worked!

The script i used to build the kernel was based very closely on the one modified by BusError. If i remember correctly I had to change a path near the end of the script. I’ve attached a copy of the exact same script which worked for reference.

You run the script by simply typing:

sudo sh mini2440-bootstrap-v2.sh

On my laptop using an Intel T7400 CPU this takes about 30-45 minutes depending on the download speeds.

If you use the default install path you should have u-boot.bin and uImage along with some other files in the directory:

/usr/src/mini2440/output

If you don’t then something has gone wrong so go back and check the various error messages in the terminal and fix them!

You can then flash these files as per normal.

Downloads:

Fedora 11 Installed packages

Mini2440 build script

Categories: Uncategorized Tags: ,