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.

CCS/TMS320C6748: TMS320C6748 LCDK

Part Number: TMS320C6748
Other Parts Discussed in Thread: CDCE913, TVP5147

Tool/software: Code Composer Studio

Mr. Rahul :

I add the following content in the vpif_lcd_loopback.c file ,


//// add the following 2017-07-11

if( VLIB_cache_init())
{

VLIB_memError("VLIB_Canny_Edge_Detection");

}
else
{

//// VLIB_Canny_Edge_Detection_d-aa(0);


canny_getTestParams(&prm, &test_cases);

/* Initialize profiling */
VLIB_profile_init(2, "VLIB_Canny_Edge_Detection");

/* Run each test case */
for( tpi=0; tpi < test_cases; tpi++ )
{

/* Initialize status flags */
int32_t status_nat_vs_int = vlib_KERNEL_PASS; /* Test status : Natural c vs. Optimized */
int32_t status_nat_vs_ref = vlib_KERNEL_PASS; /* Test status : Natural c vs. Static Reference */

/* Compute buffer sizes */
uint32_t bufferSize = prm[tpi].width * prm[tpi].height;

/* Allocate buffers for each test vector */
uint8_t *pInput = (uint8_t *) VLIB_malloc(bufferSize * sizeof(uint8_t));
int16_t *pBufGradX = (int16_t *) VLIB_malloc(bufferSize * sizeof(int16_t));
int16_t *pBufGradY = (int16_t *) VLIB_malloc(bufferSize * sizeof(int16_t));
int16_t *pBufMag = (int16_t *) VLIB_malloc(bufferSize * sizeof(int16_t));
uint8_t *pScratch = (uint8_t *) VLIB_malloc(bufferSize * sizeof(uint8_t));
uint8_t *pBufOut = (uint8_t *) VLIB_malloc(bufferSize * sizeof(uint8_t));
uint8_t *pBufOut_cn = (uint8_t *) malloc(bufferSize * sizeof(uint8_t));
int32_t numItems;
int32_t numItems_cn;

/* Only run the test if the buffer allocations fit in the heap */
if( pInput && pBufGradX && pBufGradY && pBufMag && pScratch && pBufOut && pBufOut_cn )
{
uint32_t fail;

/* Fill input arrays according to desired test pattern */
VLIB_fillBuffer(prm[tpi].testPattern,
(uint8_t)127,
pInput, prm[tpi].input,
prm[tpi].width, prm[tpi].height, prm[tpi].width,
sizeof(uint8_t), testPatternString);

/* initialize memory */
memset(pBufGradX, 0, bufferSize * sizeof(int16_t));
memset(pBufGradY, 0, bufferSize * sizeof(int16_t));
memset(pBufMag, 0, bufferSize * sizeof(int16_t));
memset(pBufOut, 0, bufferSize * sizeof(uint8_t));
memset(pScratch, 0, bufferSize * sizeof(uint8_t));

/* Test optimized kernel */
VLIB_profile_start(vlib_KERNEL_OPT);
}
}

}

//// add the above 2017-07-11


then Project-> Build Project

the following appear in the Console window ,

<Linking>
error: symbols in the reserved far sections cannot be accessed as near; symbol
"act_kernel" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_test.oe674>

(.far)" is accessed as near in the section "./vpif_lcd_loopback.obj(.text)"
>> Compilation failure
error: symbols in the reserved far sections cannot be accessed as near; symbol
"beg_count" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_profile.oe6
74>(.far)" is accessed as near in the section
"./vpif_lcd_loopback.obj(.text)"
error: symbols in the reserved far sections cannot be accessed as near; symbol
"beg_count" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_profile.oe6
74>(.far)" is accessed as near in the section
"./vpif_lcd_loopback.obj(.text)"
error: symbols in the reserved far sections cannot be accessed as near; symbol
"test_cases" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_test.oe674>
(.fardata)" is accessed as near in the section
"./vpif_lcd_loopback.obj(.text)"
error: symbols in the reserved far sections cannot be accessed as near; symbol
"test_cases" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_test.oe674>
(.fardata)" is accessed as near in the section
"./vpif_lcd_loopback.obj(.text)"
error: symbols in the reserved far sections cannot be accessed as near; symbol
"test_cases" in the far section
"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_test.oe674>
(.fardata)" is accessed as near in the section
"./vpif_lcd_loopback.obj(.text)"
warning: creating output section ".sram_start" without a SECTIONS
specification

