From ae0fb4f4fc3909be511f811a77bafad8345245be Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 12 Jan 2022 11:48:25 +0100 Subject: [PATCH] UE NR PHY cell select minor fixes --- srsue/src/phy/nr/cell_search.cc | 7 +++++++ srsue/src/phy/sync_sa.cc | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/srsue/src/phy/nr/cell_search.cc b/srsue/src/phy/nr/cell_search.cc index 51c75e27c..b6ff1d58b 100644 --- a/srsue/src/phy/nr/cell_search.cc +++ b/srsue/src/phy/nr/cell_search.cc @@ -54,6 +54,13 @@ bool cell_search::start(const cfg_t& cfg) ssb_cfg.pattern = cfg.ssb_pattern; ssb_cfg.duplex_mode = cfg.duplex_mode; + // Print SSB configuration, helps debugging gNb and UE + if (logger.info.enabled()) { + std::array ssb_cfg_str = {}; + srsran_ssb_cfg_to_str(&ssb_cfg, ssb_cfg_str.data(), (uint32_t)ssb_cfg_str.size()); + logger.info("Cell search: Setting SSB configuration %s", ssb_cfg_str.data()); + } + // Configure SSB if (srsran_ssb_set_cfg(&ssb, &ssb_cfg) < SRSRAN_SUCCESS) { logger.error("Cell search: Error setting SSB configuration"); diff --git a/srsue/src/phy/sync_sa.cc b/srsue/src/phy/sync_sa.cc index 4f38b4f11..ce0677719 100644 --- a/srsue/src/phy/sync_sa.cc +++ b/srsue/src/phy/sync_sa.cc @@ -122,11 +122,9 @@ cell_search::ret_t sync_sa::cell_search_run(const cell_search::cfg_t& cfg) rrc_proc_state = PROC_SEARCH_RUNNING; - // Configure searcher without locking state for avoiding stalling the Rx stream - logger.info("Cell search: starting in center frequency %.2f and SSB frequency %.2f with subcarrier spacing of %s", - cfg.center_freq_hz / 1e6, - cfg.ssb_freq_hz / 1e6, - srsran_subcarrier_spacing_to_str(cfg.ssb_scs)); + // tune radio + logger.info("Tuning Rx channel %d to %.2f MHz", 0, cfg.center_freq_hz / 1e6); + radio->set_rx_freq(0, cfg.center_freq_hz); if (not searcher.start(cfg)) { logger.error("Sync: failed to start cell search");