AnsweredAssumed Answered

libiio iio.Buffer.refill() resets UI_OVF bit?

Question asked by IPrium on Apr 13, 2018
Latest reply on Apr 17, 2018 by larsc

Hello ADI

 

I have ZedBoard + FMCOMMS4 + 2017_R1 SD Card.
I execute following python script inside ZedBoard Linux (local context):

import iio

ctx = iio.Context('local:')

rx_dev = ctx.find_device("cf-ad9361-lpc")
rx_ch0 = rx_dev.find_channel('voltage0', is_output = False)
rx_ch1 = rx_dev.find_channel('voltage1', is_output = False)
rx_ch0.enabled = True
rx_ch1.enabled = True
rx_buf = iio.Buffer(rx_dev, 1048576, False)

for i in range(20):
    print 'Before refill: ', rx_dev.reg_read(0x80000088)
    rx_buf.refill()
    print 'After refill:  ', rx_dev.reg_read(0x80000088)
    t = rx_buf.read()
    print 'After read:    ', rx_dev.reg_read(0x80000088)

 

I'm reading REG_UI_STATUS from 'cf-ad9361-lpc' to control UI_OVF bit (FIFO overflow).

From description I see that "Software must write a 0x1 to clear this register bit".

But I see following log from my script:

Before refill:  4
After refill:   0
After read:     4
Before refill:  4
After refill:   0
After read:     4

 

That means for me, that 'rx_buf.refill()' resets UI_OVF bit. I think it's wrong behaviour because it hides possible FIFO overflow problems.

 

DAC FIFO Undeflow bit works as expected, I have to write '1' to clear UI_UNF, no self-resets or other resets happen for DAC. Why ADC works in different way?

 

Any help appreciated, thanks.

 

Danil Shendrik, IPrium LLC

Outcomes