Error: undefined symbol: hm2_pktuart_setup_rx - while lading custom modbus.so

More
14 Feb 2025 18:08 #321570 by Corne
I like to get some data out of my Servo driver (Bergerda SDF20NK9). 
Followed all instructions according documented Mesa Modbus. Created an sdf_modbus.so (I made an exact copy as discribes in Mesa Modbus documentation.
If I execute: 'halcmd loadrt sdf_modbus' I get the following error: undefined symbol: hm2_pktuart_aetup_rx

I have seen this thread:  Mesa modbus and pktUart  where the same error message was reported by  Donno  but I can't reproduce his solution. 
I use a Mesa 7i96s card.

Who can help me out?

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 18:13 #321571 by PCW
That halcmd command is missing the port stanza

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 18:18 #321572 by Corne
Your right!
But also halcmd loadrt sdf_modbus ports=hm2_7i96s.0.pktuart.0 gives the same error.

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 18:21 - 14 Feb 2025 18:27 #321573 by PCW
Does your firmware have a pkt_uart?
Last edit: 14 Feb 2025 18:27 by PCW.

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 19:15 #321576 by Corne
yes.
I loaded 7i96sd_pktv2.bin and see the PktUARTRX and TX port (0) with mesaflash --readhmid --addr 10.10.10.10 --device 7i96s

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 19:16 #321577 by Corne
for the record, I'm running linuxcnc 2.9.4 on Debian bookworm

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 19:25 #321579 by PCW
x86 or ARM?

If you post the .mod file I can try and duplicate the issue
 

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 19:33 #321580 by Corne
I'm running x86

To be sure I have no errors in my mod file, I just copied the one from the Mesa Modbus documentation:

 /*
The format of the channel descriptors is:

{TYPE, FUNC, ADDR, COUNT, pin_name}

TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/

#define MAX_MSG_LEN 16 // may be increased if necessary to max 251

static const hm2_modbus_chan_descriptor_t channels = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
// Create 8 HAL bit pins coil-00 .. -07 supplying the values of coils at 0x0000
{HAL_BIT, 1, 0x0000, 8, "coil"},
// Create 8 HAL bit pins input-00 .. -07 supplying the values of inputs at 0x0000
{HAL_BIT, 2, 0x0000, 8, "input"},
// Create a HAL pin to set the coil at address 0x0010
{HAL_BIT, 5, 0x0010, 1, "coil-0"},
// Create 8 HAL pins to set the coils at 0x0020
{HAL_BIT, 15, 0x0020, 8, "more_coils"},
// Create a scaled floating point pin calculated from input register 0x0100
{HAL_FLOAT, 4, 0x0100, 1, "float"},
// Create 4 unsigned integer HAL pins from the holding registers at 0x0200-0x203
{HAL_S32, 3, 0x0003, 4, "holding"},
// Create a single signed int HAL pin to control the register at 0x0300
{HAL_S32, 6, 0x0300, 1, "relay-3"},
// Create 7 scaled FP HAL pins to control holfing registers at 0x400-0x406
{HAL_FLOAT, 16, 0x0300, 1, "more_floats"},
};

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 20:05 - 14 Feb 2025 20:21 #321582 by PCW
That does not seem to compile

Can you try an example file from the modbus directory, say relayboard.mod

or alternatively here's a  simple .mod file I am running right now (linuxCNC 2.9.4)
that works with the common 32in 32 out modbus modules from Eletechsup:


 

File Attachment:

File Name: mb25ioc32.txt
File Size:1 KB


Needs to be renamed to mb25ioc32.mod before compiling with

modcompile mb25ioc32.mod

 
Attachments:
Last edit: 14 Feb 2025 20:21 by PCW.

Please Log in or Create an account to join the conversation.

More
14 Feb 2025 20:38 #321584 by Corne
Now it's obvious i'm a newby. I don't know where to find your example. It doesn't looks to be on my machine.

Strange that the example I mentioned above does not work. I just did a complete fresh install of 2.9.4 and it compiled ok, but same error at loadrt.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.086 seconds
Powered by Kunena Forum