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.

Ethercat_slave example not working on ICE

Other Parts Discussed in Thread: SYSBIOS, AM3359

CCS5.5 and  SDK 1.1.0.3

I am trying to run ethercat_slave on ICE

First of all I have removed "${PROJECT_ROOT}/.config/xconfig_ethercat/config.bld" from XDCtools because it was not building with this one.

The build log after this is;

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

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../ethercat.cfg'
'Invoking: XDCtools'
"C:/ti/xdctools_3_25_03_72/xs" --xdcpath="C:/ti/bios_6_35_04_50/packages;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.A8Fnv -p ti.platforms.evmAM3359 -r debug -c "C:/ti/ccsv5/tools/compiler/arm_5.1.1" --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.3/sdk/examples/ethercat_slave_3/src/sysbios.aea8fnv ...
clea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/BIOS.c ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/TaskSupport_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/exc/Exception_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/a8/TimestampProvider_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/a8/Mmu_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/a8/Cache_asm.asm ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm.s470 ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm_switch.s470 ...
asmea8fnv C:/ti/bios_6_35_04_50/packages/ti/sysbios/timers/gptimer/Timer_asm.s470 ...
asmea8fnv C:/ti/bios_6_35_04_50/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 ...
Build of libraries done.
clea8fnv package/cfg/ethercat_pea8fnv.c ...
'Finished building: ../ethercat.cfg'
' '
1 file(s) copied.
making ../src/sysbios.aea8fnv ...
gmake[1]: Nothing to be done for `all'.
'Building file: ../tiescappl.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv5/tools/compiler/arm_5.1.1/bin/armcl" -mv7A8 --code_state=32 --abi=eabi -me --include_path="C:/ti/ccsv5/tools/compiler/arm_5.1.1/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.3/sdk/examples/ethercat_slave_3" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/os_drivers/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/platform/am335x/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/protocols/ethercat_slave/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/protocols/ethercat_slave/firmware" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/starterware/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/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/ccsv5/tools/compiler/arm_5.1.1/bin/armcl" -mv7A8 --code_state=32 --abi=eabi -me --include_path="C:/ti/ccsv5/tools/compiler/arm_5.1.1/include" --include_path="C:/ti/am335x_sysbios_ind_sdk_1.1.0.3/sdk/examples/ethercat_slave_3" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/os_drivers/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/platform/am335x/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/protocols/ethercat_slave/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/protocols/ethercat_slave/firmware" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/starterware/include" --include_path="C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/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"
'Finished building: ../tiescutils.c'
' '
'Building target: ethercat.out'
'Invoking: ARM Linker'
"C:/ti/ccsv5/tools/compiler/arm_5.1.1/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/ccsv5/tools/compiler/arm_5.1.1/lib" -i"C:/ti/ccsv5/tools/compiler/arm_5.1.1/include" -i"C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/platform/am335x/lib" -i"C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/os_drivers/lib" -i"C:/ti2/am335x_sysbios_ind_sdk_1.1.0.3/sdk/protocols/ethercat_slave/stack_lib" --reread_libs --warn_sections --xml_link_info="ethercat_linkInfo.xml" --rom_model -o "ethercat.out" -l"./configPkg/linker.cmd" "./tiescutils.obj" "./tiescappl.obj" "../am335x.cmd" -l"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/platform/am335x/lib/am335x_platform.lib" -l"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/starterware/binary/armv7a/cgt_ccs/am335x/drivers/drivers.lib" -l"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/starterware/binary/armv7a/cgt_ccs/am335x/evmAM335x/platform/platform.lib" -l"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/protocols/ethercat_slave/stack_lib/ecat_slave_stack.lib" -l"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/os_drivers/lib/sys_bios_driver.lib" -l"libc.a"
<Linking>
'Finished building target: ethercat.out'
' '
"C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk/tools/post_build/post_build.bat" "C:/ti/ccsv5" "C:/ti/ccsv5/tools/compiler/arm_5.1.1" "C:\ti\am335x_sysbios_ind_sdk_1.1.0.3\sdk\examples\ethercat_slave_3\Debug" "ethercat" "C:\ti2\am335x_sysbios_ind_sdk_1.1.0.3\sdk\tools\isdk_image\" "1" "0" "0x80000000" "0x80000000"
"COMPILER ARM_5_x"
1 file(s) copied.
C:\ti\am335x_sysbios_ind_sdk_1.1.0.3\sdk\examples\ethercat_slave_3\Debug
Input File - ethercat.bin
Output File - ethercat_SD.bin
Generating TI_Image of [Application] to be stored in [SD Card]

Input File - ethercat.bin
Output File - ethercat_SPI.bin
Generating TI_Image of [Application] to be stored in [SPI Flash]

finished
' '

**** Build Finished ****

Now I am trying to debug it on ICE but it is disconnected while loading. When I tried to reset the emulator I get the following in the serial port.

*** StarterWare Boot Loader. Build - ***
Copying application image from MMCSD to RAM
Unable to open application file from MMCSD
Copying application image from SPI to RAM
Image Copy Successful, Executing Application..

any idea why it doesnt compile with the bld setting and why it doesnt run on board?

thanks

  • I don't see any error in the build log...

    On the emulation you should try an easier example to make sure your emulation setup is working fine.

    Regards.

  • Thanks!

    I have already run i2c and ethernetip example on the board without any problems.

    So I believe the settings for the emulator should be ok.

  • Are you trying to run the application via J-Tag or are you flashing it on the ICE board?

  • j-Tag. Emulator device is XDS100v2 USB Emulator/IcePick_D_0

    cpus are m3_wakeupSS, cortxA8 and 2 prus

    thanks

  • Please ensure you carry out the following after you connect to CortexA8

    1) CPU Reset (HW) -- Select CortexA8, and Run -> Reset -> CPU Reset (HW)

    2) Load the GEL file (in sdk\tools\gel\ICE\) and run the Initialization script: Scripts -> AM335x System Initialization -> AM3359_ICE_Initialization.

    After these, load and execute the application.

    Also ensure that the USB cable you are using is in good condition.

  • Thanks!

    I did what you say but i can not debug the SW. 

    The application invokes disconnected and when I try to "connect target" the applicaiton stops and I get this;

    0x000233BE(no symbols are defined for (0x000233BE)

    When I run;

    I get

    "*** StarterWare Boot Loader. Build - ***
    Copying application image from MMCSD to RAM
    Unable to open application file from MMCSD
    Copying application image from SPI to RAM
    Image Copy Successful, Executing Application.."

    in the terminal.

    Does this mean that ethercat application is up and running? Isnt it possible to debug it? Why dont I get this behaviour when I use ethernet_ip example. Because when I try ethernet_ip example gel initilization is automatically done while loading the application.

    Anyway many thanks for your help I really need to run this ethernet example on this board.

  • I have never seen that loading an application caused the debugger to disconnect. Actually in your case I believe it is causing a complete reset of the board as the device then boots from SPI (whatever app was stored there - usually th EtherCAT example...).

    To my mind that indicates a bug in your application build and the memory map is all wrong so that during load the debugger does write into some device register space causing bad things. As we really tested the examples I assume this has to do with the fact that you changed the build config manually.

    So go back and re-install the SDK to start from scratch. Import the project again and open app.cfg once. Now re-build the projects. This needs to work without errors or your whole CCS setup has an issue. The resulting .out file should work with the debugger. You might want to check the .map file for correct memory allocation.

    Regards.

  • Ok Many Thanks I ll try. I guess this is happening because I needed to remove .bld from xdctools setup. 

    By the way this will be my more than 10th reinstallation of SDK:)