Upgrading from Axis 2.3.1

More
17 Sep 2019 19:43 #145427 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1

lspci -nn returns the following:
03:02.0 Bridge [0680]: PLX Technology, Inc. Device [10b5:3001] (rev 01)


10B5 and 3001 Are what the driver is expecting, so it seems like it ought to work.
In fact, looking at the driver, the card must be being detected to get to the point where it says "MOTENC: ERROR, unknown card detected\n"
It would be really helpful if the RTAPI_MSG_INFO messages were being printed. Unfortunately I don't know of a simple way to set the messaging level in LinuxCNC in the current builds. (there used to be a way: echo 7 > /proc/rtapi/level (or something like that))

So, I have written a simple HAL component.

Save the following text to a file called "set_msg_level.comp"
component set_msg_level;
license "GPL v2+";
author "andypugh";
option extra_setup;
pin out unsigned level;
;;

EXTRA_SETUP(){
    rtapi_set_msg_level(5);
}
Then compile and install it on your system:
sudo halcompile --install set_msg_level.comp

Now your debug session can be:
halrun
loadrt set_msg_level
loadrt hal_motenc

And we should get a bit more info about what is going on.

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

More
17 Sep 2019 20:23 - 17 Sep 2019 20:24 #145430 by smorin
Replied by smorin on topic Upgrading from Axis 2.3.1
Thanks again for the help..
I saved the file on the desktop and compiled it (i think) :)
cnc@cnc:~/Desktop$ sudo halcompile --install set_msg_level.comp
[sudo] password for cnc:
make KBUILD_EXTRA_SYMBOLS=/usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/Module.symvers -C /usr/src/linux-headers-3.4-9-rtai-686-pae SUBDIRS=`pwd` CC=gcc V=0 modules
make[1]: Entering directory `/usr/src/linux-headers-3.4-9-rtai-686-pae'
  CC [M]  /tmp/tmpCgqGG8/set_msg_level.o
set_msg_level.comp: In function ‘extra_setup’:
set_msg_level.comp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/tmpCgqGG8/set_msg_level.mod.o
  LD [M]  /tmp/tmpCgqGG8/set_msg_level.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.4-9-rtai-686-pae'
cp set_msg_level.ko /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/
cnc@cnc:~/Desktop$

then...
cnc@cnc:~$ halrun
halcmd: loadrt set_msg_level
halcmd: loadrt hal_motenc
Error: could not insert module /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/hal_motenc.ko: No such device
<stdin>:2: exit value: 1
<stdin>:2: insmod for hal_motenc failed, returned -1
See the output of 'dmesg' for more information.
halcmd:
Last edit: 17 Sep 2019 20:24 by smorin.

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

More
17 Sep 2019 20:29 #145431 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1
Anything in dmesg?

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

More
17 Sep 2019 20:37 - 17 Sep 2019 20:38 #145434 by smorin
Replied by smorin on topic Upgrading from Axis 2.3.1
I could not figure out where that file (demsg) resides.
Last edit: 17 Sep 2019 20:38 by smorin.

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

More
17 Sep 2019 20:40 #145435 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1
just type "dmesg" after exiting HAL.

(it's probably best to "sudo dmesg -c" before starting the HAL session to clear the log, so that it is clearer what is LinuxCNC output)

"dmesg" actually displays the latest from /var/log/kern.log

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

More
17 Sep 2019 21:08 #145443 by smorin
Replied by smorin on topic Upgrading from Axis 2.3.1
here's what it says
cnc@cnc:~$ dmesg
[21756.068773] I-pipe: head domain RTAI registered.
[21756.068777] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[21756.068848] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[21756.068849] SYSINFO: CPUs 8, LINUX APIC IRQ 2312, TIM_FREQ 6235080, CLK_FREQ 3591887000, CPU_FREQ 3591887000
[21756.068850] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[21756.068852] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 6235080, 6235080, 6183750
[21756.071862] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[21756.071888] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[21756.071891] RTAI[sched]: hard timer type/freq = APIC/6235080(Hz); default timing: oneshot; linear timed lists.
[21756.071892] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 3591887000 hz.
[21756.071893] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21756.075598] RTAI[math]: loaded.
[21788.021871] HAL: creating pin 'set-msg-level.0.level'
[21803.152363] HAL: initializing component 'hal_motenc'
[21803.152366] RTAPI: initing module HAL_hal_motenc
[21803.152368] RTAPI: module 'HAL_hal_motenc' loaded, ID: 5
[21803.152369] HAL: component 'hal_motenc' initialized, ID = 05
[21803.152384] MOTENC: Card detected in slot  2
[21803.152385] MOTENC: Card address @ f8076000, Len = 512
[21803.152389] MOTENC: Card is unknown, ID: 0
[21803.152390] MOTENC: ERROR, unknown card detected
[21803.152391] HAL: removing component 05
[21803.152392] RTAPI: module 5 exiting
[21803.152394] RTAPI: module 5 exited, name: 'HAL_hal_motenc'
[21803.152395] HAL: component 05 removed, name = 'hal_motenc'
[21820.292304] HAL: removing component 04
[21820.292307] RTAPI: module 4 exiting
[21820.292309] RTAPI: module 4 exited, name: 'HAL_set_msg_level'
[21820.292310] HAL: component 04 removed, name = 'set_msg_level'
[21820.310639] HAL_LIB: removing kernel lib
[21820.310658] RTAPI: shmem 01 freed by module 01
[21820.310659] RTAPI: module 1 exiting
[21820.310661] RTAPI: module 1 exited, name: 'HAL_LIB'
[21820.310662] HAL_LIB: kernel lib removed successfully
[21820.311455] RTAPI: Exiting
[21820.311462] RTAPI: Exit complete
[21820.312252] RTAI[math]: unloaded.
[21820.313051] SCHED releases registered named ALIEN PEDV$D
[21820.314388] RTAI[malloc]: unloaded.
[21820.411794] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[21820.412800] I-pipe: head domain RTAI unregistered.
[21820.412887] RTAI[hal]: unmounted.
cnc@cnc:~$

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

More
17 Sep 2019 21:17 #145445 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1
Now we are getting somewhere. It is finding the card, OK, but seems to think it has ID of 0 and does not like that.

It isn't clear if this is the same ID as is set by J3 jumpers on the board, and the manual is a bit unclear on how to configure board ID, but maybe try changing that.

This might possibly be a fault in the driver, if ID 0 is default and also not accepted by thr driver.

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

More
17 Sep 2019 21:23 #145446 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1
Sorry, that was bad advice.

Looking further this is nothing to do with the Board ID.

It is looking for 0 in a register for MOTENC-100 and 1 for MOTENC-Lite.

Is your board either of those?

github.com/LinuxCNC/linuxcnc/blob/master...rs/hal_motenc.c#L406

Unfortunately the driver fails to mention what board type code it has actually found.

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

More
17 Sep 2019 21:27 #145448 by smorin
Replied by smorin on topic Upgrading from Axis 2.3.1
I have Motenc-lite installed.

is that a "lite" I see at the end of the tunnel? :-)

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

More
17 Sep 2019 21:31 #145449 by andypugh
Replied by andypugh on topic Upgrading from Axis 2.3.1
I think you might need to look in to the possibility of compiling LinuxCNC from source to delve deeper in to this.
(the motenc driver has too many library calls to be compiled easily with halcompile)

This isn't _very_ difficult, if you are prepared to give it a go.

I assume you are in the US and sending the card to me (in the UK) is not going to be viable?

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

Time to create page: 0.168 seconds
Powered by Kunena Forum