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.

Linking error with SYS/BIOS 6.31

Other Parts Discussed in Thread: SYSBIOS, CCSTUDIO

Hi,

I tried to modify a multi-processor MessageQ example on C6A8168 DSP into something I might use in my project. But i have had the following linking errors. Can someone please help me identifying these errors? I have looked all over the SysBios Users Guide and IPC Users Guide but could not find any clues.

I have the error messages in the following and I have also attached the zip file of the project. Your help is very much appreciated!

Zhao

<Linking>

error: symbol "_ti_sysbios_knl_Queue_head__E" redefined: first defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Queue.o674>"

error: symbol "_ti_sysbios_knl_Queue_empty__E" redefined: first defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Queue.o674>"

error: symbol "_ti_sysbios_knl_Semaphore_pendTimeout__I" redefined: first

defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Semaphore.o674>"

error: symbol "_ti_sysbios_knl_Semaphore_post__E" redefined: first defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Semaphore.o674>"

error: symbol "_ti_sysbios_knl_Semaphore_Instance_finalize__F" redefined: first

defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Semaphore.o674>"

error: symbol "_ti_sysbios_knl_Semaphore_pend__E" redefined: first defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Semaphore.o674>"

error: symbol "_ti_sysbios_knl_Clock_workFunc__E" redefined: first defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Clock.o674>"

error: symbol "_ti_sysbios_knl_Clock_Instance_finalize__F" redefined: first

defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_pr

ogram_debug\ti.sysbios.knl.a674<Clock.o674>"

error: symbol "_ti_sysbios_hal_Timer_Instance_finalize__F" redefined: first

defined in

"C:/tmp_C6A8168/DspApp/Debug/configPkg/package/cfg/message_dsp.p674.obj";

redefined in

"C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\hal\lib\whole_pr

ogram_debug\ti.sysbios.hal.a674<Timer.o674>"

undefined first referenced

symbol in file

--------- ----------------

_ti_sysbios_knl_Mailbox_Instance_State_dataQue__O C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

_ti_sysbios_knl_Mailbox_Instance_State_dataSem__O C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

_ti_sysbios_knl_Mailbox_Instance_State_freeQue__O C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

_ti_sysbios_knl_Mailbox_Instance_State_freeSem__O C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

_ti_sysbios_knl_Mailbox_Object__create__S ./DspApp.obj

_ti_sysbios_knl_Mailbox_Params__init__S ./DspApp.obj

_xdc_runtime_Gate_enterSystem__E C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

_xdc_runtime_Gate_leaveSystem__E C:\CCStudio_v5.1\ccsv5\bios_6_31_04_27\packages\ti\sysbios\knl\lib\whole_program_debug\ti.sysbios.knl.a674<Mailbox.o674>

error: unresolved symbols remain

error: errors encountered during linking; "DspApp.out" not built

>> Compilation failure

gmake: *** [DspApp.out] Error 1

