No, you don’t need to write any kernel code, that’s already there.

 

The send/receive callbacks are mainly for use with RTAI or Xenomai 
implementations where the application is implemented in a super-kernel layer.  
You don’t need to use them for a userspace application.

 

From: Ruika You [mailto:crazylinux...@gmail.com] 
Sent: Saturday, 6 May 2017 02:53
To: Gavin Lambert <gavin.lamb...@compacsort.com>
Cc: etherlab-users@etherlab.org
Subject: Re: [etherlab-users] how to implement EoE example?

 

Thanks for your reply.

 

You mean I no need to write kernel module for EoE, even though EoE is kernel 
module of ethercat master. 

 

I found some useful information from follow post:

<https://www.mail-archive.com/etherlab-users@etherlab.org/msg01559.html>

 

As Thomas Bitsky, Jr. comment:

void
send_callback(void *cb_data)
{
ec_master_t *m = (ec_master_t *) cb_data;
        down(&master_sem);
ecrt_master_send_ext(m);
        up(&master_sem);
}
 
void
receive_callback(void *cb_data)
{
ec_master_t *m = (ec_master_t *) cb_data;
        down(&master_sem);
ecrt_master_receive(m);
        up(&master_sem);
 }
 
If they are not in the program and activated by ecrt_master_callbacks, then
there is no lock-up. Of course, EoE doesn't work.

 

I will add code into user space application and give a try. But I confused that 
how can I send data and receive data if there is no call back function?

 

Thanks!

-chengxi  

  

 

On Fri, May 5, 2017 at 7:27 AM, Gavin Lambert <gav...@compacsort.com 
<mailto:gav...@compacsort.com> > wrote:

I don’t use EoE myself, but as I understand it the kernel component of the 
master (which exists even if your application is only in userspace) creates 
regular Linux ethernet devices for the EoE ports of the slaves, and takes care 
of the message relaying itself.  So your application doesn’t need to do 
anything special and the userspace application (or any other process on the PC) 
can send packets to those devices just like any other network interface.  You 
might need to assign it a static IP before regular apps will talk to it, though.

 

From: etherlab-users [mailto:etherlab-users-boun...@etherlab.org 
<mailto:etherlab-users-boun...@etherlab.org> ] On Behalf Of Ruika You
Sent: Friday, 5 May 2017 02:45
To: etherlab-users@etherlab.org <mailto:etherlab-users@etherlab.org> 
Subject: [etherlab-users] how to implement EoE example?

 

Dear all,

 

Recently I am trying to implement EoE and do read all threads related EoE in 
this mailing list.But I  still do not understand well.

First of all, If I am not wrong EoE only works in kernel space? Unfortunatelly, 
currently my application works in user space. So in this case, I had better to 
run two master one in user space with current application, another one in 
kernel space with EoE?

 

Secondly, if anyone have experience with EoE, would you mind share one example?

 

Now I can start EoE and ping through eoe between two machines. I am not clear 
how to send data and receive data, like tty serial example? but El6614 does not 
have .xml file.

 

Any hints are appreciated.

 

Thanks very much!  

 

 

_______________________________________________
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to