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.
Tool/software: TI-RTOS
Hello,
Following this Link http://processors.wiki.ti.com/index.php/PRU_ICSS_EtherCAT. I was able to to make a Slave Project ethercat_slave_full_AM572x_arm for ARM Subsystem which works.
Code Composer Studio Version: 7.2.0.00013, XDC Tools Revision 3.32.1.22, SYS/BIOS 6.46.5.55, am57xx PDK, 1.08PRU-ICSS-EtherCAT_Slave_01.00.05.00
I have started to make a Project for C66xx_DSP, which I can compile now after some changes in Cfg-File and in
tiesbsb.h
#ifndef DSP_ETHERCAT_COMPATIBILITY
#define ASSERT_DMB() __asm(" dmb")
#define ASSERT_DSB() __asm(" dsb")
#else
#define ASSERT_DMB() __asm(" mfence")
#define ASSERT_DSB() __asm(" mfence")
#endif
I am not sure about if the dmb and dsb (arm) can be translated.
After Debug the demo I have mentioned that the Example is made for the Arm. so that
PRUICSS_registerIrqHandler(pruIcssHandle,evtOutNum,pruIsrNum, ....) Fails. The Reason ist that evtOutNum and pruIsrNum are mapped for the ARM
Cause I am not really firm with the EtherCat and the PRU I Need more Information about the Interface to the PRU-EtherCat Firmware
Here my Question:
Is it possible to run the demo on DSP Subsystem in principle?
Which changes I have to make or the Points i have to Change (ARM <-> DSP) in General.
Uemit.
Hi Garrett,
I have progarmmed the part wirh EventCombiner(). The EscCmdLowAckIsr in now called().
After commenting out Board_getDigInput() in APPL_Application() (SPI_Transfer hangs, dont know why) i could find myEtherCat Slave in EC-Engineer via "Scan Ethernet Network"
On Starting "Diagnose Mode" on PC-EC-Enigineer the Routine EcatIsr() is called on DSP Side like in ARM.
Problem:
Failure "Failed to chane master state: ERROR: Slave error (ErrCode 0x98110024)" and the "Motor Variables" are gone.
I will look deeper tomorrow.
Regards
Ümit
Hi;
Pressing on "DiagnoseMode" in EC-Engieer
the ECATIsr() is called (I am sitting on the breakpoint) BUT
also following Message in EC-Engineer appears
The meaning is "Slave is not addressable".
Any Ideas ?
Regards
Ümit
The Problem is:
The VendorId in Ecat_def.h is only use in the ObjectRef 1018
On ARM the Slave is detected with VendorId 0x00000059 ObjectDictionary 1018=0x00000059
On DSP the Slave is detected with VendorId 0xE0000059 ObjectDictionary 1018=0x00000059
Where can I set the correct Identifier VendorId ??
After deleteing the ESI-Table on EC-Enginner i get following Information :
DSP: VendorId: 0xe000059d ProductCode: 0x54490003 RevisionNor:0x1
ARM:VendorId: 0x59d ProductCode: 0x54490003 RevisionNo:0x11
It's impressive that you can reach to this point! Is the demo fully working with DSP now?
Regards,
Garrett
Hi Garrett.
Currently I am in the Routine APPL_GeneratingMap() above main(). This routine i called on entering the "Diagnose Mode" on Ec-Engineer and calculates
Input/Output Size of the used PDO's. The calculation of the size in DSP is unfortunatly wrong! I find out the reason but i need a common solution :-)
The following line Fails on DSP calling it twice. (pPDOEntry is a *uint32_t)
OutputSize += (uint16_t)((*pPDOEntry) & 0xFF);
1st call pPDOEntry Points to &RxPDOMap.aEntry[0] and is a uint32_t
&RxPDOMap= 0x80039C5A is NOT32-Bit alligned &RxPDOMap.aEntries[0].= 0x80039C5C is 32-Bit alligned !!
2nd call pPDOEntry Points to &RxPDO1Map.aEntry[0]
&RxPDO1Map= 0x80039C70 is 32-Bit alligned &RxPDO1Map.aEntries[0].= 0x80039C72 is NOT 32-Bit alligned !!
Cause I have a *uint32_t and using a NOT alligend address it is no wonder to catch a wrong value via (*pPDOEntry)
Cause in EtherCat there i a lot of stuff belongs to the "CAN-ObjectRef" i fear the consequences. In other words: Fixing the Problem in this Routine is not a Problem but I need
a more common solution.
Not using __attribute__((packed)) for STRUCT_PACKED_END was not the solution.
May be Setting CONTROLLER_32BIT. Check this Monday.
Thx for your help.
Ümit
Hi,
Thanks for sharing this!
Have you changed the ESC mode from freeRun to DC sync through master TwinCAT?
Regards, Garrett
Hi Garrett.
in ecat_def.h the DC_ Definition is defined as follows.
#define DC_SUPPORTED 1
Ümit
Thx Garret,
Even the ARM Slave does not run with DC. The Slave does not go in operational (stays in SafeOp).
Not sure. I have just setted Operation-Mode from FreeRun to DC-Synchron in Ec-Engineer.
I will check later the TwinCAT Settings in Detail. (Tasks and so on)
Currently i do not work on this issue.
Unfortunately I captured a new failure, which i for me now more important.
Starting DSP Application, enter Ec-Enginneer Diagnose-Mode. Set Led, all is ok.
The INDUSTRIAL LED0= is green.Master state Change from Init to Pre-Op to Safe-Op to Op: seems perfect!
Than I get cyclic "No Response on cyclic Ethernet Frame" every 3-10 Minutes as DBG-Information in Message-View.
Also The Processing Unit Error Counter increases every 10-20 seconds! (This can be ok; cause it is the same behaviour on ARM)
After 1 Hour the connenction break down.
DBG | 2018-06-12 15:01:44 | Retry sending a acyclic frame due to frame loss
INF | 2018-06-12 15:01:44 | Slave with station address 1001 removed from network
DBG | 2018-06-12 15:01:44 | BusMismatch: wPrevFixedAddress=0, wPrevAIncAddress=0x0001, wPrevPort=255, Bus=0x0/0x0/0x0, Cfg=0x59D/0x54490003/0x11
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | No response on cyclic Ethernet frame
DBG | 2018-06-12 15:01:44 | Retry sending a acyclic frame due to frame loss
Maybe following Definition is incorrect? (changed by patch)
-#define MIN_PD_CYCLE_TIME 0x7A120
+#define MIN_PD_CYCLE_TIME 0x79E0// 31.2us 0x7A120
I am not sure if I must set ESC_32BIT_ACCESS. If I do so the Programm does not compile.
ESC_DC_SYNC_ACTIVATION_OFFSET is not defined.
Ümit
In Routine CheckIfEcatError() the WdStateOk (ESC_PD_WD_TRIGGER_MASK) is not setted so that Slave will Change to SafeOp.
HW_EscReadWord(WdStatusOK, ESC_PD_WD_STATE);
WdStatusOK = SWAPWORD(WdStatusOK);
if (!(WdStatusOK & ESC_PD_WD_TRIGGER_MASK) && (nPdOutputSize > 0))
{
/*The device is in OP state*/
if (bEcatOutputUpdateRunning
#if !OP_PD_REQUIRED
&& bEcatFirstOutputsReceived
#endif
)
{
AL_ControlInd(STATE_SAFEOP, ALSTATUSCODE_SMWATCHDOG);
return;
}
#define SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER 1 in ecat_def.h
Test with TwinCAT 3.1.
Set LED ok
running 3 days (incoming PDI's) let the Industrial LED blink!
Set LED ok
Regards,
Ümit
Hi Garret.
I have let it run for a day with following definitions.
#define UPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER 0
#define MIN_PD_CYCLE_TIME 0xFA00 // 64 ms
It seems to work
Regards
Ümit