developing drivers for custom boards

More
09 Aug 2011 01:20 #12314 by PCW
Replied by PCW on topic Re:developing drivers for custom boards
The funny thing about EPP mode is you can still change the handshaking line signals in the normal parallel port control register
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.

More
09 Aug 2011 01:35 #12316 by btvpimill
Replied by btvpimill on topic Re:developing drivers for custom boards
Well that makes sense. Tomorrow's fun will be to see IF I can query base+$402 to first see with my eyes if BIOS does in fact have the port in EPP mode. Then I shall see if I can first manually set the AS/DS high by writing 4 to control reg. At that point, at least before I try to talk to my card I will be able to verify the lines are correct.

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.

More
09 Aug 2011 10:03 #12327 by andypugh
Replied by andypugh on topic Re:developing drivers for custom boards
btvpimill wrote:

HALRUN
loadrt constant ioaddr=0x378
start
val=inb(0x378+0x402)
print val

I don't think you can use inb() or outb() at the halcmd prompt.
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.

More
09 Aug 2011 17:06 - 09 Aug 2011 17:08 #12345 by btvpimill
Replied by btvpimill on topic Re:developing drivers for custom boards
Well I am back to square 1. I tried to add a function to my comp file, but it wouldn't compile. So I deleted my changes, and now the original won't compile. I think I must need to take a short break from this and try to figure out what I am doing - cuz clearly I don't know. So tonight I am going to study the first 2 listed in this thread. My goal is to understand everything that is going on in them. Maybe then I will be able to create a driver that sets up the port, and talks to my card.

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.
Last edit: 09 Aug 2011 17:08 by btvpimill.

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

More
09 Aug 2011 18:03 #12346 by andypugh
Replied by andypugh on topic Re:developing drivers for custom boards
btvpimill wrote:

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.

More
09 Aug 2011 18:28 #12347 by btvpimill
Replied by btvpimill on topic Re:developing drivers for custom boards
warnings:
"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.

More
09 Aug 2011 18:40 #12348 by btvpimill
Replied by btvpimill on topic Re:developing drivers for custom boards
just got the same errors trying with Johns simple comp on page 5. Maybe I have screwed up something system wise?

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.

More
09 Aug 2011 18:59 #12350 by andypugh
Replied by andypugh on topic Re:developing drivers for custom boards
This probably isn't the problem, but "constant" is a bad choice of name, as that is a pre-existing hal module.

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

More
09 Aug 2011 19:07 - 09 Aug 2011 19:11 #12351 by andypugh
Replied by andypugh on topic Re:developing drivers for custom boards
It just worked fine for me, on a stock install. The errors are there, but it still loads with halrun.
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
Last edit: 09 Aug 2011 19:11 by andypugh.

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

More
09 Aug 2011 19:11 #12353 by BigJohnT
Replied by BigJohnT on topic Re:developing drivers for custom boards
andypugh wrote:

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.

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