undefined first referenced
symbol in file
--------- ----------------
_sram_start C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_memory.oe674>
canny_getTestParams ./vpif_lcd_loopback.obj

error: unresolved symbols remain
error: errors encountered during linking; "vpif_lcd_loopback.out" not built
gmake: *** [vpif_lcd_loopback.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****


What can I do ?
Waiting for your helpful message .
Good Luck !

Zhangbin , Alex .

  • Alex,

    Most likely, you need to set the --mem_model compiler switch to far or far_aggregate. You can read about that switch and the settings in the Compiler User Guide.

    Regards,
    RandyP
  • I will try again according to your command . Thanks !
  • Mr. :

    Now I use  Code Composer Studio , Version: 5.1.1.00031 

    I can not find where to set the --mem_model ,.

    can you give me some more suggestions in detail ?

    Or how can I get a web-site link , or a file , to tell me ,  how to set the --mem_model compiler switch to far ?

    Waiting for your response .

    Good Luck !

    Zhangbin , Alex .

  • Alex,

    Unfortunately, I am using CCSv7. My compiler revision is also likely different from yours.

    But please find the version of your Compiler Tools and the correct version of the Optimizing C/C++ Compiler User Guide for your compiler. You can browse through the many compiler switches to find the exact compiler switch - it may be an older and simpler format. But there will be a switch related to the memory model. It will be important to understand what the memory model setting does by reading the specific details. Changes to the memory model can affect the performance, but also can affect the build process as is your case.

    To be honest, when I am trying to remember some compiler switches that I do not use very often, I will go to the project Properties dialog box in CCS, select the Compiler or even the Linker, and will look at every item that can be selected and all the switches that are shown. This is the way I learn what is available or refresh my memory of a particular switch's syntax. That may be easier than using the Compiler User Guide, but both will be informative.

    Regards,
    RandyP
  • Errors ( 5 items)

    errors encountered during linking; "vpif_lcd_loopback.out" not built


    symbols in the reserved far sections cannot be accessed as near; symbol


    unresolved symbol _sram_start, first referenced in C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_memory.oe674>


    unresolved symbol canny_getTestParams, first referenced in ./vpif_lcd_loopback.obj


    unresolved symbols remain





    the above are errors I meet after I Project -> Build Project .
  • Mr. RandyP :

    According to Project -> Properties -> Build -> C6000 Compiler -> Runtime Model Options -> Const Access Model , I select " far " option , and Data Access Model , I select " far " option .
    Am I right ?

    But still appear five errors after I Project -> Build Project , as following :

    Errors ( 5 items)

    errors encountered during linking; "vpif_lcd_loopback.out" not built


    symbols in the reserved far sections cannot be accessed as near; symbol


    unresolved symbol _sram_start, first referenced in C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.ae674<VLIB_memory.oe674>


    unresolved symbol canny_getTestParams, first referenced in ./vpif_lcd_loopback.obj


    unresolved symbols remain
  • It looks like you are not using the lnk.cmd that comes with the example projects. Please refer to the lnk.cmd file that is in the vlib_c674x_3_3_0_3\packages\ti\vlib\src\common\c64P folder.


    You are probably missing the following line from your lnk.cmd file:

    .sram_start START(_sram_start) > L2_SRAM NOINIT
  • Mr. Jesse Villarreal :

    Now I use the example project under directory

    pkd_C6748_2_0_0_0 / C6748_StarterWare_1_20_03_03 / examples / lcdkC6748 /

    vpif_lcd_loopback , Under pkd_C6748_2_0_0_0 direcroty and its subdirectory , there is no lnk.cmd , but has vpif_lcd_loopback.cmd .


    the content of file vpif_lcd_loopback.cmd is as following before I modify it :

    //

    ============================================================================
    // Linker Command File for Linking c674 DSP Programs
    //
    // These linker options are for command line linking only. For IDE linking,
    // you should set your linker options in Project Properties.
    // -c Link Using C Conventions
    // -stack 0x1000 Software Stack Size
    // -heap 0x1000 Heap Area Size
    // ===========================================================================
    -stack 0x1000
    -heap 0x1000

    //

    ============================================================================
    // Specify the System Memory Map
    //

    ============================================================================
    MEMORY
    {
    L1P: o = 0x11E00000 l = 0x00008000
    L1D: o = 0x11F00000 l = 0x00008000
    L2: o = 0x11800000 l = 0x00040000
    DDR2: o = 0xC0000000 l = 0x08000000
    }

    //

    ============================================================================
    // Specify the Sections Allocation into Memory
    //

    ============================================================================
    SECTIONS
    {


    .cinit > DDR2 // Initialization Tables
    .pinit > DDR2 // Constructor Tables
    .init_array > DDR2 //
    .binit > DDR2 // Boot Tables
    .const > DDR2 // Constant Data
    .switch > DDR2 // Jump Tables
    .text > DDR2 // Executable Code
    .text:_c_int00: align=1024 > DDR2 // Entrypoint

    GROUP (NEARDP_DATA) // group near data
    {
    .neardata
    .rodata
    .bss // note: removed fill = 0
    } > DDR2
    .far: fill = 0x0, load > DDR2 // Far Global & Static Variables
    .fardata > DDR2 // Far RW Data
    .stack > DDR2 // Software System Stack
    .sysmem > DDR2 // Dynamic Memory Allocation

    Area

    .cio > DDR2 // C I/O Buffer
    .vecs > DDR2 // Interrupt Vectors
    }


    Then , today , I modify it as following ,


    //

    ============================================================================
    // Linker Command File for Linking c674 DSP Programs
    //
    // These linker options are for command line linking only. For IDE linking,
    // you should set your linker options in Project Properties.
    // -c Link Using C Conventions
    // -stack 0x1000 Software Stack Size
    // -heap 0x1000 Heap Area Size
    // ===========================================================================
    -stack 0x1000
    -heap 0x1000

    //

    ============================================================================
    // Specify the System Memory Map
    //

    ============================================================================
    MEMORY
    {
    L1P: o = 0x11E00000 l = 0x00008000
    L1D: o = 0x11F00000 l = 0x00008000
    L2: o = 0x11800000 l = 0x00040000
    DDR2: o = 0xC0000000 l = 0x08000000
    }

    //

    ============================================================================
    // Specify the Sections Allocation into Memory
    //

    ============================================================================
    SECTIONS
    {


    //// add it 2017-07-18
    .sram_start START(_sram_start) > L2_SRAM NOINIT

    // .kernel {
    // vlib.a*<*.o*> (.text:optimized)
    // } SIZE(_kernel_size) > DDR2

    // .kernel_data {
    // vlib.a*<*.o*> (.bss)
    // vlib.a*<*.o*> (.const)
    // vlib.a*<*.o*> (.neardata)
    // vlib.a*<*.o*> (.rodata)
    // vlib.a*<*.o*> (.far)
    // vlib.a*<*.o*> (.fardata)
    // vlib.a*<*.o*> (.switch)
    // } SIZE(_data_size) > DDR2

    //// add over



    .cinit > DDR2 // Initialization Tables
    .pinit > DDR2 // Constructor Tables
    .init_array > DDR2 //
    .binit > DDR2 // Boot Tables
    .const > DDR2 // Constant Data
    .switch > DDR2 // Jump Tables
    .text > DDR2 // Executable Code
    .text:_c_int00: align=1024 > DDR2 // Entrypoint

    GROUP (NEARDP_DATA) // group near data
    {
    .neardata
    .rodata
    .bss // note: removed fill = 0
    } > DDR2
    .far: fill = 0x0, load > DDR2 // Far Global & Static Variables
    .fardata > DDR2 // Far RW Data
    .stack > DDR2 // Software System Stack
    .sysmem > DDR2 // Dynamic Memory Allocation

    Area

    .cio > DDR2 // C I/O Buffer
    .vecs > DDR2 // Interrupt Vectors
    }

    Then I do , Project -> Build All ,

    The result is as following :


    **** Build of configuration Debug for project

    vpif_lcd_loopback_c674x_c6748_lcdkC6748 ****

    C:\ti\ccsv5\utils\bin\gmake -k all
    'Building target: vpif_lcd_loopback.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --gcc --define=c6748 -

    -diag_warning=225 --mem_model:const=far --mem_model:data=far --abi=eabi -z -

    m"vpif_lcd_loopback_c674x_c6748_lcdkC6748.map" --warn_sections -

    i"C:/ti/ccsv5/tools/compiler/c6000/lib" -

    i"C:/ti/ccsv5/tools/compiler/c6000/include" -

    i"../../../../../../../binary/c674x/cgt_ccs/c6748/drivers/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/c6748/lcdkC6748/platform/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/c6748/system_config/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/c6748/ipclib/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/c6748/usblib/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/utils/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/grlib/Debug" -

    i"../../../../../../../binary/c674x/cgt_ccs/nandlib/Debug" --reread_libs --

    rom_model -o "vpif_lcd_loopback.out" "./vpif_lcd_loopback.obj"

    "./tvp5147.obj" "./i2cgpio.obj" "./codecif.obj" "./cdce913.obj"

    "./cbcr422sp_to_rgb565_dsp.obj" "./adv7343.obj" -l"libc.a" -

    l"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\vlib_cn.lib" -

    l"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\vlib.lib" -

    l"C:\ti\vlib_c674x_3_3_0_3\packages\ti\vlib\lib\common.lib" -ldrivers.lib -

    lutils.lib -lplatform.lib -lsystem_config.lib "../vpif_lcd_loopback.cmd"
    <Linking>
    "../vpif_lcd_loopback.cmd", line 32: warning: memory range not found: L2_SRAM
    on page 0
    "../vpif_lcd_loopback.cmd", line 32: error: no valid memory range(NULL)
    available for placement of ".sram_start"
    "../vpif_lcd_loopback.cmd", line 32: error: run placement fails for object
    ".sram_start", size 0x1 (page 0)

    undefined first referenced
    symbol in file
    --------- ----------------
    canny_getTestParams ./vpif_lcd_loopback.obj

    error: unresolved symbols remain
    error: errors encountered during linking; "vpif_lcd_loopback.out" not built

    >> Compilation failure
    gmake: *** [vpif_lcd_loopback.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****


    I konw I can not add the " .sram_start START(_sram_start) > L2_SRAM NOINIT "

    correctly , can you give some suggestion ?

    Waiting for your response !

    Good Luck !

    Zhangbin , Alex .
  • Mr. Jesse Villarreal :

    After I modify my vpif_lcd_loopback.cmd file , now , no error , but appear warnings :

    <Linking>
    "../vpif_lcd_loopback.cmd", line 41: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 45: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 46: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 47: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 48: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 49: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 50: warning: no matching section
    "../vpif_lcd_loopback.cmd", line 51: warning: no matching section

    how can I save these warning ?



    my vpif_lcd_loopback.cmd file is as following :

    40 .kernel {
    41 vlib.a*<*.o*> (.text:optimized)
    42 } SIZE(_kernel_size) > DDR2
    43
    44 .kernel_data {
    45 vlib.a*<*.o*> (.bss)
    46 vlib.a*<*.o*> (.const)
    47 vlib.a*<*.o*> (.neardata)
    48 vlib.a*<*.o*> (.rodata)
    49 vlib.a*<*.o*> (.far)
    50 vlib.a*<*.o*> (.fardata)
    51 vlib.a*<*.o*> (.switch)
    52 } SIZE(_data_size) > DDR2

    Waiting for your response . Thanks !

    Zhangbin , Alex
  • Alex,

    The warning that you are seeing are not fatal as in they may not cause any functional issue. Some of the errors is caused because you are sections in the linker command file corresponding to COFF build but the compiler now builds ELF binary code.

    processors.wiki.ti.com/.../C6000_EABI_Migration

    For neardata, rodata and bss try adding the following:

    GROUP (NEAR_DP_RELATIVE)
    {
        .neardata
        .rodata
        .bss
    } > DDR2
  • Mr. Rahul Prabhu :

    Now , in my project , the content about the canny , can not work well .

    So I want to try according to the VLIB_Canny_Edge_Detection_d.c file .

    But I can not find the definition of the gTITexasLogo , and the gTITexasLogoCannyRef ,
    Can you tell me how can I get them ?

    static canny_testParams_t testParams[]=
    {
    /********************************************
    testPattern,
    *input, *refOutput, refNumItems,
    width, height
    *********************************************/
    {
    STATIC,
    gTITexasLogo, gTITexasLogoCannyRef, 307,
    64, 64
    },



    Another question is ,

    If I want to use the gTITexasLogo , to verify the canny ,

    as following ,

    /* Test optimized kernel */
    VLIB_profile_start(vlib_KERNEL_OPT);
    VLIB_Canny_Edge_Detection(pInput,
    pBufGradX,
    pBufGradY,
    pBufMag,
    pBufOut,
    pScratch,
    &numItems,
    prm[tpi].width,
    prm[tpi].height);

    the "tpi" should be 1 , right ?
    the pInput , should be gTITexasLogo , right ?

    And after that , can you give me the correct content of the pBufOut ?

    I want to use this method to debug my program step by step .

    Can you help me ?

    Waiting for your response . Thanks !

    Good luck !

    Zhangbin , Alex .