Commit 340d05ee authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'calib-LimeSDR' of https://gitlab.eurecom.fr/oai/openairinterface5g into calib-LimeSDR

Conflicts:
	targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
parents 19a2337c 4342595e
......@@ -558,6 +558,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")
......
......@@ -2016,7 +2016,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
eNB->UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits
eNB->UE_stats[(uint32_t)UE_id].sector = 0;
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n",
LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n",
eNB->Mod_id,
eNB->CC_id,
frame,
......
......@@ -131,11 +131,17 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
* \returns 0 in success
*/
int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
int ret;
LMS_SetGaindB(lms_device, LMS_CH_TX, 0, openair0_cfg[0].tx_gain[0]);
LMS_SetGaindB(lms_device, LMS_CH_RX, 0, openair0_cfg[0].rx_gain[0]);
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_SetNormalizedGain(lms_device, LMS_CH_TX, 0, .2);//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
......@@ -196,9 +202,9 @@ 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);
//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);
......@@ -276,12 +282,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,97.0}, // on H PAD
{2660000000.0,110.0}, // on H PAD
{2300000000.0,106.0}, // on H PAD
{1880000000.0,106.0}, // on H PAD
{816000000.0,116.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}};
......@@ -328,7 +343,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
......@@ -340,8 +355,8 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
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_bw = 15.36e6;
openair0_cfg[0].rx_bw = 15.36e6;
break;
case 7680000:
openair0_cfg[0].samples_per_packet = 1024;
......
......@@ -40,7 +40,7 @@ eNBs =
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 20;
rx_gain = 116;
rx_gain = 100;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
......@@ -136,7 +136,7 @@ eNBs =
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.70";
mme_ip_address = ( { ipv4 = "127.0.0.3";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -145,11 +145,11 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24";
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
......
......@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208";
mobile_network_code = "93";
mobile_network_code = "92";
////////// Physical parameters:
......@@ -39,7 +39,7 @@ eNBs =
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 70;
tx_gain = 20;
rx_gain = 116;
prach_root = 0;
prach_config_index = 0;
......@@ -50,7 +50,7 @@ eNBs =
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -30;
pdsch_referenceSignalPower = -36;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
......
......@@ -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;
}
......@@ -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;
......
......@@ -267,7 +267,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), "");
......@@ -366,13 +366,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;
......@@ -639,6 +639,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