diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index b45f41c82a..143f105847 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -117,7 +117,10 @@ static void tx_func(void *param) int slot_rx = info->slot_rx; int absslot_tx = info->timestamp_tx / info->gNB->frame_parms.get_samples_per_slot(slot_tx, &info->gNB->frame_parms); int absslot_rx = absslot_tx - info->gNB->RU_list[0]->sl_ahead; - + if (absslot_rx < 0) { + LOG_W(NR_PHY, "Slot ahead %d is larger than absslot_tx %d. Cannot start TX yet.\n", info->gNB->RU_list[0]->sl_ahead, absslot_tx); + return; + } LOG_D(NR_PHY, "%d.%d running tx_func\n", frame_tx, slot_tx); PHY_VARS_gNB *gNB = info->gNB; module_id_t module_id = gNB->Mod_id;