Hello:
I am using the TS-7260 and a custom PC/104 device. This device contains a UART
in which you set the BASE(0x300) with rotatory switches and the IO and IRQ
dynamically. So lets say you set them to 0x300. This means at 0x300 you then
need to write the upper Most Significant Bye (MSB) of the Serial port IO
address and at 0x301 you need to write the Least Significant Byte (LSB) of the
Serial Port IO address, like this:
0x300 0x03(msb)
0x301 0xf8(lsb)
0x302 0x06(irq=6 in board)
Now i created a device in the /dev directory for it,using
mknod /dev/pc_104 c 4 64
Which is performed sucesfully since I can see it in the /dev directory.
Then I set the port using setserial as follow
setserial /dev/pc_104 port 0x11e0_0000 baud_base 115200 irq 33
However when my program tries to manage IO dinamically using mmap it
crashes.This is how the code looks like:
int fd;
void *pc_104;
fd = open(/dev/pc_104, O_RDWR | O_SYNC)
if(fd <=0)perror("fd error");
pc_104 = mmap(0,getpagesize(),PROT_READ|PROT_WRITE, MAP_SHARED,
fd, 0x11E00000);
if(pc_104 == MAP_FAILED)
perror("pc_104");
And i get, once I run the executable:
pc_104: No such device.
I do not know what to do now in order to get this board working, so any help
will be preciated. Sorry is the post is too long but I tried to be specific on
it.
Thanks in advance
Damian Miralles
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|