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.

RTOS/AM5728: Rebuilding IPC and the IPC examples

Expert 1935 points
Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello,

I'm trying to rebuild the IPC and the IPC examples from sources.

When I use the pre-built libraries and packages that are provided with:

ti-processor-sdk-rtos-am57xx-evm-04.01.00.06
ti-processor-sdk-linux-am57xx-evm-04.01.00.06
it works out of the box.

For the development environment I've built IPC from sources, following the instructions form here:

http://processors.wiki.ti.com/index.php/IPC_Install_Guide_Linux 

(I also installed xdctools, cgt6000 and compiled sysbios)

This works well as long as I don't specify a CMEM_INSTALL_DIR. If I provided a CMEM_INSTALL_DIR (listed as optionally in the processor wiki page mentioned above) it fails:

/[..path..]/bin/arm-buildroot-linux-gnueabihf-gcc -DPACKAGE_NAME=\"TI\ IPC\" -DPACKAGE_TARNAME=\"ti-ipc\" -DPACKAGE_VERSION=\"3.0.0\" -DPACKAGE_STRING=\"TI\ IPC\ 3.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"ti-ipc\" -DVERSION=\"3.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -I.   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I../../../hlos_common/include -D_GNU_SOURCE -Wall -pthread  -I/[..path..]/share/ti-cmem/include -I[..path..]/build/linux-custom/include/generated/uapi  -I../../../linux/include -I../../../packages  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -MT GateMPApp.o -MD -MP -MF .deps/GateMPApp.Tpo -c -o GateMPApp.o `test -f '../../../linux/src/tests/GateMPApp.c' || echo './'`../../../linux/src/tests/GateMPApp.c
make[2]: *** No rule to make target '/[..path..]/share/ti-cmem/src/cmem/api/.libs/libticmem.a', needed by 'GateMPApp'.  Stop.

True, libticmem.a is not built by the cmem Makefile. (libticmem.la is built, not not the archived .a format).

Without CMEM_INSTALL_DIR GateMPApp.c is not built, so it doesn't fail.

If I just omit the CMEM_INSTALL_DIR I end up with an IPC installation, but compiling the ex02_messageq example fails with:

IpcMemory.loadSegment not found

Questions:

When should I specify the CMEM_INSTALL_DIR variable?

Is ex02_messageq compile error related to the missing CMEM_INSTALL_DIR reference?

What is the recommended workflow to create IPU and DSP binaries from sources?

Best regards,

