We are currently working on a testbed that involves a USRP X410 receiving a signal over all the four different channels in GNURadio. The X410 and UHD enables control of external components (transceivers in our case) via SPI and the HDMI front-panel connectors. For that, one has to set the pins on the desired GPIO port and configure the data direction. According to the manual page for the X410 (link), up to 4 peripherals are supported. A vector of peripheral configurations has to be passed to the spi_iface_getter.
Our aim was to connect 2 transceivers to GPIO0 (left hand side HDMI connector) and the other two transceivers to GPIO1 (right hand side HDMI connector). Each of the transceiver uses 4 pins, so in total we want to use 16 out of the 24 pins from both connectors (eight on each GPIO0/GPIO1). We were trying to initialize all 4 transceivers with the following line:
spi_ref = spi_getter_iface.get_spi_ref(periph_cfgs)
periph_cfgs is a vector of the four peripheral configurations. However, this returns an error as we are only allowed to push two peripheral configurations (two of our transceivers) into periph_cfgs. The get_spi_ref only accepts a vector of size 1/2. In each vector entry, we define the CLK/SDI/SDO/CS pins.
A peripheral configuration perip_cfg has been created as such:
spi_pconf periph_cfg;
periph_cfg.periph_clk = SPI_CLK_PIN_0;
periph_cfg.periph_sdi = SPI_SDI_PIN_0;
periph_cfg.periph_sdo = SPI_SDO_PIN_0;
periph_cfg.periph_cs = SPI_CS_PIN_0;
periph_cfgs.push_back(periph_cfg);
To circumvent this error our idea was to initialize two different spi_getter_iface objects, each with two peripheral configurations. We attempted to get the spi_getter_iface_0 and get the spi_getter_iface_1 objects from different radio controllers with the following lines:
spi_getter_iface_0 = usrp->get_radio_control(0).get_feature<spi_getter_iface>
spi_ref_0 = spi_getter_iface_0.get_spi_ref(periph_cfgs_0)
spi_getter_iface_1 = usrp->get_radio_control(1).get_feature<spi_getter_iface>
spi_ref_1 = spi_getter_iface_1.get_spi_ref(periph_cfgs_1)
However, our SPI commands are only executed on the spi_ref_1, not on spi_ref_0. If we reverse the order of the commands of spi_ref_0/spi_ref_1, it's the other way around, spi_ref_0 gets executed, spi_ref_1 not. Thus, it seems like only the "last" command is executed.
We have also verified, that both HDMI ports can be used (that they are not physically turned off), by having one configuration for GPIO0 and one for GPOI1 in the periph_cfgs_1 (the one executed last and thus working). This also works but the other two configs in periph_cfgs_0 are still not (as before with calling both spi_getter_iface_0/spi_getter_iface_1.
Is there any way to use multiple (more than 2) configurations via both GPIO0/GPIO1 at the same time?
We are currently working on a testbed that involves a USRP X410 receiving a signal over all the four different channels in GNURadio. The X410 and UHD enables control of external components (transceivers in our case) via SPI and the HDMI front-panel connectors. For that, one has to set the pins on the desired GPIO port and configure the data direction. According to the manual page for the X410 (link), up to 4 peripherals are supported. A vector of peripheral configurations has to be passed to the
spi_iface_getter.Our aim was to connect 2 transceivers to GPIO0 (left hand side HDMI connector) and the other two transceivers to GPIO1 (right hand side HDMI connector). Each of the transceiver uses 4 pins, so in total we want to use 16 out of the 24 pins from both connectors (eight on each GPIO0/GPIO1). We were trying to initialize all 4 transceivers with the following line:
periph_cfgsis a vector of the four peripheral configurations. However, this returns an error as we are only allowed to push two peripheral configurations (two of our transceivers) intoperiph_cfgs. Theget_spi_refonly accepts a vector of size 1/2. In each vector entry, we define the CLK/SDI/SDO/CS pins.A peripheral configuration
perip_cfghas been created as such:To circumvent this error our idea was to initialize two different
spi_getter_ifaceobjects, each with two peripheral configurations. We attempted to get thespi_getter_iface_0and get thespi_getter_iface_1objects from different radio controllers with the following lines:However, our SPI commands are only executed on the
spi_ref_1, not onspi_ref_0. If we reverse the order of the commands ofspi_ref_0/spi_ref_1, it's the other way around,spi_ref_0gets executed,spi_ref_1not. Thus, it seems like only the "last" command is executed.We have also verified, that both HDMI ports can be used (that they are not physically turned off), by having one configuration for
GPIO0and one forGPOI1in theperiph_cfgs_1(the one executed last and thus working). This also works but the other two configs inperiph_cfgs_0are still not (as before with calling bothspi_getter_iface_0/spi_getter_iface_1.Is there any way to use multiple (more than 2) configurations via both
GPIO0/GPIO1at the same time?