Skip to content

Commit cae3836

Browse files
plskeggsmbolivar-nordic
authored andcommitted
doc: nrf_cloud_pgps: Add P-GPS partition documentation
Document new Kconfig options related to the new dedicated P-GPS partition in flash. Add to release notes and known issues. This includes doc review edits. Signed-off-by: Pete Skeggs <[email protected]> Signed-off-by: Francesco Domenico Servidio <[email protected]>
1 parent f91bb3d commit cae3836

File tree

4 files changed

+111
-30
lines changed

4 files changed

+111
-30
lines changed

doc/nrf/glossary.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Glossary
1313
Access Port Protection (APPROTECT)
1414
A register used to prevent read and write access to all CPU registers and memory-mapped addresses.
1515

16+
Almanac data
17+
In the :term:`Global Navigation Satellite System (GNSS)`, the data providing coarse orbit and status information for each satellite in the constellation.
18+
Each satellite broadcasts Almanac data for all the satellites in the constellation.
19+
1620
Anycast addressing
1721
An addressing type that routes datagrams to a single member of a group of potential receivers that are all identified by the same destination address.
1822
This is a one-to-nearest association.
@@ -28,6 +32,11 @@ Glossary
2832
Application Programming Interface (API)
2933
A language and message format used by an application program to communicate with an operating system, application, or other services.
3034

35+
Assisted GPS (A-GPS)
36+
A form of assistance provided to devices trying to obtain a :term:`Global Navigation Satellite System (GNSS)` fix.
37+
It improves the :term:`Time to First Fix (TTFF)` by utilizing a connection (for example, over cellular) to the internet to retrieve the :term:`Almanac data` and :term:`Ephemeris data`.
38+
A connection to an internet server that has the Almanac and Ephemeris data is several times quicker than using the data link to the GPS satellites.
39+
3140
Attribute Protocol (ATT)
3241
"[It] allows a device referred to as the server to expose a set of attributes and their associated values to a peer device referred to as the client."
3342
`Bluetooth Core Specification`_, Version 5.3, Vol 3, Part F, Section 1.1.
@@ -148,6 +157,10 @@ Glossary
148157
Endpoint
149158
In the context of a :ref:`Matter <ug_matter>` or :ref:`Zigbee <ug_zigbee>` network, an addressable container that contains *clusters* appropriate for a single device type such as a sensor or a light bulb.
150159

160+
Ephemeris data
161+
In the :term:`Global Navigation Satellite System (GNSS)`, the data providing information about the orbit of the satellite transmitting it.
162+
This data is valid for four hours and becomes inaccurate after that.
163+
151164
Evaluation Kit (EK)
152165
A platform used to evaluate different development platforms.
153166

@@ -448,6 +461,11 @@ Glossary
448461
A feature introduced in 3GPP Release 12 to improve the battery life of IoT (Internet of Things) devices by minimizing energy consumption.
449462
The device stays dormant during the PSM window.
450463

464+
Predicted GPS (P-GPS)
465+
A form of assistance provided to devices trying to obtain a :term:`Global Navigation Satellite System (GNSS)` fix, where the device can download up to two weeks of predicted satellite Ephemerides data.
466+
It enables devices to determine the exact orbital location of the satellite without connecting to the network every two hours with a trade-off of reduced accuracy of the calculated position over time.
467+
It is available through :term:`nRF Cloud`.
468+
451469
Preview Development Kit (PDK)
452470
A development platform used for application development.
453471
A Preview Development Kit uses an engineering sample of the chip and it is not production-ready in comparison to the Development Kit that uses a production-ready version of the chip.
@@ -570,6 +588,9 @@ Glossary
570588
Target
571589
The goal of an operation, for example, programming a specific image on a device, compiling a specific set of files, or removing previously generated files.
572590

591+
Time to First Fix (TTFF)
592+
The time needed by a :term:`Global Navigation Satellite System (GNSS)` module to estimate its position.
593+
573594
Transmission Control Protocol (TCP)
574595
A connection-oriented protocol that provides reliable transport.
575596
This reliability comes at the cost of control packets overhead of the protocol itself, making it unsuitable for bandwidth-constrained applications.

doc/nrf/known_issues.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ CIA-463: Wrong network mode parameter reported to cloud
124124
NCSDK-14235: Timestamps that are sent in cloud messages drift over time
125125
Due to a bug in the :ref:`lib_date_time` library, timestamps that are sent to cloud drift because they are calculated incorrectly.
126126

127+
.. rst-class:: v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-0
128+
129+
CIA-604: ATv2 cannot be built for the ``thingy91_nrf9160_ns`` build target with ``SECURE_BOOT`` enabled
130+
Due to the use of static partitions with the Thingy:91, there is insufficient room in the flash memory to enable both the primary and secondary bootloaders.
131+
127132
Serial LTE Modem
128133
================
129134

doc/nrf/libraries/networking/nrf_cloud_pgps.rst

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,40 @@ nRF Cloud P-GPS
77
:local:
88
:depth: 2
99

10-
The nRF Cloud P-GPS library enables applications to request and process predicted GPS data from `nRF Cloud`_ to be used with the nRF9160 SiP.
10+
The nRF Cloud P-GPS library enables applications to request and process :term:`Predicted GPS (P-GPS)` data from `nRF Cloud`_ to be used with the nRF9160 SiP.
1111
This library is an enhancement to the :ref:`lib_nrf_cloud` library.
12-
It can be used with or without Assisted GPS (`A-GPS`_) data from nRF Cloud.
12+
It can be used with or without :term:`Assisted GPS (A-GPS)` data from nRF Cloud.
1313

14-
P-GPS is intended for specific use cases.
15-
It is not targeted for general use cases that already work with A-GPS.
16-
P-GPS is designed for devices that are frequently disconnected from the cloud but need periodic GNSS fixes as quickly as possible to save power.
14+
Overview
15+
********
1716

18-
To get a position fix, a GNSS receiver needs information such as the satellite orbital data, exact date and time of the day, and accurate hardware clock frequency data.
17+
To get a position fix, a :term:`Global Navigation Satellite System (GNSS)` receiver needs information such as the satellite orbital data, exact date and time of the day, and accurate hardware clock frequency data.
1918
GPS satellites broadcast this information in a pattern, which repeats every 12.5 minutes.
20-
Predicted GPS data contains information about the estimated orbits (`Ephemerides <Ephemeris_>`_) of the 32 GPS satellites for up to a two-week period, with each set of ephemerides predictions being valid for a specific four-hour period within the set of all provided predictions.
21-
These ephemeris predictions are downloaded from the cloud, stored by the device in flash memory, and later injected into the GNSS module when needed.
19+
20+
Predicted GPS (P-GPS) is a form of assistance that reduces the :term:`Time to First Fix (TTFF)`, the time needed by a GNSS module to estimate its position.
21+
It is provided through :term:`nRF Cloud` services.
22+
In P-GPS, nRF Cloud provides data containing information about the estimated orbits (`Ephemerides <Ephemeris_>`_) of the 32 GPS satellites for up to two weeks.
23+
Each set of ephemerides predictions is valid for a specific four-hour period within the set of all provided predictions.
24+
A device using P-GPS downloads the ephemeris predictions from the cloud, it stores them in its flash memory, and later it injects them into the GNSS module when needed.
25+
26+
P-GPS is designed for devices that are frequently disconnected from the cloud but need periodic GNSS fixes as quickly as possible to save power.
27+
This is possible because a device can download the broadcasted information and predictions of satellite data provided through P-GPS (or also A-GPS) at a faster rate from nRF Cloud than from the data links of the satellites.
28+
However, P-GPS should not be used for general use cases that already work with :term:`Assisted GPS (A-GPS)` only.
2229

2330
.. note::
31+
When using two-week ephemeris prediction sets, the TTFF towards the end of the second week will increase due to the accumulated errors in the predictions and the decrease in the number of satellite ephemerides in the later prediction periods.
2432

