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.

compiling error 10010 and 10234-d

Other Parts Discussed in Thread: TM4C123GH6PM

hi guys i have problem on compiling my software and get this error as below


**** Build of configuration Debug for project lm4f ****

"c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
'Building file: ../ti_codec.c'
'Invoking: ARM Compiler'
"c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/StellarisWare" --include_path="c:/ti/ccsv6/tools/compiler/arm_5.1.5/include" -g --define=PART_LM4F120H5QR --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="ti_codec.pp" "../ti_codec.c"
At end of source: warning #97-D: a translation unit must contain at least one declaration
'Finished building: ../ti_codec.c'
' '
'Building target: lm4f.out'
'Invoking: ARM Linker'
"c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --define=PART_LM4F120H5QR --display_error_number --diag_warning=225 --diag_wrap=off -z -m"lm4f.map" --heap_size=0 --stack_size=512 -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/lib" -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="lm4f_linkInfo.xml" --rom_model -o "lm4f.out" "./ti_codec.obj" "./main.obj" "./lm4f120h5qr_startup_ccs.obj" "./i2c_if.obj" "C:/StellarisWare/driverlib/ccs-cm4f/Debug/driverlib-cm4f.lib" "../lm4f120h5qr.cmd" -l"libc.a" -l"C:\StellarisWare\driverlib\ccs-cm4f\Debug\driverlib-cm4f.lib" 
<Linking>

undefined first referenced
symbol in file 
--------- ----------------
CodecReset ./main.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "lm4f.out" not built

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

**** Build Finished ****

i have no idea where goes wrong but i suspect it come from 1 of my file in my ccs. other c file are goes fine since i compile, while i added in a file i not sure why

below are some code which i have modified from 1 example

//*****************************************************************************
// ti_codec.c
//
// Driver for TI TLV320AIC3110 CODEC
//
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 
// 
// 
//  Redistribution and use in source and binary forms, with or without 
//  modification, are permitted provided that the following conditions 
//  are met:
//
//    Redistributions of source code must retain the above copyright 
//    notice, this list of conditions and the following disclaimer.
//
//    Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the 
//    documentation and/or other materials provided with the   
//    distribution.
//
//    Neither the name of Texas Instruments Incorporated nor the names of
//    its contributors may be used to endorse or promote products derived
//    from this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
//  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
//  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
//  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
//  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
//  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup wifi_audio_app
//! @{
//
//*****************************************************************************
#ifdef TI_CODEC
#include "ti_codec.h"
#include "i2c_if.h"
#include <stdint.h>
#include <stdbool.h>
#include "test.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"
#include "inc/hw_uart.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_i2c.h"
#include "driverlib/fpu.h"
#include "driverlib/systick.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom_map.h"
#include "driverlib/debug.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/uart.h"
#include "driverlib/rom.h"
#include "driverlib/i2c.h"
#include "driverlib/usb.h"
//*****************************************************************************
//                          LOCAL DEFINES
//*****************************************************************************
#define CRYSTAL_FREQ               40000000
#define SYS_CLK                    CRYSTAL_FREQ
#define CODEC_I2C_SLAVE_ADDR      ((0x30 >> 1)) 
#define CLOCK_512KHZ               1
#define DRC                        1
//******************************************************************************
//            GLOBAL VARIABLES
//******************************************************************************
unsigned char val[2],I,J=0;

//******************************************************************************
//
// Selects the Page for reading/writing
//
//******************************************************************************
unsigned long CodecPageSelect(unsigned long ulPageAddress)
{ 
    return CodecRegWrite(PAGE_CTRL_REG,ulPageAddress);
}

