fix(nrppa): fix UL-RTOA k1 overflow and TRP position mismatch for TDOA positioning

- fix uint64_t overflow in handle_nr_srs_toa_vendor_ext_measurements:
  T_ns_inv was uint64_t causing silent wrap-around on negative ta_offset_nsec,
  making all 8 antennas report k1=985025 instead of distinct per-antenna values

- promote SRS TOA log from LOG_D to LOG_I in nr_measurements_gNB.c
  to make per-antenna timing visible at default log level
This commit is contained in:
Nima Chaharba
2026-05-09 18:25:26 +02:00
parent cc175ef74f
commit f3dddcc288
5 changed files with 26 additions and 14 deletions

View File

@@ -213,7 +213,7 @@ lmf:
num_gnb: 1
trp_info_wait_ms: 500
positioning_wait_ms: 500
measurement_wait_ms: 500
measurement_wait_ms: 5000
support_features:
request_trp_info: no
determine_num_gnb: yes

View File

@@ -1714,8 +1714,8 @@ void handle_nr_srs_toa_vendor_ext_measurements(const module_id_t module_id,
f1ap_ul_rtoa_measurement_item_t *ul_rtoa = &m_res_value->choice.ul_rtoa.ul_rtoa_measurement_item;
uint32_t Tc_inv = 4096 * 480000;
uint64_t T_inv = Tc_inv / (1 << mu);
uint64_t T_ns_inv = 1000000000;
int32_t k_value = (int32_t)(((int64_t)ta_offset_nsec[i] * (int64_t)T_inv) / T_ns_inv) + 492512;
int64_t T_ns_inv = 1000000000;
//int32_t k_value = (int32_t)(((int64_t)ta_offset_nsec[i] * (int64_t)T_inv) / T_ns_inv) + 492512;
//int32_t k_value = (int32_t)(((int64_t)ta_offset_nsec[i] * (int64_t)T_inv) / T_ns_inv) + 492512;
int32_t k_value;

View File

@@ -404,12 +404,12 @@ static int vrtsim_connect(openair0_device_t *device)
if (vrtsim_state->role == ROLE_SERVER) {
parse_ue_config(vrtsim_state);
compute_ue_antenna_offsets(vrtsim_state);
/////////////////////////// next line changed from = 0
int num_tx_streams = device->openair0_cfg[0].rx_num_channels;
///////////////////////////
int num_tx_streams = 0;
int num_rx_streams = vrtsim_state->num_ues * device->openair0_cfg[0].rx_num_channels;
//for (int i = 0; i < vrtsim_state->num_ues; i++) {
//num_tx_streams += vrtsim_state->ue_conf[i].rx_ant;
//}
for (int i = 0; i < vrtsim_state->num_ues; i++) {
num_tx_streams += vrtsim_state->ue_conf[i].rx_ant;
}
vrtsim_state->channel =
shm_td_iq_channel_create(DEFAULT_CHANNEL_NAME, num_tx_streams, num_rx_streams);
LOG_A(HW, "vrtsim created a shm_td_iq_channel with config tx: %d rx: %d\n", num_tx_streams, num_rx_streams);

View File

@@ -1,4 +1,4 @@
Active_gNBs = ( "gNB-OAI");
Active_gNBs = ( "gNB-OAI-DT");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
@@ -6,11 +6,11 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gNB-OAI";
gNB_name = "gNB-OAI-DT";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1; }) });
nr_cellid = 12345678L;
nr_cellid = 0xe0001;
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
pdsch_AntennaPorts_N1 = 2;
@@ -102,7 +102,7 @@ gNBs =
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
hoppingId = 40;
p0_nominal = -90;
ssb_PositionsInBurst_Bitmap = 1;
# ssb_periodicityServingCell
@@ -137,7 +137,8 @@ gNBs =
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ({ ipv4 = "172.21.6.4"; });
#amf_ip_address = ({ ipv4 = "172.21.6.4"; });
amf_ip_address = ({ ipv4 = "192.168.70.132"; });
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.117/24";
@@ -217,3 +218,14 @@ e2_agent = {
#sm_dir = "/path/where/the/SMs/are/located/"
sm_dir = "/usr/local/lib/flexric/"
};
positioning_config = (
{
NumTRPs = 8; # number of TRPs this match with total number of antenas set in config file
TRPIDs = [1,2,3,4,5,6,7,8]; # userdefined distinct IDs
TRPxAxis = [0,9000,27000,36000,50000,50000,50000,50000]; # X-axis value of each TRP in millimeter
TRPyAxis = [0,0,0,0,20000,25000,30000,35000]; # Y-axis value of each TRP in millimeter
TRPzAxis = [2200,2200,2200,2200,11000,11000,11000,11000]; # Z-axis value of each TRP millimeter
Units = [0, 0, 0, 0, 0, 0, 0, 0]; # 0 = mm, 1 = cm, 2 = dm
}
);

View File

@@ -4,7 +4,7 @@ uicc0 = {
imsi = "001010000000001";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; nssai_sd = 16777215; });
}
position0 = {