Page 1 of 7
Mini2440
From LinuxMCE wiki
Contents
1 About 2 Preparations 3 Setting up the bootloader 3.1 Compiling uboot 3.2 Flashing uboot 3.3 Configure uboot 4 Kernel 4.1 Compilation 4.2 Kernel Modules 4.3 Flash kernel 4.4 Configure uboot 5 Bit Baking Angstrom, and QT Embedded 4 5.1 Getting the required software 5.2 Adding QT to baking recipes 5.3 running the bitbake 6 Troubleshooting 6.1 Write errors 6.2 Python Alignment trap, Segmentation fault 6.3 Messed Up Screen Positions( or TS calibration) IN QT 7 Links
mini2440
About
This is a howto install uboot and a new kernel on the mini2440. Big thanks to BusError for the instructions and guidance. DISCLAIMER: This worked for me, if it eats your cat or burns your kitchen sink, don't blame me. Specification MINI2440v2 CPU S3C2440A MHz 400-533 RAM 64MB NOR flash 2MB Nand Flash 128MB Ethernet 10/100M Ethernet, RJ-45 connector Serial ports 3 RS232 1 USB Host 1 USB Device 1 SD card slot 1 Audio Interface In, Out, Mic LCD connector 1 Camera Interface 1 JTAG 10pin JTAG connector Bus 40pin connector GPIO 34pin connector Dimension 100x100mm Linux Open Embeddeed with ngstrm WinCE WinCE 6.0 For more details:http://www.developmentboard.net/index.php/productdetail/Development+board/ARM9/SAMSUNG/S3C2440/MINI2440v2/info/1
Preparations
I used this one: Add the bin dir to the $PATH. If you have a toolchain with another prefix (like arm-linux-) adapt the CROSS_COMPILE environment variable in the next steps.
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 2 of 7
Compile:
make all
This will give you a "u-boot.bin". If you get an error about a missing whatever-gcc, verifiy if there is a hardcoded CROSS_COMPILE setting in the Makefile
Flashing uboot
We use the installed vivi bootloader to load uboot via usb. Power the board off, set the NOR switch to on, power the board on. You'll get the vivi output on the serial console. Press 'q' to go to the shell and do the "load flash" on address 0 with the size of "u-boot.bin" (238232 bytes in this example):
[q] Goto shell of vivi Enter your selection: q Supervivi> load flash 0 238232 u USB host is connected. Waiting a download.
Use the "s3c2410_boot_usb" utility (http://mini2440.googlecode.com/files/s3c2410_boot_usb-20060807.tar.bz2) to upload the "u-boot.bin" via usb:
./s3c2410_boot_usb u-boot.bin
You'll see something like this as output, ignore the error message:
csum = 0x9a6e send_file: addr = 0x33f80000, len = 0x0003a298 Error downloading program
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 3 of 7
Try
MINI2440 # nand scrub ... Really scrub this NAND flash? <y/N>
Now power off the board, set the NOR switch back to off, and power on the board. We verify the version and then prepare config storage in flash:
MINI2440 # version U-Boot 1.3.2-dirty-moko12 (Mar 8 2009 - 13:50:19)
MINI2440 # dynenv set 40000 device 0 offset 0x40000, size 0x3fc0000 45 4e 56 30 - 00 00 04 00 MINI2440 # saveenv Saving Environment to NAND... Erasing Nand...Writing to Nand... done MINI2440 # reset
Configure uboot
do a "printenv" to show active settings. Adjust the IP for uboot and the tftp server. We need proper IP connectivity to load the kernel with tftp. "setenv" is your friend. "saveenv" stores the setting to flash.
Kernel
Compilation
Fetch from git:
mkdir kernel ; cd kernel git clone git://repo.or.cz/linux-2.6/mini2440.git cd mini2440 mkdir -p ../kernel-bin
(optional) if you want to modify kernel modules use this command afterwards:
(optional if you don't have libncurses5-dev) apt-get install libncurses5-dev cd ../kernel-bin make ARCH=arm menuconfig cd ../mini2440
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 4 of 7
Kernel Modules
To create the dynamically loaded kernel modules, which would go into the root file system later on do this:
CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/ modules CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/ INSTALL_MOD_PATH=.. modules_install
After this step, there should be a directory ../lib which would contain the dynamically loaded modules(drivers). This folder would go to the root file system of your board, for example I have my filesystem on a sd card. I would stick the SD card in the PC, and mount it and then copy the modules as:
cp ../lib/modules/2.6.32-rc8/ /media/rootfs/lib/modules/ -r
don't forget to
sync umount /media/*
Flash kernel
Verify partitions, we need the offset for the kernel partition (probably 0x60000):
mtdparts
Note the size, pad it to 512 byte and use the nand write command to flash it:
nand write 32000000 60000 <padded size>.
Configure uboot
We use a nfs chroot for now:
setenv bootargs console=ttySAC0,115200 noinitrd init=/sbin/init mini2440=1tb ip=192.168.80.12 root=/dev/nfs rw nfsroot=192.168.80.1:/home/public/arm
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 5 of 7
and choose "<No>" from the menu. Then we create a helper for ourselves:
gedit ~/OE/source-me.txt
and past the following, and change the /home/ashkax to your own home directory address.
export OETREE="/home/ashkax/OE" BBPATH=${OETREE}/:${OETREE}/openembedded/ echo Setting up dev env for ngstrm 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} LD_LIBRARY_PATH= export PATH LD_LIBRARY_PATH BBPATH export LANG=C export BB_ENV_EXTRAWHITE="MACHINE DISTRO OETREE ANGSTROM_MODE ANGSTROMLIBC LIBC" sudo sysctl vm.mmap_min_addr=0 echo "Altered environment for OE Development"
This file that we just created will be used later on, to setup the compiler... Now lets edit the bitbake configuration file to tell bit bake we like it to compile the QT embedded for us too:
cd ~/OE/openembedded wget http://www.electronics.diycinema.co.uk/wp-content/uploads/2009/11/local.conf.txt gedit local.conf.txt
now change all the doug to your own user name, save the file and quit gedit. Then
cp local.conf.txt conf/local.conf
Alternatively you can use the original sample file and edit it to your liking:
cd openembedded gedit mini2440_local_conf_example.conf cp mini2440_local_conf_example.conf conf/local.conf
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 6 of 7
ANGSTROM_EXTRA_INSTALL ?= "" DEPENDS = "task-base-extended \ psplash-zap \ esekeyd u-boot-utils tslib \ i2c-tools i2c screen rsync nfs-utils \ directfb gdbserver directfb mtd-utils \ " IMAGE_INSTALL = "task-base-extended \ ${ANGSTROM_EXTRA_INSTALL} \ psplash-zap qt4-embedded\ esekeyd u-boot-utils tslib-calibrate tslib-tests \ i2c-tools i2c screen rsync nfs-utils-client \ directfb gdbserver directfb mtd-utils \ rsvg pango \ " export IMAGE_BASENAME = "mini2440-image" IMAGE_LINGUAS = ""
inherit image
If you get an error trying to build a package try cleaning it: bitbake -c clean INSERTPACKAGENAME Then try and build the image again. Maybe you wont have this problem. I guess its either because the checksum parser failed to build or my hdd is dodgy. It only happened once on binutils but worked fine after cleaning it. A few hours later if all goes well you should have images in: ~/OE/oetmp/deploy/glibc/images/mini2440/ Obviously that directory depends on what you setup in the local.conf. but, for a fun start boot up your mini2440 with the new image that you've just created and issue the following command:
ts_calibrate ts_test qtdemo -qws
Troubleshooting
Write errors
When you have bad blocks in NAND, you'll get write errors. This gives more information: http://wiki.openmoko.org/wiki/NAND_bad_blocks Clear the flash (do not reset the board till uboot is reinstalled, or you need to use NOR/vivi to reinstall uboot via usb):
nand scrub
Reflash uboot (use the size in the output from the tftp command and pad it to hit 512 byte boundaries for the nand write command)
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011
Page 7 of 7
Links
http://bliterness.blogspot.com/ http://www.developmentboard.net/index.php/productdetail/Development+board/ARM9/SAMSUNG/S3C2440/MINI2440v2/info/1 http://blog.cor-net.org/ (Qt 4.5 on mini2440) http://wiki.openembedded.net/index.php/Getting_Started http://www.sereno-online.com/site/2010/05/01/qt-4-6-2-installation-procedure-for-friendlyarm-mini-2440-board/ (Qt 4.6.2 on mini 2440) Retrieved from "http://wiki.linuxmce.org/index.php/Mini2440" Categories: Hardware | Tutorials This page was last modified 16:44, 29 September 2010.
http://wiki.linuxmce.org/index.php/Mini2440
3/2/2011