AnsweredAssumed Answered

AD9361 overflow detection not working correctly at low datarates

Question asked by LeroyKii on Feb 22, 2017
Latest reply on Mar 2, 2017 by rejeesh
Branched from an earlier discussion

Just to let you know, I also found what may be another bug related to enabling FIR filter.

I'm using the xflow monitor code (appended below) that someone uploaded here to check if an overflow or underflow of radio buffers has happened.
Underflow ('U') and overflow ('O') info are correctly printed in console until I enable the FIR filter. From that moment the monitor is only able to inform about underflows, but not overflows though. To fix this issue the platform need to be rebooted.


Monitor threads code:

 static void *monitor_xflow_fn(void *arg) {
  // struct iio_context *ctx;
  monitor_thread_t *monitor = (monitor_thread_t *) arg;
  uint32_t val;
  int ret;

  // if (monitor->is_tx) printf("TX\n");
  // else printf("RX\n");

  /* Clear all status bits */
  iio_device_reg_write(monitor->dev, 0x80000088, 0x6);

  while (1) {
    ret = iio_device_reg_read(monitor->dev, 0x80000088, &val);
    if (ret) {
      fprintf(stderr, "Failed to read status register: %s\n",

    if (monitor->is_tx) {
      if (val & 1)
        fprintf(stderr, "U\n");
    } else {
      if (val & 4)
        fprintf(stderr, "O\n");

    /* Clear bits */
    if (val)
      iio_device_reg_write(monitor->dev, 0x80000088, val);

  return (void *)0;