Digital Loopback

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
flo003
Posts: 9
Joined: Tue Sep 15, 2015 9:56 am

Digital Loopback

Post by flo003 »

Hi,

We have been studying for a while Blade's schematics. Our goal is to modify the fpga in order to implement the inner receiver of an OFDM demodulator. The idea is to then connect the output to a .grc in GNURadio to continue processing the signal.

We are interested in finding a way to provide a repetitive input to the fpga, a known signal to which we know what to expect in the output of each block we will implement.

We found in the bladder-hosted.vhd what appears to be a configuration of digital loopback of the FPGA. We think this could be exactly what we need in order to test our system.

Code: Select all

Line 78: type rx_mux_mode_t is (RX_MUX_NORMAL, RX_MUX_12BIT_COUNTER, RX_MUX_32BIT_COUNTER, RX_MUX_ENTROPY, RX_MUX_DIGITAL_LOOPBACK) ;
We have tried modifying the GPIO's value in the BladeRF-CLI in order to activate the digital loopback configuration with no success.

Has anyone tried using the digital loopback? We are not sure if it's implemented since it appears in the Tasks' list: https://github.com/Nuand/bladeRF/wiki/Tasks .
Does anyone know another way to provide a repetitive input to our circuit?

Thanks in advance.
Florencia
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: Digital Loopback

Post by bpadalino »

So the digital loopback assumes the RX and TX clocks are the same, and it also hopes that the RX and TX clocks are potentially slow enough to not cause metastable issues since the raw samples are going back into the RX side without a buffer inbetween them.

If I were you, I'd write a simple modulator for your OFDM signal, and feed it simple inputs and have it run all the time, feeding rx_sample_i/q/valid. Or take over the digital loopback mode and really just make it your own OFDM source.

At least that's how I would do it.
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: Digital Loopback

Post by bpadalino »

Take a look more like what the 12-bit or 32-bit counter does and how that mechanism works. That should be more insightful.
math
Posts: 3
Joined: Sat Jul 12, 2014 2:27 pm

Re: Digital Loopback

Post by math »

Try this to set the rx mux mode using libbladerf

Code: Select all

typedef enum bladerf_fpga_mux {
    BLADERF_RX_MUX_NORMAL = 0,
    BLADERF_RX_MUX_12BIT_COUNTER,
    BLADERF_RX_MUX_32BIT_COUNTER,
    BLADERF_RX_MUX_ENTROPY,
    BLADERF_RX_MUX_DIGITAL_LOOPBACK
} bladerf_fpga_mux_t;

static int bladerf_set_fpga_rx_mux(struct bladerf *dev, bladerf_fpga_mux_t mux) {
    uint32_t config_gpio;
    int status;

    if ((status = bladerf_config_gpio_read(dev, &config_gpio))) {
        return status;
    }

    // rx_mux_sel is a 3-bit value starting at bit 8
    // clear value
    config_gpio &= ~((1 << 8) | (1 << 9) | (1 << 10));
    // set value
    config_gpio |= mux << 8;

    return bladerf_config_gpio_write(dev, config_gpio);
}
flo003
Posts: 9
Joined: Tue Sep 15, 2015 9:56 am

Re: Digital Loopback

Post by flo003 »

Hi, thanks for your answers. We made more tests and could activate the digital loopback.
In order to do this we connected to the blade via the CLI interface and used the following commands:

set frequency 557143000
set bandwidth 7M
set samplerate 10M

print gpio
set gpio 0x457
print gpio

rx config file=/Users/test/.. N=10
rx
tx config file=/Users/test/..
tx config repeat = 0

tx start
tx
rx start
rx
tx stop

We made different tests and with a samplerate of 10M we received exactly what we sent.

We are pausing these tests for a while but we are thinking in incorporating the configuration in the CLI so thanks math! for the suggestion.

Florencia
Post Reply