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: FoE (File access over EtherCAT) doesn't work as expected.

Part Number: AM2434
Other Parts Discussed in Thread: IND-COMMS-SDK

Tool/software:

Hi,

The customer tried File access over EtherCAT (FoE) included in Industrial Communications SDK, but they were not able to get an expected result. Could you help to answer their question below ?

 

---- From Customer ---------------------------------

I followed the steps described in C:/ti/motor_control_sdk_am243x_11_00_00_06/ind_comms_sdk/docs/am243x/ethercat_subdevice/_fo_e_page.html, then got an unexpected result. See below for details.

 

<Used example>

C:\ti\ind_comms_sdk_am243x_11_00_00_08\examples\industrial_comms\ethercat_subdevice_demo\device_profiles\401_simple\am243x-lp\r5fss0-0_freertos

 

<Steps> I followed:

C:/ti/motor_control_sdk_am243x_11_00_00_06/ind_comms_sdk/docs/am243x/ethercat_subdevice/_fo_e_page.html

 

"Download file and uploaded file are included in attached zip file.

F337CC24.zip

- download file : this_is_a_test_file.txt

- uploaded file : result.txt"

 

"The files, this_is_a_test_file.txt and result.txt, are different.

I expected the files should be the same."

 

"In my debug, foeFileHeader seems to be written correctly, however content of file is failed. 2 files are modified from original example, nvm.c, ESL_foeDemo.c, which are also included in .zip. As you see, some log outputs are added them. Their outputs as follows:

 

- on downloading

```

EC_SLV_APP_FoE_fileOpen() : pName=test, nameLen=4, isRead=0, password=0x0

EC_SLV_APP_FoE_fileWrite() : size=19

EC_SLV_APP_FoE_fileClose() : errorCode=0x0

NVM_APP_write() : id=0, offset=2097408, length=20, forceErase=1

74 68 69 73 5f 69 73 5f 61 5f 74 65 73 74 5f 66

69 6c 65 00

NVM_APP_write() : id=0, offset=2097152, length=44, forceErase=1

00 00 00 00 14 00 00 00 01 01 04 74 65 73 74 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00

```

 

- on uploading

```

EC_SLV_APP_FoE_fileOpen() : pName=test, nameLen=4, isRead=1, password=0x0

NVM_APP_read() : id=0, offset=2097152, length=44

00 00 00 00 14 00 00 00 01 01 04 74 65 73 74 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00

EC_SLV_APP_FoE_fileRead() : size=1012, fileOffset=0

NVM_APP_read() : id=0, offset=2097408, length=19

ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

ff ff ff

```"

------------------------------------------

 

Could you help to provide any advice to them ?

 

 

Thanks and regards,

Hideaki

 

  • Hello Hideaki Matsumoto,

    The TI EtherCAT 401-Simple demo example support FoE file upload/download and should work without any additional code modifications. In your case, the problem is with the additional printing loop added in the nvm.c and ESL_foeDemo.c file. This printing loop in the API NVM_APP_write() and NVM_APP_read() creates an additional delay and leads to timeout in TwinCAT.

    for(int i=0 ; i<length ; i++) {
        uint8_t* p = (uint8_t*)pData;
        OSAL_printf("%02x ", p[i]);
        if(i % 16 == 15) {
            OSAL_printf("\r\n");
        }
    }
    OSAL_printf("\r\n");

    Please remove all the printing loops added and test again.

    Kind Regards,

  • Hi Harsha,

    Thank you for your proposal, and sorry for our delayed response. The customer tried again without any modifications to ethercat_subdevice_simple_demo_am243x-lp_r5fss0-0_freertos_ti-arm-clang of ind_comms_sdk_am243x_2025_00_00_05. Then, an error occurs. Please see below for details.

    - ind_comms_sdk_am243x_2025_00_00_05
    - build ethercat_subdevice_simple_demo_am243x-lp_r5fss0-0_freertos_ti-arm-clang without any modification.
    - download .out and run (debug mode) with no breakpoints.
    - follow steps described in:
    - file:///C:/ti/ind_comms_sdk_am243x_2025_00_00_05/docs/am243x/ethercat_subdevice/_fo_e_page.html
    - section : File Download
    They got an error on TwinCAT with 20byte text file:
    Do you have any idea to solve this error ?
    Thanks and regards,
    Hideaki
  • Hi Hideaki,

    Yes. I was able to reproduce the timeout issue when downloading a smaller file (<256bytes) via FoE and I have shared the patch to fix this issue over a mail.

    Kind Regards,

  • Hi Harsha,

    Thank you so much for sharing the patch file. They was able to passed the timeout error, thank you.

    However, the status has been changed a little. Could you please help again below.

    From the customer,
    --------------------------------------------------------------------------- 

    I tried again without any modifications to ethercat_subdevice_simple_demo_am243x-lp_r5fss0-0_freertos_ti-arm-clang of ind_comms_sdk_am243x_2025_00_00_05. Then, an error occurs.

    The download file and the uploaded file are mismatch. Please see below for details.

     

    - ind_comms_sdk_am243x_2025_00_00_05

    - build ethercat_subdevice_simple_demo_am243x-lp_r5fss0-0_freertos_ti-arm-clang without any modification.

    - download .out and run (debug mode) with no breakpoints.

    - follow steps described in:

    - file:///C:/ti/ind_comms_sdk_am243x_2025_00_00_05/docs/am243x/ethercat_subdevice/_fo_e_page.html

    - section : File Download

     

    I got an error on TwinCAT with 20byte text file:

      

    The error above(timeout error) is passed because timeout settings for mailbox on TwinCAT is changed to be longer. 

     

    "download.txt" is downloaded to evaluation board. Then, the file is uploaded and saved to "uploaded.txt".

    The expected result is that "download.txt" is the same as "uploaded.txt". However, they are different. Contents of "download.txt" and "uploaded.txt" are shown bellow:

     

    C:\Users\yuuba\Documents\work>hexdump -C download.txt

    00000000 74 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66         | this is a test f |

    00000010 69 6c 65 2e                                                                         | ile. |

    00000014

     

    C:\Users\yuuba\Documents\work>hexdump -C uploaded.txt

    00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                                         | ................ |

    00000010 ff ff ff ff                                                                                | .... |

    00000014

    -------------------------------------------------------------------------------------------- 

    Thanks and regards,

    Hideaki

  • Hello Hideaki,

    Thanks for confirming that the FoE timeout issue has been resolved. Unfortunately, I could not reproduce this issue at my end. Could you please share the binary file that the customer is testing with?

    The error above(timeout error) is passed because timeout settings for mailbox on TwinCAT is changed to be longer. 

    Please confirm whether the patch has been applied to ind-comms-sdk or not?

    Kind Regards,

  • Hi Harsha,

    Thank you for your reply.

    Thanks for confirming that the FoE timeout issue has been resolved. Unfortunately, I could not reproduce this issue at my end. Could you please share the binary file that the customer is testing with?

    What kind of binary do you need ? Their test application code ? downloading file ? or both ?

     

     

    Please confirm whether the patch has been applied to ind-comms-sdk or not?

    No, they didn't.

    Thanks and regards,

    Hideaki

  • Hello Hideaki,

    What kind of binary do you need ? Their test application code ? downloading file ? or both ?

    Please share the EtherCAT SubDevice 401-Simple example binary that they are testing. Kindly apply the patch that I shared earlier and try to reproduce this issue. 
    I'm requesting their binary since I could not reproduce this issue at my end with the EtherCAT SubDevice 401-Simple example that I built locally.

    I will also share the binaries over drive that I tested at my end. 

    Kind Regards,