Hi,
I have the same problem with "halcmd: hal_init() failed: -22", but if I try
to run emc from root it start, realy I don't know why.
Hope help you.


2010/1/21 Francois-Marie Lefevere <[email protected]>

> Hello,
> I am trying to setup emc on linux kernel 2.6.28.9 with rtai-3.7.1
>
> I've tested RTAI with the /usr/realtime/testsuite/kern/latency/run
> script and it seems to work.
> I've compiled emc from the git repository.
>
> Running emc gives the following trace:
>
> EMC2 - 2.4.0~pre
> Machine configuration directory is '/home/lefevere/emc2/configs/stepper'
> Machine configuration file is 'stepper_mm.ini'
> Starting EMC2...
> RTAPI: ERROR: failed to map shmem
> HAL: ERROR: could not open shared memory
> halcmd: hal_init() failed: -22
> NOTE: 'rtapi' kernel module must be loaded
> RTAPI: ERROR: failed to map shmem
> HAL: ERROR: could not open shared memory
> halcmd: hal_init() failed: -22
> NOTE: 'rtapi' kernel module must be loaded
> etc...
>
> Actually the rtapi module loads properly, I can see it for a few
> second when running lsmod while emc is starting.
> And here is the dmesg log:
>
> [  719.592026] I-pipe: Domain RTAI registered.
> [  719.592032] RTAI[hal]: <3.7.1> mounted over IPIPE-NOTHREADS 2.2-07.
> [  719.592035] RTAI[hal]: compiled with gcc version 4.4.1 (Ubuntu
> 4.4.1-4ubuntu9) .
> [  719.592075] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE
> (INTERNAL IRQs VECTORED), ISOL_CPUS_MASK: 0).
> [  719.592077] PIPELINE layers:
> [  719.592080] f83ecb80 9ac15d93 RTAI 200
> [  719.592082] c078b800 0 Linux 100
> [  719.609080] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
> [  719.609288] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with
> RTAI OWN KTASKs>, <uses LINUX SYSCALLs>, kstacks pool size = 524288
> bytes.
> [  719.609295] RTAI[sched]: hard timer type/freq = APIC/12528446(Hz);
> default timing: periodic; linear timed lists.
> [  719.609299] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq
> = 2004715000 hz.
> [  719.609301] RTAI[sched]: timer setup = 999 ns, resched latency = 2944
> ns.
> [  719.655780] RTAI[math]: loaded.
> [  719.664626] RTAPI: Init
> [  719.664663] RTAPI: Init complete
> [  719.672586] HAL_LIB: loading kernel lib
> [  719.672590] RTAPI: initing module HAL_LIB
> [  719.672593] RTAPI: module 'HAL_LIB' loaded, ID: 1
> [  719.672676] RTAPI: shmem 01 created by module 01, key: 1212238898,
> size: 262000
> [  719.672685] HAL_LIB: kernel lib installed successfully
> [  722.029547] RTAI[math]: unloaded.
> [  722.034259]
> [  722.034260] SHM_CLEANUP_MODULE releases:
> 'CF$Z8N':0x48414c32:1212238898 (262144).
> [  722.068310] RTAI[malloc]: unloaded.
> [  722.168053] RTAI[sched]: unloaded (forced hard/soft/hard
> transitions: traps 0, syscalls 0).
> [  722.170772] I-pipe: Domain RTAI unregistered.
> [  722.170821] RTAI[hal]: unmounted.
>
> Here is the content of a few other files:
> emc_debug.txt:
> 3735
>  PID TTY      STAT   TIME COMMAND
>  3735 pts/0    Z+     0:00 [emcsvr] <defunct>
>  PID TTY      STAT   TIME COMMAND
> Stopping realtime threads
> Unloading hal components
>
> emc_print.txt:
> RUN_IN_PLACE=yes
> EMC2_DIR=
> EMC2_BIN_DIR=/home/lefevere/emc2-dev/bin
> EMC2_TCL_DIR=/home/lefevere/emc2-dev/tcl
> EMC2_SCRIPT_DIR=
> EMC2_RTLIB_DIR=/home/lefevere/emc2-dev/rtlib
> EMC2_CONFIG_DIR=
> EMC2_LANG_DIR=/home/lefevere/emc2-dev/src/objects
> INIVAR=inivar
> HALCMD=halcmd
> EMC2_EMCSH=/usr/bin/wish8.5
> INIFILE=/home/lefevere/emc2/configs/stepper/stepper_mm.ini
> PARAMETER_FILE=stepper.var
> EMCMOT=motmod
> EMCIO=io
> TASK=milltask
> HALUI=
> DISPLAY=axis
> NML_FILE=emc.nml
> Starting EMC2 server program: emcsvr
> Loading Real Time OS, RTAPI, and HAL_LIB modules
> Starting EMC2 IO program: io
> Killing task emcsvr, PID=3735
> Removing HAL_LIB, RTAPI, and Real Time OS modules
> Removing NML shared memory segments
>
> Any idea ?
> Thanks.
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to