Commit 8da8de72 authored by Raymond Knopp's avatar Raymond Knopp

fixed bad BLADERF defines (BLADRF), some gain adjustments

parent 596b0fd1
...@@ -208,7 +208,8 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai ...@@ -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)); brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
memset(brf, 0, 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 // The number of buffers to use in the underlying data stream
brf->num_buffers = 128; brf->num_buffers = 128;
// the size of the underlying stream buffers, in samples // 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 ...@@ -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); 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)); fprintf(stderr,"Failed to set RX bandwidth: %s\n", bladerf_strerror(status));
brf_error(status); brf_error(status);
}else }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) { 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)); 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 ...@@ -280,11 +281,11 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
}else }else
printf("[BRF] set TX sampling rate to %u \n", (unsigned int) openair0_cfg[card].sample_rate); 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)); fprintf(stderr, "Failed to set TX bandwidth: %s\n", bladerf_strerror(status));
brf_error(status); brf_error(status);
}else }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) { 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)); fprintf(stderr,"Failed to set TX gain: %s\n",bladerf_strerror(status));
......
...@@ -35,7 +35,7 @@ eNBs = ...@@ -35,7 +35,7 @@ eNBs =
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 20; tx_gain = 60;
rx_gain = 20; rx_gain = 20;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
......
...@@ -950,7 +950,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ...@@ -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]= ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
#ifdef EXMIMO #ifdef EXMIMO
((short*)dummy_tx_b)[2*i]<<4; ((short*)dummy_tx_b)[2*i]<<4;
#elif OAI_BLADRF #elif OAI_BLADERF
((short*)dummy_tx_b)[2*i]; ((short*)dummy_tx_b)[2*i];
#else #else
((short*)dummy_tx_b)[2*i]<<4; ((short*)dummy_tx_b)[2*i]<<4;
...@@ -958,7 +958,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ...@@ -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]= ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]=
#ifdef EXMIMO #ifdef EXMIMO
((short*)dummy_tx_b)[2*i+1]<<4; ((short*)dummy_tx_b)[2*i+1]<<4;
#elif OAI_BLADRF #elif OAI_BLADERF
((short*)dummy_tx_b)[2*i+1]; ((short*)dummy_tx_b)[2*i+1];
#else #else
((short*)dummy_tx_b)[2*i+1]<<4; ((short*)dummy_tx_b)[2*i+1]<<4;
...@@ -2935,11 +2935,9 @@ int main( int argc, char **argv ) ...@@ -2935,11 +2935,9 @@ int main( int argc, char **argv )
openair0_cfg[card].remote_ip = &rrh_eNB_ip[0]; openair0_cfg[card].remote_ip = &rrh_eNB_ip[0];
openair0_cfg[card].remote_port = rrh_eNB_port; 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 #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 // 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. // 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 // in the case of EXMIMO2, these values are overwirtten in the function setup_eNB/UE_buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment