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.

求助hyperlnk 例程中databuffer的问题(求Thomas yang)



在MCSDK的hyperliink 例程中有如下一段:

#pragma DATA_SECTION (dataBuffer, ".bss:remoteable");

#pragma DATA_ALIGN (dataBuffer, hyplnk_EXAMPLE_LINE_SIZE);

在hyplnkExample.c的436行开始

这个bss:remoteable 在哪里?找不到啊 ?

现在我无法确认这个地址映射的实际地址啊。dataBuffer在哪里?

  • 我找到有cfg产生的link.cmd文件了,里面有bss的内容,但是对理解cmd理解不深?

    这个remoteable在哪里?

    cmd文件如下:

    /*
    * Do not modify this file; it is automatically generated from the template
    * linkcmd.xdt in the ti.targets.elf package and will be overwritten.
    */

    /*
    * put '"'s around paths because, without this, the linker
    * considers '-' as minus operator, not a file name character.
    */


    -l"D:\project\ccsproject\hyplnk_exampleProject\Debug\configPkg\package\cfg\memoryMappedExample_pe66.oe66"
    -l"D:\Program Files\Texas Instruments\pdk_C6678_1_0_0_19\packages\ti\csl\lib\ti.csl.ae66"
    -l"D:\Program Files\Texas Instruments\pdk_C6678_1_0_0_19\packages\ti\csl\lib\ti.csl.intc.ae66"
    -l"D:\Program Files\Texas Instruments\pdk_C6678_1_0_0_19\packages\ti\drv\hyplnk\lib\ti.drv.hyplnk.ae66"
    -l"D:\ti\xdctools_3_22_04_46\packages\ti\targets\rts6000\lib\ti.targets.rts6000.ae66"
    -l"D:\ti\xdctools_3_22_04_46\packages\ti\targets\rts6000\lib\boot.ae66"

    --retain="*(xdc.meta)"

    /* function aliases */
    /* ignore error about def and ref in the same file */
    --diag_remark=10268
    --symbol_map xdc_runtime_Text_putSite__E=xdc_runtime_Text_putSite__F
    --symbol_map xdc_runtime_Text_putLab__E=xdc_runtime_Text_putLab__F
    --symbol_map xdc_runtime_GateNull_query__E=xdc_runtime_GateNull_query__F
    --symbol_map xdc_runtime_Registry_getModuleId__E=xdc_runtime_Registry_getModuleId__F
    --symbol_map xdc_runtime_Error_check__E=xdc_runtime_Error_check__F
    --symbol_map xdc_runtime_System_sprintf_va__E=xdc_runtime_System_sprintf_va__F
    --symbol_map xdc_runtime_Text_cordText__E=xdc_runtime_Text_cordText__F
    --symbol_map xdc_runtime_Registry_findByName__E=xdc_runtime_Registry_findByName__F
    --symbol_map xdc_runtime_System_avsprintf__E=xdc_runtime_System_avsprintf__F
    --symbol_map xdc_runtime_Registry_getMask__E=xdc_runtime_Registry_getMask__F
    --symbol_map xdc_runtime_Memory_getMaxDefaultTypeAlign__E=xdc_runtime_Memory_getMaxDefaultTypeAlign__F
    --symbol_map xdc_runtime_GateNull_leave__E=xdc_runtime_GateNull_leave__F
    --symbol_map xdc_runtime_Gate_leaveSystem__E=xdc_runtime_Gate_leaveSystem__F
    --symbol_map xdc_runtime_Error_getSite__E=xdc_runtime_Error_getSite__F
    --symbol_map xdc_runtime_HeapStd_isBlocking__E=xdc_runtime_HeapStd_isBlocking__F
    --symbol_map xdc_runtime_System_printf_va__E=xdc_runtime_System_printf_va__F
    --symbol_map xdc_runtime_System_vsprintf__E=xdc_runtime_System_vsprintf__F
    --symbol_map xdc_runtime_Log_doPrint__E=xdc_runtime_Log_doPrint__F
    --symbol_map xdc_runtime_SysMin_ready__E=xdc_runtime_SysMin_ready__F
    --symbol_map xdc_runtime_SysMin_abort__E=xdc_runtime_SysMin_abort__F
    --symbol_map xdc_runtime_Text_matchRope__E=xdc_runtime_Text_matchRope__F
    --symbol_map xdc_runtime_SysMin_putch__E=xdc_runtime_SysMin_putch__F
    --symbol_map xdc_runtime_Error_init__E=xdc_runtime_Error_init__F
    --symbol_map xdc_runtime_Error_getId__E=xdc_runtime_Error_getId__F
    --symbol_map xdc_runtime_Error_raiseX__E=xdc_runtime_Error_raiseX__F
    --symbol_map xdc_runtime_Registry_getModuleName__E=xdc_runtime_Registry_getModuleName__F
    --symbol_map xdc_runtime_System_putch__E=xdc_runtime_System_putch__F
    --symbol_map xdc_runtime_System_abort__E=xdc_runtime_System_abort__F
    --symbol_map xdc_runtime_Diags_setMask__E=xdc_runtime_Diags_setMask__F
    --symbol_map xdc_runtime_System_aprintf_va__E=xdc_runtime_System_aprintf_va__F
    --symbol_map xdc_runtime_Registry_getNextModule__E=xdc_runtime_Registry_getNextModule__F
    --symbol_map xdc_runtime_Error_getData__E=xdc_runtime_Error_getData__F
    --symbol_map xdc_runtime_HeapStd_alloc__E=xdc_runtime_HeapStd_alloc__F
    --symbol_map xdc_runtime_Registry_isMember__E=xdc_runtime_Registry_isMember__F
    --symbol_map xdc_runtime_GateNull_enter__E=xdc_runtime_GateNull_enter__F
    --symbol_map xdc_runtime_Text_putMod__E=xdc_runtime_Text_putMod__F
    --symbol_map xdc_runtime_Memory_getStats__E=xdc_runtime_Memory_getStats__F
    --symbol_map xdc_runtime_Memory_free__E=xdc_runtime_Memory_free__F
    --symbol_map xdc_runtime_Startup_exec__E=xdc_runtime_Startup_exec__F
    --symbol_map xdc_runtime_Memory_query__E=xdc_runtime_Memory_query__F
    --symbol_map xdc_runtime_System_vprintf__E=xdc_runtime_System_vprintf__F
    --symbol_map xdc_runtime_SysMin_flush__E=xdc_runtime_SysMin_flush__F
    --symbol_map xdc_runtime_System_exit__E=xdc_runtime_System_exit__F
    --symbol_map xdc_runtime_Error_getCode__E=xdc_runtime_Error_getCode__F
    --symbol_map xdc_runtime_Registry_findById__E=xdc_runtime_Registry_findById__F
    --symbol_map xdc_runtime_Startup_rtsDone__E=xdc_runtime_Startup_rtsDone__F
    --symbol_map xdc_runtime_Error_getMsg__E=xdc_runtime_Error_getMsg__F
    --symbol_map xdc_runtime_Registry_addModule__E=xdc_runtime_Registry_addModule__F
    --symbol_map xdc_runtime_Memory_alloc__E=xdc_runtime_Memory_alloc__F
    --symbol_map xdc_runtime_System_flush__E=xdc_runtime_System_flush__F
    --symbol_map xdc_runtime_System_avprintf__E=xdc_runtime_System_avprintf__F
    --symbol_map xdc_runtime_Text_ropeText__E=xdc_runtime_Text_ropeText__F
    --symbol_map xdc_runtime_Error_print__E=xdc_runtime_Error_print__F
    --symbol_map xdc_runtime_Memory_calloc__E=xdc_runtime_Memory_calloc__F
    --symbol_map xdc_runtime_HeapStd_free__E=xdc_runtime_HeapStd_free__F
    --symbol_map xdc_runtime_System_asprintf_va__E=xdc_runtime_System_asprintf_va__F
    --symbol_map xdc_runtime_System_atexit__E=xdc_runtime_System_atexit__F
    --symbol_map xdc_runtime_SysMin_exit__E=xdc_runtime_SysMin_exit__F
    --symbol_map xdc_runtime_Registry_findByNamePattern__E=xdc_runtime_Registry_findByNamePattern__F
    --symbol_map xdc_runtime_Gate_enterSystem__E=xdc_runtime_Gate_enterSystem__F
    --symbol_map xdc_runtime_Memory_valloc__E=xdc_runtime_Memory_valloc__F
    --symbol_map xdc_runtime_HeapStd_getStats__E=xdc_runtime_HeapStd_getStats__F

    --args 0x200
    -heap 0x1000
    -stack 0x1400

    MEMORY
    {
    L2SRAM (RWX) : org = 0x800000, len = 0x80000
    MSMCSRAM (RWX) : org = 0xc000000, len = 0x400000
    DDR3 : org = 0x80000000, len = 0x20000000
    }

    /*
    * Linker command file contributions from all loaded packages:
    */

    /* Content from xdc.services.global (null): */

    /* Content from xdc (null): */

    /* Content from xdc.corevers (null): */

    /* Content from xdc.shelf (null): */

    /* Content from xdc.services.spec (null): */

    /* Content from xdc.services.intern.xsr (null): */

    /* Content from xdc.services.intern.gen (null): */

    /* Content from xdc.services.intern.cmd (null): */

    /* Content from xdc.bld (null): */

    /* Content from ti.targets (null): */

    /* Content from ti.targets.elf (null): */

    /* Content from xdc.rov (null): */

    /* Content from xdc.runtime (null): */

    /* Content from ti.targets.rts6000 (null): */

    /* Content from ti.drv.hyplnk (null): */

    /* Content from ti.csl (null): */

    /* Content from ti.catalog.c6000 (null): */

    /* Content from ti.catalog (null): */

    /* Content from ti.catalog.peripherals.hdvicp2 (null): */

    /* Content from xdc.platform (null): */

    /* Content from xdc.cfg (null): */

    /* Content from ti.platforms.evm6678 (null): */

    /* Content from configPkg (null): */


    /*
    * symbolic aliases for static instance objects
    */
    xdc_runtime_Startup__EXECFXN__C = 1;
    xdc_runtime_Startup__RESETFXN__C = 1;

    SECTIONS
    {
    .text: load >> MSMCSRAM
    .ti.decompress: load > L2SRAM
    .stack: load > L2SRAM
    GROUP: load > L2SRAM
    {
    .bss:
    .neardata:
    .rodata:
    }
    .cinit: load > L2SRAM
    .pinit: load >> L2SRAM
    .init_array: load > L2SRAM
    .const: load >> MSMCSRAM
    .data: load >> L2SRAM
    .fardata: load >> L2SRAM
    .switch: load >> L2SRAM
    .sysmem: load > L2SRAM
    .far: load >> L2SRAM
    .args: load > L2SRAM align = 0x4, fill = 0 {_argsize = 0x200; }
    .cio: load >> L2SRAM
    .ti.handler_table: load > L2SRAM
    .csl_vect: load >> L2SRAM
    xdc.meta: load >> MSMCSRAM, type = COPY

    }

  • 因为我想通过地址映射,在remote端的dsp上实际的看到传过去的数,所以想确定databuffer的确切地址。

  • 是不是0x0080_0000 ,又因为在core0,所以是0x1080_0000

    将out文件加载进去Debug后看到的

  • 是在0x00800000,我也看到这个了。

    bufferthroughhyplnk在0x40000000

    但是现在的状况是两边跑起来,由于这个memory更新速度很快,无法在memory view里看到,暂停之后程序就会传输就会出错,不往下运行了

    这个如何破?

  • 之后我做了如下的尝试

    因为按照例程的地址映射配置,我分析0x40000000对应的是0x00800000

    所以core0的0x40000200block对应到core8就是0x00800200,(不知道是否正确)

    为了证实我的分析

    我将远端的程序改为地址映射和caching enable之后就只有一个while循环来打印0x00800200地址的数据。

    如下:

    while(1)

    {

    for(i=0;i<2000*8192/5+1;i++)

    asm("nop 5");

    system_printf("data at 0x00800200= 0x%08\n",*(unsigned int *)0x00800200);

    }

    core0的程序依旧为基本没改动,并将iteration设为0,无限循环

    但是运行结果是core8 一直打印0x00800200的数据位0x00000000(持续好长一段时间)

    之后core0 打印fail 0 0

    hyperlnkexamplecputoken exchange failed:1

    single wrte failed之后

    core8 显示数据位0x00000000一次,之后变为0xfee1dead(这个正是我想看到的数,是否一定程度上证明我对地址映射的理解是对的?)

    这个时候core0程序已经exit。

    我很好奇,我在core8的这种打印操作会影响hyperlnk数据传输么?

    而且之前调试的时候发现如果把一个核暂停查看memory会导致数据传输failed,这样另一边的程序exit,就不会继续下去了

    我对dsp理解不是很深刻,还请哪位帮忙分析一下

  • 你的理解是正确的

    你先测试下不要打印,用数据读的形式来观察remote memory是否被正常读写了

  • 有一个问题:

    是否我只能通过往0x40000000开始的hyperlnk data 数据地址写数才会映射到远端?

    也即地址映射即0x40000000和远端选定的部分产生映射?