Hi,
I try to debug some SDO upload request (expedited) of specific index at specific slave address that don't work.
Soon we figured out that the address that we send to the PRU and the one on the "wire" was not the same.
As far as I can follow the address, his value is as wanted:
UINT8 MBX_CopyToSendMailbox( TMBX MBXMEM *pMbx )
{
if ( (nAlStatus & STATE_MASK) == STATE_INIT)
{
/* the mailbox is disabled if the slave is in the INIT state */
return( ERROR_INVALIDSTATE );
}
if ( !bMbxRunning )
{
/* the mailbox is disabled if the slave is in the INIT state */
return( ERROR_INVALIDSTATE );
}
if ( bSendMbxIsFull )
{
/* mailbox service cannot be sent because the send mailbox is still full */
return MBXERR_NOMOREMEMORY;
}
else
{
/* the variable mbxSize contains the size of the mailbox data to be sent */
UINT16 mbxSize = pMbx->MbxHeader.Length;
PRINTLN("HW_EscWriteMbxMem at addr: 0x%X", pMbx->MbxHeader.Address); /////////////////////////////// output: HW_EscWriteMbxMem at addr: 0x3EA
HW_EscWriteMbxMem((MEM_ADDR *)pMbx, u16EscAddrSendMbx, (mbxSize + MBX_HEADER_SIZE));
Wireshark trace:
Frame 964: 71 bytes on wire (568 bits), 71 bytes captured (568 bits) on interface 0
Interface id: 0 (\Device\NPF_{D1941824-1A2A-45F5-9238-CCAE8E883F8B})
Interface name: \Device\NPF_{D1941824-1A2A-45F5-9238-CCAE8E883F8B}
Encapsulation type: Ethernet (1)
Arrival Time: Aug 6, 2019 14:26:16.629419000 Eastern Daylight Time
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1565115976.629419000 seconds
[Time delta from previous captured frame: 0.000008000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 1.154025000 seconds]
Frame Number: 964
Frame Length: 71 bytes (568 bits)
Capture Length: 71 bytes (568 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ecatf:ecat:ecat_mailbox]
Ethernet II, Src: Beckhoff_01:00:00 (01:01:05:01:00:00), Dst: 22:47:47:cc:37:f4 (22:47:47:cc:37:f4)
Destination: 22:47:47:cc:37:f4 (22:47:47:cc:37:f4)
Address: 22:47:47:cc:37:f4 (22:47:47:cc:37:f4)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: Beckhoff_01:00:00 (01:01:05:01:00:00)
[Expert Info (Warning/Protocol): Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)]
[Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)]
[Severity level: Warning]
[Group: Protocol]
Address: Beckhoff_01:00:00 (01:01:05:01:00:00)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
Type: EtherCAT frame (0x88a4)
EtherCAT frame header
.... .000 0011 0111 = Length: 0x037
.... 0... .... .... = Reserved: Valid (0x0)
0001 .... .... .... = Type: EtherCAT command (0x1)
EtherCAT datagram(s): 3 Cmds, 'FPRD': len 16, 'FPRD': len 1, 'FPRD': len 2
EtherCAT datagram: Cmd: 'FPRD' (4), Len: 16, Adp 0x3e9, Ado 0x1080, Cnt 1
Header
Cmd : 4 (Configured address Physical Read)
Index: 0xaa
Slave Addr: 0x03e9
Offset Addr: 0x1080
Length : 16 (0x10) - No Roundtrip - More Follows...
.... .000 0001 0000 = Length: 16
..00 0... .... .... = Reserved: Valid (0)
.0.. .... .... .... = Round trip: Frame is not circulating
1... .... .... .... = Last indicator: More EtherCAT datagrams will follow
Interrupt: 0x0000
EtherCAT Mailbox Protocol:CoE SDO Req : 'Initiate Upload' (2) Idx=0x1001 Sub=0
Header
Length: 10
Address: 0x03e9
.... ..00 = Priority: 0
Type: CoE (CANopen over EtherCAT) (3)
Counter: 2
CoE
Number: 0
Type: SDO Req (2)
SDO Req : 'Initiate Upload' (2) Idx=0x1001 Sub=0
Init Upload: 0x40
...0 .... = Access: Legacy
Index: 0x1001
SubIndex: 0x00
Working Cnt: 1
EtherCAT datagram: Cmd: 'FPRD' (4), Len: 1, Adp 0x3e9, Ado 0x10ff, Cnt 1
Header
Cmd : 4 (Configured address Physical Read)
Index: 0x00
Slave Addr: 0x03e9
Offset Addr: 0x10ff
Length : 1 (0x1) - No Roundtrip - More Follows...
.... .000 0000 0001 = Length: 1
..00 0... .... .... = Reserved: Valid (0)
.0.. .... .... .... = Round trip: Frame is not circulating
1... .... .... .... = Last indicator: More EtherCAT datagrams will follow
Interrupt: 0x0000
Data: 00
Working Cnt: 1
EtherCAT datagram: Cmd: 'FPRD' (4), Len: 2, Adp 0x3eb, Ado 0x1080, Cnt 0
Header
Cmd : 4 (Configured address Physical Read)
Index: 0x00
Slave Addr: 0x03eb
Offset Addr: 0x1080
Length : 2 (0x2) - No Roundtrip - Last Sub Command
.... .000 0000 0010 = Length: 2
..00 0... .... .... = Reserved: Valid (0)
.0.. .... .... .... = Round trip: Frame is not circulating
0... .... .... .... = Last indicator: Last EtherCAT datagram
Interrupt: 0x0000
Data: 0000
Working Cnt: 0
Version - EtherCAT Slave 01.00.07.02
Board name : AM43_IDK
Board Revision : 1.4A
EtherCAT Device
SYS/BIOS EtherCAT Internal application 3.3.0ENETPHY_FindingState: PhyNum: 0
I already tried this:
#define ENABLE_MULTIPLE_SM_ACCESS_IN_SINGLE_DATAGRAM 1
Thank you
Stéphane Germain