Commit 01645168 authored by Thomas Schlichter's avatar Thomas Schlichter 🇩🇪
Browse files

NR_UE: handle initial TA the same way as TA updates, independent of the UE_mode

In FDD mode, the UE_mode switches to PUSCH mode before the initial TA value was applied.
Because of this, the ta_command was misinterpreted.
Fix this by adding 31 to the initial TA comamnd and handle it the same as TA updates.
parent e023f67e
......@@ -238,33 +238,15 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){
int factor_mu = 1 << numerology;
uint16_t bw_scaling = get_bw_scaling(bwp_ul_NB_RB);
LOG_D(PHY, "In %s: applying timing advance -- frame %d -- slot %d -- UE_mode %d\n", __FUNCTION__, frame_tx, slot_tx, ue->UE_mode[gNB_id]);
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling / factor_mu;
if (ue->UE_mode[gNB_id] == RA_RESPONSE){
ue->timing_advance = ul_time_alignment->ta_command * bw_scaling / factor_mu;
LOG_D(PHY, "In %s: [UE %d] [%d.%d] Received (RAR) timing advance command %d new value is %u \n",
__FUNCTION__,
ue->Mod_id,
frame_tx,
slot_tx,
ul_time_alignment->ta_command,
ue->timing_advance);
} else if (ue->UE_mode[gNB_id] == PUSCH){
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling / factor_mu;
LOG_D(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
__FUNCTION__,
ue->Mod_id,
frame_tx,
slot_tx,
ul_time_alignment->ta_command,
ue->timing_advance);
}
LOG_I(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
__FUNCTION__,
ue->Mod_id,
frame_tx,
slot_tx,
ul_time_alignment->ta_command,
ue->timing_advance);
ul_time_alignment->ta_frame = -1;
ul_time_alignment->ta_slot = -1;
......
......@@ -2230,7 +2230,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
// TA command
ul_time_alignment->apply_ta = 1;
ul_time_alignment->ta_command = rar->TA2 + (rar->TA1 << 5);
ul_time_alignment->ta_command = 31 + rar->TA2 + (rar->TA1 << 5);
#ifdef DEBUG_RAR
// CSI
......
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