Re: [etherlab-dev] "Master still waiting for devices!" problem.

2017-01-18 Thread Graeme Foot
Hi,


My CX2100 patch is attached.


Graeme.



From: 周甫霖 
Sent: Thursday, 19 January 2017 4:14:33 PM
To: Graeme Foot
Cc: etherlab-dev@etherlab.org
Subject: Re: [etherlab-dev] "Master still waiting for devices!" problem.

Hi Graeme,

I think that 1) and 2) was done correctly in my case.
For 3), I'll check dmesg.
For 4), I found the thread in 2013:
http://lists.etherlab.org/pipermail/etherlab-users/2013/002074.html
But I can't get the attachment since I'm not in the etherlab-user mail list.
Is there any other way to get the attachment?

Thank you for your response.
Best regards - Erix Chou

2017-01-19 5:27 GMT+08:00 Graeme Foot 
>:

I can think of four possible errors at the moment:


1) Your ethercat configuration file isn't matching the correct MAC address.


In /etc/sysconfig/ethercat you have "MASTER0_DEVICE="ff:ff:ff:ff:ff:ff"".  
ff:ff:ff:ff:ff:ff matches the first available device, looking at devices in the 
order the drivers are loaded (in the DEVICE_MODULES key).  So you may have 
sepecified a MAC address that is not matching your device



2) You are not loading your device module.


In /etc/sysconfig/ethercat you have "DEVICE_MODULES=".  This specifies the 
network driver modules (ethercat versions) that you want to run (space 
delimited list).  You should put your module first in the list if you use a 
generic MAC address (ie: ff:ff:ff:ff:ff:ff) in the setting above.


eg:

DEVICE_MODULES="cpsw e1000 e1000e"



3) Your driver doesn't work.


Check dmesg for any errors.



4) Your driver is not correctly integrating with the EtherCAT master.


There's various functions that your driver needs to interact with the master.  
But from memory the one that tells the master that a device is available is:

ecdev_offer();



But the guts of it is that no offered net devices match the requirements of the 
MASTER0_DEVICE config setting.



I wrote a patch for the CX2100 device a while ago.  You could look it up in the 
forums to check how it interacts with the master (or I could send it if you 
can't find it).  Look for the ecdev_... methods and the notes about the skb's.



Regards,

Graeme.






From: etherlab-dev 
> 
on behalf of 周甫霖 >
Sent: Wednesday, 18 January 2017 9:26:42 PM
To: etherlab-dev@etherlab.org
Subject: [etherlab-dev] "Master still waiting for devices!" problem.

Hi all,

First appreciate the implement of etherlabmaster.
I'm devolping a non-native supported ethernet device to be able to work as a 
RTDM EtherCAT master.
What the device is one part of TI AM335x SoC and is named "cpsw".
Everything smoothly while adapting driver code, building module file, and 
installing.
But I was stuck by a problem when I try to start EtherCAT master.
Following is my steps and message shown by dmesg:

# /etc/init.d/ethercat start
Starting EtherCAT master 1.5.2  done

[   30.849754] EtherCAT: Requesting master 0...
[   30.854265] EtherCAT ERROR 0: Master still waiting for devices!

More information:

# /opt/etherlab/bin/ethercat master
Master0
  Phase: Waiting for device(s)...
  Active: no
  Slaves: 0
  Ethernet devices:
Main: a0:f6:fd:22:bd:ed (waiting...)
  Link: DOWN
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Tx errors:   0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]:  0  0  0
  Rx rate [KByte/s]:  0.00.00.0
Common:
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Lost frames: 0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]: -509579 -509608 -335544
  Rx rate [KByte/s]:   845836.0 -469824.0 163840.0
  Loss rate [1/s]:  0  0  0
  Frame loss [%]: 0.00.00.0
  Distributed clocks:
Reference clock: None
Application time: 0
  2000-01-01 00:00:00.0



Could anyone kindly advice what is the key point to go forword form "waiting 
device"?

Best regards - Erix Chou



--
動程科技有限公司
台南市安平區建平十七街159號七樓之一
周甫霖 Erix Chou
E-mail:erixc...@mapacode.tw
TEL:06-2970665
Mobile:0985946776


etherlabmaster-1.5-2266-d_cx2100.patch
Description: etherlabmaster-1.5-2266-d_cx2100.patch
___
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev


Re: [etherlab-dev] "Master still waiting for devices!" problem.

2017-01-18 Thread Graeme Foot
I can think of four possible errors at the moment:


1) Your ethercat configuration file isn't matching the correct MAC address.


In /etc/sysconfig/ethercat you have "MASTER0_DEVICE="ff:ff:ff:ff:ff:ff"".  
ff:ff:ff:ff:ff:ff matches the first available device, looking at devices in the 
order the drivers are loaded (in the DEVICE_MODULES key).  So you may have 
sepecified a MAC address that is not matching your device



2) You are not loading your device module.


In /etc/sysconfig/ethercat you have "DEVICE_MODULES=".  This specifies the 
network driver modules (ethercat versions) that you want to run (space 
delimited list).  You should put your module first in the list if you use a 
generic MAC address (ie: ff:ff:ff:ff:ff:ff) in the setting above.


eg:

DEVICE_MODULES="cpsw e1000 e1000e"



3) Your driver doesn't work.


Check dmesg for any errors.



4) Your driver is not correctly integrating with the EtherCAT master.


There's various functions that your driver needs to interact with the master.  
But from memory the one that tells the master that a device is available is:

ecdev_offer();



But the guts of it is that no offered net devices match the requirements of the 
MASTER0_DEVICE config setting.



I wrote a patch for the CX2100 device a while ago.  You could look it up in the 
forums to check how it interacts with the master (or I could send it if you 
can't find it).  Look for the ecdev_... methods and the notes about the skb's.



Regards,

Graeme.






From: etherlab-dev  on behalf of 周甫霖 

Sent: Wednesday, 18 January 2017 9:26:42 PM
To: etherlab-dev@etherlab.org
Subject: [etherlab-dev] "Master still waiting for devices!" problem.

Hi all,

First appreciate the implement of etherlabmaster.
I'm devolping a non-native supported ethernet device to be able to work as a 
RTDM EtherCAT master.
What the device is one part of TI AM335x SoC and is named "cpsw".
Everything smoothly while adapting driver code, building module file, and 
installing.
But I was stuck by a problem when I try to start EtherCAT master.
Following is my steps and message shown by dmesg:

# /etc/init.d/ethercat start
Starting EtherCAT master 1.5.2  done

[   30.849754] EtherCAT: Requesting master 0...
[   30.854265] EtherCAT ERROR 0: Master still waiting for devices!

More information:

# /opt/etherlab/bin/ethercat master
Master0
  Phase: Waiting for device(s)...
  Active: no
  Slaves: 0
  Ethernet devices:
Main: a0:f6:fd:22:bd:ed (waiting...)
  Link: DOWN
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Tx errors:   0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]:  0  0  0
  Rx rate [KByte/s]:  0.00.00.0
Common:
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Lost frames: 0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]: -509579 -509608 -335544
  Rx rate [KByte/s]:   845836.0 -469824.0 163840.0
  Loss rate [1/s]:  0  0  0
  Frame loss [%]: 0.00.00.0
  Distributed clocks:
Reference clock: None
Application time: 0
  2000-01-01 00:00:00.0



Could anyone kindly advice what is the key point to go forword form "waiting 
device"?

Best regards - Erix Chou
___
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev


[etherlab-dev] Problem to get VoE Data (Etherlab master patchset 20160804)

2017-01-18 Thread Christoph Schroeder

Hi,

I am currently testing the patchset 20160804 and encountered a problem
introduced by 0005-Support-for-multiple-mailbox-protocols.patch. It's
not possible to retrieve the data via the libraries
"ecrt_voe_handler_data" function anymore after a successful
ecrt_voe_handler_read. I still get the correct data size but there is no
data found at the returned pointer address.

I guess this is the problem:
"The mailbox state machines will check and fetch the data from their own
buffer instead of the datagram buffer (that is no longer used for
mailbox read data)."

The data seems to be stored somewhere else now and the function still
returns a pointer to a datagram buffer. Communication still works and
the data is there inside the master as debuglevel=1 prints the correct
data into the kernel log. I found the lines were this is done in the new
introduced "ec_voe_handler_state_read_response_data", but how can I
access the data from the library without using ioctl calls from my user
application? I would appreciate any hint or an update of the patch.


Thanks and best regards,
Christoph



Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Karl Eugen Huthmacher, stv. Vorsitzende Dr. 
Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de
___
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev


[etherlab-dev] EoE in OP mode

2017-01-18 Thread Geller, Nir
Hi,


I recently upgraded ethercat master to Gavin Patchset 20160804, adding to that, 
patch 0061.


EoE seems to be working fine while the master is idle, with heavy SDO traffic 
in parallel.


When the master is active our realtime application invokes  
ecrt_master_receive(master);  and  ecrt_master_send(master);  from interrupt 
context, and NOT from

ec_master_operation_thread() thread context.


The problem comes up when the master is active.


Just as I issue


ifconfig eoe0a1 up


I get a bunch of UNMATCHED DATAGRAMS in the kernel log, and the master is 
released.