Lo2

  • The RTOS team have been notified. They will respond here.
  • Lo2,

    libticmem.a should be under ludev/src/cmem/api/.libs. Some example/test cases use CMEM thus requires CMEM_INSTALL_DIR. ex02_messageq compile error should be unrelated to the missing CMEM_INSTALL_DIR reference.

    $ ls
    cmem.o libticmem.a libticmem.la libticmem.lai libticmem.so libticmem.so.1 libticmem.so.1.0.0

    Can you try to build cmem like this:
    $ ./configure --host=arm-linux-gnueabihf CC=/home/user/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc --prefix=/home/user/ludev/generate
    $ make; sudo make install

    Regards,
    Garrett
  • Hi Garret,

    thanks for your response.

    I set up a new, clean directory and installed:

    linux-4.9.41
    ti-cgt-6000
    ti-cgt-arm
    ti-cmem
    ti-ipc (+examples)
    ti-sysbios
    ti-xdctools

    I build cmem using the following commands:

    ./configure --host=arm-linux CC=/data/ti/e2e/host/bin/arm-linux-gcc --prefix=/data/ti/e2e/ti-cmem-install
    make; make install

    libticmem.a and libticmem.so are built.
    (I also built the kernel module)

    To build ipc I looked at www.ti.com/.../sprugo6e.pdf which seems outdated (2012?).
    So I followed the instructions on the wiki: processors.wiki.ti.com/.../IPC_Install_Guide_Linux

    I edit ti-ipc/products.mak (not ipc.mak as written in the UG) to match my paths:

    DEPOT = /data/ti/e2e/
    PLATFORM = DRA7XX
    DESTDIR = /data/ti/e2e/ti-ipc-install
    TOOLCHAIN_LONGNAME = arm-linux
    TOOLCHAIN_INSTALL_DIR = $(DEPOT)/host/
    TOOLCHAIN_PREFIX = $(TOOLCHAIN_INSTALL_DIR)/bin/$(TOOLCHAIN_LONGNAME)-
    KERNEL_INSTALL_DIR = $(DEPOT)/linux-4.9.41
    CMEM_INSTALL_DIR = $(DEPOT)/ti-cmem
    XDC_INSTALL_DIR = $(DEPOT)/ti-xdctools
    BIOS_INSTALL_DIR = $(DEPOT)/ti-sysbios
    ti.targets.elf.C66 = $(DEPOT)/ti-cgt-6000
    ti.targets.arm.elf.M4 = $(DEPOT)/ti-cgt-arm

    Build for Linux using:
    make -f ipc-linux.mak config
    make

    I encountered two minor issues:
    - the include path for the linux kernel headers needs a linux prefix (I added a symbolic link)
    - it picks libticmem.a from the path: $(CMEM_INSTALL_DIR)/src/cmem/api/.libs/libticmem.a instead of $(CMEM_INSTALL_DIR)/lib (I have now CMEM_INSTALL_DIR pointing to the src dir)

    make -f ipc-bios.mak all

    This takes a while, it builds the targets .interfaces, .libs, tests and fails due to an incompatible compiler version:
    I'm using sysbios 6_46_05_55 and cgt-6000 8.1.4.

    Details:
    js: "/data/ti/e2e/ti-xdctools/packages/xdc/cfg/Main.xs", line 167: Error: xdc.cfg.INCOMPATIBLE_TARGET_VERSION: the compiler version [] used by the current target 'ti.targets.elf.C66' is not compatible with compiler version of targets used to build the following packages; package ti.targets.rts6000 [in /data/ti/e2e/ti-sysbios/packages/ti/targets/rts6000/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.family.c64p [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c64p/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.knl [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/knl/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.gates [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/gates/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.syncs [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/syncs/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.hal [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/hal/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.family.c66 [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c66/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.xdcruntime [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/xdcruntime/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.heaps [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/heaps/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.family.shared.vayu [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/shared/vayu/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.timers.dmtimer [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/timers/dmtimer/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.rts.ti [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/rts/ti/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.family.c62 [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c62/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].
    ; package ti.sysbios.utils [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/utils/] was built using the target 'ti.targets.elf.C66' with compiler version [7.4.17].

    To continue I specified:
    environment['xdc.cfg.check.fatal'] = 'false';

    But that didn't help.

    So I rebuilt sysbios following the instructions in SPRUEX3R.pdf which seems up to date.

    Then I went back to ipc which continued until:

    js: "/data/ti/e2e/ti-xdctools/packages/xdc/cfg/Main.xs", line 167: Error: xdc.cfg.INCOMPATIBLE_TARGET_VERSION: the compiler version [] used by the current target 'ti.targets.elf.C66' is not compatible with compiler version of targets used to build the following packages; package ti.targets.rts6000 [in /data/ti/e2e/ti-sysbios/packages/ti/targets/rts6000/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.family.c64p [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c64p/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.knl [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/knl/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.gates [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/gates/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.syncs [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/syncs/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.hal [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/hal/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.deh [in /data/ti/e2e/ti-ipc/packages/ti/deh/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.family.c66 [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c66/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.xdcruntime [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/xdcruntime/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.heaps [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/heaps/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.family.shared.vayu [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/shared/vayu/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.timers.dmtimer [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/timers/dmtimer/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.rts.ti [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/rts/ti/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.family.c62 [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/family/c62/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].
    ; package ti.sysbios.utils [in /data/ti/e2e/ti-sysbios/packages/ti/sysbios/utils/] was built using the target 'ti.targets.elf.C66' with compiler version [8.1.4].

    So I tried a clean and rebuild

    [...wait, go for lunch,...]

    all files complete: Fre Okt 13 12:50:31 CEST 2017.

    :-)

    Building the examples form sources was not possible: the package ti.ipc.utils.genbundle is missing.
    So I copied the examples from the ti-processor-sdk-rtos and did:
    make clean ; make XDC_INSTALL_DIR=/data/ti/e2e/ti-xdctools/ DRA7XX_linux_elf all

    I boot the kernel, start the lad daemon, (the new firmware binaries are in /lib/firmware/dra7-xxxx-fw.*) load the modules (cmemk, rpmsg_proto, virtio_rpmsg_bus, omap_remoteproc, remoteproc, rpmsg_core) and get the following messages:

    [ 190.887362] omap-rproc 58820000.ipu: assigned reserved memory node ipu1_cma@9d000000
    [ 190.895234] remoteproc remoteproc0: 58820000.ipu is available
    [ 190.901374] omap-rproc 55020000.ipu: assigned reserved memory node ipu2_cma@95800000
    [ 190.909350] remoteproc remoteproc1: 55020000.ipu is available
    [ 190.915704] omap-rproc 40800000.dsp: assigned reserved memory node dsp1_cma@99000000
    [ 190.928134] remoteproc remoteproc2: 40800000.dsp is available
    [ 190.928486] remoteproc remoteproc1: powering up 55020000.ipu
    [ 190.928498] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 3830504
    [ 190.928591] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 190.939037] remoteproc remoteproc0: powering up 58820000.ipu
    [ 190.939049] remoteproc remoteproc0: Booting fw image dra7-ipu1-fw.xem4, size 3830504
    [ 190.939173] omap-iommu 58882000.mmu: 58882000.mmu: version 2.1
    [ 190.979872] remoteproc remoteproc2: powering up 40800000.dsp
    [ 190.985587] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4183048
    [ 190.986817] omap-rproc 58820000.ipu: mbox_request_channel failed: -517
    [ 190.986823] remoteproc remoteproc0: can't start rproc 58820000.ipu: -16
    [ 190.993901] omap-rproc 41000000.dsp: assigned reserved memory node dsp2_cma@9f000000
    [ 190.994011] remoteproc remoteproc3: 41000000.dsp is available
    # [ 191.028732] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 191.034632] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 191.040599] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 191.049878] omap-rproc 55020000.ipu: mbox_request_channel failed: -517
    [ 191.056471] remoteproc remoteproc1: can't start rproc 55020000.ipu: -16
    [ 191.068484] omap-rproc 40800000.dsp: mbox_request_channel failed: -517
    [ 191.075046] remoteproc remoteproc2: can't start rproc 40800000.dsp: -16
    [ 191.094572] omap_hwmod: mmu1_dsp1: _wait_target_disable failed
    [ 191.107507] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 191.119400] remoteproc remoteproc3: powering up 41000000.dsp
    [ 191.125099] remoteproc remoteproc3: Booting fw image dra7-dsp2-fw.xe66, size 4039996
    [ 191.139807] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
    [ 191.145701] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0
    [ 191.151622] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0
    [ 191.165661] omap-rproc 41000000.dsp: mbox_request_channel failed: -517
    [ 191.172248] remoteproc remoteproc3: can't start rproc 41000000.dsp: -16
    [ 191.190703] omap_hwmod: mmu1_dsp2: _wait_target_disable failed
    [ 191.203296] omap_hwmod: mmu0_dsp2: _wait_target_disable failed


    Questions:
    - Where can I find the current Users Guide for IPC?
    - the lad_dra7xx daemon is built but not installed. Should I copy it manually?
    - Is it ok to rebuild sysbios with the c6000 compiler 8.1.4?
    - Rebuilding examples: where should genbundle come from?
    - Is it safe to pick the examples from the ti-processor-sdk-rtos? (e.g. compiler versions)
    - Is there a way to parallelize the build? Is it safe to use make -j XX?
    - What causes the kernel message "mbox_request_channel failed: -517"? Is it a devicetree issue?

    Best regards,
    Lo2
  • Hi Lo2,

    - Where can I find the current Users Guide for IPC?
    processors.wiki.ti.com/.../IPC_Users_Guide

    - the lad_dra7xx daemon is built but not installed. Should I copy it manually?
    The daemon should be in Linux file system already. Unless you modified the source code, you don't have to install it.

    - Is it ok to rebuild sysbios with the c6000 compiler 8.1.4?
    The sysbios should not need to be re-built. Did you try the recommend compiler 8.1.3: processors.wiki.ti.com/.../Processor_SDK_RTOS_Release_Notes

    - Rebuilding examples: where should genbundle come from?
    Do you still have the build log for the error? genbundle?

    - Is it safe to pick the examples from the ti-processor-sdk-rtos? (e.g. compiler versions)
    Yes.

    - Is there a way to parallelize the build? Is it safe to use make -j XX?
    I think you may try to build in Linux farm. But we typically just build with no parallelism as it's one time effort.

    - What causes the kernel message "mbox_request_channel failed: -517"? Is it a devicetree issue?
    Which example were you running? do you have issue to boot up Linux with default file system that has IPC example pre-installed?

    Regards,
    Garrett
  • Hi Garret,

    Thanks for the link to the Users Guide. I'll have to dump snapshot for our documentation then.

    Meanwhile I resolved my issues:
    - I've managed to build the lad_dra7xx daemon
    - I recompiled sysbios for C6000 using the cgt-6000 version 8.1.4, seems ok.
    - I've rebuilt the examples from the rtos SDK (and meanwhile my own test code)

    It took me a while (mostly reading docs) to figure out how all the pieces fit together.
    I still don't build in parallel, but that's ok. As you pointed out it's not something you do everyday anyway. (Once you have a working set up)

    Regarding the mbox request channel failed message: It was a device tree issue as my board is based on a 3rd party module, I had to modify the module's device tree. The mbox setup was wrong.
    That also explains why it worked on the SDK (although there I used pre-built binaries).

    Best regards,
    Lo2
  • Thanks for the update Lo2. I will mark the thread as closed.

    Regards,
    Garrett