AnsweredAssumed Answered

More comprehensive Linux Driver documentation?

Question asked by htorke on Jan 16, 2017
Latest reply on Feb 19, 2017 by rgetz

Is there any more formal documentation on how to use the Linux drivers than this:

 

https://wiki.analog.com/resources/tools-software/linux-drivers-all

 

The page linked above gives a good general overview, but is sometimes sparse on detail or specifics, which makes it hard to work with.

 

Right now what I'm trying to do is this:

 

1. Create an mmap to the ring buffer where AD9371 samples are stored, which should start at physical address 0x7C400000

2. Set the desired RX frequency of the AD9371 RX

3. Turn on the AD9371 RX

4. Copy the data from the mmapped buffer into another array at a given instance in time

 

This seems straightforward enough, but using the resource isn't clear on how to go about it.

 

For example, while I am able to mmap the expected memory location, reading from this location in memory returns 0's. My current guess is that the reason is that 'cat \sys\bus/iio\devices\iio\:device6\buffer\enable' returns 0, meaning the ring buffer is disabled. But writing '1' or 'buffer_on' or 'on' or 'enable' to that file in the sysfs returns "Invalid argument".

 

The Linux Driver page for the AD9371 doesn't make specific mention to the \buffer file in the RX Signal Path section, so I don't know where to find information on how to enable this buffer. And beyond that, I'm not even sure if that is why I'm not seeing anything in the buffer, or if the RX is even on.

 

If there is any more comprehensive documentation for the Linux drivers, please let me know where I can find it. I am aware of the LibIIO and have been suggested trying that by people on the forum, but I would like the option of having this lower level interface.

Outcomes