diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 8cddc78e3d..b997b35268 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -781,13 +781,16 @@ void *UE_thread(void *arg) { decoded_frame_rx, curMsg->proc.frame_rx ); int flags = 0; - int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX; - if (slot_tx_usrp%10==7) + uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots; + uint8_t num_UL_slots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots + + (mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols!=0); + uint8_t first_tx_slot = tdd_period - num_UL_slots; + if (curMsg->proc.nr_slot_tx%tdd_period==first_tx_slot) flags=2; - else if (slot_tx_usrp%10==8) - flags = 1; - else if (slot_tx_usrp%10==9) + else if (curMsg->proc.nr_slot_tx%tdd_period==first_tx_slot+num_UL_slots-1) flags = 3; + else if (curMsg->proc.nr_slot_tx%tdd_period>first_tx_slot) + flags = 1; if (flags || IS_SOFTMODEM_RFSIM || IS_SOFTMODEM_NOS1) AssertFatal( writeBlockSize == diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index da84901602..9df9be4cbd 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -1019,6 +1019,7 @@ typedef struct typedef struct { uint8_t tdd_period;//DL UL Transmission Periodicity. Value:0: ms0p5 1: ms0p625 2: ms1 3: ms1p25 4: ms2 5: ms2p5 6: ms5 7: ms10 8: ms3 9: ms4 + uint8_t tdd_period_in_slots; fapi_nr_max_tdd_periodicity_t* max_tdd_periodicity_list; } fapi_nr_tdd_table_t; diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 66308e46fe..b77da95844 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -82,6 +82,7 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } int nb_slots_per_period = ((1<tdd_table.tdd_period_in_slots = nb_slots_per_period; if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 ) AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots),