diff --git a/srsue/hdr/phy/phy_common.h b/srsue/hdr/phy/phy_common.h index 9fb4f5f3b..86b20a8e3 100644 --- a/srsue/hdr/phy/phy_common.h +++ b/srsue/hdr/phy/phy_common.h @@ -157,6 +157,7 @@ public: void get_sync_metrics(sync_metrics_t m[SRSLTE_MAX_CARRIERS]); void reset(); + void reset_radio(); /* SCell Management */ void enable_scell(uint32_t cc_idx, bool enable); diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index ea6d25ecf..bb56d15c4 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -341,7 +341,9 @@ uint32_t phy::get_current_earfcn() { void phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm) { + n_ta = 0; sfsync.set_time_adv_sec(0.0f); + common.reset_radio(); if (!prach_buffer.prepare_to_send(preamble_idx, allowed_subframe, target_power_dbm)) { Error("Preparing PRACH to send\n"); } diff --git a/srsue/src/phy/phy_common.cc b/srsue/src/phy/phy_common.cc index 0d298f4ed..45bb19aa7 100644 --- a/srsue/src/phy/phy_common.cc +++ b/srsue/src/phy/phy_common.cc @@ -692,10 +692,19 @@ void phy_common::get_sync_metrics(sync_metrics_t m[SRSLTE_MAX_CARRIERS]) sync_metrics_read = true; } +void phy_common::reset_radio() +{ + is_first_tx = true; + for (int i = 0; i < SRSLTE_MAX_RADIOS; i++) { + is_first_of_burst[i] = true; + } +} + void phy_common::reset() { + reset_radio(); + sr_enabled = false; - is_first_tx = true; cur_pathloss = 0; cur_pusch_power = 0; p0_preamble = 0; @@ -711,10 +720,6 @@ void phy_common::reset() pcell_report_period = 20; - for (int i = 0; i < SRSLTE_MAX_RADIOS; i++) { - is_first_of_burst[i] = true; - } - ZERO_OBJECT(pending_dl_ack); ZERO_OBJECT(pending_dl_dai); ZERO_OBJECT(pending_ul_ack); diff --git a/srsue/src/phy/prach.cc b/srsue/src/phy/prach.cc index 524bfb586..0fa4c84d0 100644 --- a/srsue/src/phy/prach.cc +++ b/srsue/src/phy/prach.cc @@ -167,7 +167,7 @@ bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_, float } else { if (!cell_initiated) { Error("PRACH: Cell not configured\n"); - } else if (preamble_idx_ >= 64) { + } else { Error("PRACH: Invalid preamble %d\n", preamble_idx_); } return false; diff --git a/srsue/src/stack/mac/ul_harq.cc b/srsue/src/stack/mac/ul_harq.cc index b2fae689c..5ef991afc 100644 --- a/srsue/src/stack/mac/ul_harq.cc +++ b/srsue/src/stack/mac/ul_harq.cc @@ -110,7 +110,7 @@ void ul_harq_entity::new_grant_ul(mac_interface_phy_lte::mac_grant_ul_t grant, Info("Not implemented\n"); } } else { - Warning("Received grant for unknnown rnti=0x%x\n", grant.rnti); + Warning("Received grant for unknown rnti=0x%x\n", grant.rnti); } } diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index ccc8abc7f..7d84c145b 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -1070,9 +1070,9 @@ bool rrc::ho_prepare() ho_src_rnti = uernti.crnti; // Reset/Reestablish stack + mac->wait_uplink(); mac->clear_rntis(); phy->meas_reset(); - mac->wait_uplink(); pdcp->reestablish(); rlc->reestablish(); mac->reset(); @@ -1472,7 +1472,7 @@ void rrc::start_cell_reselection() return; } - rrc_log->info("Cell Reselection - Starting..."); + rrc_log->info("Cell Reselection - Starting...\n"); callback_list.defer_task([this]() { if (cell_selector.run()) { return srslte::proc_outcome_t::yield; @@ -1498,7 +1498,7 @@ void rrc::start_cell_reselection() break; } } - rrc_log->info("Cell Reselection - Finished successfully"); + rrc_log->info("Cell Reselection - Finished successfully\n"); return srslte::proc_outcome_t::success; }); }