Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Sep 2008 02:49 PM by  embedded@ferrin.org
HOWTO: Run Linux 2.6.19.2 + QT Application
 18 Replies
Sort:
You are not authorized to post a reply.
Author Messages

DrOctavius



New Member


Posts:
New Member


--
01 Apr 2008 07:09 PM
    This how-to shows the steps to take a vanilla kernel 2.6.19.2, apply the megapatch v1.0.0,
    build a kernel, qtopia and pictureflow (application demo).

    OS host: Opensuse 10.3
    Board: IMX31Lite
    Kernel: 2.6.19.2
    LTIB: 3
    Megapatch: linux-2.6.19.2-imx31lite-v1.0.0

    What hardware and software worked/tested with the patch + LTIB:
    + USB Host, Device and OTG.
    + UART.
    + LCD 800x480 TFT (16 bpp).
    + Touch.
    + Audio.
    + Ethernet.
    + Leds.
    + Microwindows.
    + tslib.
    + DirectFB.
    + OpenGLES.
    + Qtopia: 4.3.3.
    + madplay (mp3s).

    What I didn't try:
    - SD Cards
    - PCMCIA
    - ATA

    What is included in the package:
    + PDF with instructions
    + Linux Bootloader (2nd stage bootloader)
    + Patch linux-2.6.19.2-imx31lite-v1.0.0
    + Kernel 2.6.19.2 Config
    + Pictureflow for qt4.3.3

    http://myfreefilehosting..../f/2565780551_2.29MB

    DrOctavius

    tombrus



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 01:28 AM
    Thanks DrOctavius,

    A question: how do I get Linux BSP iMX31ADS Release 3?
    I can only find downloads of the Release 5 from the FreeScale website.

    -Tom

    DrOctavius



    New Member


    Posts:
    New Member


    --

    lilja.magnus@gmail.com



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 12:39 PM
    Have thought of splitting the big kernel-patch so it's easier to see what changes originate from Freescale's BSP and what additional changes you have done?

    Posted By DrOctavius on 2 Apr 2008 9:46 AM
    http://opensource.freesca...hb=bsp-imx27ads-rel3




    That's the link to the kernel part of rel 3 of the i.MX27 BSP. The correct link would be http://opensource.freesca...;h=bsp-imx31ads-rel3


    I guess that Tom was referring to the BSP iso image.

    /Magnus

    tombrus



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 01:47 PM
    I was . Thanks Magnus!

    DrOctavius



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 03:41 PM
    yep, wrong link.
    You can still use LTIB-5 as build tool. After install LTIB, overwrite the linux folder (you need to change some paths too). In this way you will have the newest packages (for example: the OPENGLES drivers are newer in LTIB-5)

    DrOctavius

    DrOctavius



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 08:18 PM
    Magnus,

    The good thing about this big patch is that can be applied to a vanilla 2.6.19.2 kernel. If I have time I'm planning to isolate ADS from LITE code, so we can patch futures LTIB versions (I think this was what you have done in your 2.6.22 version).

    BTW, Pengutronix is making a great job unifying IMX platform code:
    http://thread.gmane.org/g...el/40038/focus=40054

    macneibfallon



    New Member


    Posts:
    New Member


    --
    02 Apr 2008 10:18 PM
    DrOctavius,
    Thank you for your great contribution.
    I'm running LTIB Rel5b and I'm getting hung up on the video. Sooooo close!!

    I'm very interested in this patch because it seems like a straight line to getting the my 3.6-QVGA LCD up and running finally.
    Like other attempts, I'm stalled again at the DirectFB v 0.9.24 build. Once again am I humbled by this operating system.
    Thank you kindly to all who have assisted me so far.

    Initially I got stuck on the build complaining about not being able to find
    /"LTIB Installation"/rootfs/usr/src/linux/include/linux/config.h

    I took Rico's advice and used the autoconf.h in the directory
    /"LTIB Installation"/rootfs/usr/src/linux/include/linux/autoconf.h
    and created a symbolic link
    /"LTIB Installation"/rootfs/usr/src/linux/include/linux/config.h

    now it's complaining about
    export: 1: -I/"LTIB Installation"/rootfs//usr/include: bad variable name

    What I think is interesting is the '//' between /rootfs//usr/

    Here's my thinking, Could you go into some more detail about which paths you modified to get this up and running?

    I've included a dump of the build any insight would be very appreciated.

    Processing: DirectFB
    ======================
    rpmbuild --dbpath /"LTIB Installation"/rpmdb --define '_unpackaged_files_terminate_build 0' --define '_target_cpu arm' --define '__strip strip' --define '_topdir /"LTIB Installation"/rpm' --define '_prefix /usr' --define '_tmppath /"LTIB Installation"/tmp' --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bc --short-circuit /"LTIB Installation"/dist/lfs-5.1/DirectFB/DirectFB.spec
    Executing(%build): /bin/sh -e /"LTIB Installation"/tmp/rpm-tmp.56723
    + umask 022
    + cd /"LTIB Installation"/rpm/BUILD
    + cd DirectFB-0.9.24
    + KHDR_DIR=/"LTIB Installation"/rootfs/usr/src/linux/include
    + [ ! -f /"LTIB Installation"/rootfs/usr/src/linux/include/linux/config.h ]
    + export FREETYPE_CONFIG=/"LTIB Installation"/rootfs/usr/bin/freetype-config
    + /"LTIB Installation"/rootfs/usr/bin/freetype-config --prefix=/"LTIB Installation"/rootfs//usr --cflags
    + export FREETYPE_CFLAGS=-I/"LTIB Installation"/rootfs//usr/include/freetype2 -I/"LTIB Installation"/rootfs//usr/include
    export: 1: -I/"LTIB Installation"/rootfs//usr/include: bad variable name
    error: Bad exit status from /"LTIB Installation"/tmp/rpm-tmp.56723 (%build)
    RPM build errors:
    Bad exit status from /"LTIB Installation"/tmp/rpm-tmp.56723 (%build)
    Build time for DirectFB: 1 seconds
    Failed building DirectFB
    f_buildrpms() returned an error, exiting
    These packages failed to build:
    DirectFB
    Build Failed
    Exiting on error or interrupt

    Regards,
    Blair

    DrOctavius



    New Member


    Posts:
    New Member


    --
    03 Apr 2008 01:42 AM
    The HOWTO needs some fixes, but I'm really busy right now, I think the best thing I can do is to upload the LTIB3 asap.

    DrOctavius

    lilja.magnus@gmail.com



    New Member


    Posts:
    New Member


    --
    03 Apr 2008 01:46 PM
    Posted By DrOctavius on 2 Apr 2008 8:18 PM
    Magnus,

    The good thing about this big patch is that can be applied to a vanilla 2.6.19.2 kernel. If I have time I''m planning to isolate ADS from LITE code, so we can patch futures LTIB versions (I think this was what you have done in your 2.6.22 version).

    BTW, Pengutronix is making a great job unifying IMX platform code:
    http://thread.gmane.org/g...el/40038/focus=40054




    I took Freescales patches to the vanilla kernel and put them in a series file so quilt can handle it, after that I added my own patches (using quilt).

    I agree on the work done by Pengutronix.

    /Magnus

    tombrus



    New Member


    Posts:
    New Member


    --
    09 Apr 2008 07:22 AM
    DrOctavius, could you upload that LTIB 3 iso somewhere?

    I am trying to use the LTIB 5b for this but I am struggling to get it to build....

    -Tom

    priyanka



    New Member


    Posts:
    New Member


    --
    02 Jul 2008 12:27 PM
    Posted By DrOctavius on 3 Apr 2008 1:42 AM
    The HOWTO needs some fixes, but I''m really busy right now, I think the best thing I can do is to upload the LTIB3 asap.

    DrOctavius





    DrOctavius,

    Can you please tell us what fixes are needed?
    I am using LTIB3, still I have errors

    make[1]:***[arch/arm/mach-mx3/built-in.o] Error 1
    make:*** [arch/arm/mach-mx3] Error 2
    error: Bad exit status from /opt/freescale/ltib-imx31ads-20070128/tmp/rpm-tmp.70558(%build)

    RPM build errors:
    Bad exit status from /opt/freescale/ltib-imx31ads-20070128/tmp/rpm-tmp.70558(%build)
    Build time kernel-2.6.19-mx: 5 seconds

    Failed building kernel-2.6.19-mx

    f_buildrpms() returned an error, exiting

    These packages failed to build:
    kernal-2.6.19-mx
    Build Failed

    -thanks

    DrOctavius



    New Member


    Posts:
    New Member


    --
    04 Jul 2008 09:19 PM
    When I said "fix something", I was talking about clean-up the documentation. Your output error is another thing.
    Maybe if you post the complete steps of what you are doing I could help you to fix it.

    priyanka



    New Member


    Posts:
    New Member


    --
    05 Jul 2008 01:34 AM
    Posted By DrOctavius on 3 Apr 2008 1:42 AM
    When I said "fix some thing", I was talking about clean-up the documentation. Your output error is another thing.
    Maybe if you post the complete steps of what you are doing I could help you to fix it.




    Thanks for the reply, but yeah, even I was talking about the document....anyways, I got stable linux working on my kit now

    DrOctavius



    New Member


    Posts:
    New Member


    --
    07 Jul 2008 10:28 AM
    Congratulations!

    embedded@ferrin.org



    New Member


    Posts:
    New Member


    --
    05 Aug 2008 11:54 AM
    Posted By DrOctavius on 3 Apr 2008 1:42 AM
    This how-to...
    http://myfreefilehosting..../f/2565780551_2.29MB




    This link ain't working for me

    I am getting mad about not being able to run Linux after 3 days of messing with the damn thing. It shouldn't be that difficult.

    embedded@ferrin.org



    New Member


    Posts:
    New Member


    --
    08 Sep 2008 08:37 AM
    I was able to build this on LTIB 6, in a way that shuld be compatible with other LTIB versions.


    1.- Install LTIB, but don't --configure it!

    2.- Copy the "megapatch" in /opt/freescale/pkgs/, then make a signature for it:
    gato@/opt/freescale/pkgs$ md5sum linux-2.6.19.2-imx31lite-v1.0.0.patch > linux-2.6.19.2-imx31lite-v1.0.0.patch.md5


    3.- Add a RPM spec file like this one:
    ltib-imx31ads-20080722/dist/lfs-5.1/kernel/kernel-2.6.19.2-imx31lite.spec.in:
    # Template = kernel-common.tmpl

    %define pfx /opt/freescale/rootfs/%{_target_cpu}
    %define dversion 2.6.19.2
    %define bld_dir_name linux-2.6.19
    %define kernel arch/arm/boot/zImage
    %define pkg_name linux

    Summary : Linux kernel for i.MX31 Lite dev kit
    Name : kernel
    Version : 2.6.19
    Release : 2
    License : GPL
    Vendor : kernel.org
    Packager : gatopeich
    Group : System Environment/Kernel
    Source : %{pkg_name}-%{dversion}.tar.bz2
    Patch0 : linux-2.6.19.2-imx31lite-v1.0.0.patch

    BuildRoot : %{_tmppath}/%{name}
    Prefix : %{pfx}

    %Description
    %{summary}

    From kernel.org
    Megapatch: linux-2.6.19.2-imx31lite-v1.0.0

    %Prep
    %setup -n %{pkg_name}-%{dversion}
    %patch0 -p5

    # keep ltib's kernel config and kernel source tree consistent
    if [ -f "$PLATFORM_PATH/$PKG_KERNEL_PRECONFIG" ]; then
    cp $PLATFORM_PATH/$PKG_KERNEL_PRECONFIG arch/$LINTARCH/configs/${PLATFORM}_defconfig
    fi

    Now LTIB knows how to build our imx31lite kernel, and it will download the tarball for us...

    4.- Then make a copy of "config/platform/imx31ads", into "config/platform/imx31lite", and edit main.lkc like this...
    ltib-imx31ads-20080722/config/platform/imx31lite/main.likc:
    # constants (forced values)
    config CONFIG_TITLE
    string
    default "LTIB: LogicPD IMX31 Lite development kit"

    config CPU
    string
    default "MX31"

    config PLATFORM_COMMENT
    string
    default "LogicPD IMX31 Lite development kit"

    config VENDOR
    string
    default "LogicPD"

    config PLATFORM
    string
    default "imx31lite"

    config GNUTARCH
    string
    default arm

    config LINTARCH
    string
    default arm

    config CFGHOST
    string
    default arm-linux

    # capabilities if different from defaults.lkc

    source ../../userspace/endian.lkc
    source ../../userspace/libc_type.lkc

    comment "Choose your toolchain"
    choice
    prompt "Toolchain"
    default TOOLCHAIN1
    help
    Choose the cross toolchain for building your packages. If you
    choose none, you can enter the path to your toolchain by hand.

    config TOOLCHAIN1
    bool "ARMv5te gcc-4.1.2,Multi-lib,gnueabi/glibc-2.5-nptl-3" if GLIBC || LIBC_NONE || LIBC_HACKING
    config TOOLCHAIN_CUSTOM
    bool "custom"
    endchoice

    config TOOLCHAIN
    string
    default tc-fsl-x86lnx-armeabi-nptl-4.1.2-3.i386.rpm if TOOLCHAIN1

    config TOOLCHAIN_PATH
    string
    default "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi" if TOOLCHAIN1
    string "Supply your toolchain path" if TOOLCHAIN_CUSTOM

    config CUSTOM_TOOLCHAIN_PREFIX
    depends TOOLCHAIN_CUSTOM
    string "Enter your cross tools prefix"

    config TOOLCHAIN_PREFIX
    string
    default "arm-none-linux-gnueabi-" if TOOLCHAIN1
    default CUSTOM_TOOLCHAIN_PREFIX if TOOLCHAIN_CUSTOM

    config TOOLCHAIN_CFLAGS
    string
    default "-O2 -fsigned-char -mfloat-abi=softfp -mfpu=vfp" if TOOLCHAIN1
    string "Enter any CFLAGS for gcc/g++"
    help
    This option lets you set flags that will be passed to gcc/g++
    These will be injected by the spoofing mechanism, so they
    only work if you reference the compiler as gcc/g++ in your
    rpm spec files (you cannot say for instance powerpc-linux-gcc)

    comment "Choose your Kernel"
    choice
    prompt "kernel"
    default KERNEL2
    help
    This menu will let you choose the kernel to use with your board.
    If you don't want to build a kernel, unselect this option.

    config KERNEL1
    bool "Linux 2.6.24-mx"
    help
    This is the kernel for the imx31ads platform
    config KERNEL2
    bool "Linux 2.6.19.2 + imx31lite megapatch v1.0.0"
    help
    This is the kernel for the imx31lite dev kit
    Megapatch v1.0.0 applied to vanilla Linux 2.6.19.2
    config KERNEL_DIR_BUILD
    bool "Local Linux directory build"
    help
    Build using a local copy of the kernel sources
    config KERNEL_NONE
    bool "Do not build the Linux kernel"
    help
    Select this if you dont want to build the kernel
    endchoice

    config PKG_KERNEL
    string
    default "kernel-2.6.24-mx" if KERNEL1
    default "kernel-2.6.19.2-imx31lite" if KERNEL2
    default "kernel26-dir-build" if KERNEL_DIR_BUILD

    source ../../userspace/kernel_dir_build.lkc

    config PKG_KERNEL_PRECONFIG
    string "kernel preconfig"
    default "linux-2.6.24-imx31lite.config" if KERNEL1
    default "linux-2.6.19-imx31lite.config" if KERNEL2

    config PKG_KERNEL_WANT_HEADERS
    depends ! KERNEL_NONE
    bool "Include kernel headers"
    help
    Selecting this will copy kernel headers to rootfs/usr/src/linux/include

    config PKG_KERNEL_WANT_CF
    depends ! KERNEL_NONE
    bool "Configure the kernel"
    default y

    config PKG_KERNEL_LEAVESRC
    depends ! KERNEL_NONE
    bool "Leave the sources after building"
    default y
    help
    This is a one shot option that can be used to build the kernel and
    leave the build source tree in rpm/BUILD in place

    config DEPLOYMENT_ERASE_BLOCK_SIZE
    string
    default 16

    source ../../userspace/distro.lkc
    source ../../userspace/packages.lkc
    source ../../userspace/sysconfig.lkc
    source ../../userspace/deployment.lkc
    source ../../userspace/defaults.lkc


    Note that we added a new platform named "imx31lite". You should copy your kernel config file here too, named "linux-2.6.19-imx31lite.config" to match PKG_KERNEL_PRECONFIG.

    5.- Change [ltib]/config/main.lkc:
    config CONFIG_TITLE
    string
    default "GNU/Linux Target Image Builder : Platform Selection"

    mainmenu "GNU/Linux Target Image Builder main menu"

    choice
    prompt "Platform choice"
    help
    This menu will let you choose from a list of boards

    config PLATFORM_imx31ads
    bool "Freescale IMX31 ADS reference board"
    config PLATFORM_imx31lite
    bool "LogicPD IMX31 Lite development kit"
    endchoice

    config PLATFORM_DIR
    string
    default "config/platform/imx31lite" if PLATFORM_imx31lite
    default "config/platform/imx31ads" if PLATFORM_imx31ads


    6.- Now you can run ./ltib --configure and select "imx31lite" as your platform, then choose your kernel etc.

    I haven't had time to test the resulting binaries though...

    DrOctavius



    New Member


    Posts:
    New Member


    --
    08 Sep 2008 11:45 PM
    Gatopeich,

    Thanks for this amazing update to LTIB6.

    embedded@ferrin.org



    New Member


    Posts:
    New Member


    --
    09 Sep 2008 02:49 PM
    Posted By DrOctavius on 8 Sep 2008 11:45 PM
    Gatopeich,

    Thanks for this amazing update to LTIB6.




    No problem!
    Thank you in the first place for the 'megapatch'.
    I have to say that LTIB is very well designed and documented.
    You are not authorized to post a reply.