Altera_Forum
Honored Contributor
20 years agoPIO devices under uClinux
I'm having a problem getting the PIO ports to work under uClinux.
If I try to access the PIO by reading or writing to the memory location, pointed to by the pio struct, then nothing seems to happen. Monitoring the bit on the hardware side shows that it isn't toggling. I have data cache, but was under the impression that setting the most significant bit of the address would force the data to ignore cache and go out to memory space, therefore hitting the PIO registers. Is this not the case? In other words, all the peripherals off the Avalon bus utilize and address with its most significant bit set. In order to overcome this issue, I tried using the standard io macros utilized in Linux. However, I had problems using the outl and inl functions. It warns that they are not defined, even though asm/io.h is included. I little digging into asm/io.h shows that these inline macros aren't included, because their are behind an "#ifdef __KERNEL__". Basically, I guess the code was written, so that these inline macros are only valid from kernel space. It seems like there should be a simple way to directly control the pio devices within a user-space program under uClinux. Does anybody have a proven method? Is there anything else that might be going wrong??? Thanks in advance. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif