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.

Link error of am335x sysbios industrial sdk example.

Other Parts Discussed in Thread: SYSBIOS, AM3359

I'm trying to compile and load example program(ethercat slave) but there are error at linking.

It seemed to be wrong .cmd file. 

 Evaluation Board is ICE V1. 

1. Error log message 

<Linking>
warning: creating output section ".text" without a SECTIONS specification
warning: creating output section ".data" without a SECTIONS specification
warning: creating output section ".const" without a SECTIONS specification
warning: creating output section "ti.sysbios.family.arm.a8.mmuTableSection"
without a SECTIONS specification
warning: creating output section ".bss" without a SECTIONS specification
warning: creating output section "xdc.meta" without a SECTIONS specification
warning: creating output section ".vecs" without a SECTIONS specification
warning: creating output section ".bss:.common" without a SECTIONS
specification
warning: creating output section ".cinit" without a SECTIONS specification

undefined first referenced 

symbol in file 
--------- ---------------- 
IND_CALL C:\ti\xdctools_3_24_07_73\packages\ti\targets\arm\rtsarm\lib\auto_init.aea8fnv<auto_init.oea8fnv> 
>> Compilation failure
app_reload_code_run ./tiescutils.obj 
app_reload_code_size ./tiescutils.obj 
app_reload_code_start ./tiescutils.obj 
ti_sysbios_family_arm_a8_intcps_Hwi_create C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/os_drivers/lib/sys_bios_driver.lib<osdrv_uart.obj> 
ti_sysbios_family_arm_a8_intcps_Hwi_delete C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/os_drivers/lib/sys_bios_driver.lib<osdrv_uart.obj> 
ti_sysbios_knl_Semaphore_create C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib<tiescbsp.obj>
ti_sysbios_knl_Semaphore_delete C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib<tiescbsp.obj>

error: unresolved symbols remain
error: errors encountered during linking; "ethercat.out" not built
gmake: *** [ethercat.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

2. Reference set:

3.Command file ( No modified. )

3.1 am335x.cmd : is clicked twice, and strange at DDR3 ->  ICE v1 has DDR2.

SECTIONS
{
.init: { boot*(.text)} > 0x80000000 /* make sure we can boot! */
GROUP: load > SRAM_HI
{
.bss:
.data:
.stack:
}

.app_reload_code: { -lsys_bios_driver.lib<osdrv_spiflash.obj,osdrv_mcspi.obj>(.text),-lam335x_platform.lib<plat_delay.obj,plat_mcspi.obj>(.text),-lecat_slave_stack.lib<tiesc_appreload.obj>(.text) } load > DDR3, run > 0x80040000, align = 0x4
LOAD_START(app_reload_code_start)
RUN_START(app_reload_code_run)
SIZE(app_reload_code_size)

.cinit: load > DDR3
.text: load >> DDR3 align = 0x8000
.const: load > DDR3
.vecs: load > DDR3

ti.sysbios.family.arm.a8.mmuTableSection: load >> SRAM_HI, type = NOINIT
xdc.meta: load >> DDR3, type = COPY
}

3.2 am335x_iram.cmd

SECTIONS
{
.init: { boot*(.text)} > 0x40300000

GROUP: load > 0x402f0400
{
.bss:
.neardata:
.rodata:
}
ti.sysbios.family.arm.a8.mmuTableSection: load > 0x402F8000 , type = NOINIT
.stack: load > SRAM_HI
.data: load >> SRAM_HI
.app_reload_code: { -lsys_bios_driver.lib<osdrv_spiflash.obj,osdrv_mcspi.obj>(.text),-lam335x_platform.lib<plat_delay.obj,plat_mcspi.obj>(.text),-lecat_slave_stack.lib<tiesc_appreload.obj>(.text) } load > OCMC_SRAM, run > 0x4030f000, align = 0x4
LOAD_START(app_reload_code_start)
RUN_START(app_reload_code_run)
SIZE(app_reload_code_size)

/* BL stack starts at 0x402f9600 and is 0x300 in size. Placing these in a safe zone(after mmuTableSection) */
GROUP: load > 0x402fc000
{
.vecs:
.const:
}
/* Forcing to make sure it does not conflict with BL execution. Grouping with above result in a warning */
.cinit: load > 0x402fcc00

.text: load >> OCMC_SRAM | SRAM_HI align = 0x4, fill = 0
.init_array: load > DDR3

xdc.meta: load >> SRAM_HI, type = COPY
xdc.noload: load >> OCMC_SRAM, type = COPY

}

3.3 am335x_nor.cmd

MEMORY
{
/* 16 bytes reserved for application header */
NOR_1 (RX) : org = 0x08010010, len = 0xFFF0
NOR_2 (RX) : org = 0x08020000, len = 0x20000
NOR_3 (RX) : org = 0x08040000, len = 0x20000
}


SECTIONS
{
.init: { boot*(.text)} load > 0x08010010
.text: load >> NOR_2
.cinit: load > NOR_1
.init_array: load > NOR_1
.const: load >> NOR_1
.vecs: load >> NOR_1

.bios_code: { sysbios.* (.text)} load > NOR_1

.sdk_mmu_code: { -lsys_bios_driver.lib<osdrv_mmu.obj> (.text)} load > NOR_1
.sdk_led_code: { -lam335x_platform.lib<plat_led.obj> (.text)} load > NOR_1
.sdk_platform_code: { -lam335x_platform.lib (.text)} load > NOR_1
.start_platform_code: { -lplatform.lib (.text) } load > NOR_1
.xdc_code: { ethercat_nor_pea8fnv.oea8fnv (.text) } load > NOR_1
.start_i2c_code: { -ldrivers.lib<hsi2c.obj> (.text) } load > NOR_1
GROUP: load > 0x08018000
{
.rtsarm_code: { ti.targets.arm.rtsarm.aea8fnv (.text) }
.tiescappl_code: { tiescappl.obj (.text)}
.tiescutils_code: { tiescutils.obj (.text)}
}


.autoinit_code: { auto_init.aea8fnv (.text) } load > NOR_1
.rtsv7a8_eabi_code: { -lrtsv7A8_A_le_n_v3_eabi.lib (.text) } load > NOR_1


.start_drivers_code: { drivers.lib (.text) } load > 0x08028000
.tiescutils_const: { tiescutils.obj (.const) } load > NOR_2
.coeappl_const: { -lecat_slave_stack.lib<coeappl.obj> (.const) } load > NOR_2
.tiescbsp_const: { -lecat_slave_stack.lib<tiescbsp.obj> (.const) } load > NOR_2
.objdef_const: { -lecat_slave_stack.lib<objdef.obj> (.const) } load > NOR_2
.sdoserv_const: { -lecat_slave_stack.lib<sdoserv.obj> (.const) } load > NOR_2

}

  • Can you clean and rebuild and then post the complete output from the build console? I would like to see how and when are these linker command files used.
  • Clean Log message:


    **** Clean-only build of configuration Debug for project ethercat ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k clean
    cleaning ../src/sysbios ...
    DEL /F "ethercat.out" "configPkg\linker.cmd" "configPkg\compiler.opt" "ethercat.hex"
    C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk\examples\ethercat_slave\Debug\ethercat.out을(를) 찾을 수 없습니다.
    C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk\examples\ethercat_slave\Debug\ethercat.hex을(를) 찾을 수 없습니다.
    RMDIR /S/Q "configPkg\"
    DEL /F "tiescappl.pp" "tiescutils.pp"
    DEL /F "tiescappl.obj" "tiescutils.obj"
    'Finished clean'
    ' '

    **** Build Finished ****

    Build Log Message:


    **** Build of configuration Debug for project ethercat ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    making ../src/sysbios/sysbios.lib ...
    clea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/BIOS.c ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/TaskSupport_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/exc/Exception_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/a8/TimestampProvider_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/a8/Mmu_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/a8/Cache_asm.asm ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm.s470 ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm_switch.s470 ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/timers/gptimer/Timer_asm.s470 ...
    asmea8fnv C:/ti/bios_6_33_04_39/packages/ti/sysbios/timers/dmtimer/Timer_asm.s470 ...
    area8fnv BIOS.obj arm_IntrinsicsSupport_asm.obj arm_TaskSupport_asm.obj exc_Exception_asm.obj a8_TimestampProvider_asm.obj a8_Mmu_asm.obj a8_Cache_asm.obj intcps_Hwi_asm.obj intcps_Hwi_asm_switch.obj gptimer_Timer_asm.obj dmtimer_Timer_asm.obj ...
    'Building file: ../ethercat.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_24_07_73/xs" --xdcpath="C:/ti/bios_6_33_04_39/packages;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.A8Fnv -p ti.platforms.evmAM3359 -r debug -b "C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/examples/ethercat_slave/.config/xconfig_ethercat/config.bld" -c "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2" --compileOptions "-g --optimize_with_debug" "../ethercat.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring ethercat.xea8fnv from package/cfg/ethercat_pea8fnv.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/examples/ethercat_slave/src/sysbios/sysbios.lib ...
    Build of libraries done.
    clea8fnv package/cfg/ethercat_pea8fnv.c ...
    'Finished building: ../ethercat.cfg'
    ' '
    'Building file: ../tiescappl.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/bin/armcl" -mv7A8 --code_state=32 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/examples/ethercat_slave" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/os_drivers/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/platform/am335x/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/protocols/ethercat_slave/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/protocols/ethercat_slave/firmware" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/starterware/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/starterware/include/hw" -g --gcc --define=ECAT_LIMITED_DEMO --define=am3359 --diag_warning=225 --preproc_with_compile --preproc_dependency="tiescappl.pp" --cmd_file="./configPkg/compiler.opt" "../tiescappl.c"
    'Finished building: ../tiescappl.c'
    ' '
    'Building file: ../tiescutils.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/bin/armcl" -mv7A8 --code_state=32 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/examples/ethercat_slave" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/os_drivers/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/platform/am335x/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/protocols/ethercat_slave/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/protocols/ethercat_slave/firmware" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/starterware/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/starterware/include/hw" -g --gcc --define=ECAT_LIMITED_DEMO --define=am3359 --diag_warning=225 --preproc_with_compile --preproc_dependency="tiescutils.pp" --cmd_file="./configPkg/compiler.opt" "../tiescutils.c"
    "../tiescutils.c", line 205: warning: variable "loop" was declared but never referenced
    "../tiescutils.c", line 206: warning: variable "ledOn" was declared but never referenced
    'Finished building: ../tiescutils.c'
    ' '
    'Building target: ethercat.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/bin/armcl" -mv7A8 --code_state=32 --abi=eabi -me -g --gcc --define=ECAT_LIMITED_DEMO --define=am3359 --diag_warning=225 -z -m"ethercat.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include" -i"C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/platform/am335x/lib" -i"C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/os_drivers/lib" -i"C:/ti/am335x_sysbios_ind_sdk_1.1.0.6/sdk/protocols/ethercat_slave/stack_lib" --reread_libs --define=A8_CORE=1 --warn_sections --xml_link_info="ethercat_linkInfo.xml" --rom_model -o "ethercat.out" "./tiescappl.obj" "./tiescutils.obj" -l"./configPkg/linker.cmd" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/platform/am335x/lib/am335x_platform.lib" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/os_drivers/lib/sys_bios_driver.lib" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/starterware/binary/armv7a/cgt_ccs/am335x/drivers/drivers.lib" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/starterware/binary/armv7a/cgt_ccs/am335x/evmAM335x/platform/platform.lib" -l"C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk\starterware\binary\armv7a\cgt_ccs\am335x\system_config\system.lib" -l"libc.a"
    <Linking>
    warning: creating output section ".text" without a SECTIONS specification
    warning: creating output section ".data" without a SECTIONS specification
    warning: creating output section ".const" without a SECTIONS specification
    warning: creating output section "ti.sysbios.family.arm.a8.mmuTableSection"
    without a SECTIONS specification
    warning: creating output section ".bss" without a SECTIONS specification
    warning: creating output section "xdc.meta" without a SECTIONS specification
    warning: creating output section ".vecs" without a SECTIONS specification
    warning: creating output section ".bss:.common" without a SECTIONS
    specification
    warning: creating output section ".cinit" without a SECTIONS specification


    >> Compilation failure
    undefined first referenced
    symbol in file
    --------- ----------------
    IND_CALL C:\ti\xdctools_3_24_07_73\packages\ti\targets\arm\rtsarm\lib\auto_init.aea8fnv<auto_init.oea8fnv>
    app_reload_code_run ./tiescutils.obj
    app_reload_code_size ./tiescutils.obj
    app_reload_code_start ./tiescutils.obj
    ti_sysbios_family_arm_a8_intcps_Hwi_create C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/os_drivers/lib/sys_bios_driver.lib<osdrv_uart.obj>
    ti_sysbios_family_arm_a8_intcps_Hwi_delete C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/os_drivers/lib/sys_bios_driver.lib<osdrv_uart.obj>
    ti_sysbios_knl_Semaphore_create C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib<tiescbsp.obj>
    ti_sysbios_knl_Semaphore_delete C:\ti\am335x_sysbios_ind_sdk_1.1.0.6\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib<tiescbsp.obj>

    error: unresolved symbols remain
    error: errors encountered during linking; "ethercat.out" not built
    gmake: *** [ethercat.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • I can see where linker.cmd command file is being used, but I don't see any reference to any of the linker command files from your original post. The symbols 'app_reload_code_*' are defined in one of these files, so the symbols are undefined because the link command line does not contain the file with the definitions.
    The file linker.cmd should have a SECTIONS directive that allocates .text, .data and other sections. What's in that file?
  • Linker.cmd file is just reference for possibility of my invalid setting. Linker.cmd file is in project folder but project is not use the file.
    I already tested to set the linker.cmd file at advanced setting ( linker command) of properties, then there was other undefined error.

    Above build log is the result that didn't set the linker.cmd file, and if set linker.cmd file , it occurred other error.
  • When you say "linker.cmd" I think you are referring to one of the files you posted in your first message. I think you should include one of them in the project. I am not sure which one because I don't know exactly what's the difference between them, but they are defining some symbols that you need. If they cause some other errors when included, then these errors have to be fixed some other way rather than excluding these necessary files.

    I also asked you earlier to post the content of the generated file configPkg/linker.cmd. It's in your Debug or Release directory. That file should resolve some of the undefined symbols, so I need to see it to find out why it's not resolving these symbols.