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.

CODECOMPOSER: Undefined symbol

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi everyone,

I have a simple following code:

Fullscreen
1
2
3
4
5
6
#include "device.h"
#include "driverlib.h"
void main(){
Device_init();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The function Device_init() is defined in "device.h", and I have included it.

  

Why I still receive the following error:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
**** Build of configuration Debug for project Test_I2C ****
"C:\\ti\\ccs1020\\ccs\\utils\\bin\\gmake" -k -j 20 all -O
Building file: "../main.c"
Invoking: C2000 Compiler
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --include_path="C:/VietDucK19/CCS/I2c/Test_I2C" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/device_support/f2807x/common/include" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/device_support/f2807x/headers/include" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/driverlib/f2837xd/driverlib/inc" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --preproc_with_compile --preproc_dependency="main.d_raw" "../main.c"
Finished building: "../main.c"
Building target: "Test_I2C.out"
Invoking: C2000 Linker
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi -z -m"Test_I2C.map" --stack_size=0x200 --warn_sections -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/lib" -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="Test_I2C_linkInfo.xml" --rom_model -o "Test_I2C.out" "./main.obj" "../2837x_FLASH_lnk_cpu1.cmd" -llibc.a
<Linking>
undefined first referenced
symbol in file
--------- ----------------
_Device_init ./main.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "Test_I2C.out" not built
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Can someone help me, thank you in advance.

  • Hello,

    I am sending your thread over to the C2000 team. Feel free to ping the thread if you don't get a response in a day or so.

    Regards,

    Nick

  • Hi Nick,

    Thank you so much. I appreciate your help.

  • Is it *defined* or *declared* in device.h?

    If it is only a prototype in device.h, you may need to make sure that the source file that contains your routine is in the search path.

  • sorry for the confusion, it is declared in device.h

  • Hello,

    Make sure that the proper include and library paths are set up in the Project Properties (you can refer to an example in C2000Ware for the device you're using). The Device_init function is defined in the device.c file, so if the function is not recognized that means you have not configured the project to include the proper driverlib source code.

    As a general recommendation, you should be creating projects based on the empty_project template for the F2837x/F2807x device in C2000Ware 5.01 (for other devices, you should be able to use the universal example which has the SysConfig Universal Project setup).