test: test_loopback_onoff_rf now loops back successfully
That being said, the test still fails. Most likely requires a hysteresis region for the pwr threshold when reading RX'd samples.
This commit is contained in:
parent
d0384b2330
commit
01e8ea3b95
4 changed files with 22 additions and 3 deletions
|
|
@ -144,6 +144,13 @@ int setup_device_loopback_rf(struct loopback_burst_test *t)
|
|||
return status;
|
||||
}
|
||||
|
||||
status = bladerf_set_frequency(dev, BLADERF_MODULE_RX, t->frequency);
|
||||
if (status!= 0) {
|
||||
fprintf(stderr, "Failed to set RX sample rate: %s\n",
|
||||
bladerf_strerror(status));
|
||||
return status;
|
||||
}
|
||||
|
||||
status = bladerf_sync_config(t->dev, BLADERF_MODULE_RX,
|
||||
BLADERF_FORMAT_SC16_Q11_META,
|
||||
t->params->num_buffers,
|
||||
|
|
@ -164,6 +171,14 @@ int setup_device_loopback_rf(struct loopback_burst_test *t)
|
|||
|
||||
}
|
||||
|
||||
status = bladerf_set_frequency(dev, BLADERF_MODULE_TX, t->frequency);
|
||||
if (status!= 0) {
|
||||
fprintf(stderr, "Failed to set TX frequency: %s\n",
|
||||
bladerf_strerror(status));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
status = bladerf_sync_config(t->dev, BLADERF_MODULE_TX,
|
||||
BLADERF_FORMAT_SC16_Q11_META,
|
||||
t->params->num_buffers,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ struct loopback_burst_test {
|
|||
pthread_mutex_t lock;
|
||||
bool stop;
|
||||
bool rx_ready;
|
||||
bladerf_frequency frequency;
|
||||
};
|
||||
|
||||
struct loopback_burst {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ static void usage(const char *argv0)
|
|||
printf(" loopback_onoff Transmits ON-OFF bursts which are verified\n");
|
||||
printf(" loopback_onoff_rf Transmits ON-OFF bursts verified by\n");
|
||||
printf(" looping back from TX1 to RX1 via SMA cable.\n");
|
||||
printf(" NOTE: 20dB attenuator required\n");
|
||||
printf(" loopback_onoff_zp Transmits ON-OFF bursts with zero-padding,\n");
|
||||
printf(" which are verified via baseband loopback\n");
|
||||
printf(" to the RX module.\n");
|
||||
|
|
|
|||
|
|
@ -211,9 +211,14 @@ int test_fn_loopback_onoff_rf(struct bladerf *dev, struct app_params *p)
|
|||
test.num_bursts = 1000;
|
||||
test.stop = false;
|
||||
test.rx_ready = false;
|
||||
test.frequency = 100e6;
|
||||
|
||||
pthread_mutex_init(&test.lock, NULL);
|
||||
|
||||
fprintf(stderr, "[WARNING] loopback_onoff_rf under construction\n");
|
||||
fprintf(stderr, "[WARNING] Failure expected\n");
|
||||
fprintf(stderr, "[WARNING] 20dB attenuator required\n");
|
||||
|
||||
test.bursts = (struct loopback_burst *) malloc(test.num_bursts * sizeof(test.bursts[0]));
|
||||
if (test.bursts == NULL) {
|
||||
perror("malloc");
|
||||
|
|
@ -244,9 +249,6 @@ int test_fn_loopback_onoff_rf(struct bladerf *dev, struct app_params *p)
|
|||
pthread_mutex_unlock(&test.lock);
|
||||
}
|
||||
|
||||
fprintf(stderr, "[Error] loopback_onoff_rf under construction\n");
|
||||
goto out;
|
||||
|
||||
status = pthread_create(&tx_thread, NULL, tx_task, &test);
|
||||
if (status != 0) {
|
||||
fprintf(stderr, "Failed to start TX thread: %s\n", strerror(status));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue