infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 3 of 3

Thread: XMC4800 EtherCAT Fatal Sync Error

  1. #1
    Beginner Beginner GraemeF is on a distinguished road
    Join Date
    Jun 2019
    Location
    New Zealand
    Posts
    11
    Points
    145

    XMC4800 EtherCAT Fatal Sync Error

    Hi,

    I have been getting the occasional Alarm Status 0x002C: Fatal Sync Error occur from my EtherCAT master. My project is based on the ETHCAT_SSC_AUT_BASE_XMC48 example project. I have distributed clocks enabled with a PDO period of 1ms. I'm using Slave Stack Code 5.12.

    I have put an oscilloscope on to monitor the Sync0 SYNC0IRQHandler function and the EtherCAT ecat_ssc_timer_handler function. The ecat_ssc_timer_handler function is slowly drifting and occasionally crosses the SYNC0IRQHandler function.

    The SYNC0IRQHandler has an interrupt priority of 30
    ecat_ssc_timer_handler has an interrupt priority of 63

    I think I have tracked down the problem to the SYNC0IRQHandler occasionally preempting the ecat_ssc_timer_handler when it is in the middle of incrementing Sync0WdCounter (ecatslv.c, DC_CheckWatchdog(), line 2163). If this is the case then the old value will be incremented and the reset of the value in SYNC0IRQHandler (ecatappl.c, Sync0_Isr(), line 576) will be missed. i.e. the old value of 1 will continue to be incremented to 2. If the ecat_ssc_timer_handler DC_CheckWatchdog() function then manages to check the Sync0WdCounter value on the next cycle before being interrupted it will raise a watchdog error resulting in the Fatal Sync Error.

    To work around this problem I have:
    • updated the CPU_CTRL_XMC4_0 "Number of priority bits for priority grouping" value to: 4
    • modified the interrupt priorities to:
      INT_SYNC0, priority: 10, sub-priority: 0
      INT_SYNC1, priority: 10, sub-priority: 1
      ECAT_INTERRUPT_0, priority: 10, sub-priority: 2

    Giving the ECAT_INTERRUPT_0 object (which calls ecat_ssc_timer_handler) the same priority as the INT_SYNC0 object (which calls SYNC0IRQHandler) will effectively serialize the two handlers, but the sub-priorities will give INT_SYNC0 and INT_SYNC1 order preference.

    Regards,
    Graeme.

  2. #2
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    MichaelIFX is on a distinguished road
    Join Date
    Mar 2016
    Posts
    48
    Points
    484.53125
    The example you reference is only compatible with SSC5.11.

    If you like to work with SSC5.12, you can download the example ETHCAT_SSC_XMC48 from here
    https://www.infineon.com/cms/en/prod...downloads.html
    Just follow the instructions/documentation of this example, but please take note, that the pinning needs to be adapted to the automation board.
    The pinning of example ETHCAT_SSC_XMC48 origins from the XMC48 Relax Kit.

    General advice: Every time you download a new EtherCAT APP make sure to erase the complete flash (e.g. using SEGGER).
    By this you can make sure, the emulated EEPROM inside FLASH is erased as well and you new application is correctly installed.

    Kind Regards

    Michael
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    Beginner Beginner GraemeF is on a distinguished road
    Join Date
    Jun 2019
    Location
    New Zealand
    Posts
    11
    Points
    145
    Hi Michael,

    Thanks for the link to the example. It looks like the example has used the same solution, giving INTERRUPT_0 the same interrupt priority as INT_SYNC0 and INT_SYNC1.

    In my case there is a higher priority interrupt function that may still be running briefly when any of the above interrupts are due. When it exits I would like to give priority to INT_SYNC0 before INTERRUPT_0 so it is quite handy using the sub-priority option.

    The other main difference I can see is the implementation of ENABLE_ESC_INT_USER() and DISABLE_ESC_INT_USER(). Will implement that and I should be good to go.

    Thanks,
    Graeme.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.