From 98f304bfa8d2e8dd05fb6433c22cbc0c439415eb Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 11 Jan 2022 19:48:49 +0100 Subject: [PATCH] Add in srsue and srsenb SSB configuration in log --- srsenb/src/phy/nr/worker_pool.cc | 7 +++++++ srsue/src/phy/nr/slot_sync.cc | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/srsenb/src/phy/nr/worker_pool.cc b/srsenb/src/phy/nr/worker_pool.cc index 8f3f775b1..733c78047 100644 --- a/srsenb/src/phy/nr/worker_pool.cc +++ b/srsenb/src/phy/nr/worker_pool.cc @@ -138,6 +138,13 @@ int worker_pool::set_common_cfg(const phy_interface_rrc_nr::common_cfg_t& common ssb_cfg.scaling = srsran_convert_dB_to_amplitude(srsran_gnb_dl_get_maximum_signal_power_dBfs(common_cfg.carrier.nof_prb)); + // 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("Setting SSB configuration %s", ssb_cfg_str.data()); + } + // For each worker set configuration for (uint32_t i = 0; i < pool.get_nof_workers(); i++) { // Reserve worker from pool diff --git a/srsue/src/phy/nr/slot_sync.cc b/srsue/src/phy/nr/slot_sync.cc index aef0a23a1..a007e5815 100644 --- a/srsue/src/phy/nr/slot_sync.cc +++ b/srsue/src/phy/nr/slot_sync.cc @@ -62,6 +62,14 @@ bool slot_sync::init(const args_t& args, stack_interface_phy_nr* stack_, srsran: int slot_sync::set_sync_cfg(const srsran_ue_sync_nr_cfg_t& cfg) { + // Print the configuration, it is essential to make sure the UE synchronizes with the wight cell + if (logger.info.enabled()) { + std::array ssb_cfg_str = {}; + srsran_ssb_cfg_to_str(&cfg.ssb, ssb_cfg_str.data(), (uint32_t)ssb_cfg_str.size()); + logger.info("SYNC: Setting SSB configuration %s Tracking N_id=%d.", ssb_cfg_str.data(), cfg.N_id); + } + + // Set the synchronization configuration if (srsran_ue_sync_nr_set_cfg(&ue_sync_nr, &cfg) < SRSRAN_SUCCESS) { logger.error("SYNC: failed to set cell configuration for N_id %d", cfg.N_id); return SRSRAN_ERROR;