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