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 IPC-based application on ARM fail

Hi!


I'm working with the EVMK2H board (Rev 4.0) and I have trouble cross-compiling a simple application on the ARM side of the chip. My goal is to simply create a MessageQ (using the IPC API) on the ARM and then read some packets sent by the DSPs. I'm trying to cross-compile that application from my laptop using linaro gcc.

The Makefile I use is a modified version of the one given in the image processing demo (attached to this post). I cross-compiled the IPC libraries into a custom directory that I then pass to the linker. However I'm stuck with the reference to "ti/targets/std.h" missing and a storm of type-related error (I assume the xdc/std.h file is not taken in account properly though its path is given with the -I option to the compiler). I also attached the compilation errors.

I'm sure I'm missing something obvious but I can't find out what. Also I can't test to compile on the board right now but will be able to do so tomorrow or the day after. I can also say that I can't cross-compile the master part of the image processing example and I have the same errors if I try to compile with gcc or the TI compiler from CCS (v6). Also, I can't import the master part of the demo inside CCS, it's not recognize as a CCS project, is that normal ?

Thanks for your help,


Thomas.

cc_error.tar.gz

  • Hi Thomas,
    Please refer to the following IPC FAQ TI wiki page.
    processors.wiki.ti.com/.../IPC_FAQ_for_Keystone_Devices.
  • Hi!


    Thanks for your answer, I already checked the FAQ, User Guide and wiki pages, I must have missed something. Can you point me to the right direction ? It seems that the more dependencies I fix, the more missing ones I get...


    Thanks,


    Thomas.

  • I tested to compile the application directly on the board (the linux kernel is the one provided by MCSDK 3.1.4.7 and I loaded the tisdk-rootfs-k2hk-evm filesystem with NFS) and I got stuck with the same kind of error:

    fatal error: ti/ipc/MessageQ.h: No such file or directory

    I thought I followed the installation and setup guides for MCSDK, IPC and so on well but I obviously missed something that I cannot find...
  • Hi Skinner,

    I tested to compile the application directly on the board (the linux kernel is the one provided by MCSDK 3.1.4.7 and I loaded the tisdk-rootfs-k2hk-evm filesystem with NFS) and I got stuck with the same kind of error:

    fatal error: ti/ipc/MessageQ.h: No such file or directory

    Can you please attach the screen shot of the error ?
  • Hi!

    Sure, here is the full transcript:

    gcc -Wall -O2 -std=c99 -I. -D_GNU_SOURCE -c main.c -o main.o
    In file included from main.c:1:0:
    c66xx_consumer.h:5:29: fatal error: ti/ipc/MessageQ.h: No such file or directory
    compilation terminated.
    Makefile:19: recipe for target 'main.o' failed
    make: *** [main.o] Error 1

    The Makefile (on the board) is as follow (extracted from the image processing demo):

    RM = rm -f
    CC = $(CROSS_COMPILE)gcc
    LD = $(CC)
    
    TARGET = c66xx_consumer
    OBJS = main.o c66xx_consumer.o
    
    CFLAGS := -Wall -O2 -std=c99 -I. -D_GNU_SOURCE
    LFLAGS := -lpthread -ltitransportrpmsg -ltiipc -ltiipcutils
    
    .PHONY: all clean
    
    all: $(TARGET)
    
    $(TARGET): $(OBJS)
            $(LD) -o $@ $^ $(LDFLAGS)
    
    main.o: main.c
            $(CC) $(CFLAGS) -c $< -o $@
    
    c66xx_consumer.o: c66xx_consumer.c
            $(CC) $(CFLAGS) -c $< -o $@

    Thanks.

  • So I found the error with the cross-compilation: there was a conflict between xdc/runtime/std.h and ti/ipc/Std.h. The presence of xdc/runtime/std.h is my mistake, simply removing it resolve the problem. I also fixed the problem by setting -Dxdc_target_types__=gnu/targets/arm/std.h -Dxdc_target_name__=GCArmv5T and the right include path to xdc_tools while keeping the xdc dependency.

    To clarify, if anyone has trouble cross-compiling IPC-based applications on the ARM side of the keystone 2, the following steps might help:

    1. Cross-compile the IPC library and put the resulting libs in a custom directory. To do so, you need to first configure the package:

    ./configure --build=x86_64-unknown-linux-gnu \
    --host=arm-linux-gnueabihf\
    --prefix=/path/to/created/libs/directory\
     CC=/usr/bin/arm-linux-gnueabihf-gcc\
     PLATFORM=TCI6636\ 
     CMEM_INSTALL_DIR=\
     KERNEL_INSTALL_DIR=/path/to/the/linux-keystone/kernel\
     DRM_PREFIX= \
     AF_RPMSG=

    You need of course to update the parameters with the ones matching your system. Then you can simply run make and sudo make install to complete the package installation.

    NOTE : the two latest commands (make and make install) can yield compilation errors but as long as they happen during the compilation of the tests it's ok. My guess is that the test are compiled for the target system thus creating problems if cross-compiled.

    2. Compile your application by linking it to the previously created libraries (see image processing demo Makefile for example)


    PS: I still can't compile natively on the board (same issue as before) but I'm looking into it!

  • Hi Skinner,
    I'm glad that you were able to solve the problem.
    Thanks for the update.