gmake: Target `all' not remade because of errors.

**** Build Finished ****

7183.Dspapp.zip

  • Zhao,

    I think you should be able to solve your problem by adding the following line to your message_common.cfg.xs:

        var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');

    The errors are sort of cryptic but basically it looks like you are using the Mailbox module without doing a useModule of it in your .cfg file.
    The reason you are seeing this is because you are biulding with the "whole_program" profile.  We have since moved away from this profile
    in BIOS v6.32.xx.

    Judah

  • Hi Judah,

    Thank you for your suggestion. It did solve my linking problem. I will mark your message as answered.

    About the "whole_program", i changed it to "debug" profile and here is a remark from compiler:

    remark: the selected profile (debug) does not generate optimized code. 'debug' and 'release' profiles should only be used for source-level debugging of BIOS code. While these profiles build faster, the code runs slower and requires extra stack space. 'whole_program' profile is recommended for optimized code.

    I am using BIOS 6.32.05.54. Why does it recommend to use "whole_program"?

    Thanks,

    Zhao

  • Zhao,

    For BIOS 6.32.xx.xx, "whole_program" is recommended because its the most optimal.
    For BIOS 6.33.xx.xx, we deprecated "whole_program" and moved to "release" build which is nearly as good as "whole_program" without the complexity of it.

    Judah

  • Hi Judah,

    I encountered a problem in my TxTask() where a Mailbox_pend(...) should block but it did not.

    Is it possible for you to take a look at my projects? I have zipped up the two projects. I modified the MessageQ example for TI816x to have two tasks on DSP. The ARM side is not changed except that the HOST(ARM core) will initiate sending a message to the DSP. The DSP will receive it in RxTask() and pass it along to a mailbox in between the RxTask() and TxTask(). The TxTask() will retrieve the message from the mailbox and send the message back to HOST(ARM core). This is the idea but it has implementation problem where the Mailbox_pend() in TxTask() won't block.

    ARM_sysbios_ipc_MessageQ_example.zip is for ARM and Dspapp.zip is for DSP.

    Your help is very much appreciated.

    Zhao

    6560.ARM_sysbios_ipc_MessageQ_example.zip

    1157.Dspapp.zip

  • Zhao,

    Can you check the status of the Mailbox in ROV? What is the return from Mailbox_pend (TRUE if there is a message, FALSE if there is not and timeout expired)?

    Todd

  • Hi Todd,

    I traced the problem to Mailbox_create() function. It returned 0 as the Mailbox_Handle. That's why the Mailbox_pend did not block. Please provide sysbios 6.31 mailbox examples for C6A8168 if you have. Or look at my Dspapp.c source file in the zip file Dspapp.zip attached to see what is wrong with the mailbox creation.

    Thanks for your help.

    Zhao

    3324.Dspapp.zip

  • Zhao,

    Generally a dynamic create fails because there is not enough memory. Can you check how big the default is in ROV (the default is used since you did not specify a heap parameter in the params)

    You did not initialize the Error_Block. You need to have the following before you pass it into the Mailbox_create.

        Error_init(&eb);    
        Mailbox_Params_init(&params);
        d_txQueue = Mailbox_create(sizeof(MessageQ_MsgHeader),numMsg,&params,&eb);

    Todd

  • Todd,

    Thanks. I added the Erro_init(&eb); and the Mailbox_create() works. Then it comes again the non blocking of Mailbox_pend(). It returned TRUE. Please see the zip file.

    The only reference for BIOS 6.31 Mailbox is SPRUEX3G which comes with the CCS5.1 installation. Are there any other reference like SYSBIOS API explanations I can get from you? Can you please provide a Mailbox example in the context of SYSBIOS 6.3x?

    Another problem i am having is unable to read variable values while debugging. Do I need to change from "whole_program" to "debug" in order to be able to check variable values? Please let me know how to change it as well. I had this question asked to CCS forum but could not get satisfactory answers. It would be great if you could help with this question.

    Best Regards,

    Zhao

    8015.Dspapp.zip

  • Zhao,

    You can look at the following website: http://processors.wiki.ti.com/index.php/SYS/BIOS_Training_Lab:_Mailbox_App

    You can use the Mailbox.c and mailbox_configuration.cfg for your device. The mailbox in this example is created statically in the .cfg file. Please make sure that the msgSize you set in the create is the same size as the buffers you are passing into the Mailbox_pend and Mailbox_post.

    You can look at the SYSBIOS API reference guide in CCS' Help->Help Contents->SYS BIOS-> API Reference. Specifically Mailbox is in ti->sysbios->knl.

    Todd

  • Hi Todd,

    I found the issue is between the MessageQ and Mailbox. They can not share buffers. MessageQ allocates buffer from HEAP (shared memory region) but Mailbox copies MessageQ buffer into its own buffer on DSP. So when i try to deliver the DSP Mailbox buffer back to ARM, it generates the following error and aborts execution. Can you please suggest a solution to this problem?

    DspApp.c for DSP and message_multicore.c for ARM are attached.

    Thanks and Regards,

    Zhao

    [C674X_0] localQueueName is DSP

    [C674X_0] nextQueueName is HOST

    [CortexA8] Start the main loop

    [CortexA8] Sending a message #1 to DSP

    [C674X_0] Sending a message #1 to HOST

    [C674X_0] ti.sdo.ipc.transports.TransportShm: line 380: assertion failure: A_regionInvalid: Region is invalid

    [C674X_0] xdc.runtime.Error.raise: terminating execution

    0447.Dspapp.zip

  • Hi Zhao,

    Mailbox is definitely copied based. After the Mailbox_post, you still own that msg. You must free it or send it to someone else.

    Why even use the Mailbox? With MessageQ, you can send to other threads on the same processor.

    Todd

  • Hi Todd,

    That's a good suggestion. It was for compatibility with our previous software based on BIOS 5.21 and DSPLINK. Now we have to migrate to SYSBIOS 6.3x and IPC 1.2x.

    Thanks for the help. I will see if it works with 3 MessageQs in the two core system.

    Have a good weekend.

    Zhao

  • Hi Todd,

    I have another question regarding memory map of the two programs on DSP and ARM core. They look overlapped. For DSP the map is like this in message_dsp_x674.xdl

    MEMORY

    {

    OCMC_0 (RWX) : org = 0x40300000, len = 0x20000

    OCMC_1 (RWX) : org = 0x40400000, len = 0x20000

    DDR_DSP (RWX) : org = 0x83000000, len = 0x2000000

    DDR_SR0 (RWX) : org = 0x8e000000, len = 0x1000000

    }

    and for ARM the map is in the following in message_host_pea8f.xdl

    MEMORY

    {

    SRAM (RWX) : org = 0x402f0000, len = 0x10000

    OCMC_0 : org = 0x40300000, len = 0x20000

    OCMC_1 : org = 0x40400000, len = 0x20000

    VECTORS (RWX) : org = 0x0, len = 0x10000

    DDR_HOST (RWX) : org = 0x80000000, len = 0xb000000

    DDR_SR0 (RWX) : org = 0x8e000000, len = 0x1000000

    }

    I know these files are generated automatically and i cannot change them. But how do I control the memory map of those two cores, in the platform package file?

    Thanks,

    Zhao

  • Zhao,

    Can you post this on a new thread? It makes management of the forums much easier for us if a thread deals with one topic.

    Thanks,

    Todd