//******************************************************************************
//
// Writes to specfied register
// ulRegAddr - Register Address
// ucRegValue - 8 bit Register Value
//
//******************************************************************************
unsigned long CodecRegWrite(unsigned long ulRegAddr,unsigned char ucRegValue)
{
    unsigned char ucData[2]; 
    ucData[0] = (unsigned char)ulRegAddr;
    ucData[1] = ucRegValue;
    val[1]=ucData[1];
#if 0
    if(I2C_IF_ReadFrom(0x44,&ucRegAddr, 1, 
                   &ucRegData[0], 2) != 0)
    return -1;
#endif   
    J=I2C_IF_Write(CODEC_I2C_SLAVE_ADDR, ucData, 2, 1);
    if(J !=0)
        return (1U<<31);
        MAP_UtilsDelay(27000);

    J=I2C_IF_ReadFrom(CODEC_I2C_SLAVE_ADDR, &ucData[0], 1,&val[0],1);
    if(J !=0)
        return (1U<<31);

    if(val[0] != val[1])
        ++I;

    return 0;
}

void CodecReset(void)
{
    //
    // Select page 0
    //
    CodecPageSelect(0);

    //
    // Soft RESET
    //
    CodecRegWrite(CODEC_REG_SOFT_RESET,1);
}

#endif

the header file

//*****************************************************************************
// ti_codec.h
//
// Driver for TI TLV320AIC3110 CODEC
//
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 
// 
// 
//  Redistribution and use in source and binary forms, with or without 
//  modification, are permitted provided that the following conditions 
//  are met:
//
//    Redistributions of source code must retain the above copyright 
//    notice, this list of conditions and the following disclaimer.
//
//    Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the 
//    documentation and/or other materials provided with the   
//    distribution.
//
//    Neither the name of Texas Instruments Incorporated nor the names of
//    its contributors may be used to endorse or promote products derived
//    from this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
//  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
//  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
//  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
//  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
//  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
//*****************************************************************************
//
// ti_codec.h - Macros and Prototypes for TI TLV320AIC3110 CODEC
//
//*****************************************************************************
#ifndef __TI_CODEC_H__
#define __TI_CODEC_H__
#ifdef TI_CODEC

#define CODEC_I2C_SLAVE_ADDR      ((0x30 >> 1)) 
#define PAGE_CTRL_REG           0x00

//******************************************************************************
//
// Supported Wordlength
//
//******************************************************************************
#define CODEC_I2S_WORD_LEN_16           0x00
#define CODEC_I2S_WORD_LEN_20           0x10
#define CODEC_I2S_WORD_LEN_24           0x20
#define CODEC_I2S_WORD_LEN_32           0x30

//******************************************************************************
//
// Codec Page 0 Registers
//
//******************************************************************************

#define CODEC_REG_SOFT_RESET            0x01
#define CODEC_REG_CLK_MUX               0x04
#define CODEC_REG_PLL                   0x05
#define CODEC_REG_IF_CTRL               0x1B
#define CODEC_REG_NDAC                  0x0B
#define CODEC_REG_MDAC                  0x0C
#define CODEC_REG_DOSR_MSB              0x0D
#define CODEC_REG_DOSR_LSB              0x0E
#define CODEC_REG_DAC_PRB               0x3C
#define CODEC_REG_DAC_VOL               0x40
#define CODEC_REG_DAC_LEFT_VOL          0x41
#define CODEC_REG_DAC_RIGHT_VOL         0x42

//******************************************************************************
//
// Codec Page 1 Registers
//
//******************************************************************************

#define CODEC_REG_HP                    0x1F
#define CODEC_REG_OUTPUT_MIXER          0x23
#define CODEC_REG_HPL_DRIVER            0x28
#define CODEC_REG_HPR_DRIVER            0x29
#define CODEC_REG_SPL_DRV               0x2A
#define CODEC_REG_SPR_DRV               0x2B
#define CODEC_REG_CLASS_D_AMP           0x20
#define CODEC_REG_HPL_VOL               0x24
#define CODEC_REG_HPR_VOL               0x25
#define CODEC_REG_SPL_VOL               0x26
#define CODEC_REG_SPR_VOL               0x27
#define CODEC_REG_DAC_DATA_PATH         0x3F

//******************************************************************************
//
// Codec Page 8 Registers
//
//******************************************************************************
#define CODEC_REG_DAC_COFF_BUF          0x01

