Commit b2bda949 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/calib-LimeSDR' into develop_integration_w11

parents 4ae59999 c6581031
......@@ -561,6 +561,7 @@ elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
include_directories("/usr/local/include/lime")
include_directories("/usr/include/lime")
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
LINK_DIRECTORIES("/usr/local/lib")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -128,30 +128,20 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
/*! \brief Set Gains (TX/RX) on LMSSDR
* \param device the hardware to use
* \param openair0_cfg openair0 Config structure
* \returns 0 in success
* \returns 0 in success, -1 on error
*/
int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
int ret = 0;
LMS_SetNormalizedGain(lms_device, LMS_CH_TX, 0, openair0_cfg[0].tx_gain[0]/100.0);
// RX gains, use low-level setting
double gv = openair0_cfg[0].rx_gain[0] - openair0_cfg[0].rx_gain_offset[0];
if (gv > 31) {
printf("RX Gain 0 too high, reduce by %f dB\n",gv-31);
gv = 31;
}
if (gv < 0) {
printf("RX Gain 0 too low, increase by %f dB\n",-gv);
gv = 0;
}
printf("[LMS] Setting 7002M G_PGA_RBB to %d\n", (int16_t)gv);
LMS7002M lms7;
lms7.SetConnection(lms7.GetConnection());
lms7.Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB),(int16_t)gv);
if (openair0_cfg->rx_gain[0] > 70+openair0_cfg->rx_gain_offset[0]) {
printf("[LMS] Reduce RX Gain 0 by %f dB\n",openair0_cfg->rx_gain[0]-openair0_cfg->rx_gain_offset[0]-70);
ret = -1;
}
LMS_SetGaindB(lms_device, LMS_CH_TX, 0, openair0_cfg->tx_gain[0]);
LMS_SetGaindB(lms_device, LMS_CH_RX, 0, openair0_cfg->rx_gain[0]-openair0_cfg->rx_gain_offset[0]);
return(0);
return(ret);
}
/*! \brief Start LMSSDR
......@@ -212,10 +202,11 @@ int trx_lms_start(openair0_device *device){
}
printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6);
/*
printf("Override antenna settings to: RX1_H, TXA_2");
LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1);
LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2);
*/
for (int i = 0; i< device->openair0_cfg->rx_num_channels; i++)
......@@ -292,12 +283,21 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in
// 31 = 19 dB => 105 dB total gain @ 2.6 GHz
/*! \brief calibration table for LMSSDR */
// V1.2 board
rx_gain_calib_table_t calib_table_lmssdr_1v2[] = {
{3500000000.0,44.0}, // on L PAD
{2660000000.0,55.0}, // on L PAD
{2300000000.0,54.0}, // on L PAD
{1880000000.0,54.0}, // on L PAD
{816000000.0,79.0}, // on W PAD
{-1,0}};
// V1.4 board
rx_gain_calib_table_t calib_table_lmssdr[] = {
{3500000000.0,70.0},
{2660000000.0,80.0},
{2300000000.0,80.0},
{1880000000.0,74.0}, // on W PAD
{816000000.0,76.0}, // on W PAD
{3500000000.0,44.0}, // on H PAD
{2660000000.0,55.0}, // on H PAD
{2300000000.0,54.0}, // on H PAD
{1880000000.0,54.0}, // on H PAD
{816000000.0,79.0}, // on L PAD
{-1,0}};
......@@ -344,7 +344,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
device->type=LMSSDR_DEV;
printf("LMSSDR: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
openair0_cfg[0].iq_txshift = 0;
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
// from usrp_time_offset
......@@ -355,9 +355,9 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
break;
case 15360000:
openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 70;
openair0_cfg[0].tx_bw = 10e6;
openair0_cfg[0].rx_bw = 10e6;
openair0_cfg[0].tx_sample_advance = 450;
openair0_cfg[0].tx_bw = 15.36e6;
openair0_cfg[0].rx_bw = 15.36e6;
break;
case 7680000:
openair0_cfg[0].samples_per_packet = 1024;
......
......@@ -35,8 +35,8 @@ eNBs =
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 107;
tx_gain = 70;
rx_gain = 116;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
......@@ -46,7 +46,7 @@ eNBs =
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -17;
pdsch_referenceSignalPower = -30;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
......@@ -64,9 +64,9 @@ eNBs =
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -96;
pucch_p0_Nominal = -104;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
......
......@@ -23,85 +23,89 @@ eNBs =
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 13;
downlink_frequency = 751000000L;
uplink_frequency_offset = 31000000;
Nid_cell = 0;
N_RB_DL = 50;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -20;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -96;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 13;
downlink_frequency = 751000000L;
uplink_frequency_offset = 31000000;
Nid_cell = 0;
N_RB_DL = 50;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 20;
rx_gain = 100;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -30;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -104;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
......@@ -131,7 +135,6 @@ eNBs =
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.3";
ipv6 = "192:168:30::17";
......@@ -146,7 +149,7 @@ eNBs =
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
......
......@@ -39,8 +39,8 @@ eNBs =
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 100;
rx_gain = 111;
tx_gain = 20;
rx_gain = 116;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
......@@ -50,7 +50,7 @@ eNBs =
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -30;
pdsch_referenceSignalPower = -35;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
......@@ -136,7 +136,7 @@ eNBs =
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.3";
mme_ip_address = ( { ipv4 = "192.168.12.148";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -145,11 +145,11 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
......
......@@ -1004,6 +1004,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
start_rf_prev_ts = start_rf_new_ts;
clock_gettime( CLOCK_MONOTONIC, &start_rf_new);
start_rf_new_ts = ts;
LOG_D(PHY,"rx_rf: first_rx %d received ts %"PRId64" (sptti %d)\n",proc->first_rx,ts,fp->samples_per_tti);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
proc->timestamp_rx = ts-eNB->ts_offset;
......@@ -1020,7 +1021,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
else {
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples\n",proc->timestamp_rx - old_ts - fp->samples_per_tti);
LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,eNB->ts_offset);
eNB->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
proc->timestamp_rx = ts-eNB->ts_offset;
}
......@@ -1559,7 +1560,7 @@ static void* eNB_thread_single( void* param ) {
wait_sync("eNB_thread_single");
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if (eNB->node_function < NGFI_RRU_IF5)
if ((eNB->node_function < NGFI_RRU_IF5) && (eNB->mac_enabled==1))
wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
#endif
......@@ -1723,7 +1724,7 @@ void init_eNB_proc(int inst) {
proc->CC_id = CC_id;
proc->instance_cnt_synch = -1;
proc->first_rx=1;
proc->first_rx=2;
proc->first_tx=1;
proc->frame_offset = 0;
......
......@@ -1739,7 +1739,7 @@ int main( int argc, char **argv ) {
#if defined(ENABLE_ITTI)
if ((UE_flag == 1)||
(node_function[0]<NGFI_RAU_IF4p5))
((node_function[0]<NGFI_RAU_IF4p5)&&(phy_test==0)))
// don't create if node doesn't connect to RRC/S1/GTP
if (create_tasks(UE_flag ? 0 : 1, UE_flag ? 1 : 0) < 0) {
printf("cannot create ITTI tasks\n");
......
......@@ -269,7 +269,7 @@ static void *UE_thread_synch(void *arg) {
}
}
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
// AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
while (oai_exit==0) {
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
......@@ -368,13 +368,13 @@ static void *UE_thread_synch(void *arg) {
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
UE->rfdevice.trx_stop_func(&UE->rfdevice);
//UE->rfdevice.trx_stop_func(&UE->rfdevice);
sleep(1);
init_frame_parms(&UE->frame_parms,1);
if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
/*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
LOG_E(HW,"Could not start the device\n");
oai_exit=1;
}
}*/
} else {
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
UE->is_synchronized = 1;
......@@ -647,6 +647,7 @@ void *UE_thread(void *arg) {
int sub_frame=-1;
//int cumulated_shift=0;
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
while (!oai_exit) {
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
int instance_cnt_synch = UE->proc.instance_cnt_synch;
......
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