[Discuss OpenCPI] Multiple ad9361_config_proxy Instances

From: Davis Hoover <dhoover_at_geontech.com>
Date: Mon, 24 Feb 20 10:47:28 -0500

I've been unable to recreate this issue in xsim, I'll see if there's a way
to emulate this scenario on hardware (we don't have a physical device with
2 AD9361s to test this). You may well have found a bug with the device
proxy worker memory mapping.

---------- Forwarded message ---------
From: Brian Padalino <bpadalino_at_gmail.com>
Date: Thu, Feb 20, 2020 at 3:44 PM
Subject: [Discuss OpenCPI] Multiple ad9361_config_proxy Instances
To: <discuss_at_lists.opencpi.org>


I've been able to build my FPGA image with multiple AD9361's connected.

Now I'm trying to actually interact with them individually and I believe I
have run into a bug with how the ad9361_config_proxy is being initialized.

I am modifying the ad9361_config_proxy_test to instantiate both of my front
ends and all supporting proxies. I'm giving them unique names and working
with their names directly. I am definitely initializing each of the
individual front ends separately, which is great. If I disable one of
them, the appropriate ad9361_init() call fails.

Unfortunately, it seems that whichever was initialized second is the only
one I can access. In my program, I setup 4 properties:

  - afe0_config_proxy, temperature
  - afe1_config_proxy, temperature
  - afe0_config_proxy, rx_lo_freq
  - afe1_config_proxy, rx_lo_freq

I then loop through printing all 4 items to a line. The temperatures and
frequencies for both are always the same. When I run the program with
OCPI_LOG_LEVEL=10, I notice the address printed around the No-OS API calls
switches after the first initialization. Here are the two initialization
functions from my log:

  OCPI(10:275.0635): Setting the default value of property 'ad9361_init' of
instance 'afe0_config_proxy'
  OCPI(10:275.0635): set8RegisterOffset 0xb3059000 24 1
  --
  OCPI(10:275.0637): afe0_config_proxy: No-OS API call: ad9361_init(...)
  OCPI(10:275.0637): get8RegisterOffset 0xb3059000 12
  --
  OCPI(10:276.0305): Setting the default value of property 'ad9361_init' of
instance 'afe1_config_proxy'
  OCPI(10:276.0305): set8RegisterOffset 0xb3559000 24 1
  --
  OCPI(10:276.0307): afe1_config_proxy: No-OS API call: ad9361_init(...)
  OCPI(10:276.0307): get8RegisterOffset 0xb3559000 12

Once afe1_config_proxy has been initialized, the 0xb3059000 address never
shows up. I'd expect, when querying the values from the device, they
should show up. Here are the 4 values being queried:

  OCPI(10:283.0173): afe0_config_proxy: No-OS API call:
ad9361_get_temperature(...)
  OCPI(10:283.0173): getBytesRegisterOffset 0xb3559000 45 sz 1
  --
  OCPI(10:283.0173): afe0_config_proxy: No-OS API call:
ad9361_get_rx_lo_freq(...)
  OCPI(10:283.0173): getBytesRegisterOffset 0xb3559000 25d sz 1
  --
  OCPI(10:283.0174): afe1_config_proxy: No-OS API call:
ad9361_get_temperature(...)
  OCPI(10:283.0174): getBytesRegisterOffset 0xb3559000 45 sz 1
  --
  OCPI(10:283.0174): afe1_config_proxy: No-OS API call:
ad9361_get_rx_lo_freq(...)
  OCPI(10:283.0175): getBytesRegisterOffset 0xb3559000 25d sz 1

So something seems to be overwriting the initial 0xb3059000 address with
0xb3559000 in the afe0_config_proxy even though it should only be
associated with the afe1_config_proxy.

I didn't see anything obvious in the ad9361_config_proxy.cc but it's also
not the easiest file to read.

Does anyone familiar with that file/subsystem have any insights?

Thanks,
Brian


Received on Mon Feb 24 2020 - 15:47:28 CST

This archive was generated by hypermail 2.3.0 : Fri Jun 05 2026 - 08:45:25 CDT