External comp driver for custom hostmot2 module
- jayyhu
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 1
10 Mar 2025 20:06 - 10 Mar 2025 20:34 #323628
by jayyhu
External comp driver for custom hostmot2 module was created by jayyhu
Hello,
I'm currently in the process of creating a new module for the 7i80 FPGA, and realizing that I also need to add a driver on the LinuxCNC side. Since the module is pretty niche, I'm trying to avoid modifying the entire Hostmot2 driver (and then worry about having to maintain my local copy against master every time there's a version change), so I was wondering if it was possible to write a driver for Hostmot2 as an external comp. I've seen the mesa_7i65.comp and mesa_uart.comp examples, but I'm more interested in the low level register access (eg. how the inmux driver communicates with the inmux module on the FPGA).
Thanks,
James H.
I'm currently in the process of creating a new module for the 7i80 FPGA, and realizing that I also need to add a driver on the LinuxCNC side. Since the module is pretty niche, I'm trying to avoid modifying the entire Hostmot2 driver (and then worry about having to maintain my local copy against master every time there's a version change), so I was wondering if it was possible to write a driver for Hostmot2 as an external comp. I've seen the mesa_7i65.comp and mesa_uart.comp examples, but I'm more interested in the low level register access (eg. how the inmux driver communicates with the inmux module on the FPGA).
Thanks,
James H.
Last edit: 10 Mar 2025 20:34 by jayyhu.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23262
- Thank you received: 4928
02 Apr 2025 13:18 #325514
by andypugh
Replied by andypugh on topic External comp driver for custom hostmot2 module
Sorry for the late reply.
I think that this woud be difficult, as the Hostmot2 main driver needs to know what to do with your new module.
The UART / PktUART drivers are provided with a "hook" with which the external comps can get access to the register data, so at the very least you would need to do that.
I think that you will need to find some other way to persist your changes going forwards, unfortunately. You can probably keep a patch file to re-apply your changes (which would be limited to a standalone handler for your module, and additions to hotmot2.h and hostmot2.c
I also don't see any way to avoid re-compiling LinuxCNC to include your code.
Are you sure that no-one else would ever want your module? From your point of view adding it to the main codebase would be cleanest.
Note that you also want to make sure that you avoid a clash with the "official" Mesa GTAGs ( github.com/LinuxCNC/linuxcnc/blob/master...tmot2/hostmot2.h#L94 )
I think that this woud be difficult, as the Hostmot2 main driver needs to know what to do with your new module.
The UART / PktUART drivers are provided with a "hook" with which the external comps can get access to the register data, so at the very least you would need to do that.
I think that you will need to find some other way to persist your changes going forwards, unfortunately. You can probably keep a patch file to re-apply your changes (which would be limited to a standalone handler for your module, and additions to hotmot2.h and hostmot2.c
I also don't see any way to avoid re-compiling LinuxCNC to include your code.
Are you sure that no-one else would ever want your module? From your point of view adding it to the main codebase would be cleanest.
Note that you also want to make sure that you avoid a clash with the "official" Mesa GTAGs ( github.com/LinuxCNC/linuxcnc/blob/master...tmot2/hostmot2.h#L94 )
The following user(s) said Thank You: rodw, jayyhu
Please Log in or Create an account to join the conversation.
- jayyhu
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 1
13 Apr 2025 20:48 #326230
by jayyhu
Replied by jayyhu on topic External comp driver for custom hostmot2 module
Hi Andy,
Thanks for the response. One idea I was playing around with was making a raw-module API for the HM2 driver where user-provided HAL components can just hook into that to get HM2 module lifecycle notifications and make raw reads and writes to the FPGA (see hostmot2-module.h ).
Unfortunately I haven't had time to complete that as I eventually went with just creating a HAL component that pokes the GPIO lines which were adequate for my needs. As for the device I'm trying to control, it's for the Emco Concept Mill55 ACC backplane that has a bus-multiplexor device to read and write slow I/O signals. I'm trying to do a minimal conversion where only the (old, broken) computer is replaced with a 7i80HDT, that interfaces directly with the ACC backplane board. Eventually I'll try to do a write-up of my conversion, but for now, I'm still trying to get everything working.
Thanks for the response. One idea I was playing around with was making a raw-module API for the HM2 driver where user-provided HAL components can just hook into that to get HM2 module lifecycle notifications and make raw reads and writes to the FPGA (see hostmot2-module.h ).
Unfortunately I haven't had time to complete that as I eventually went with just creating a HAL component that pokes the GPIO lines which were adequate for my needs. As for the device I'm trying to control, it's for the Emco Concept Mill55 ACC backplane that has a bus-multiplexor device to read and write slow I/O signals. I'm trying to do a minimal conversion where only the (old, broken) computer is replaced with a 7i80HDT, that interfaces directly with the ACC backplane board. Eventually I'll try to do a write-up of my conversion, but for now, I'm still trying to get everything working.
Please Log in or Create an account to join the conversation.
Time to create page: 0.086 seconds