[   73.324525] EtherCAT DEBUG 0: UNMATCHED datagram:
[   73.324528] EtherCAT DEBUG: 0D 83 01 00 10 09 08 80 00 00 68 5A 4A 84 9C 9B
[   73.324539] EtherCAT DEBUG: 84 11 01 00
[   73.324544] EtherCAT DEBUG 0: UNMATCHED datagram:
[   73.324547] EtherCAT DEBUG: 04 84 01 00 90 09 08 80 00 00 B0 3D 4C 84 9C 9B
[   73.324557] EtherCAT DEBUG: 84 11 01 00
[   73.324562] EtherCAT DEBUG 0: UNMATCHED datagram:
[   73.324565] EtherCAT DEBUG: 0C 85 00 00 00 00 10 80 00 00 00 00 70 FF FF FF
[   73.324575] EtherCAT DEBUG: 50 52 70 FF FF FF 00 00 31 00 03 00
[   73.324584] EtherCAT DEBUG 0: UNMATCHED datagram:
[   73.324587] EtherCAT DEBUG: 07 86 01 00 30 01 02 00 00 00 08 00 01 00
[   73.324838] EtherCAT 0: fsm->slaves_responding[fsm->dev_idx]=1
[   73.324843] EtherCAT 0: 0 slave(s) responding on main device.
[   73.324846] EtherCAT 0: datagram->working_counter=0 
<-  In wireshark capture WC is 1 
[   73.324850] EtherCAT 0: datagram->state=4
[   73.324853] EtherCAT 0: datagram->device_index=0
[   73.324856] EtherCAT 0: datagram->device_origin=0
[   73.324860] EtherCAT 0: datagram->index=134
[   73.324863] EtherCAT 0: datagram->type=7
[   73.324866] EtherCAT DEBUG 0: Rescanning the bus



This happens due to a timeout. When the EoE thread invokes


master->receive_cb(master->cb_data); which leads to invoke of 
ecrt_master_receive(master); it somehow messes up


master->devices[EC_DEVICE_MAIN].cycles_poll


which leads to a negative time delta in the calculation 
master->devices[EC_DEVICE_MAIN].cycles_poll - datagram->cycles_sent.


Attempting to bypass that in the EoE thread, I commented out  
master->receive_cb(master->cb_data);  and  master->send_cb(master->cb_data);

and once I invoke

ifconfig eoe0a1 up


I get an explosion of


[  123.529911] EtherCAT WARNING 0-main-0: Failed to receive mbox check datagram 
for eoe0a1.
[  123.529918] EtherCAT WARNING 0-main-0: Failed to receive mbox check datagram 
for eoe0a1.
[  123.529925] EtherCAT WARNING 0-main-0: Failed to receive mbox check datagram 
for eoe0a1.
[  123.529932] EtherCAT WARNING 0-main-0: Failed to receive mbox check datagram 
for eoe0a1.



If I comment out only master->receive_cb(master->cb_data);


I get no errors in dmesg, but then of course, EoE is not functional, and EoE 
thread starts gathering more and more CPU usage.


I understand that an invoke of master->send_cb(master->cb_data); leads to

ec_master_internal_send_cb --> ecrt_master_send_ext(master);


which pulls datagrams from master->ext_datagram_queue and pushes them forward 
with ec_master_queue_datagram(), and then

invokes ecrt_master_send(master); which will lead to a collision with 
ecrt_master_send() in the interrupt context.


So instead of invoking master->send_cb(master->cb_data); i tried only to pass 
datagrams from master->ext_datagram_queue,

but it caused a kernel panic.



So, if I want EoE to work when the master is active, how should I pass 
datagrams from EoE thread to the master?

Should I change the ethernet.c state machine?


Thanks a lot,


Nir.

___
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev


[etherlab-dev] "Master still waiting for devices!" problem.

2017-01-18 Thread 周甫霖
Hi all,

First appreciate the implement of etherlabmaster.
I'm devolping a non-native supported ethernet device to be able to work as
a RTDM EtherCAT master.
What the device is one part of TI AM335x SoC and is named "cpsw".
Everything smoothly while adapting driver code, building module file, and
installing.
But I was stuck by a problem when I try to start EtherCAT master.
Following is my steps and message shown by dmesg:

# /etc/init.d/ethercat start
Starting EtherCAT master 1.5.2  done

[   30.849754] EtherCAT: Requesting master 0...
[   30.854265] EtherCAT ERROR 0: Master still waiting for devices!

More information:

# /opt/etherlab/bin/ethercat master
Master0
  Phase: Waiting for device(s)...
  Active: no
  Slaves: 0
  Ethernet devices:
Main: a0:f6:fd:22:bd:ed (waiting...)
  Link: DOWN
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Tx errors:   0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]:  0  0  0
  Rx rate [KByte/s]:  0.00.00.0
Common:
  Tx frames:   0
  Tx bytes:0
  Rx frames:   0
  Rx bytes:0
  Lost frames: 0
  Tx frame rate [1/s]:  0  0  0
  Tx rate [KByte/s]:  0.00.00.0
  Rx frame rate [1/s]: -509579 -509608 -335544
  Rx rate [KByte/s]:   845836.0 -469824.0 163840.0
  Loss rate [1/s]:  0  0  0
  Frame loss [%]: 0.00.00.0
  Distributed clocks:
Reference clock: None
Application time: 0
  2000-01-01 00:00:00.0



Could anyone kindly advice what is the key point to go forword form
"waiting device"?

Best regards - Erix Chou
___
etherlab-dev mailing list
etherlab-dev@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-dev