From 1199a79851a3bc083d10ac077337e72664d0b32d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 21 Jul 2020 17:45:14 +0200 Subject: [PATCH] fix Scell sync for large cells the PSS detection needs more temporary buffer than a full subframe. we therefore need to allocate and initialize the sync object with larger maximum size to support Scell search of large cells, e.g. 20 MHz this fixes issue #1538 --- lib/src/phy/sync/sync.c | 1 - srsue/hdr/phy/scell/scell_sync.h | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/src/phy/sync/sync.c b/lib/src/phy/sync/sync.c index b25b0f8f6..e9c04b27c 100644 --- a/lib/src/phy/sync/sync.c +++ b/lib/src/phy/sync/sync.c @@ -53,7 +53,6 @@ int srslte_sync_init(srslte_sync_t* q, uint32_t frame_size, uint32_t max_offset, } int srslte_sync_init_decim(srslte_sync_t* q, uint32_t frame_size, uint32_t max_offset, uint32_t fft_size, int decimate) { - int ret = SRSLTE_ERROR_INVALID_INPUTS; if (q != NULL && fft_size_isvalid(fft_size)) { diff --git a/srsue/hdr/phy/scell/scell_sync.h b/srsue/hdr/phy/scell/scell_sync.h index fa5210e88..a5acb3dad 100644 --- a/srsue/hdr/phy/scell/scell_sync.h +++ b/srsue/hdr/phy/scell/scell_sync.h @@ -59,7 +59,7 @@ private: uint32_t channel = 0; srslte_sync_t find_pss = {}; int32_t sf_len = 0; - std::array temp; + std::array temp; /** * Executes the PSS search state @@ -110,14 +110,18 @@ private: public: /** * Constructor + * + * Init PSS search object with twice the max subframe length to support max cell bandwidth. + * * @param _callback provides the class for giving feedback * @param _channel provides the channel index where the feedback needs to be applied */ sync(sync_callback* _callback, uint32_t _channel) : callback(_callback), channel(_channel) { // Initialise Find PSS object - if (srslte_sync_init(&find_pss, SRSLTE_SF_LEN_MAX, SRSLTE_SF_LEN_MAX, SRSLTE_SYMBOL_SZ_MAX) != SRSLTE_SUCCESS) { - ERROR("Initiating Synchroniser\n"); + if (srslte_sync_init(&find_pss, 2 * SRSLTE_SF_LEN_MAX, 2 * SRSLTE_SF_LEN_MAX, SRSLTE_SYMBOL_SZ_MAX) != + SRSLTE_SUCCESS) { + ERROR("Initiating Synchronizer\n"); } }