From f7265977ad94ff12399e8acae64030201dfceaf4 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 13 Jan 2026 16:56:56 +0100 Subject: [PATCH] NR UE: when compensating for large timing_advance changes, set writeBlockSize to 0 instead of 1 --- executables/nr-ue.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index ef53351047..f66d11f4c3 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -294,6 +294,10 @@ static int nr_ue_slot_select(const fapi_nr_config_request_t *cfg, int nr_slot) static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **txp) { + int writeBlockSize = rxtxD->writeBlockSize; + if (writeBlockSize == 0) + return; + PHY_VARS_NR_UE *UE = rxtxD->UE; const fapi_nr_config_request_t *cfg = &UE->nrUE_config; const UE_nr_rxtx_proc_t *proc = &rxtxD->proc; @@ -353,7 +357,6 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx } openair0_timestamp_t writeTimestamp = proc->timestamp_tx; - int writeBlockSize = rxtxD->writeBlockSize; // if writeBlockSize gets longer that slot size, fill with dummy const int maxWriteBlockSize = get_samples_per_slot(proc->nr_slot_tx, fp); while (writeBlockSize > maxWriteBlockSize) { @@ -1010,9 +1013,9 @@ void *UE_thread(void *arg) UE->N_TA_offset = new_N_TA_offset; } if (writeBlockSize < 0) { - timing_advance += writeBlockSize - 1; - LOG_I(PHY, "writeBlockSize is %d, setting it to 1 and changing timing_advance to %d\n", writeBlockSize, timing_advance); - writeBlockSize = 1; + timing_advance += writeBlockSize; + LOG_I(PHY, "writeBlockSize is %d, setting it to 0 and changing timing_advance to %d\n", writeBlockSize, timing_advance); + writeBlockSize = 0; } if (curMsg.proc.nr_slot_rx == 0)