Hello,
I've got a problem while trying to run a Ethercat-Slave application synchron to the SyncManger2.
My hardware setup is as following: Master (Beckhoff TwinCAT 3.1) <---> Slave (TMDSICE3359). The ethercat slave is configured to the provided "ethercat_slave_full_AM335x_arm" example, which means it has process data output and input.
The error is reproducible with following steps:
1. Run the ethercat network in "free run" mode
2. Request OP state from the slave. The slave goes into OP.
3. Deactivate/Toggle "free run" mode in TwinCAT.
The slave now goes after 100 ms (configured PD watchdog timeout) back to SAFEOP. TwinCAT shows following error log:
22.05.2018 11:33:20 116 ms | 'Box 2 (complex slave)' (1001): abnormal state change (from 'OP' to 'SAFEOP') with code 0x1b, 'Sync manager watchdog'. Try to go back to 'OP'...
I suspect the root cause for the error either in my configuration, or in the TI ethercat slave PRU software.
My software configuration is as following:
I obtained the slave stack code from Beckhoff and enabled ESC_SM_WD_SUPPORTED, AL_EVENT_ENABLED and DC_SUPPORTED. I generated the slave stack code and copied the files to the ethercat_slave_full_AM335x_arm project.
According to the PRU ICSS EtherCAT firmware API guide, ENABLE_PDI_TASK and ENABLE_SYNC_TASK are defined in tiescbsp.h.
The software versions of the development kits which I use are listed here in the screenshot:
Observations:
The function CheckIfEcatError(void) in ecatslv.c sets the error code 0x1b (ALSTATUSCODE_SMWATCHDOG), as a result of the expired watchdog.
HW_EscReadWord(WdStatusOK, ESC_PD_WD_STATE); WdStatusOK = SWAPWORD(WdStatusOK); wdBuffer[wdBufferIndex] = WdStatusOK; wdBufferIndex++; wdBufferIndex = wdBufferIndex % 1023; if (!(WdStatusOK & ESC_PD_WD_TRIGGER_MASK) && (nPdOutputSize > 0)) { /*The device is in OP state*/ if (bEcatOutputUpdateRunning ) { AL_ControlInd(STATE_SAFEOP, ALSTATUSCODE_SMWATCHDOG); return; } else { bEcatFirstOutputsReceived = FALSE; } }
However the PRU ICSS EtherCAT firmware API guide says:
"bsp_set_pdi_wd_trigger_mode
Function
void bsp_set_pdi_wd_trigger_mode (Uint32 mode)
Parameters
•• mode: PDI_WD_TRIGGER_RX_SOF/PDI_WD_TRIGGER_LATCH_IN/PDI_WD_TRIGGER_SYNC0/1_OUT
•• Return value: none
Description Configure PDI WD trigger mode, PDI WD is triggered automatically by h/w on RX_SOF(port0/port1),
latch0/1 input high, SYNC0/1 out high. PDI WD is also triggered whenever host sends a command to firmware. PDI
WD may not expire if host stops sending commands to firmware alone, this will occur only if configured h/w events
do not occur during WD period"
For my case, the watchdog should get resetted because of the incoming cyclic data from the master, AND sending commands from A8 to PRU.
I don't understand why the watchdog still expires. Can anybody help me, or give me a hint what I can double check?
Please ask for additional required information of my environment.