25-
If two-week prediction sets are used, TTFF towards the end of the second week will increase due to accumulated errors in the predictions and decrease in number of satellite ephemerides in the later prediction periods.
33+
P-GPS requires a cloud connection approximately once a week, depending on the configuration settings.
34+
A-GPS requires a cloud connection each time.
2635

27-
If nRF Cloud services such as A-GPS or P-GPS are used either individually or in combination, the broadcasted information and predictions of satellite data can be downloaded at a faster rate from nRF Cloud than from the satellites.
36+
A device can use P-GPS together with A-GPS.
37+
This provides the following advantages:
2838

29-
The use of P-GPS reduces Time to First Fix (TTFF) (time for a GNSS module to estimate its position) when compared to using no assistance at all.
30-
Further, it only requires a cloud connection approximately once a week, depending on configuration.
31-
On the other hand, when only A-GPS is used, a cloud connection is needed each time.
32-
If you use P-GPS along with A-GPS, TTFF is faster compared to an implementation with P-GPS only.
33-
The amount of cloud data needed for each fix is smaller during each fix compared to an implementation with A-GPS only.
34-
With proper configuration, A-GPS can be used with P-GPS, when a cloud connection is available, and acquire fast fixes even without a cloud connection.
35-
This is possible as long as the stored P-GPS data is still valid, and current date and time (accurate to a few seconds) and the most recent location (accurate to a few dozen kilometers) are known.
39+
* It shortens TTFF compared to using only P-GPS.
40+
* It requires less cloud data during each fix compared to using only A-GPS.
41+
42+
With proper configuration, A-GPS can be used with P-GPS when a cloud connection is available, and it can acquire fast fixes even without a cloud connection.
43+
This is possible as long as the stored P-GPS data is still valid, and the current date and time (accurate to a few seconds) and the most recent location (accurate to a few dozen kilometers) are known.
3644

3745
.. note::
3846
To use the nRF Cloud P-GPS service, an nRF Cloud account is needed, and the device needs to be associated with a user's account.
@@ -53,21 +61,37 @@ Configure these additional options to refine the behavior of P-GPS:
5361
* :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_DOWNLOAD_FRAGMENT_SIZE`
5462
* :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_REQUEST_UPON_INIT`
5563

56-
Configure the following option if you need your application to use A-GPS as well, for coarse time and position data and to get the fastest TTFF:
64+
Configure the following option if you need your application to also use A-GPS, for coarse time and position data and to get the fastest TTFF:
5765

5866
* :kconfig:option:`CONFIG_NRF_CLOUD_AGPS`
5967

60-
If A-GPS is not desired (due to data costs, low power requirements, or expected frequent loss of cloud connectivity), you must disable the option.
68+
.. note::
69+
Disable this option if you do not want to use A-GPS (due to data costs, low power requirements, or expected frequent loss of cloud connectivity).
6170

62-
For an application that uses P-GPS, the following options must be configured for storing settings, for having accurate clock time, and for having a location to store predictions:
71+
You must also configure the following options for storing settings, for having accurate clock time, and for having a location to store predictions:
6372

6473
* :kconfig:option:`CONFIG_FLASH`
6574
* :kconfig:option:`CONFIG_FCB`
6675
* :kconfig:option:`CONFIG_SETTINGS_FCB`
6776
* :kconfig:option:`CONFIG_DATE_TIME`
68-
* :kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT`
69-
* :kconfig:option:`CONFIG_IMG_MANAGER`
70-
* :kconfig:option:`CONFIG_MCUBOOT_IMG_MANAGER`
77+
78+
The P-GPS library requires a storage location in the flash memory where to store the P-GPS prediction data.
79+
There are three ways to define this storage location:
80+
81+
* To use a dedicated partition, enable the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_PARTITION` option.
82+
* To use the MCUboot secondary partition as storage, enable the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_MCUBOOT_SECONDARY` option.
83+
84+
Use this option if the flash memory for your application is too full to use a dedicated partition, but the application uses MCUboot for FOTA updates but not for MCUboot itself.
85+
Do not use this option if you are using MCUboot as a second-stage upgradable bootloader and also have FOTA updates enabled for MCUboot itself, and not just the application (using :kconfig:option:`CONFIG_SECURE_BOOT` and :kconfig:option:`CONFIG_BUILD_S1_VARIANT`).
86+
The P-GPS library will otherwise prevent the MCUboot update from fully completing, and the first-stage immutable bootloader will revert MCUboot to its previous image.
87+
88+
* To use an application-specific storage, enable the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_CUSTOM` option.
89+
You must also pass the address and the size of your custom location in the flash memory to the :c:func:`nrf_cloud_pgps_init` function.
90+
91+
.. note::
92+
The address must be aligned to a flash page boundary, and the size must be equal to or greater than 2048 bytes times the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_NUM_PREDICTIONS` option.
93+
94+
Use this third option if you do not use MCUboot and if you want complete control over where to store P-GPS data in the flash memory.
7195

7296
See :ref:`configure_application` for information on how to change configuration options.
7397

@@ -83,14 +107,11 @@ In these cases, predictions might be unavailable until a connection is establish
83107
Each prediction requires 2 KB of flash. For prediction periods of 240 minutes (four hours), and with 42 predictions per week, the flash requirement adds up to 84 KB.
84108

85109
The P-GPS subsystem's :c:func:`nrf_cloud_pgps_init` function takes a pointer to a :c:struct:`nrf_cloud_pgps_init_param` structure.
86-
The structure at a minimum must specify the storage base address and the storage size in flash, where P-GPS subsystem stores predictions.
110+
The structure must specify, if :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_CUSTOM` is enabled, the storage base address and the storage size in the flash memory where the P-GPS subsystem stores predictions.
87111
It can optionally pass a pointer to a :c:func:`pgps_event_handler_t` callback function.
88112

89-
As an example, the :ref:`gnss_sample` sample shows how to pass the address of the :ref:`secondary MCUboot partition <mcuboot_ncs>`.
90-
The address is defined by the ``PM_MCUBOOT_SECONDARY_ADDRESS`` macro and the ``PM_MCUBOOT_SECONDARY_SIZE`` macro.
91-
These are automatically defined by the build system in the file :file:`pm_config.h`.
92-
This partition is safe to store data until a FOTA job is received.
93-
To avoid loss during FOTA, application developers can opt to store predictions in another location.
113+
.. note::
114+
The storage base address must be aligned to a flash memory page boundary.
94115

95116
Time
96117
****
@@ -114,6 +135,8 @@ P-GPS data can be requested from the cloud using one of the following methods:
114135
* If :kconfig:option:`CONFIG_NRF_CLOUD_REST` is enabled:
115136

116137
* Pass a properly initialized :c:struct:`nrf_cloud_rest_pgps_request` structure to the :c:func:`nrf_cloud_rest_pgps_data_get` function.
138+
* Pass the response to the :c:func:`nrf_cloud_pgps_process` function.
139+
* If either call fails, call the :c:func:`nrf_cloud_pgps_request_reset` function.
117140

118141
* Indirectly:
119142

@@ -125,7 +148,8 @@ P-GPS data can be requested from the cloud using one of the following methods:
125148

126149
* If :kconfig:option:`CONFIG_NRF_CLOUD_REST` is enabled:
127150

128-
* N/A
151+
* Call :c:func:`nrf_cloud_pgps_preemptive_updates`.
152+
* Call :c:func:`nrf_cloud_pgps_notify_prediction`.
129153

