This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[OMAP5] Cross compilers and software development packages

Howdy,

Is there a list of development packages for cross compiling for the ES 2.0 uEVM?  Or at least a good getting started guide somewhere? We are looking to have a minimal linux based system and compiling some C, and C++ files.

Thanks,

Glenn

  • Hi,

    I am not aware of a public guide specifically for OMAP5 ES2; most of the principles described on OMAPPedia (http://omappedia.org/wiki/Main_Page) apply, though, but you will need to add a new kernel and bootloader.

    Cross compiling can be done on e.g. an Ubuntu PC with e.g. arm-linux-gnueabihf-gcc-4.6.

    You could start from the following kernel (https://github.com/vstehle/linux/tree/VINCENT/5432-ES2-5, omap2plus_defconfig) and u-boot (https://github.com/vstehle/u-boot/tree/VINCENT/5432-ES2-5, omap5_evm_config).

    Alternatively, busybox (http://www.busybox.net/) could be used to build a minimal userspace with /bin/sh and more.

    Best regards,

    V.

  • I'd take a private guide. :-)

    We have a kernel and boot loader from our vendor, so that's not the big deal, but we have some other code that needs to cross compile and running gcc --target=arm-linux-gnueabihf-gcc-4.6 is coming back with an error:

    cc1plus: warning: command line option ‘-ftarget=arm-linux-gnueabihf-gcc-4.6’ is valid for Java but not for C++ [enabled by default]

    This leads me to believe I am going about this wrong.  This is our code for other platforms, so I may be taking the wrong steps.

    At this point I am just trying to get some sample code built on my host to my ES2 which is currently running Ubuntu something (12.04 maybe?).

    EDIT:

    I am looking at http://omappedia.org/wiki/Support_Tools#Cross_Compilershttp://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/, and http://www.virtualopensystems.com/media/kvm-resources/kvm-arm-guide.pdf.  All of which are almost but not quite what I am looking for. 

  • > At this point I am just trying to get some sample code built on my host to my ES2 which is currently running Ubuntu something (12.04 maybe?).

    Hi Glenn,

    12.04 would be the 'precise' release. You may then readily install this package for example: https://launchpad.net/ubuntu/precise/amd64/gcc-arm-linux-gnueabihf/4:4.6.2-7. An apt-get install gcc-arm-linux-gnueabihf should do. You will be able to use /usr/bin/arm-linux-gnueabihf-gcc afterwards.

    Using the cross-compiler is done with an export CROSS_COMPILE=arm-linux-gnueabihf- for linux and u-boot. Doing export ARCH=arm is useful, too.

    Best regards,

    V.

  • Hi Vincent,

    Thanks for the replies.  Still not quite what I am looking for, but I have some leads now.

    On my pc (Mint), I have the gcc-arm, and it seems to be fine, building (I guess your github) linux (https://github.com/vstehle/linux.git) worked, but stopped on the "Starting kernel . . ." during boot, so I have something set up wrong it looks like, so I will go back to trying to get the known working kernel working before I try an get our code working.

    Glenn

  • Hi Glenn,

    Here is the u-boot script I use those days:

    mmc part
    fatload mmc 0:1 0x825f0000 omap5-panda.dtb
    fatload mmc 0:1 0x80300000 uImage
    fatload mmc 0:1 0x81600000 uInitrd
    setenv bootargs 'console=ttyO2,115200n8 earlyprintk debug'
    setenv fdt_high 0x84000000
    setenv initrd_high 0x86000000
    bootm 0x80300000 0x81600000 0x825f0000

    You might want to copy especially the *_high directives.

    Best regards,

    V.

  • I don't have a uInitrd, so this failed after that point.  Not sure if I missed a step.

    Also, on the Ubunutu release, the startx & command fails on the reading /etc/X11/X symbolic link (Invalid argument), so I am not even sure my release was set right.

    I think I will be able to compile with this package list:

    gcc-4.6-arm-linux-gnueabi binutils-arm-linux-gnueabi \
    libc6-armel-cross linux-libc-dev-armel-cross libncurses5-dev \
    gcc-arm-linux-gnueabi libc6-dev-armel-cross cpp-arm-linux-gnueabi

    but we'll see. 

    Thanks again for help so far.

  • Ok, I have tried a few things with no luck.  At this point I just want a hello world program to work and it won't.  I am trying to compile a c program on a linux mint machine for a ES 2.0 that is running Ubuntu 12.04.1 LTS

    arm-linux-gnueabi-gcc hello.c -static

    arm-linux-gnueabi-gcc -march=cortex-a15 hello.c -o hello-march

    arm-linux-gnueabi-gcc -mcpu=cortex-a15 hello.c -o hello-mcpu
    arm-linux-gnueabi-gcc -marm -mcpu=cortex-a15 hello.c -o hello-mcpu
    arm-linux-gnueabi-gcc -marm -mglibc -mcpu=cortex-a15 hello.c -o hello-mcpu-mglibc

    Each of theses commands has resulted in a file the doesn't run.  When I try to run it I get:

    root@omaphost:/home/omapuser# ./hello-mcpu-mglibc
    -bash: ./hello-mcpu-mglibc: No such file or directory
    root@omaphost:/home/omapuser# sudo !!
    sudo ./hello-mcpu-mglibc
    root@omaphost:/home/omapuser# ./hello-mcpu
    hello-mcpu hello-mcpu-mglibc
    root@omaphost:/home/omapuser# ./hello-mcpu
    -bash: ./hello-mcpu: No such file or directory
    root@omaphost:/home/omapuser# sudo ./hello-mcpu
    root@omaphost:/home/omapuser# chmod +x hello-mcpu*
    root@omaphost:/home/omapuser# ./hello-mcpu
    -bash: ./hello-mcpu: No such file or directory
    root@omaphost:/home/omapuser# sudo !!
    sudo ./hello-mcpu
    root@omaphost:/home/omapuser# ./hello-mcpu-mglibc
    -bash: ./hello-mcpu-mglibc: No such file or directory
    root@omaphost:/home/omapuser# sudo !!
    sudo ./hello-mcpu-mglibc
    root@omaphost:/home/omapuser#

    So, how do I compile a c program that will run on the ES 2.0?

    Thanks

    Glenn

  • Hi,

    First, try to use a cross compiler version, very close to the compiler used by your userspace. On Ubuntu, you would prefer e.g. arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3.

    Then make sure your userspace dynamic loader matches your compiler's (even with -static). A quick try here tells me my static cross compiled binary will require e.g. ld-linux.so.3 and/or ld-linux-armhf.so.3.

    Best regards,

    V.

  • Thank you for your patience and quick response.  Changing to arm-linux-gnueabihf-gcc worked.