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.

Undefined symbol

Other Parts Discussed in Thread: CCSTUDIO

Hello,

I have seen some problems similar to mine in this support platform but still nothing solves my compilation failure...

Could you recognize a special error in my code thanks to that response? Which procedure do I have to undertake ?

Many thanks in advance

Please find the error message below :

[Linking...] "C:\Programs\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -@"CustomMW.lkf"
<Linking>

undefined                        first referenced
 symbol                              in file
---------                        ----------------
_C64_enableIER                   C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\codec_driver_interface.obj
_SEM_pend                        C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\codec_driver_interface.obj
_C64_disableIER                  C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\codec_driver_interface.obj
_SEM_post                        C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\edma.obj
_HWI_dispatchPlug                C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\HW_interrupt.obj
_HWI_eventMap                    C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\HW_interrupt.obj
__SEM_dopost                     C:\\Documents and Settings\\maxime\\Desktop\\project\\PERON\\Simulink\\audiotest_ccslink\\CustomMW\\mcbsp_aic23_buffer.obj
>>   error: symbol referencing errors - 'audiotest.out' not built

>> Compilation failure

Build Complete,
  2 Errors, 0 Warnings, 0 Remarks.

Maxime PERON

  • Hi Maxime,

    These are linker errors indicating that your compiler cannot find references to the above declared functions in the memory map. This may happen due to faulty linker (.cmd) file or faulty spellings of functions in code. Can you post the code and linker file here?

    Regards,

    Sid

  • Hi

    The project is done directly by simulink so I have a lot of ( Include , Libraries, Sources, and two commands)

    I can write the two commands which are the linkers if I understand, and then the main program : ( I am sorry for the length of the message)

    Thank you very much

    AUDIOTEST.CMD (

    MEMORY
    {
        IRAM:  org=0x800000, len=0x1f8000
        DDR:  org=0xe0000000, len=0x10000000
    }
    SECTIONS
    {
        .vectors:  load = 0x00800000
        .text:  > IRAM
        .switch:  > IRAM
        .bss:  > IRAM
        .far:  > IRAM
        .cinit:  > IRAM
        .pinit:  > IRAM
        .const:  > IRAM
        .data:  > IRAM
        .cio:  > IRAM
        .sysmem:  > IRAM
        .stack:  > IRAM
        .rtdx_data:  > IRAM
        .rtdx_text:  > IRAM
        .mw_isrambuff:  > IRAM
    }

     

    CODEC_DRIVER.CMD

    /* 
     *  $Revision: 1.1.6.2 $
     *  $Date: 2008/06/20 08:22:28 $
     *  Copyright 2007-2008 The MathWorks, Inc.
     */

    /*
     * File: codec_driver.cmd
     *
     * Description: Linker command file used by Codec Driver
     *
     * Remarks: We place the Codec Receive and Transmit buffers in IRAM
     *          so cache coherency will be automatically taken care of by the
     *          cache controller.
     */

    SECTIONS
    {
        .SEC_Codec_Buffers:  > IRAM
    }

     

    AUDIOTEST_MAIN.C

    #include "audiotest.h"
    #include "rtwtypes.h"
    #include "rtmodel.h"
    #include "rt_sim.h"
    #include <stdlib.h>
    #include "MW_c6xxx_csl.h"
    #include "audiotest_private.h"
    #include "c6000_main.h"
    #include <stdlib.h>
    #include <stdio.h>

    void exitprocessing()
    {
      disable_interrupts();
    }

    extern RT_MODEL *MODEL(void);
    extern void MdlInitializeSizes(void);
    extern void MdlInitializeSampleTimes(void);
    extern void MdlStart(void);
    extern void MdlOutputs(int_T tid);
    extern void MdlUpdate(int_T tid);
    extern void MdlTerminate(void);
    RT_MODEL *S;
    volatile int IsrOverrun = 0;
    static boolean_T OverrunFlag = 0;
    void rt_OneStep(void)
    {
      real_T tnext;
      if (OverrunFlag++) {
        IsrOverrun = 1;
        OverrunFlag--;
        return;
      }

      IER |= (1 << 15);
      tnext = rt_SimGetNextSampleHit();
      rtsiSetSolverStopTime(rtmGetRTWSolverInfo(S), tnext);
      MdlOutputs(0);
      MdlUpdate(0);
      rt_SimUpdateDiscreteTaskSampleHits(rtmGetNumSampleTimes(S),
        rtmGetTimingData(S),
        rtmGetSampleHitPtr(S),
        rtmGetTPtr(S));
      IER &= ~(1 << 15);
      OverrunFlag--;
    }

    void main(void)
    {
      volatile boolean_T noErr;
      const char_T *status;
      targetInitialize();
      rt_InitInfAndNaN(sizeof(real_T));
      S = MODEL();
      if (rtmGetErrorStatus(S) != NULL) {
        puts("Error during model registration\n");
        exit(EXIT_FAILURE);
      }

      rtmSetTFinal(S, rtInf);
      MdlInitializeSizes();
      MdlInitializeSampleTimes();
      status = rt_SimInitTimingEngine(rtmGetNumSampleTimes(S),
        rtmGetStepSize(S),
        rtmGetSampleTimePtr(S),
        rtmGetOffsetTimePtr(S),
        rtmGetSampleHitPtr(S),
        rtmGetSampleTimeTaskIDPtr(S),
        rtmGetTStart(S),
        &rtmGetSimTimeStep(S),
        &rtmGetTimingData(S));
      if (status != NULL) {
        puts("Failed to initialize sample time engine\n");
        exit(EXIT_FAILURE);
      }

      MdlStart();
      atexit (exitprocessing);
      puts("**starting the model**\n");
      configureTimers();
      noErr =
        rtmGetErrorStatus(audiotest_M) == (NULL);
      enable_interrupts();
      while (noErr ) {
        noErr =
          rtmGetErrorStatus(audiotest_M) == (NULL);
      }

      puts("**stopping the model**\n");
      MdlTerminate();
      targetTerminate();
    }

     

     

     

     

  • Hi Maxime,

    This seems to be incomplete, for eg, the linker error says that there exists an unreferenced variable in HW_interrupt.obj, which sould be the name of a function or a source file. But it doesnt exist in the code.

    Are you sure you have the entire code, is it using some other path or other options for linking? If yes ,try to modify Linker options in Build Properties.

    Regards,

    Sid

  • Hi Maxime,

    The functions missing are DSP/BIOS functions, and looking at your linker command file it does not look like you are using DSP/BIOS, can you check for me?

    When you use DSP/BIOS you have a tcf file in your project and this TCF file generates a cmd file that needs to be included in the file.

  • Hi

    Exactly i don't have any DSP/BIOS Config in the project !

    This project is done thanks to Simulink. What should I do to make this DSP/BIOS function ? (act on Simulink or CCS?)

    (I dont know if it is important to know that I have installed DSP/BIOS 5.33.06 and selected in CCS component manager...)

    Thank you

  • We compiler experts have no experience with Simulink.  But it seems you need help from someone who knows Simulink.  Normally, I'd move this thread to another forum.  But I'm not sure which forum would be most helpful for a Simulink question.

    Thanks and regards,

    -George

     

  • Hi

    It is working properly now.

    Problems were in Simulink > Configuration Parameters. In Real Time Workshop the DSP/BIOS was not taken into account...

    Now compilation and implementation are working well.

    Thank you all very much for your help

    Regards

    Maxime PERON