- Configuring LinuxCNC
- HAL
- HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
- RicardoCNC
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
05 Jan 2025 16:05 #318162
by RicardoCNC
HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization ) was created by RicardoCNC
Dear LinuxCNC Enthusiasts,
I’m new to LinuxCNC and working on a custom setup. My hardware includes a PCI board (not Mesa or parallel port), which handles real-time interrupts. The drives manage their own position PID loops; they only require the theoretical trajectory, which I provide via a proprietary protocol using a custom library. Feedback data, like actual position, is also available if needed.Since my setup is non-standard, I’ve manually created the necessary INI, HAL, and HAL C files. However, I’m encountering the following errors:
HAL: ERROR: pin_new(my_handler.0-pos-cmd) called with already-initialized memory
HAL: ERROR: data_ptr_addr not in shared memory
Failed to create x_pos_cmd pin.
I use hal_malloc, and insure proper initialitation, but the errors persist.The 3 files that i use are attached. At this point, i would just need a sample to a component that will simply print out the theoritical possition and sent back this theoritical position as the real position (just for the example)I’d greatly appreciate guidance on debugging or examples of similar setups.
Thanks in advance for your help!
I’m new to LinuxCNC and working on a custom setup. My hardware includes a PCI board (not Mesa or parallel port), which handles real-time interrupts. The drives manage their own position PID loops; they only require the theoretical trajectory, which I provide via a proprietary protocol using a custom library. Feedback data, like actual position, is also available if needed.Since my setup is non-standard, I’ve manually created the necessary INI, HAL, and HAL C files. However, I’m encountering the following errors:
HAL: ERROR: pin_new(my_handler.0-pos-cmd) called with already-initialized memory
HAL: ERROR: data_ptr_addr not in shared memory
Failed to create x_pos_cmd pin.
I use hal_malloc, and insure proper initialitation, but the errors persist.The 3 files that i use are attached. At this point, i would just need a sample to a component that will simply print out the theoritical possition and sent back this theoritical position as the real position (just for the example)I’d greatly appreciate guidance on debugging or examples of similar setups.
Thanks in advance for your help!
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19526
- Thank you received: 6553
05 Jan 2025 17:58 #318164
by tommylight
Replied by tommylight on topic HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
how did you install the my_handler.c file?
From the error report, my_handler has no access rights to rtapi_app_main.
From the error report, my_handler has no access rights to rtapi_app_main.
Please Log in or Create an account to join the conversation.
- RicardoCNC
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
05 Jan 2025 17:59 #318165
by RicardoCNC
Replied by RicardoCNC on topic HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
Hello again,
Solve the first part of the problem. i do not know exactly why but i could not make work hal_pin_float_new but if i used instead hal_pin_float_newf with a structure it works.
however, i am still seeing some issue as you can see per the annexed screenshot. The emcMotionInit is not able to start.
Do you have any idea what i am doing wrong ? My goal for not is just to have a component that can output/input the theoretical/real position.
i updated the files and they are annexed.
Thanks in advance for your help
Solve the first part of the problem. i do not know exactly why but i could not make work hal_pin_float_new but if i used instead hal_pin_float_newf with a structure it works.
however, i am still seeing some issue as you can see per the annexed screenshot. The emcMotionInit is not able to start.
Do you have any idea what i am doing wrong ? My goal for not is just to have a component that can output/input the theoretical/real position.
i updated the files and they are annexed.
Thanks in advance for your help
Please Log in or Create an account to join the conversation.
- RicardoCNC
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
05 Jan 2025 18:11 #318166
by RicardoCNC
Replied by RicardoCNC on topic HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
Thank you for your feedback, error operation not permitted fo the rtapi_app_main was probably due to the fact the i returned -1 when the function hal_pin_float_new failed.
to install (compile) it, i simply use the following command :
ricardo@RicardoCNC:~/Desktop/linuxcnc-config/src$ sudo halcompile --install my_handler.c
[sudo] password for ricardo:
Compiling realtime my_handler.c
Linking my_handler.so
cp my_handler.so /usr/lib/linuxcnc/modules/
I could solve this first part of the problem by using the function hal_pin_float_newf.
However, i have a different issue now, i do not exactly now what it did wrong on my config files. I uploaded everything.
Thanks for you valuable help
to install (compile) it, i simply use the following command :
ricardo@RicardoCNC:~/Desktop/linuxcnc-config/src$ sudo halcompile --install my_handler.c
[sudo] password for ricardo:
Compiling realtime my_handler.c
Linking my_handler.so
cp my_handler.so /usr/lib/linuxcnc/modules/
I could solve this first part of the problem by using the function hal_pin_float_newf.
However, i have a different issue now, i do not exactly now what it did wrong on my config files. I uploaded everything.
Thanks for you valuable help
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- HAL
- HAL Component Issues with Custom Hardware (Data Sharing and Pin Initialization )
Time to create page: 0.139 seconds