Skip to content

X410 SPI mode: using more than 2 peripherals simultaneously #929

Description

@inets-rwth

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions