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.

TMS320C6748: Build SPI Loopback example and modify to work in Master/Slave mode

Part Number: TMS320C6748
Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hello,

When I Install  pdk_omapl138_1_0_3 sdk and run spi looback example I get the following error. I am using ccs 6.0.0.00190.

Description : #20 identifier "Error_IGNORE" is undefined  

  Resource  :.ccsproject

   Path         : /SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProject 

            Location   :  line 483, external location: C:\ti\bios_6_52_00_12\packages\ti\sysbios\knl\Swi.c  

  Type : C/C++ Problem

ERROR:


"c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/spi_test.cfg'
'Invoking: XDCtools'
"c:/ti/xdctools_3_30_01_25_core/xs" --xdcpath="C:/ti/bios_6_52_00_12/packages;C:/ti/pdk_omapl138_1_0_3/packages;C:/ti/edma3_lld_2_12_05_30B/packages;C:/ti/ipc_3_47_00_00/packages;C:/ti/ndk_2_26_00_08/packages;C:/ti/uia_2_21_02_07/packages;c:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C674 -p ti.platforms.evmOMAPL138 -r debug -c "c:/ti/ccsv6/tools/compiler/c6000_7.4.7" "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/spi_test.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring spi_test.xe674 from package/cfg/spi_test_pe674.cfg ...
generating custom ti.sysbios library makefile ...
    Linking with library ti.drv.uart:./lib/omapl138/c674/release/ti.drv.uart.ae674
    Linking with library ti.drv.spi:./lib/omapl138/c674/release/ti.drv.spi.ae674
    Linking with library ti.board:./lib/lcdkOMAPL138/c674/release/ti.board.ae674
    Linking with library ti.csl:./lib/omapl138/c674/release/ti.csl.ae674
    Linking with library ti.osal:./lib/tirtos/omapl138/c674/release/ti.osal.ae674
Starting build of library sources ...
making C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios/sysbios.ae674 ...
gmake[1]: Entering directory `C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios'
cle674 C:/ti/bios_6_52_00_12/packages/ti/sysbios/BIOS.c ...
"C:/ti/bios_6_52_00_12/packages/ti/sysbios/knl/Swi.c", line 483: error #20: identifier "Error_IGNORE" is undefined

>> Compilation failure
1 error detected in the compilation of "C:/ti/bios_6_52_00_12/packages/ti/sysbios/knl/Swi.c".
gmake[1]: *** [BIOS.obj] Error 1
gmake[1]: Leaving directory `C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios'
gmake: *** [C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios/sysbios.ae674] Error 2
Build of libraries failed.
error: xdc.cfg.SourceDir: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/cfg/SourceDir.xs", line 184: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:

