Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to allocate Memory #101

Open
satiowadahc opened this issue May 27, 2021 · 7 comments
Open

Failed to allocate Memory #101

satiowadahc opened this issue May 27, 2021 · 7 comments

Comments

@satiowadahc
Copy link

Looking for assistance on this one.

halrun
halcmd: loadusr -W lcec_conf ~/conf.xml
Note: Using POSIX realtime                                                                               
Failed to map process data: Cannot allocate memory                                                                
LCEC: failed to activate master 0                                                                             
lcec: rtapi_app_main: Invalid argument (-22)                                                                             
<stdin>:3: waitpid failed /usr/bin/rtapi_app lcec                                                                    
<stdin>:3: /usr/bin/rtapi_app exited without becoming ready                                                          
<stdin>:3: insmod for lcec failed, returned -1
uname                                                             
5.10.30-rt39 #1 SMP PREEMPT_RT Wed May 19 14:38:10 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

I see the error is actually originating from the IGH code, however the driver seems to working on their end.

I can see the master and slaves and communicate with Ethercat commands. But I can't seem to run it in LCNC

@satiowadahc
Copy link
Author

Looks like overflow, master->process_data_size is -120624156508160. but why...

@sirop
Copy link

sirop commented May 28, 2021

Could you please post the contents of your conf.xml ...

@satiowadahc
Copy link
Author

<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1">
    <slave idx="0" type="EK1101"/>
<!-- <slave idx="0" type="EK1100"/> -->
    <slave idx="1" type="EL1008"/>
  </master>
</masters>

I hard coded the master->process_data_size in ethercat lib/master to sizeof(int) and it seems to work now. (until I get more slaves on the network.

@satiowadahc
Copy link
Author

EK1100 works on our older computers running kernel 4.10 for the EK1101, but on my newer laptop I need kernel 5.10 for processor support and tried both the 1101 and 1100. (From pr #102)

@sirop
Copy link

sirop commented May 28, 2021

Do you use the source code from the official repo https://gitlab.com/etherlab.org/ethercat or the unofficial one https://github.com/ribalda/ethercat ?

Do you use generic drivers with kernel 5.10?

Did you try ethercat debug 1 for more debug info?

Hard coded slave description works until you get more slaves on the network?

Do you get a core dump of lcec crash?

@satiowadahc
Copy link
Author

  1. Official code.

  2. Yes Generic drivers.

  3. Debug is how I found the domain size.

If I set master->process_data_size = 2, I can have 2 slaves or less, I get unmatched datagram errors with more
If I set master->process_data_size = 3, I can have 3 slaves or less, I get unmatched datagram errors with more.
etc.

  1. Do you have a reference or code for getting a core dump?

@sirop
Copy link

sirop commented May 31, 2021

You use refClockSyncCycles="-1" , which means that you want to sync your master thread to hardware time of a DC capable slave.
On the other hand side you use generic drivers with high latency. This is a bit contradictory.
Correct me if am wrong.

https://github.com/ribalda/ethercat has some commits for 5.x, although I could find any adopted drivers for kernels newer than 4.19 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants