Mesaflash Generated Xml compatible with PnCConf

More
6 years 3 months ago #176308 by TheBigLebowski
Is the Xml file that can be generated via mesaflash compatible with PnCConf?

I am going to switch my Tormach from pathpilot to plain old linuxcnc. The Tormach Firmware used in the mesa 5i25 is different than that used in any of the other setups. I know that I can generate an Xml through mesaflash, but I don't know if it is or can be made compatible with PnCConf.

I was thinking this would be the easier route, as I can avoid or at least reduce the need to manually tweak all of setup files generated.

For reference, this is the Tormach Hostmot2. I also have all of the pathpilot hal and ini files.

Code:
Configuration Name: HOSTMOT2 General configuration information: BoardName : MESA5I25 FPGA Size: 9 KGates FPGA Pins: 144 Number of IO Ports: 2 Width of one I/O port: 17 Clock Low frequency: 33.3333 MHz Clock High frequency: 200.0000 MHz IDROM Type: 3 Instance Stride 0: 4 Instance Stride 1: 64 Register Stride 0: 256 Register Stride 1: 256 Modules in configuration: Module: DPLL There are 1 of DPLL in configuration Version: 0 Registers: 7 BaseAddress: 7000 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: WatchDog There are 1 of WatchDog in configuration Version: 0 Registers: 3 BaseAddress: 0C00 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: IOPort There are 2 of IOPort in configuration Version: 0 Registers: 5 BaseAddress: 1000 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: QCount There are 2 of QCount in configuration Version: 2 Registers: 5 BaseAddress: 3000 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: PWM There are 2 of PWM in configuration Version: 0 Registers: 5 BaseAddress: 4100 ClockFrequency: 200.000 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: StepGen There are 10 of StepGen in configuration Version: 2 Registers: 10 BaseAddress: 2000 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Module: LED There are 1 of LED in configuration Version: 0 Registers: 1 BaseAddress: 0200 ClockFrequency: 33.333 MHz Register Stride: 256 bytes Instance Stride: 4 bytes Configuration pin-out: IO Connections for P3 Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir 1 0 IOPort StepGen 4 Step/Table1 (Out) 14 1 IOPort None 2 2 IOPort StepGen 0 Dir/Table2 (Out) 15 3 IOPort None 3 4 IOPort StepGen 0 Step/Table1 (Out) 16 5 IOPort None 4 6 IOPort StepGen 1 Dir/Table2 (Out) 17 7 IOPort PWM 0 PWM (Out) 5 8 IOPort StepGen 1 Step/Table1 (Out) 6 9 IOPort StepGen 2 Dir/Table2 (Out) 7 10 IOPort StepGen 2 Step/Table1 (Out) 8 11 IOPort StepGen 3 Dir/Table2 (Out) 9 12 IOPort StepGen 3 Step/Table1 (Out) 10 13 IOPort None 11 14 IOPort None 12 15 IOPort None 13 16 IOPort QCount 0 Quad-IDX (In) IO Connections for P2 Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir 1 17 IOPort StepGen 9 Step/Table1 (Out) 14 18 IOPort None 2 19 IOPort StepGen 5 Dir/Table2 (Out) 15 20 IOPort None 3 21 IOPort StepGen 5 Step/Table1 (Out) 16 22 IOPort None 4 23 IOPort StepGen 6 Dir/Table2 (Out) 17 24 IOPort PWM 1 PWM (Out) 5 25 IOPort StepGen 6 Step/Table1 (Out) 6 26 IOPort StepGen 7 Dir/Table2 (Out) 7 27 IOPort StepGen 7 Step/Table1 (Out) 8 28 IOPort StepGen 8 Dir/Table2 (Out) 9 29 IOPort StepGen 8 Step/Table1 (Out) 10 30 IOPort QCount 1 Quad-IDX (In) 11 31 IOPort QCount 1 Quad-A (In) 12 32 IOPort QCount 1 Quad-B (In) 13 33 IOPort None

Please Log in to join the conversation.

More
6 years 3 months ago #176309 by cmorley
What version of linuxcnc are you using?
In theory mesaflash's XML will work with pncconf - that's what is was made for.
But unfortunately it's XML is slightly different - I think I covered for that...

But if using 2.8 or master there is another way to use that file you posted directly.

Please Log in to join the conversation.

More
6 years 3 months ago #176311 by TheBigLebowski
I am running 2.8 on linux mint

Please Log in to join the conversation.

More
6 years 3 months ago #176317 by cmorley
feel free to try the XML file or:

if you have the board plugged in and any daughter boards powered:
you can try interrogating the board it's self...

on the start page make sure 'show advanced pages' is clicked on
move along till you get to the mesa page.
now under the boardname combobox the is an entry called 'discovery option'
after selecting it a button will show called 'board discovery'
click it and fill in the details and press ok.
if all goes well the mesa page will be filled out and you can then use pncconf as usual.


Now you can also fool pncconf to use a text file rather then talking to the card.
here is how to do that:

run pncconf from a terminal with this command:
pnccond -d debug

now click help in pncconf
click on the input tab
paste the HISTMOT2 text you posted onto that page.

on the start page make sure 'show advanced pages' is clicked on

move along till you get to the mesa page.
now under the boardname combobox the is an entry called 'discovery option'
after selecting it a button will show called 'board discovery'
click it and fill in the details and press ok.
if all goes well the mesa page will be filled out and you can then use pncconf as usual.

I tried the second method with your text file and it looked like it worked fine.

Chris

Please Log in to join the conversation.

More
6 years 3 months ago #176430 by TheBigLebowski
I am running into a couple of problems that I cant figure out.

Using the board discovery option only works when I run PNCconf as root. If I do not run as root, it will generate an error and under the output tab say "You need root privileges (or setuid root) to access PCI Hardware".

Is this normal or is this an install problem on my end?

When I run PNCConf as root, the board discovery option works fine and detects the board as it should. While running as root works to fix that, it causes other more major problems down the line. (For example, the /linuxcnc/configs and /linuxcnc/nc_files both are created as root folders, and linux cnc cant access them. It may also screw up some other things, but I am not sure on that)

Using the hostmot2 text method works fine and does not require you to run pncconf as root.


Both methods leave me with the same result. I think what is happening is it is looking a file that it cant find?

Sample one. Errors pulled from terminal while trying to run the PID Test through PNCconf
Code:
nc@nc:~$ pncconf **** INFO firmware 0 changed **** INFO firmware 0 changed **** INFO firmware 0 changed **** INFO firmware 0 changed s-stepgen-step None s-pwm-pulse None s-encoder-a None spindle-enable None spindle-cw None spindle-ccw None spindle-brake None s-pot-output None s-stepgen-step None s-pwm-pulse None s-encoder-a None spindle-enable None spindle-cw None spindle-ccw None spindle-brake None s-pot-output None Note: Using POSIX realtime config=" num_encoders=2 num_pwmgens=2 num_stepgens=10": dlopen: /usr/lib/linuxcnc/modules/config=" num_encoders=2 num_pwmgens=2 num_stepgens=10".so: cannot open shared object file: No such file or directory <stdin>:14: waitpid failed /usr/bin/rtapi_app config=" num_encoders=2 num_pwmgens=2 num_stepgens=10" <stdin>:14: /usr/bin/rtapi_app exited without becoming ready <stdin>:14: insmod for config=" num_encoders=2 num_pwmgens=2 num_stepgens=10" failed, returned -1 <stdin>:15: parameter or pin 'hm2_5i25.0.pwmgen.pwm_frequency' not found <stdin>:16: parameter or pin 'hm2_5i25.0.pwmgen.pdm_frequency' not found <stdin>:17: parameter or pin 'hm2_5i25.0.watchdog.timeout_ns' not found HAL: ERROR: function 'hm2_5i25.0.read' not found <stdin>:18: addf failed HAL: ERROR: function 'hm2_5i25.0.write' not found <stdin>:23: addf failed <stdin>:42: parameter or pin 'hm2_5i25.0.stepgen.00.step_type' not found <stdin>:43: parameter or pin 'hm2_5i25.0.stepgen.00.control-type' not found <stdin>:44: parameter or pin 'hm2_5i25.0.stepgen.00.position-scale' not found <stdin>:45: parameter or pin 'hm2_5i25.0.stepgen.00.steplen' not found <stdin>:46: parameter or pin 'hm2_5i25.0.stepgen.00.stepspace' not found <stdin>:47: parameter or pin 'hm2_5i25.0.stepgen.00.dirhold' not found <stdin>:48: parameter or pin 'hm2_5i25.0.stepgen.00.dirsetup' not found <stdin>:50: parameter or pin 'hm2_5i25.0.stepgen.00.maxaccel' not found <stdin>:51: parameter or pin 'hm2_5i25.0.stepgen.00.maxvel' not found <stdin>:52: Pin 'hm2_5i25.0.stepgen.00.enable' does not exist <stdin>:53: Pin 'hm2_5i25.0.stepgen.00.velocity-cmd' does not exist <stdin>:54: Pin 'hm2_5i25.0.stepgen.00.position-fb' does not exist <stdin>:55: Pin 'hm2_5i25.0.stepgen.00.velocity-fb' does not exist

Sample 2. Error when you try and launch Linuxcnc using the auto generated setup.
Code:
Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl: Print file information: RUN_IN_PLACE=no LINUXCNC_DIR= LINUXCNC_BIN_DIR=/usr/bin LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc LINUXCNC_SCRIPT_DIR= LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules LINUXCNC_CONFIG_DIR= LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs INIVAR=inivar HALCMD=halcmd LINUXCNC_EMCSH=/usr/bin/wish8.6 LINUXCNC - 2.8.0~pre1 Machine configuration directory is '/home/nc/linuxcnc/configs/TEST1' Machine configuration file is 'TEST1.ini' INIFILE=/home/nc/linuxcnc/configs/TEST1/TEST1.ini VERSION=1.1 PARAMETER_FILE=linuxcnc.var TASK=milltask HALUI=halui DISPLAY=tklinuxcnc COORDINATES=XYZ KINEMATICS=trivkins coordinates=XYZ Starting LinuxCNC... Starting LinuxCNC server program: linuxcncsvr Loading Real Time OS, RTAPI, and HAL_LIB modules Starting LinuxCNC IO program: io Starting HAL User Interface program: halui Found file(REL): ./TEST1.hal Shutting down and cleaning up LinuxCNC... Running HAL shutdown script hm2: loading Mesa HostMot2 driver version 0.15 hm2: unloading Removing HAL_LIB, RTAPI, and Real Time OS modules Removing NML shared memory segments Debug file information: Note: Using POSIX realtime config=" num_encoders=2 num_pwmgens=2 num_stepgens=10": dlopen: /usr/lib/linuxcnc/modules/config=" num_encoders=2 num_pwmgens=2 num_stepgens=10".so: cannot open shared object file: No such file or directory ./TEST1.hal:9: waitpid failed /usr/bin/rtapi_app config=" num_encoders=2 num_pwmgens=2 num_stepgens=10" ./TEST1.hal:9: /usr/bin/rtapi_app exited without becoming ready ./TEST1.hal:9: insmod for config=" num_encoders=2 num_pwmgens=2 num_stepgens=10" failed, returned -1 4822 Stopping realtime threads Unloading hal components Note: Using POSIX realtime ----------------------------------------------------------------------- Info report created by linuxcnc_info: The file: /tmp/linuxcnc_info.txt can be posted to a forum or a web site like: http://pastebin.com in order to provide information about the linuxcnc system and configuration. Date: Wed Jul 29 18:34:40 EDT 2020 UTC Date: Wed Jul 29 22:34:40 UTC 2020 this program: /usr/bin/linuxcnc_info uptime: 18:34:40 up 1:18, 1 user, load average: 0.17, 0.17, 0.18 lsb_release -sa: LinuxMint Linuxcnc Uspace Powered by Linux Mint 19.2 Tina 19.2 tina which linuxcnc: /usr/bin/linuxcnc pwd: /home/nc/linuxcnc/configs/TEST1 USER: nc LOGNAME: nc HOME: /home/nc EDITOR: VISUAL: LANGUAGE: en_US TERM: dumb COLORTERM: DISPLAY: :0 DESKTOP: mate display size: 1920x1080 pixels (508x285 millimeters) PATH: /usr/bin:/home/nc/linuxcnc/configs/TEST1/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games uname items: nodename -n: nc kernel-name -s: Linux kernel-vers -v: #1 SMP PREEMPT RT Thu Mar 5 00:02:34 AEDT 2020 machine -m: x86_64 processor -p: x86_64 platform -i: x86_64 oper system -o: GNU/Linux /proc items: cmdline: BOOT_IMAGE=/boot/vmlinuz-4.19.106-rt44-lcnc root=UUID=b576e09e-7c03-4e54-91d8-6f38c7096c56 ro quiet splash isolcpus=1,2,3 vt.handoff=1 model name: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz cores: 4 cpu MHz: 1870.338 parport: serial: 0000-0000 : serial Versions: gcc: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 python: Python 2.7.17 git: git version 2.17.1 git commit: NA tcl: 8.6 tk: 8.6 glade: not_in_PATH glade-gtk2: not_in_PATH linuxcnc_var all: LINUXCNCVERSION: 2.8.0~pre1 LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples REALTIME: /etc/init.d/realtime RTS: uspace HALLIB_DIR: /usr/share/linuxcnc/hallib dpkg -l '*linuxcnc*': Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-===================-============================-============-===================================================================== un linuxcnc <none> <none> (no description available) un linuxcnc-dev <none> <none> (no description available) un linuxcnc-doc <none> <none> (no description available) ii linuxcnc-doc-en 1:2.8.0~pre1.5821.g7525a1528 all motion controller for CNC machines and robots (English documentation) un linuxcnc-sim <none> <none> (no description available) un linuxcnc-sim-dev <none> <none> (no description available) ii linuxcnc-uspace 1:2.8.0~pre1.5821.g7525a1528 amd64 motion controller for CNC machines and robots ii linuxcnc-uspace-dev 1:2.8.0~pre1.5821.g7525a1528 amd64 PC based motion controller for real-time Linux


Any thoughts? I am not sure where to start on it.
If it tells you anything, I get the same error on a virtual machine. From what I can tell the setups for standardized mesa firmware work fine, so I think it is a problem isolated to the non standard mesa firmware.

Thanks,
Shawn

Please Log in to join the conversation.

More
6 years 3 months ago #176432 by cmorley
Yes don't run pncconf with sudo.
You must have a slightly old version of 2.8 - the sudo-for-pci-card problem was fixed maybe a week or so ago.
use the text method until you update.

can you post the config files it created.

Please Log in to join the conversation.

More
6 years 3 months ago #176435 by cmorley
if you look in the TEST1.hal file look for
Code:
loadrt config=" num_encoders=2 num_pwmgens=2 num_stepgens=10"

change it to:
Code:
loadrt hm2_pci config=" num_encoders=2 num_pwmgens=2 num_stepgens=10"

See of that helps

Please Log in to join the conversation.

More
6 years 3 months ago #176441 by TheBigLebowski
It no longer produced the error testing on a VM. I will try it out on the actual computer tomorrow.

Thank you for the help.

Please Log in to join the conversation.

Time to create page: 2.654 seconds
Powered by Kunena Forum