js: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/cfg/Main.xs", line 159: Error: Configuration failed!
gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Error 1
gmake.exe: *** Deleting file `package/cfg/spi_test_pe674.xdl'
gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Deleting file `package/cfg/spi_test_pe674.h'
gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Deleting file `package/cfg/spi_test_pe674.c'
js: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
gmake: *** [configPkg/linker.cmd] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

Thanks & Regards

Navaneetha krishnan

  • Hi,

    Can you try updating the CCS?

    Best Regards
    Yordan
  • I updated ccs v8 but still I am getting the following error.


    **** Build of configuration Debug for project SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProject ****

    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k all
     
    Building file: "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/src/main_spi_loopback_example.c"
    Invoking: C6000 Compiler
    "C:/ti/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6740 --abi=eabi --include_path="C:/ti/ti-cgt-c6000_8.2.2/include" --include_path="C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi" --include_path="C:/ti/pdk_omapl138_1_0_3/packages" --include_path="/packages" --define=SOC_OMAPL138 --define=LCDK_OMAPL138 --define=USE_BIOS --define=lcdkOMAPL138 -g --diag_suppress=1111 --diag_suppress=827 --diag_suppress=824 --diag_suppress=837 --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77 --diag_suppress=232 --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main_spi_loopback_example.d_raw" --cmd_file="configPkg/compiler.opt" "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/src/main_spi_loopback_example.c"
     
    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'main_spi_loopback_example.obj' failed
    "C:/ti/xdctools_3_30_01_25_core/packages/xdc/cfg/global.h", line 39: fatal error #1965: cannot open source file "C:/ti/pdk_omapl138_1_0_3/packages/MyExampleProjects/SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProject/Debug/configPkg/package/cfg/spi_test_pe674.h"
    1 catastrophic error detected in the compilation of "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/src/main_spi_loopback_example.c".
    Compilation terminated.
    gmake: *** [main_spi_loopback_example.obj] Error 1
    Building file: "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/spi_test.cfg"
    Invoking: XDCtools
    "C:/ti/xdctools_3_30_01_25_core/xs" --xdcpath="C:/ti/bios_6_52_00_12/packages;C:/ti/pdk_omapl138_1_0_3/packages;C:/ti/edma3_lld_2_12_05_30B/packages;C:/ti/ipc_3_47_00_00/packages;C:/ti/ndk_2_26_00_08/packages;C:/ti/uia_2_21_02_07/packages;C:/ti/ccsv8/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C674 -p ti.platforms.evmOMAPL138 -r debug -c "C:/ti/ti-cgt-c6000_8.2.2" "C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/spi_test.cfg"
    configuring spi_test.xe674 from package/cfg/spi_test_pe674.cfg ...
    generating custom ti.sysbios library makefile ...
        Linking with library ti.drv.uart:./lib/omapl138/c674/release/ti.drv.uart.ae674
        Linking with library ti.drv.spi:./lib/omapl138/c674/release/ti.drv.spi.ae674
        Linking with library ti.board:./lib/lcdkOMAPL138/c674/release/ti.board.ae674
        Linking with library ti.csl:./lib/omapl138/c674/release/ti.csl.ae674
        Linking with library ti.osal:./lib/tirtos/omapl138/c674/release/ti.osal.ae674
    Starting build of library sources ...
    making C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios/sysbios.ae674 ...
    gmake[1]: Entering directory `C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios'
    cle674 C:/ti/bios_6_52_00_12/packages/ti/sysbios/BIOS.c ...
    remark #24038-D: --optimize_with_debug is deprecated and will be removed in a
       subsequent release. The behavior is enabled by default.
     
    >> Compilation failure
    gmake[1]: Leaving directory `C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios'
    Build of libraries failed.
    subdir_rules.mk:19: recipe for target 'build-668936769-inproc' failed
    "C:/ti/bios_6_52_00_12/packages/ti/sysbios/knl/Swi.c", line 483: error #20: identifier "Error_IGNORE" is undefined
    1 error detected in the compilation of "C:/ti/bios_6_52_00_12/packages/ti/sysbios/knl/Swi.c".
    gmake[1]: *** [BIOS.obj] Error 1
    gmake: *** [C:/ti/pdk_omapl138_1_0_3/packages/ti/drv/spi/example/spiLoopback/omapl138/c674/bios/src/sysbios/sysbios.ae674] Error 2
    error: xdc.cfg.SourceDir: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/cfg/SourceDir.xs", line 184: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:
     
    js: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/cfg/Main.xs", line 159: Error: Configuration failed!
    xdctools_3_30_01_25_core\gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Error 1
    xdctools_3_30_01_25_core\gmake.exe: *** Deleting file `package/cfg/spi_test_pe674.xdl'
    xdctools_3_30_01_25_core\gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Deleting file `package/cfg/spi_test_pe674.h'
    xdctools_3_30_01_25_core\gmake.exe: *** [package/cfg/spi_test_pe674.xdl] Deleting file `package/cfg/spi_test_pe674.c'
    js: "C:/ti/xdctools_3_30_01_25_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake[1]: *** [build-668936769-inproc] Error 1
    gmake: *** [build-668936769] Error 2
    subdir_rules.mk:16: recipe for target 'build-668936769' failed
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

  • The RTOS team have been notified. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Hi Navaneetha,

    Your project is pointing to the wrong version of XDCtools. It should be pointing to xdctools_3_50_03_33. You can change this by going to Project Properties->General->Products as shown below.

  • Dear Sahin Okur,

    Thanks for your valuable support.

    Now my spi loopback  example is working. Now I want to disable the loopback mode and want to communicate with the

    CAN chip. To do this I disabled the following code in the example.

    SPI_control(hwHandle,SPI_V0_CMD_LOOPBACK,(void *) &loop);

    But when I run the example SPI is disabled in the SPIGCR1 registry.

    Kindly help me to configure the SPI without loopback mode.

    Thanks

    Navaneetha krishnan

  • Hi Navaneetha,

    If the ENABLE bit is not set in the SPIGCR register, make sure you have the following line in your code before calling SPI_transfer.

    SPI_control(spiHandle, SPI_V0_CMD_XFER_ACTIVATE, (void *) &xferEnable);     (xferEnable=1)

    This API will set the ENABLE bit and activate the transfer. The example should have this line already though so make sure you did not accidentally remove this line when removing the SPI_control loopback call. 

  • Dear Sahin, No this line is already there. The same code is working fine for When I change to SPI1. I seen a similar query in the this same forum.

    kindly let me know what is possible solution for this. I have to use both the spi ports.

  • Hi Navaneetha,

    Are you using a lcdkC6748 or a custom board?

    In any case, I have an lcdkC6748 board that I'll test this on and see if I can reproduce the issue. I will let you know what I find.
  • Hi Navaneetha,

    I think the reason may be due to the pinmux configuration. By default, the lcdk board is pinmuxed for EMAC RX for interfacing with the PHY. You can check this by viewing the PINMUX3 register of the SYSCFG module in your register window after the Board_init call.

    To modify the pinmux you can either change the code in lcdkOMAPL138_pinmux.c found in pdk/packages/ti/board/src/lcdkOMAPL138/ and rebuild the board library or you can add the following code to your application after Board_init.

    #include <ti/board/src/lcdkOMAPL138/include/board_internal.h>
    
    #include <ti/csl/csl_syscfg.h>
    
     hSysCfg->PINMUX3 &= (~(CSL_SYSCFG_PINMUX3_PINMUX3_3_0_MASK |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_7_4_MASK   |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_11_8_MASK  |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_15_12_MASK |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_19_16_MASK |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_23_20_MASK |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_27_24_MASK |
    
                                CSL_SYSCFG_PINMUX3_PINMUX3_31_28_MASK ));
    
           hSysCfg->PINMUX3 |= 0x88181111;
  • Dear Sahin,

    Now the SPI is enabled in master mode. But still I didnt get SPI clock signal from SPI_CLK pin.

    Kindly suggest us what could be the problem.

    Thanks & Regards

    Navaneetha krishnan

  • Hi Navaneetha,

    The SPI0 pins are connected to the PHY on the LCDK board. You will need to disconnect this by removing resistors R178, R179, R184, and the resistor for whichever CS pin you are using. Refer to page 11 of the schematic to see exactly which resistors need to removed.You may also need to remove the pull up resistors going to the SPI0 pins (also seen on page 11).

  • Dear sahin,

    I already removed that. The same SPI0 in LCDK board  is working fine with starterware SDK. The  SPI1 is working fine with pdk_omapl138_1_0_3.

    Kindly share me the working code for SPI0 using pdk_omapl138_1_0_3.

  • Hi Navaneetha,

    Please see the attached examples for master and slave operation on SPI port 0. These are based on the SPI loopback example and have been verified on the lcdkOMAPL138/lcdkC6748.

    /cfs-file/__key/communityserver-discussions-components-files/791/8865.SPI_5F00_lcdkOMAPL138_5F00_c674xExampleProject.zip