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.

Cross Compiling for Linux C6x

Hi to all

i try to generate Executable file for Linux c6x on C6678 EVM

i can cross compile hello world example successfully using c6x-uclinux-gcc and run it on Board

in next step i start cross compiling a simple GPIO project for c6x linux (i done this project by CCS Project and ELF file )

i have some question (i am newbie in Linux code compiling ):

Q1:do i need CCS (CGT) , or c6x-uclinux-gcc enough to compile and linking CSL and other header file ?

(i read this wiki page but i don't need dynamic linking)

Q2:can i use use CCS output file (.bj , .pp , .mk , makefile) and c6x-uclinux-gcc , for generate executable file for linux c6x?

Q3:i know c6x linux have spi and GPIO driver. how can i use this driver ?

thanks

Ebi

  • A1) You can build the project either through command terminal or CCS, both method uses "cl6x".

    A2) I think, yes you can like that.

    A3) Refer to the c6x linux source code.
  • Hi Titusrathinaraj

    thanks for fast reply

    Titusrathinaraj Stalin said:
    A1) You can build the project either through command terminal or CCS, both method uses "cl6x".

    i think cl6x is C6000 Code Generation Tools (CGT) and output is ELF file (can't use for linux). is it correct?

    in CCS i can create : CCS project (use CGT) , GCC cross compile project (use c6x-uclinux-gcc) and Makefile project with existing code what is your mean about "build the project through CCs" ?

    Titusrathinaraj Stalin said:
    A2) I think, yes you can like that.

    can explain more or introduce reference?

    thanks 
    Ebi

  • Hi,

    i think cl6x is C6000 Code Generation Tools (CGT) and output is ELF file (can't use for linux). is it correct?

    cl6x is CGT and can be built in elf or coff type of output file, it can be used on Linux through elf loader (cl6x linux need elf loader stuff, I'm not sure it has or not)


    in CCS i can create : CCS project (use CGT) , GCC cross compile project (use c6x-uclinux-gcc) and Makefile project with existing code what is your mean about "build the project through CCs" ?

    What type of project are you building ?
    You can use the same procedure which you have followed for hell world application.

    Build your project either through command terminal (gmake) or CCS then use "c6x-uclinux-gcc" to make executable to be run on cl6x linux machine.
  • i compile hello world with command line and without any makefile
    > c6x-uclinux-gcc -o hello hello.c
    i try use CGT for compile and c6x-uclinux-gcc for linking but i didn't success
    (please introduce reference if possible)
    i decide on this step work on command line and use makefile

    thanks for following
  • Hi, Ebi,

    You can not use CCS to cross compile Linux-c6x. The cross-compiler is not an option when C66x is the platform in CCS project. I believe we dropped the cl6x as one of the cross compilers for c6x linux. You will need to use Mentor Graphics Sourcery tools to cross compile linux application. c6x-linux has gpio driver in arch/c6x/drivers, but I don't think spi has been ported to c6x.

    Rex

  • Hi Rex
    Sorry for replaying late , I was out of office

    thanks for your useful Post

    i try run simple project using PDK function and library , for linux c6x (by makefile and c6x-uclinux-gcc on Ubuntu 10.04 host)

    i have some problem and questions

    Q1:i need to use PDK (.lib) library and i read that .a library should be used in Linux

    when my makefile is this:

    ...

    all: LED_play.out

    LED_play.out: LED_play.o

    LED_play.out: LED_play.o
    	 c6x-uclinux-gcc $(INC) -o LED_play.out LED_play.o -L/opt/ti/pdk_C6678_1_1_2_5/packages/ti/platform/evmc6678l/platform_lib/lib/debug/ti.platform.evm6678l.lite.lib
    LED_play.o : LED_play.c 
    c6x-uclinux-gcc $(INC) -c LED_play.c

    ...

    my result of make command is:

    LED_play.o: In function `main':
    LED_play.c:(.text+0x240): undefined reference to `platform_init'
    LED_play.c:(.text+0x250): undefined reference to `platform_uart_init'
    LED_play.c:(.text+0x25c): undefined reference to `platform_uart_set_baudrate'
    LED_play.c:(.text+0x268): undefined reference to `platform_get_info'
    LED_play.c:(.text+0x298): undefined reference to `platform_uart_write'
    LED_play.c:(.text+0x2e4): undefined reference to `platform_led'
    LED_play.c:(.text+0x2ec): undefined reference to `platform_delay'
    LED_play.c:(.text+0x300): undefined reference to `platform_led'
    collect2: ld returned 1 exit status
    make: *** [LED_play.out] Error 1

    after rename ti.platform.evm6678l.lite.lib to libtest.a and change makefile to this:

    LED_play.out: LED_play.o
    	 c6x-uclinux-gcc $(INC) -o LED_play.out LED_play.o -L/opt/ti/pdk_C6678_1_1_2_5/packages/ti/platform/evmc6678l/platform_lib/lib/debug -ltest

    , my result of make command is:

    7144.output.txt

    how can i use PDK library? Rebuild library is correct way?

     thanks

    Ebi

  • update:
    pdk library generate with CGT for use in CCS and i decide to rebuild PDK with c6x-uclinux-gcc .
    i try to use CCS but can't change compiler from CGT to gcc!
    rewrite makefile to build library from source is correct solution ?
    anybody can help me?

    thanks...
  • Ebi,

    Sorry for the late reply. The PDK has not been ported to support linux-c6x and can't be used by linux. The examples in PDK and PDK package itself is for DSP SYS/BIOS.

    Rex

  • thanks Rex for your reply!

    i need to PDK library and try to Rebuild it with c6x-uclinux-gcc

    i continue my work in this post

    Ebi