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
starting LinuxCNC fails with new driver #28
Comments
This is the interesting bit on line #80 It's really hard to debug without all the ini & hal files. |
Thank you for your response @ozzyrob. It is indeed a configuration error, because the card does connect and buffers are being allocated and after all cleaned up. Please share your ini and Hal files. |
Sure. I should have attached the files... The thing is, I didn't change anything. |
Let me check one thing. Did you come from the main branch or did you update from branch 11? If you updated from branch 11: yes only the Rip and overflow have been changed. If you come from the main branch: the config file should be updated and the firmware rebuilt. Can you also share you're config json? At this moment I'm on holiday, as soon as I'm back I will build your config and investigate. Also if there are any logs available from LinuxCNC, please share. Somewhere I might have the feeling a pin has been renamed somewhere in the process. (yes, that's on me) |
Yes. I come from the 11-add-externals. |
If you can describe your system, version of Linuxcnc, Debian version & kernel version, and your method of installing Linuxcnc I can try and replicate. HALFILE = custom.hal If that is ok with you Pete. I'm unemployed ATM and looking to my mind occupied. |
All the information should be in the report I attached in the first post above. The custom and other hal Files are empty. |
@ozzyrob: I'm completely okay with that when you can try and help others. On the other hand, hope your in a job soon again. |
Cheers Pete Yeah sorry mate, you're right, was first thing in the morning down under. Just still need the json file so I can build the firmware and flash the fpga. |
Sorry. |
I'm going take a stab at this and suggest it could be a latency issue. Have you tried isolcpus=1 when booting ? The reason I think this I tried a simple sample config that uses the hal_speaker component and as my kernel was non real time I was getting these errors. waiting for s.joints<0>, s.kinematics_type<0> |
It could be. But as I said, I did not change any other thing. |
Can confirm main branch is ok, although I get Apply time exceeded limits with 2.9 least linuxcnc loads, haven't tested 2.8 yet. With 11-add-external on Buster with Linuxcnc 2.8 & Bookworm with Linuxcnc 2.9 sometimes I'm seeing errors as mentioned by OP, sometimes the system is just "freezing". |
When I am back at home I will try to go step by step through the components which causes my error |
No probs mate, thanks for all your hard work. Any thoughts on "Apply Time exceeds limits" on the main branch ? |
The apply time exceeding limits can be due to:
I did not experience any lock up though on my machines. I'm running on a RPi 4 using isolcpus=1,2,3 for best latency results. Although isolcpus=2,3 also yields good results. Generally it is recommended (no source, this is from the top of my head) to isolate a pair. My response time might be higher due to holiday. My apologies for any inconvenience. |
No rush mate, it's all sweet & cruisy Down Under, no need to apologise. Enjoy your holiday. So I'll do a bit more testing Tomorrow. |
I also have plenty of time with this. |
Back from my holiday and sadly: I can reproduce this bug. Starting my machine leads to freezing of LinuxCNC. Seems that some processes are not running any more. Edit: I have to investigate it further. When disabling |
In the LCnc Forum someone mentioned that this happens when he add stepgens to the Json config |
At this moment I'm thinking my installation is completely broken:
Reinstalled LinuxCNC to no avail. Today I'm going to format the image to see whether I can create a working config again.... |
You think it's corrupting something in the actual Linuxcnc installation ? |
https://www.dropbox.com/s/h1v0j1btdzi96ia/VID_20230804_093236.mp4?dl=0 Hey. This is with 11-external before the last update |
So 11-external was working ? |
https://www.dropbox.com/s/e3lnlcgugkhil5h/IMG_20230804_094837.jpg?dl=0 https://www.dropbox.com/s/4x0orttlawtoq6c/IMG_20230804_094831.jpg?dl=0 https://www.dropbox.com/s/m911beann6je7yi/IMG_20230804_094825.jpg?dl=0 It is a jmc ihsv57 180w servo with 1204 kus spindle and a selfmade mounting plate |
Cheers, nice solution. |
OK rolled back 11-add-external-extensions-to-litexcnc to:
Was able to get the config running, but on a quad core Intel Core i5-3470 with 3 cores isolated I was stil getting
That was with only Linuxnc being run from a terminal. |
@OJthe123 : how would you like the idea of crating a show your machine page in the documentation? @ozzyrob : this is one of the problems which has been resolved between your rollback version and the current version. Because I'm experiencing the same problem (reinstalling atm), I hope the problem is fixed. Otherwise I'll make a patch for you. |
@Peter-van-Tol : Sure, no problem. What do you need? I also have the "Apply time.." info. But I cannot say that has any impact on my machine... |
Here are my machine files... |
Spend today reinstalling LinuxCNC on my RaspberryPi, bu to no avail. Something has changed apparently and prevents the real-time components to start (i.e. emcTrajInit failed)... edit: installed the following versions:
Both give the same error on my RPi, how is that possible? |
Any luck yet ? |
Just for more success story 😄 G76 Threading cycle also works |
@OJthe123 : Nice In the meanwhile, my RPi is showing signs of life again, no errors when starting a simple configuration. Now going to install LitexCNC and re-build... The error was in the end PEBKAC (configuration error) |
Recompiled everything and can reproduce the error with the following hal file
The above hal file will run without errors. However, as soon as I enable the write function I get the error:
It boils down to something which must have changed in the write function which prevents the module from starting. Will further investigate where the write-function fails by shutting down all components and then re-enabling them one by one. Edit 1: static void litexcnc_write(void *void_litexcnc, long period) {
litexcnc_t *litexcnc = void_litexcnc;
// Check whether the write has been initialized AND the read and write functions
// are in the recommended order (first read, then write). In the first loop the
// we don't write any data to the FPGA, but it is configured. This is required,
// because the configuration requires the period to be known, which prevents the
// configuration to be performed before the HAL-loop starts
if (!litexcnc->write_loop_has_run) {
// Check whether the read cycle has been run, if not, the order is not correct
if (!litexcnc->read_loop_has_run) {
LITEXCNC_WARN("Read and write functions in incorrect order. Recommended order is read first, then write.\n", litexcnc->fpga->name);
}
// Configure the FPGA and set flag that the write function has been done once
litexcnc_config(void_litexcnc, period); // <== This line blocks the starting of the FPGA and the time-out
litexcnc->write_loop_has_run = true;
return;
} Edit 2: |
Was just going to mention that the code in litexcnc.c is the same in the commit ba57141. And that works apart from the apply time messages. |
Took some effort, but have found the error. If you pull the latest version of the branch #11 your LinuxCNC should start up again. |
Fantastic will try in the morning |
Ok gave it a go, tried with the OP's configs.......damned if I could get rid of the following error. Latency is good, I can run a config using steppers with a 25us base thread on this machine. Ping times are good. Tried isolating various cores (4 core i5) But after that whinge it does start up, just can't jog. |
The following error should be gone by the latest commit. There was a difference between Python (firmware) and C (driver) in determining the pick-off. For slow movements this could be compensated by the PID or The current commit has been tested on my EMCO5, which shows no following error when trying 1500 mm/min whilst using |
Continuing from #29 ... With the config and hal-files from @OJthe123 I can now re-produce the problem. The difference between my setup and his is mainly the scale. Now that has been sorted out, I can start debugging. Just want to close this issue in a proper manner... I have suggested that the problem might be with using the pin My observations are:
EDIT
EDIT 2 |
Awesome work! I finished 400 little parts today, which I turned on my lathe. No single problem with LiteX and Colorlite board |
Just committed the changes😃:
For an advice on position vs pid: if your setup works, there is no need to change. However, the readability and maintainability of the HAL-file will improve when using the position control. The code below is the minimal example for a single axis, which is roughly 50% reduced in size when compared to a solution with
I would really appreciate if you would test this latest version, so this issue can be closed as resolved. |
You rock dude! EDIT: `
|
Sorry guys for being a bit quiet, I’ve been playing with some 7c81 firmware on a Spartan 6 dev board. When I get the chance I’ll setup my machine that I use for testing. |
Really Happy Pete. I owe your at least a Beer Shutting down and cleaning up LinuxCNC... |
can confirm...
|
This error is due to an old
This should be combined to the following single statement:
Why this error emerges at this moment? It is because the FPGA is reset to its safe state when LinuxCNC is unloaded. This means that I will close this issue, as the original problem has been solved. In another issue I will unpublish the |
@ozzyrob : for beer that would be then a VB please 🍻 ... But to be honest: the beer would be on me. Thank you for your support, testing and time spent to make this possible and closing this issue. |
Hi.
I did "git pull" to get the updated files from 11-add-external....
then installed the new drivers "litexcnc install_driver"
rebuild the firmware.
Then LinuxCNC won't start anymore.
linuxcnc-report.txt
when I do halrun and load the driver it has no errors
loadrt litexcnc
loadrt litexcnc_eth connection_string="192.168.178.150"
Do I have to change something in the INI for the new driver version?
The text was updated successfully, but these errors were encountered: