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.

DRA75: Adding IPC to RTOS examples

Part Number: DRA75
Other Parts Discussed in Thread: SYSBIOS

Hi,

I am trying to add IPC to the MyExampleProjects created on running ./pdkProjectCreate.sh. This is done so that I can add the resource table and create an executable by building the example in CCS. I have followed the steps from the link  in which i'm trying to add IPC to IPU. The example I have tried to build is I2C_BasicExample_evmDRA75x_m4ExampleProject by including the procedures mentioned in the link but the CCS comes up with build errors. What might be the issue ? I have skipped the UART portions explained in the link since its not useful for this example.

Regards,

Padmesh

  • Hi Padmesh,

    Can you please attach a log of the errors you are facing? Hopefully that will give us a clue as to what is the problem.

    Thanks,
    Stephen
  • Hi Stephan,

    This is the log generated ,


    **** Build of configuration Debug for project I2C_BasicExample_evmDRA75x_m4ExampleProject ****

    /home/tel/ti/ccsv7/utils/bin/gmake -k -j 4 all -O
     
    Building file: "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/dra7xx/m4/bios/i2c_m4_example.cfg"
    Building file: "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/src/main_eeprom_read.c"
    Invoking: ARM Compiler
    "/home/tel/ti/ti-cgt-arm_16.9.3.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=vfplib -me --include_path="/home/tel/ti/pdk_dra7xx_1_0_10/packages/MyExampleProjects/I2C_BasicExample_evmDRA75x_m4ExampleProject" --include_path="/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c" --include_path="/home/tel/ti/ti-cgt-arm_16.9.3.LTS/include" --define=CORE_NUM=0 --define=IPU_NUM=1 --define=MAKEFILE_BUILD --define=SOC_DRA75x --define=evmDRA75x --define=DRA7XX_FAMILY_BUILD --define=ti_targets_arm_elf_M4 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --super_quiet --abi=eabi --preproc_with_compile --preproc_dependency="main_eeprom_read.d_raw" --cmd_file="configPkg/compiler.opt" "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/src/main_eeprom_read.c"

    >> Compilation failure
    subdir_rules.mk:50: recipe for target 'main_eeprom_read.obj' failed
    "/home/tel/ti/xdctools_3_50_03_33_core/packages/xdc/cfg/global.h", line 39: fatal error #1965: cannot open source file "/home/tel/ti/pdk_dra7xx_1_0_10/packages/MyExampleProjects/I2C_BasicExample_evmDRA75x_m4ExampleProject/Debug/configPkg/package/cfg/i2c_m4_example_pem4.h"
    1 catastrophic error detected in the compilation of "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/src/main_eeprom_read.c".
    Compilation terminated.
    gmake: *** [main_eeprom_read.obj] Error 1
    Invoking: XDCtools
    "/home/tel/ti/xdctools_3_50_03_33_core/xs" --xdcpath="/home/tel/ti/bios_6_52_00_12/packages;/home/tel/ti/pdk_dra7xx_1_0_10/packages;/home/tel/ti/ipc_3_47_01_00/packages;/home/tel/ti/ccsv7/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4 -p ti.platforms.evmDRA7XX -r debug -b "/home/tel/ti/pdk_dra7xx_1_0_10/packages/MyExampleProjects/I2C_BasicExample_evmDRA75x_m4ExampleProject/config.bld" -c "/home/tel/ti/ti-cgt-arm_16.9.3.LTS" --cfgArgs "{SOC:\"dra75x\", BOARD:\"evmDRA75x\"}" "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/dra7xx/m4/bios/i2c_m4_example.cfg"
    configuring i2c_m4_example.xem4 from package/cfg/i2c_m4_example_pem4.cfg ...
    # !!!  Current soc is [dra75x] !!!
    # !!!  Current board is [evmDRA75x] !!!
    subdir_rules.mk:38: recipe for target 'build-842617441-inproc' failed
    js: "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/dra7xx/m4/bios/i2c_m4_example.cfg", line 271: Error: utils.loadCapsule: can't find 'undefined' along the path '/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/dra7xx/m4/bios;/home/tel/ti/bios_6_52_00_12/packages;/home/tel/ti/pdk_dra7xx_1_0_10/packages;/home/tel/ti/ipc_3_47_01_00/packages;/home/tel/ti/ccsv7/ccs_base;/home/tel/ti/xdctools_3_50_03_33_core/packages;..;'
        "./package/cfg/i2c_m4_example_pem4.cfg", line 181
    gmake: *** [package/cfg/i2c_m4_example_pem4.xdl] Error 1
    js: "/home/tel/ti/xdctools_3_50_03_33_core/packages/xdc/tools/Cmdr.xs", line 52: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake[1]: *** [build-842617441-inproc] Error 1
    gmake: *** [build-842617441] Error 2
    subdir_rules.mk:35: recipe for target 'build-842617441' failed
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

  • Padmesh,

    Please share the changes you've made to i2c_m4_example.cfg. It looks like you are trying to load a capsule but the script is not able to resolve it's location.

    Thanks,
    Stephen
  • Hi Stephan,

    Changes made to i2c_m4_example.cfg are,

    • Copying the entire Ipu.cfg from messageq example.
    • Addition of var Program = xdc.useModule('xdc.cfg.Program'); to the beginning.
    • Commenting BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
    • Changin,
      • var ipc_cfg = xdc.loadCapsule("../shared/ipc.cfg.xs"); to var ipc_cfg = xdc.loadCapsule("../ipc.cfg.xs");
      • Program.stack = 0x1000; to Program.stack = 0x8000;
    • Commenting out the entire TICK section.
    • Adding the following lines to the end of the file,
    /* Override the default resource table with my own */
    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
    Resource.customTable = true;

    Regards,

    Padmesh

  • Hi Padmesh,

    I'm particularly concerned with this line:

    js: "/home/tel/ti/pdk_dra7xx_1_0_10/packages/ti/drv/i2c/example/eeprom_read/dra7xx/m4/bios/i2c_m4_example.cfg", line 271: Error: utils.loadCapsule: can't find 'undefined' along the path 

    Is this the xdc.loadCapsule("../ipc.cfg.xs"); line?  If so, have you copied this file over to your project directory?  If not, then can you share what is happening on line 271, with a few lines of context? 

    Thanks,
    Stephen

  • Hi Stephen,

    The code at line 271 is var configBld = xdc.loadCapsule(cfgArgs.configBld);

    The surrounding few lines of text are below,

    /*
     *  ======== Ipu2.cfg ========
     *  Platform: DRA7XX_linux_elf
     *  Target: ti.targets.arm.elf.M4
     */

    /* root of the configuration object model */
    var Program = xdc.useModule('xdc.cfg.Program');

    /* build arguments for this executable */
    var cfgArgs = Program.build.cfgArgs;
    var configBld = xdc.loadCapsule(cfgArgs.configBld);

    /* application uses the following modules and packages */
    xdc.useModule('xdc.runtime.Assert');
    xdc.useModule('xdc.runtime.Diags');
    xdc.useModule('xdc.runtime.Error');
    xdc.useModule('xdc.runtime.Log');
    xdc.useModule('xdc.runtime.Registry');

    xdc.useModule('ti.sysbios.gates.GateHwi');
    xdc.useModule('ti.sysbios.knl.Semaphore');
    xdc.useModule('ti.sysbios.knl.Task');

    /*
     *  ======== IPC Configuration ========
     */
    xdc.useModule('ti.ipc.ipcmgr.IpcMgr');

    Program.global.procName = "IPU2";
    var ipc_cfg = xdc.loadCapsule("../ipc.cfg.xs");

    var BIOS        = xdc.useModule('ti.sysbios.BIOS');
    //BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');

    /*

    Regards,

    Padmesh

  • Hi Stephen,

    By commenting out the lines ,

    var cfgArgs = Program.build.cfgArgs;
    var configBld = xdc.loadCapsule(cfgArgs.configBld);

    from the above code, I was able get the .out file. I have built the code using ti.platforms.evmDRA7XX:ipu2

    But on trying to load the program to IPU2 core , it shows the following in the console :

    Cortex_M4_IPU2_C0: File Loader: Verification failed: Values at address 0x00013FE0 do not match Please verify target memory and memory map.
    Cortex_M4_IPU2_C0: GEL: File: /home/tel/ti/pdk_dra7xx_1_0_10/packages/MyExampleProjects/I2C_BasicExample_evmDRA75x_m4ExampleProject/Debug/I2C_BasicExample_evmDRA75x_m4ExampleProject.out: a data verification error occurred, file load failed.

    Regards,
    Padmesh

  • Hi Padmesh,

    I think I see what is going on here. One of the steps in the link you provided originally was to copy the config.bld from the IPC example directory to your directory. This is the file which is responsible for defining the memory map for the application build. However, the link is missing one step: you must set the configBld variable in your configuration arguments. Since you don't set this but are referencing in the script, you get the 'undefined' error you show above.

    Go to Project Properties -> Build -> XDCtools -> Advanced Options. In the field Configuration script arguments (--cfgArgs) you'll see a few values already set. Please add another comma separated entry inside of the braces: "configBld: <location_of_config.bld>"

    Thanks,
    Stephen
  • Hi Stephen,

    As mentioned I have provided it as configBld:"../config.bld" also uncommented the lines and is able to get the .out file.

    But still the verificatipn failed error occurs.

    Regards,

    Padmesh

  • Padmesh,

    I do recall now that IPC examples use a custom memory map which require special AMMU settings, so they are not able to be loaded by CCS directly as the GEL files configure AMMU with some other settings.  If you see in config.bld, the code will be placed accordingly:

    /* Memory Map for ti.platforms.evmDRA7XX:ipu2
     *
     * --- External Memory ---
     * Virtual     Physical        Size           Comment
     * ------------------------------------------------------------------------
     * 0000_4000   ????_????    5F_C000  ( ~6 MB) EXT_CODE
     * 8000_0000   ????_????    60_0000  (  6 MB) EXT_DATA
     * 8060_0000   ????_????   960_0000  ( 86 MB) EXT_HEAP

    In the TRM, this physical address is part of the L3_MAIN space.  Therefore, we need AMMU entries to map this virtual address so that we are actually loading the code to the proper physical location.  This is handled by 

    At this point, if you have a .out file with memory in the locations shown in config.bld and the resource table has been integrated into the binary, you should be able to load the firmware through Linux remoteproc driver.

    Thanks,
    Stephen

  • Hi Stephen,

    I couldn't follow the line "This is handled by" is there any link afterwards.

    Regards,

    Padmesh

  • Hi Padmesh,

    Sorry, there was a typo in my last post - I didn't finish the sentence...  I meant to say "This is handled by the Linux kernel when loading the firmware binary through remoteproc"

    Please refer to the IPC examples loading procedure from http://processors.wiki.ti.com/index.php?title=Processor_SDK_Linux_Automotive_Software_Developers_Guide#Running_IPC_examples.  You should be able to follow similarly for the custom app you have created.

    Thanks,
    Stephen

  • Hi Stephen,

    By loading through remoteproc, you mean is to load the firmware through an sd card ?
    I was successful in executing an early boot with emac basic example integrated with ipc example loaded through sd card where in I had previously encountered an issue of resource table which was solved here and the executable is read successfully.
    But the issue now is I am not able to see the output which was previously shown by the .out file without ipc.
    On adding the IPC to EMAC example what could have prevented it from showing the blinking output on connecting the ethernet.

    Regards,
    Padmesh

  • Hi Padmesh,

    Since you have opened a separate thread with the new issues you are facing, can you please mark this thread as resolved so that we can close and have for future reference?  I will reply to the last questions on the new thread.

    Thanks,
    Stephen