//******************************************************************************
//
// Prototypes for the APIs.
//
//******************************************************************************

extern unsigned long CodecRegWrite(unsigned long ulRegAddr,unsigned char ucRegValue);
extern unsigned long CodecPageSelect(unsigned long ulPageAddress);
extern void CodecReset(void);

#endif
#endif //__TI_CODEC_H__

i think something wrong between this 2, sorry if i posted wrong area

  • Hello Kelvin,

    The define TI_CODEC is missing in the compilation of the files

    Regards

    Amit

  • hi amit

    even i add in define TI_CODEC after the #ifdef TI_CODEC, i am still having the same error. i have no idea why it is happen even i google it

  • Hello Kelvin,

    If the code you have done like this

    #ifdef TI_CODEC

    #define TI_CODEC

    ....

    #endif

    Then it will not work as without the define itself how will the compile know that it is defined. That is why I am asking you to put it in the compilation defines or

    #ifndef TI_CODEC

    #define TI_CODEC

    ...

    #endif

    Regards

    Amit

  • hi amit 

    thank for the info, just curious to ask which i have done without error, but just a warning message occur which mentioned that the function is declared implicity, just wanted to know will it affect the function from uC, if no i can proceed

    thank anyway

  • Hello Kelvin,

    Can you share the entire compilation-linker log?

    My guess is that in the file where you are getting the compilation warning, the include is not there for the header file. However at link time it finds the function and hence completes without any error.

    Regards

    Amit

  • hi amit

    here are compilation linker log

    **** Build of configuration Debug for project fyp ****

    "c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "c:/ti/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="c:/ti/ccsv6/tools/compiler/arm_5.1.6/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
    "../main.c", line 31: warning #225-D: function "CodecReset" declared implicitly
    'Finished building: ../main.c'
    ' '
    'Building target: fyp.out'
    'Invoking: ARM Linker'
    "c:/ti/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off -z -m"fyp.map" --heap_size=0 --stack_size=512 -i"c:/ti/ccsv6/tools/compiler/arm_5.1.6/lib" -i"c:/ti/ccsv6/tools/compiler/arm_5.1.6/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="fyp_linkInfo.xml" --rom_model -o "fyp.out" "./PIN.obj" "./i2c_if.obj" "./main.obj" "./ti_codec.obj" "./tm4c123gh6pm_startup_ccs.obj" "C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib/ccs/Debug/driverlib.lib" "../tm4c123gh6pm.cmd" -l"libc.a"
    <Linking>
    'Finished building target: fyp.out'
    ' '

    **** Build Finished ****

    below are my include file

    #include "i2c_if.h"
    #include <stdint.h>
    #include <stdbool.h>
    #include "PIN.h"
    #include "ti_codec.h"
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_gpio.h"
    #include "inc/hw_ints.h"
    #include "inc/hw_uart.h"
    #include "inc/hw_sysctl.h"
    #include "inc/hw_i2c.h"
    #include "driverlib/fpu.h"
    #include "driverlib/systick.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/debug.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/gpio.h"
    #include "driverlib/uart.h"
    #include "driverlib/rom.h"
    #include "driverlib/i2c.h"
    #include "driverlib/usb.h"

    highlighted are the one for linking each other

  • Hello Kelvin,

    Now that is strange. I tried duplicating your setup but could not see the warning. However the linker has resolved it so it should be OK.

    Regards

    Amit

  • hi amit 

    below are the pic show that when i near the code it show this

  • Hello Kelvin,

    More than the snapshot if you can share the project, it would be easier for me to figure it out.

    Regards

    Amit

  • hi amit

    my project something like this, this will be i2c from uC to CODEC, where i modified the program. where the main.c will be linked to ti_CODEC.c to allow main.c to run the i2c to CODEC. 

  • Hello Kelvin,

    I do understand the project flow (it is what most projects would look like, even the examples in TivaWare). But without having the same project as you have, it would not be possible for me to help you out.

    But the project however if linking w/o errors will be OK to run on the board.

    Regards

    Amit