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.

AM2434: AM2434 EtherCAT demo: IGH master Failed to send file to the slave over FOE protocol

Part Number: AM2434

Hi TI expert,

I encountered a problem while attempting to send a file over the FOE protocol. My device is a TMDS243GPEVM, and the SDK version I am using is mcu_plus_sdk_am243x_08_06_00_43. The EtherCAT master version is IgH EtherCAT master 1.6.0-rc1. The CCS project was imported from the SDK example: ethercat_slave_cia402_demo_am243x-evm_r5fss0-0_freertos_ti-arm-clang.

I made some modifications to the demo project by adding a few lines of code to register the callback function for the FOE protocol. The callback function defined in  SDK: mcu_plus_sdk_am243x_08_06_00_43\examples\industrial_comms\ethercat_slave_demo\common\os\freertos\ESL_foeDemo.c.

I am utilizing the IGH foe_write command to send a file to the AM2434. However, upon entering the command, I encountered the error "Failed to write via FoE: FOE_TIMEOUT_ERROR."

In an attempt to diagnose the issue, I captured network packets using Wireshark. It appears that the Slave device did not respond with an "ACK" to the last packet, leading to a master FOE timeout error.

The last packet is 108 bytes, while the previous packets were 244 bytes. Could this difference in packet size be the reason why the slave is unable to process the frame?

Could you please help me refine this message?

  • Hello, could anyone provide some advice on how to resolve this issue?

  • Hi Zhaofei,

    Sorry for the late reply. I believe this is the similar issue mentioned in the following E2E: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1340959/am2432-error-occurs-when-using-igh-ethercat-master-ver-1-6-0

    As quoted in the above link, IgH master by default does not work with TI ESC as it uses non-optimal PDO config which requires TI ESC to increase process path latency per device by 400ns.

    In order to increase the process path latency, you can do the folowing:

    • You can set the value for TIESC_PORT0_TX_DELAY_200_MHZ_CLOCK in tiescbsp.h located at {SDK_DIRECTORY}/source/industrial_comms/ethercat_slave/icss_fwhal to 0x98. Here is the code snippet for the above. Line 4 is the mentioned change from 0x48 to 0x98. 
      #if ENABLE_MULTIPLE_SM_ACCESS_IN_SINGLE_DATAGRAM
      #define TIESC_PORT0_TX_DELAY_200_MHZ_CLOCK    0x98
      #else
      #define TIESC_PORT0_TX_DELAY_200_MHZ_CLOCK    0x98
      #endif
      #define TIESC_PORT1_TX_DELAY_200_MHZ_CLOCK    TIESC_PORT0_TX_DELAY_200_MHZ_CLOCK
      Do note that after making the above change, the fwhal library file need to be re-built.

    Do let us know if this workaround is effective on your case.

    Regards,

    Aaron 

  • Hi ,

    Thank you for your response. I tried the method you suggested, but it did not work, and the issue persists.

    You can set the value for TIESC_PORT0_TX_DELAY_200_MHZ_CLOCK in tiescbsp.h located at {SDK_DIRECTORY}/source/industrial_comms/ethercat_slave/icss_fwhal to 0x98. Here is the code snippet for the above. Line 4 is the mentioned change from 0x48 to 0x98.

    Regarding the FOE part, I attempted to examine the source code. I obtained the source code from SSC_V5i13 but could not locate the source code for functions with names like "EC_API_SLV_xxx," such as EC_API_SLV_FoE_cbRegisterWriteFileHandler. I have a few questions:

    1. Where can I find the source code for functions named "EC_API_SLV_xxx"?

    2. What is the relationship between the source code of functions named "EC_API_SLV_xxx" and the SSC source code from SSC_V5i13? Is the underlying implementation of EC_API_SLV_xxx still based on SSC?

  • Hi ,

    I tried the method you suggested, but it did not work, and the issue persists.
    • Can you try writing the value 0x98 to the register 0x30090E10 and 0x30090E12 while in INIT state. (Reconnect the device with the master once the value is updated)
    I have a few questions:
    • I have notified the stack team regarding your queries. Will get back to you as soon as possible.

    Regards,

    Aaron 

    • Where can I find the source code for functions named "EC_API_SLV_xxx"?

    • What is the relationship between the source code of functions named "EC_API_SLV_xxx" and the SSC source code from SSC_V5i13? Is the underlying implementation of EC_API_SLV_xxx still based on SSC?


    1.) Unfortunately, the source code is not provided for the API functions of the stack, since the stack itself is proprietary software and closed-source.

    2.) For the same reason mentioned in 1.), we can't give details about the exact implementation of the stack APIs. However, the SSC serves as an low level interface on which our APIs are based.