Allow nRF Cloud A-GNSS with caller-supplied network info without using MODEM_INFO

Using nRF Connect SDK v3.4.1 with an nRF9151.

CONFIG_NRF_CLOUD_AGNSS currently has unconditional dependencies on:

depends on MODEM_INFO
depends on MODEM_INFO_ADD_NETWORK
However, nrf_cloud_coap_agnss_data_get() accepts a struct nrf_cloud_coap_agnss_request containing caller-supplied net_info.

My application already obtains MCC, MNC, TAC, and cell ID and supplies them directly.

Therefore, the modem-info library is not needed for the A-GNSS request.

Enabling it has a significant cost in this memory-constrained application. In particular, nRF Cloud allocates:

static struct modem_param_info modem_inf;
This structure consumes 2,376 bytes of BSS and remains unused (as far as I can see)

I tested an application-side Kconfig override that enables NRF_CLOUD_AGNSS while leaving MODEM_INFO disabled. The result:

  • Builds and links successfully
  • Boots successfully on the nRF9151
  • Filtered A-GNSS fetch and injection work successfully
  • Saves 5,016 bytes of flash
  • Saves 2,424 bytes of RAM

Could the A-GNSS Kconfig dependency be relaxed so MODEM_INFO is only required when the SDK must obtain network information itself?

For example, could NCS support two configurations:

  1. Network information obtained through MODEM_INFO
  2. Network information always supplied by the caller through request.net_info

It also appears that device-status encoding calls get_modem_info() whenever a non-null modem-info structure is provided, even when its device, network, and sim fields are all NRF_CLOUD_INFO_NO_CHANGE. Avoiding that query may be another useful optimisation.

Should I raise this in the Github SDK repo, or is DevZone appropriate?

Related