diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 08626224b02c5c4ab5ad03dbf06a174df5e8221d..8afdd28ce9c55ba3cb07624d674f86cb4f083a6c 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -4520,6 +4520,12 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t // ask L2 for RACH transport if ((runmode != rx_calib_ue) && (runmode != rx_calib_ue_med) && (runmode != rx_calib_ue_byp) && (runmode != no_L2_connect) ) { LOG_D(PHY, "Getting PRACH resources. Frame %d Slot %d \n", frame_tx, nr_tti_tx); + // flush Msg3 Buffer + if (ue->prach_resources[gNB_id]->Msg3 == NULL){ + for(int i = 0; i<NUMBER_OF_CONNECTED_gNB_MAX; i++) { + ue->ulsch_Msg3_active[i] = 0; + } + } nr_ue_get_rach(ue->prach_resources[gNB_id], mod_id, ue->CC_id, UE_mode, frame_tx, gNB_id, nr_tti_tx); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 5a98327e000ae4886e0b81e246888e27ff456422..472d1c0b1a693419d5177fd197c27494a4693d9a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -302,16 +302,12 @@ void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint } void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){ - #if 0 // TBR AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n"); - - LOG_D(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Setting contention resolution timer\n", mod_id, frameP); - - // start contention resolution timer + LOG_D(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Starting contention resolution timer\n", mod_id, frameP); + NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); + // start contention resolution timer mac->RA_contention_resolution_cnt = 0; mac->RA_contention_resolution_timer_active = 1; - - #endif } ///////////////////////////////////////////////////////////////////////// @@ -358,15 +354,6 @@ void nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, LOG_I(MAC, "RA not active. Starting RA preamble initialization.\n"); - /* TBR flush Msg3 Buffer - this was done like this but at PHY level - for(i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { - // flush Msg3 buffer - PHY_VARS_NR_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; - ue->ulsch_Msg3_active[i] = 0; - } - */ - mac->RA_RAPID_found = 0; /* Set RA_PREAMBLE_POWER_RAMPING_STEP */