developing drivers for custom boards
- PCW
-
- Away
- Moderator
-
- Posts: 19070
- Thank you received: 5261
so you need to set these in an idle state that makes sense for EPP. That's what the 4 written to the standard parallel port control register does
the 1 written to the status port is to clear any EPP timeout errors which may exist (Depending on chipset a EPP timeout may prevent any EPP
operations)
You are likely to get timeouts if your handshaking is not working so its good to monitor them when testing
Please Log in or Create an account to join the conversation.
- btvpimill
- Offline
- Elite Member
-
- Posts: 213
- Thank you received: 3
Then I shall try again to talk to the board. I have full hope that all will go well once the setup is done correctly.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23461
- Thank you received: 4992
I don't think you can use inb() or outb() at the halcmd prompt.HALRUN
loadrt constant ioaddr=0x378
start
val=inb(0x378+0x402)
print val
However, you _can_ use it at the normal (bash?) terminal prompt
linux.about.com/library/cmd/blcmdl2_inb.htm
If you are as unfamiliar with the command line as me:
www.freeos.com/guides/lsst/
Please Log in or Create an account to join the conversation.
- btvpimill
- Offline
- Elite Member
-
- Posts: 213
- Thank you received: 3
I think this is so frustrating because I Know what must be done, I know why it must be done, but I seem to not have any idea how to convey my desires to the puter.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23461
- Thank you received: 4992
Well I am back to square 1. I tried to add a function to my comp file, but it wouldn't compile.
There is normally some clue as to why it won't compile. What do the error messages say?
Please Log in or Create an account to join the conversation.
- btvpimill
- Offline
- Elite Member
-
- Posts: 213
- Thank you received: 3
"hal_init" [/tmp/tmpXQaY5h/constant.ko] undifined!
"hal_exit"
hal_export_funct
hal_malloc
hal_pin_bit_newf
rtapi_snprintf
hal_ready
hal_pin_u32_newf
tpapi_print
All the above have the same warning as the first one.
I am trying like this:
sudo comp --install constant.comp
So I am not sure from here. I will add that it does generate the C file using
comp constant.comp
Please Log in or Create an account to join the conversation.
- btvpimill
- Offline
- Elite Member
-
- Posts: 213
- Thank you received: 3
BTW, I know you say I can ignore the warnings, but if I try to loadrt the file, it fails
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23461
- Thank you received: 4992
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23461
- Thank you received: 4992
What does dmesg say after your attempted loadrt?
do you see the highlighted line below?
andypugh@ubuntu:~/emc2$ sudo comp --install constant.comp
make -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 -o /Module.symvers modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-122-rtai'
CC [M] /tmp/tmpmKP5S1/constant.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "hal_init" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_exit" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_export_funct" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_malloc" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_pin_bit_newf" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "rtapi_snprintf" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_ready" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "hal_pin_u32_newf" [/tmp/tmpmKP5S1/constant.ko] undefined!
WARNING: "rtapi_print" [/tmp/tmpmKP5S1/constant.ko] undefined!
CC /tmp/tmpmKP5S1/constant.mod.o
LD [M] /tmp/tmpmKP5S1/constant.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-122-rtai'
cp constant.ko /usr/realtime-2.6.32-122-rtai/modules/emc2/
andypugh@ubuntu:~/emc2$ halrun
halcmd: loadrt constant ioaddr=0x378
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
3 u32 OUT 0x00000000 constant.0.R0-in
3 u32 OUT 0x00000000 constant.0.R0-out
3 u32 OUT 0x00000000 constant.0.R1-in
3 u32 OUT 0x00000000 constant.0.R1-out
3 u32 OUT 0x00000000 constant.0.R2-in
Please Log in or Create an account to join the conversation.
- BigJohnT
-
- Offline
- Administrator
-
- Posts: 6999
- Thank you received: 1176
This probably isn't the problem, but "constant" is a bad choice of name, as that is a pre-existing hal module.
I just grabbed the example out of the HAL manual... might be a bad example.
John
Please Log in or Create an account to join the conversation.