From 8da8de7297bb21ba7b9cafc333270b823675473b Mon Sep 17 00:00:00 2001 From: Raymond Knopp <knopp@eurecom.fr> Date: Fri, 25 Dec 2015 10:08:45 +0100 Subject: [PATCH] fixed bad BLADERF defines (BLADRF), some gain adjustments --- targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 11 ++++++----- .../CONF/enb.band7.tm1.bladerfx40.conf | 2 +- targets/RT/USER/lte-softmodem.c | 10 ++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index ce2e998fbf..3a6a35a676 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -208,7 +208,8 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t)); memset(brf, 0, sizeof(brf_state_t)); - // init required params for BRF + // init required params for [97448.145250] lte-softmodem-n[20648]: segfault at 0 ip (null) sp 00007fff220167b8 error 14 in lte-softmodem-nos1[400000+3bc000] + // The number of buffers to use in the underlying data stream brf->num_buffers = 128; // the size of the underlying stream buffers, in samples @@ -254,11 +255,11 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai printf("[BRF] set RX sample rate to %u, %u\n", (unsigned int) openair0_cfg[card].sample_rate, actual_value); - if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_bw, &actual_value)) != 0){ + if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_bw*2, &actual_value)) != 0){ fprintf(stderr,"Failed to set RX bandwidth: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set RX bandwidth to %u, %u\n",(unsigned int)openair0_cfg[card].rx_bw, actual_value); + printf("[BRF] set RX bandwidth to %u, %u\n",(unsigned int)openair0_cfg[card].rx_bw*2, actual_value); if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg[card].rx_gain[0])) != 0) { fprintf(stderr,"Failed to set RX gain: %s\n",bladerf_strerror(status)); @@ -280,11 +281,11 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai }else printf("[BRF] set TX sampling rate to %u \n", (unsigned int) openair0_cfg[card].sample_rate); - if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg[card].tx_bw, NULL)) != 0){ + if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg[card].tx_bw*2, NULL)) != 0){ fprintf(stderr, "Failed to set TX bandwidth: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set TX bandwidth to %u \n", (unsigned int) openair0_cfg[card].tx_bw); + printf("[BRF] set TX bandwidth to %u \n", (unsigned int) openair0_cfg[card].tx_bw*2); if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int) openair0_cfg[card].tx_gain[0])) != 0) { fprintf(stderr,"Failed to set TX gain: %s\n",bladerf_strerror(status)); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf index bdbb46a98b..2933b43718 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf @@ -35,7 +35,7 @@ eNBs = Nid_cell_mbsfn = 0; nb_antennas_tx = 1; nb_antennas_rx = 1; - tx_gain = 20; + tx_gain = 60; rx_gain = 20; prach_root = 0; prach_config_index = 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 8e08cfc04c..9926fe75ed 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -950,7 +950,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]= #ifdef EXMIMO ((short*)dummy_tx_b)[2*i]<<4; -#elif OAI_BLADRF +#elif OAI_BLADERF ((short*)dummy_tx_b)[2*i]; #else ((short*)dummy_tx_b)[2*i]<<4; @@ -958,7 +958,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]= #ifdef EXMIMO ((short*)dummy_tx_b)[2*i+1]<<4; -#elif OAI_BLADRF +#elif OAI_BLADERF ((short*)dummy_tx_b)[2*i+1]; #else ((short*)dummy_tx_b)[2*i+1]<<4; @@ -2935,11 +2935,9 @@ int main( int argc, char **argv ) openair0_cfg[card].remote_ip = &rrh_eNB_ip[0]; openair0_cfg[card].remote_port = rrh_eNB_port; } -openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL; + openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL; #endif - openair0_cfg[card].sample_rate = sample_rate; - openair0_cfg[card].tx_bw = bw; - openair0_cfg[card].rx_bw = bw; + // in the case of the USRP, the following variables need to be initialized before the init // since the USRP only supports one CC (for the moment), we initialize all the cards with first CC. // in the case of EXMIMO2, these values are overwirtten in the function setup_eNB/UE_buffer -- GitLab