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.

AM335x EtherCAT code fails to link

Other Parts Discussed in Thread: SYSBIOS

Thank you for your reply! I found that I did not add flags correctly, so it crashed after not knowing what to do with them.

Anyways, I now have a problem where my code uses VFP register arguments, whereas the compiler does not. I added the earlier mentioned flags for that reason, but it does not seem to work.. I'm getting the following log output:


**** Build of configuration am335x_debug for project ethercat ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../am335xx_app.cfg'
'Invoking: XDCtools'
"C:/ti/xdctools_3_31_02_38_core/xs" --xdcpath="C:/ti/bios_6_45_01_29/packages;C:/ti/pdk_am335x_1_0_4/packages;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A8F -p ti.platforms.evmAM3359 -r debug -c "C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q3" "../am335xx_app.cfg"
'Finished building: ../am335xx_app.cfg'
' '
'Building file: ../tiescappl.c'
'Invoking: GNU Compiler'
"C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DAM335X_FAMILY_BUILD -DECAT_LIMITED_DEMO -Dam3359 -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/utils" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/hw" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/am335x/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/board/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/os_drivers/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/os_drivers/lld/pruss" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/firmware/v1.0" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/library/qspilib/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/device/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/control/foc" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/examples/ethercat_slave" -g -gstrict-dwarf -Wall -mfloat-abi=hard -mfpu=vfp -MMD -MP -MF"tiescappl.d" -MT"tiescappl.o" -o"tiescappl.o" @"configPkg/compiler.opt" "../tiescappl.c"
In file included from C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescutils.h:36:0,
from ../tiescappl.c:41:
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:217:21: warning: inline function 'bsp_pdi_access_perm_array' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_array(Uint16 address, Uint8 access,
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:216:21: warning: inline function 'bsp_pdi_access_perm_dword' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_dword(Uint16 address, Uint8 access);
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:215:21: warning: inline function 'bsp_pdi_access_perm_word' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_word(Uint16 address, Uint8 access);
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:214:21: warning: inline function 'bsp_get_pdi_access_perm' declared but never defined
PROTO inline Uint8 bsp_get_pdi_access_perm(Uint16 address, Uint8 access);
^
'Finished building: ../tiescappl.c'
' '
'Building file: ../tiescutils.c'
'Invoking: GNU Compiler'
"C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DAM335X_FAMILY_BUILD -DECAT_LIMITED_DEMO -Dam3359 -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/utils" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/hw" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/am335x/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/board/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/os_drivers/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/os_drivers/lld/pruss" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/firmware/v1.0" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/library/qspilib/include" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/device/" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/control/foc" -I"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/examples/ethercat_slave" -g -gstrict-dwarf -Wall -mfloat-abi=hard -mfpu=vfp -MMD -MP -MF"tiescutils.d" -MT"tiescutils.o" -o"tiescutils.o" @"configPkg/compiler.opt" "../tiescutils.c"
In file included from ../tiescutils.c:50:0:
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/soc.h:111:20: warning: inline function 'SOCGetCoreId' declared but never defined
inline socCoreId_t SOCGetCoreId(void);
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/include/soc.h:104:22: warning: inline function 'SOCGetSocFamilyId' declared but never defined
inline socFamilyId_t SOCGetSocFamilyId(void);
^
In file included from C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescutils.h:36:0,
from ../tiescutils.c:45:
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:217:21: warning: inline function 'bsp_pdi_access_perm_array' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_array(Uint16 address, Uint8 access,
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:216:21: warning: inline function 'bsp_pdi_access_perm_dword' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_dword(Uint16 address, Uint8 access);
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:215:21: warning: inline function 'bsp_pdi_access_perm_word' declared but never defined
PROTO inline Uint8 bsp_pdi_access_perm_word(Uint16 address, Uint8 access);
^
C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/include/tiescbsp.h:214:21: warning: inline function 'bsp_get_pdi_access_perm' declared but never defined
PROTO inline Uint8 bsp_get_pdi_access_perm(Uint16 address, Uint8 access);
^
'Finished building: ../tiescutils.c'
' '
'Building target: ethercat.out'
'Invoking: GNU Linker'
"C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q3/bin/arm-none-eabi-gcc.exe" -march=armv7-a -marm -mfloat-abi=hard -DAM335X_FAMILY_BUILD -DECAT_LIMITED_DEMO -Dam3359 -g -gstrict-dwarf -Wall -mfloat-abi=hard -mfpu=vfp -Wl,-Map,"ethercat.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_45_01_29/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/os_drivers/lib/am335x" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/board/lib/am335x" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/protocols/ethercat_slave/stack_lib/am335x" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/binary/dal/lib/am335x-evm/a8/release/gcc" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/binary/device/lib/am335x-evm/a8/release/gcc" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/binary/board/lib/am335x-evm/a8/release/gcc" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/binary/soc/lib/am335x-evm/a8/release/gcc" -L"C:/ti/sysbios_ind_sdk_02.01.02.02/sdk/starterware/binary/utils/lib/am335x-evm/a8/release/gcc" -Wl,--defsym,STACKSIZE=0x18000 -Wl,--defsym,HEAPSIZE=0x400 -Wl,--defsym,STACKSIZE=0x1C000 -o"ethercat.out" "./tiescappl.o" "./tiescutils.o" -Wl,-T"../AM335x.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lc -lgcc -lutils -lrdimon -lsoc -lm -lnosys -ldal -lsys_bios_driver -lboard -ldevice -lecat_slave_stack_gcc -lboard_support -Wl,--end-group
makefile:155: recipe for target 'ethercat.out' failed
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: ethercat.out uses VFP register arguments, c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_udivmoddi4.o) does not
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_udivmoddi4.o)
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: ethercat.out uses VFP register arguments, c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_fixunsdfdi.o) does not
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_fixunsdfdi.o)
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: ethercat.out uses VFP register arguments, c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_fixunssfdi.o) does not
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1\libgcc.a(_fixunssfdi.o)
collect2.exe: error: ld returned 1 exit status
gmake: *** [ethercat.out] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

  • According to another forum "--with-arch=armv6" and "--with-fpu=vfp" are incompatible. I removed the first and now it seems to compile. Not sure if it's supposed to be like that..

    Getting the following error when running the compiled code in debug:

    M3_wakeupSS: Error connecting to the target: (Error -1266 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 6.0.407.6)
  • Hi,

    Regarding the parameters, for AM335x you should be using -march=armv7-a and -mfpu=vfpv3-d16

    The error message is related to the fact you are trying to load the code to the M3 core. You should be loading it to the A8 instead.

    If you need help with this, check section 4.2 of:
    processors.wiki.ti.com/.../Debug_Handbook_for_CCS

    Hope this helps,
    Rafael