130154
The indirect methods are used in the :ref:`asset_tracker_v2` application.
131155
They are simpler to use than the direct methods.
@@ -146,6 +170,7 @@ The indirect method is used in the :ref:`gnss_sample` sample and in the :ref:`as
146170

147171
The application can inject the data contained in the prediction to the GNSS module in the modem by calling the :c:func:`nrf_cloud_pgps_inject` function.
148172
This must be done when event :c:enumerator:`NRF_MODEM_GNSS_EVT_AGPS_REQ` is received from the GNSS interface.
173+
After injecting the prediction, call the :c:func:`nrf_cloud_pgps_preemptive_updates` function to update the prediction set as needed.
149174

150175
A prediction is also automatically injected to the modem every four hours whenever the current prediction expires and the next one begins (if the next one is available in flash).
151176

doc/nrf/releases/release-notes-changelog.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ nRF9160: Asset Tracker v2
8989
* Support for :ref:`Bosch Software Environmental Cluster (BSEC) library <bosch_software_environmental_cluster_library>` driver.
9090
* Support for Indoor Air Quality (IAQ) readings retrieved from the BME680 sensor on Thingy:91. For more information, see the :ref:`asset_tracker_v2_sensor_module`.
9191
* Support for QEMU x86 emulation.
92+
* Support for the :ref:`lib_nrf_cloud_pgps` flash memory partition under certain conditions.
9293

9394
* Updated:
9495

@@ -112,6 +113,11 @@ nRF9160: Serial LTE modem
112113
* Enhanced the ``#XSLEEP`` AT command to support data indication when idle.
113114
* Enhanced the MQTT client to support the reception of large PUBLISH payloads.
114115

116+
* Fixed:
117+
118+
* The secondary MCUboot partition information is no longer passed to the P-GPS library if the P-GPS partition is enabled.
119+
* The combined use of A-GPS and P-GPS so that ephemeris and almanac data is not requested via A-GPS, saving both power and bandwidth.
120+
115121
nRF Desktop
116122
-----------
117123

@@ -200,6 +206,7 @@ nRF9160 samples
200206
* Iperf3 usage over Zephyr native TCP/IP stack and nRF9160 LTE default context.
201207
* Support for the GNSS features introduced in modem firmware v1.3.2.
202208
This includes several new fields in the PVT notification and a command to query the expiry times of assistance data.
209+
* Support for the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_PARTITION` option.
203210

204211
* :ref:`nrf_cloud_rest_fota` sample:
205212

@@ -226,6 +233,10 @@ nRF9160 samples
226233

227234
* Updated the default HTTPS URL and certificate due to the old link being broken.
228235

236+
* :ref:`gnss_sample` sample:
237+
238+
* Added support for the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_PARTITION` option.
239+
229240
OpenThread samples
230241
------------------
231242

@@ -378,6 +389,9 @@ Modem libraries
378389

379390
* Added:
380391

392+
* Support for the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_PARTITION` option.
393+
* Improved integration of A-GPS and P-GPS when both are enabled.
394+
* A missing call to the :c:func:`nrf_cloud_pgps_notify_prediction` function, when using the REST interface with P-GPS.
381395
* Support for P-GPS data retrieval from an external source, implemented separately by the application.
382396
Enabled by setting the :kconfig:option:`CONFIG_LOCATION_METHOD_GNSS_PGPS_EXTERNAL` option.
383397
The library triggers a :c:enum:`LOCATION_EVT_GNSS_PREDICTION_REQUEST` event when assistance is needed.
@@ -469,6 +483,18 @@ Libraries for networking
469483

470484
* Added :kconfig:option:`CONFIG_AZURE_IOT_HUB_NATIVE_TLS` option to configure the socket to be native for TLS instead of offloading TLS operations to the modem.
471485

486+
* :ref:`lib_nrf_cloud_pgps` library:
487+
488+
* Added:
489+
490+
* The passing of the current prediction, if one is available, along with the ``PGPS_EVT_READY`` event.
491+
* The following three ways to define the storage location in the flash memory:
492+
493+
* A dedicated P-GPS partition, enabled with the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_PARTITION` option.
494+
* The use of the MCUboot secondary partition as storage, enabled with the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_MCUBOOT_SECONDARY` option.
495+
* An application-specific storage, enabled with the :kconfig:option:`CONFIG_NRF_CLOUD_PGPS_STORAGE_CUSTOM` option.
496+
497+
472498
Libraries for NFC
473499
-----------------
474500

@@ -528,6 +554,10 @@ Other libraries
528554

529555
* Fixed a compilation error for nRF52833.
530556

557+
* Partition Manager:
558+
559+
* Added the :file:`ncs/nrf/subsys/partition_manager/pm.yml.pgps` file.
560+
531561
Common Application Framework (CAF)
532562
----------------------------------
533563

0 commit comments

Comments
 (0)