diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 085446f26c..a103089aee 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -215,6 +215,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, i,common_vars->txdataF[i], fp->samples_per_frame_wCP*sizeof(int32_t)); common_vars->beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); + memset(common_vars->beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); } for (i=0;irxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 593768fb90..c5f08d66b1 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -148,8 +148,10 @@ int nr_phy_init_RU(RU_t *ru) { } ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); - for(i=0; i< ru->nb_tx; ++i) + for(i=0; i< ru->nb_tx; ++i) { ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); + memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); + } } // !=IF5 diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 8e1b39e454..b53e30570b 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -131,16 +131,16 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ssb_start_symbol, n_hf, frame, cfg, fp); - } - - // SSB beamforming is handled at PHY - // currently our PHY does not support switching more than once a slot. - if (ssb_per_slot>1) { - LOG_W(PHY,"beamforming currently not supported for more than one SSB per slot\n"); - } - else if (ssb_per_slot==1) { - for (int j=0;jsymbols_per_slot;j++) - gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; + // SSB beamforming is handled at PHY + // currently our PHY does not support switching more than once a slot. + if (ssb_per_slot>1) { + LOG_W(PHY,"beamforming currently not supported for more than one SSB per slot\n"); + } + else if (ssb_per_slot==1) { + LOG_I(PHY,"slot %d, ssb_index %d, beam %d\n",slot,ssb_index,cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value); + for (int j=0;jsymbols_per_slot;j++) + gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; + } } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5bfd7cb4d1..c9a10988b0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -278,7 +278,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm int num_ssb=0; for (int i=0;i<32;i++) { cfg->ssb_table.ssb_beam_id_list[i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG; - if ((cfg->ssb_table.ssb_mask_list[0].ssb_mask.value>>i)&1) { + if ((cfg->ssb_table.ssb_mask_list[0].ssb_mask.value>>(31-i))&1) { cfg->ssb_table.ssb_beam_id_list[i].beam_id.value = num_ssb; num_ssb++; } @@ -286,7 +286,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm } for (int i=0;i<32;i++) { cfg->ssb_table.ssb_beam_id_list[32+i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG; - if ((cfg->ssb_table.ssb_mask_list[1].ssb_mask.value>>i)&1) { + if ((cfg->ssb_table.ssb_mask_list[1].ssb_mask.value>>(31-i))&1) { cfg->ssb_table.ssb_beam_id_list[32+i].beam_id.value = num_ssb; num_ssb++; }