Skip to content

Commit

Permalink
doc: Documentation edits for 2.7.99-cs1 release
Browse files Browse the repository at this point in the history
Added firmware bundle compatibility table.
Updated nRF54H20 GS guide.
Added initial power management documentation.
Added initial clock control documentation

Signed-off-by: Francesco Domenico Servidio <francesco.servidio@nordicsemi.no>
  • Loading branch information
FrancescoSer committed Aug 28, 2024
1 parent f7b59d2 commit 408d986
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 54 deletions.
13 changes: 13 additions & 0 deletions doc/nrf/app_dev/device_guides/nrf54h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ Zephyr and the |NCS| provide support and contain board definitions for developin
| ``nrf54h20dk_nrf54h20_cpurad``
| ``nrf54h20dk_nrf54h20_cpuppr``
The following table indicates the compatibility between nRF54H20 firmware bundle versions and |NCS| versions:

.. list-table::
:header-rows: 1

* - |NCS| version
- nRF54H20 firmware bundle version
* - v2.7
- v0.5.0
* - v2.7.99-cs1
- v0.6.2


.. toctree::
:maxdepth: 2
:caption: Subpages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ The following pages briefly describe topics like the responsibilities of the cor
ug_nrf54h20_architecture_ipc
ug_nrf54h20_architecture_boot
ug_nrf54h20_architecture_lifecycle
ug_nrf54h20_architecture_pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. _ug_nrf54h20_architecture_clockman:

nRF54H20 Clock Management
#########################

.. contents::
:local:
:depth: 2

The nRF54H20 SoC consists of multiple asynchronous clock domains and require clock sources for correct operation.
Each of the clock sources needs proper management:
to start and stop the clock at the appropriate time, to select the proper clock source, and to calibrate or synchronize the clock to another more accurate source.
Some of the clock management operations are performed solely by the hardware circuits, but others require software.
Most of the clocks can be locked to other more accurate ones to improve their accuracy.

Clock Domains
*************

The nRF54H20 SoC consists of the following clock domains:

* LFCLK
* HFXO
* FLL16M
* HSFLL Application
* HSFLL Radio (if Radio domain is present)
* HSFLL Secure
* HSFLL Global

Each of the clock domains is enabled independently of others.
Each clock domain is automatically enabled when at least one sink is active.
Firmware can choose to keep each of the clock domains enabled even when all its sinks are inactive.

Clock domain source selection differs between clock domains.
The LFCLK source is selected by the System Controller Firmware.
The HFXO source is selected by the System Controller Firmware.
The FLL16M source is selected by local domains or System Controller firmware in all scenarios except one: when firmware selects open-loop, but any of HSFLLs is closed-loop, then FLL16M is switched by hardware to closed-loop.
HSFLLs sources are selected by firmware (depending on an HSFLL instance: local domain or System Controller).

The details of each of the clock domains are described in the following sections.

The application-facing APIs show only the domain directly clocking the component used by the application.
The management of clocks on which this domain depends is handled internally by the clock driver of this domain.
One example would be a firmware module requesting better timing accuracy for a fast ``UART`` instance.
This firmware module requests the accuracy of the global ``HSFLL`` device driver, directly clocking the ``UART``.
The accuracy of the dependencies FLL16M and LFXO is requested by the global HSFLL driver internally.
Not directly by the firmware module.

LFCLK
=====

The Low-Frequency Clock domain is responsible for generating a 32768 Hz clock signal for ultra-low-power peripherals like ``GRTC`` or ``RTC``.

Zephyr clock control API
************************

Zephyr RTOS contains a *clock_control* device driver class for managing clocks.
The *clock_control* API is designed to support multiple requestors.
Moreover, the *clock_control* API supports blocking or asynchronous operations based on the notification when the requested clock settings are applied.
Because of this, the *clock_control* API is well-suited for LFCLK management in the local domains.

The *clock_control* subsystem exposes portable parameters in its functions:

* accuracy requests in ppm values
* precision requests in ppm over n cycles, period-period jitter, or (for simplicity) high- and low-precision modes
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
.. _ug_nrf54h20_architecture_pm:

nRF54H20 Power Management
#########################

.. contents::
:local:
:depth: 2

The nRF54H20 SoC is a distributed system where each domain tries to achieve minimal power consumption for itself.
When all CPUs are ready to fully minimize power consumption by entering the System Off hardware state, the System Controller prepares the system and triggers the entrance in this state.

Power states
************

The nRF54H20 ARM Cortex CPUs currently support the following software power states:

* Active
* Idle

In following releases on the |NCS|, support for the following power states will be added:

* Idle with cache retained in RAM
* Idle with cache disabled
* Local Suspend to RAM
* Suspend to RAM ready for System Off
* Soft Off

Overview
********

Each CPU in the nRF54H20 SoC tries to preserve as much power as possible, independently from other CPUs.
As such, each CPU strives to enter sleep as deep as possible in its current circumstances, switching its power states asynchronously from the other CPUs.


Power states details
********************

The following sections describes the details of each of the software power states available on the nRF54H20 SoC.

Active
======

*Active* is the power state in which the CPU is actively processing.

.. list-table::
:widths: auto

* - CPU
- Powered on and clocked.

* - RAM
- Banks used by the executed code are enabled.
Other banks may be in any state.

* - System state
- *System ON*

* - Peripherals
- All can be active.
The state of all inactive peripherals is retained in the hardware flip-flops.

* - Coprocessors
- All can be active.
The state of inactive coprocessors is retained according to their selected sleep state.

* - System timer (based on GRTC)
- Active

This is the power state with the highest power consumption.
The software execution latency is minimal.
The main latency source is the wake-up of ``MRAMC``.
The maximal latency depends on the MRAM power state configured in the ``MRAMC.POWER.AUTOPOWERDOWN`` by the System Controller.

Idle
====

*Idle* is the lightest sleep power state available in the system where the cache content is retained.

.. list-table::
:widths: auto

* - CPU
- Powered on but suspended (not clocked).

* - RAM
- Banks used by the executed code are enabled.
Other banks may be in any state.

* - System state
- *System ON*

* - Peripherals
- All can be active.
The local peripherals are powered and preserve their state.
The state of inactive peripherals in other domains is retained in the hardware flip-flops.

* - Coprocessors
- All can be active.
The state of inactive coprocessors is retained according to their selected sleep state.

* - System timer (based on GRTC)
- Active

The power consumption in this state is lower than when in *Active*, but higher than in other power states.
The wake-up latency is higher than when in *Active*, but lower than in the other power states.
The main wake-up latency source is the wake-up of ``MRAMC``, and the startup of clock sources.
The maximal latency depends on the MRAM power state configured in the ``MRAMC.POWER.AUTOPOWERDOWN`` by the System Controller.

Entering and exiting sleep states by ARM CPUs
*********************************************

All ARM CPUs managing local domains enter and exit the sleep states in a unified way.

Two sets of software sequences can take place for each sleep state:

* One executed to enter the sleep state.
* One executed after exiting the sleep state.

All of these sequences apply to all of the ARM Cortex CPUs managing the local domains.

The described sequences are executed in critical sections with all IRQs masked.
The IRQ handlers are delayed until the sequences are completed.

Idle
====

To enter the *Idle* state, it is enough to suspend the CPU execution (``WFE`` or ``WFI`` instruction).

When the CPU execution is suspended, the power domain containing the CPU and the CACHE can switch to a mode that does not retain cache status, which would result in data loss.
Powering down the power domain containing the CACHE must be prevented by setting ``LRCCONF010.POWERON.ACTIVE = 1``

The complete procedure of entering the idle state consists of the following steps:

1. ``LRCCONF010.POWERON.ACTIVE[n] = 1``, where *n* is the index of the power domain containing ``CACHE``
#. ``WFE`` or ``WFI``

Exiting this state is triggered by any event resuming the CPU execution (usually an interrupt).
The CPU continues execution of the program following the ``WFI`` / ``WFE`` instruction.
Alternatively, if the IRQ waking up the system was not masked while suspending the CPU, the CPU resumes the execution from the ISR.
The return address from the ISR is the instruction following ``WFI`` / ``WFE``.

After waking up the default configuration of the power domains should be restored through ``LRCCONF010.POWERON.ACTIVE[n] = 0``, where *n* is the index of the power domain containing ``CACHE``.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Make sure you have all the required hardware and that your computer has one of t
Hardware
========

* nRF54H20 DK version PCA10175 v0.7.2 (ES3) or PCA10175 v0.8.0 (ES3.3, ES4).
These are the only versions of the nRF54H20 DK compatible with the |NCS| v2.7.0.
Check the version number on your DK's sticker to verify its compatibility with the |NCS| version v2.7.0.
* nRF54H20 DK version PCA10175 v0.8.0 (ES4).
This is the only version of the nRF54H20 DK compatible with the |NCS| v2.7.99-cs1.
Check the version number on your DK's sticker to verify its compatibility with the |NCS| version v2.7.99-cs1.
* USB-C cable.

Software
Expand Down Expand Up @@ -81,10 +81,10 @@ To work with the nRF54H20 DK, follow the instructions in the next sections to in

.. _ug_nrf54h20_install_toolchain:

Installing the |NCS| v2.7.0 and its toolchain
*********************************************
Installing the |NCS| v2.7.99-cs1 and its toolchain
**************************************************

You can install the |NCS| v2.7.0 and its toolchain by using Toolchain Manager.
You can install the |NCS| v2.7.99-cs1 and its toolchain by using Toolchain Manager.

Toolchain Manager is a tool available from `nRF Connect for Desktop`_, a cross-platform tool that provides different applications that simplify installing the |NCS|.
Both the tool and the application are available for Windows, Linux, and MacOS.
Expand All @@ -109,9 +109,9 @@ To install the toolchain and the SDK using the Toolchain Manager app, complete t
The Toolchain Manager window

#. Click :guilabel:`SETTINGS` in the navigation bar to specify where you want to install the |NCS|.
#. In :guilabel:`SDK ENVIRONMENTS`, click the :guilabel:`Install` button next to the |NCS| version 2.7.0.
#. In :guilabel:`SDK ENVIRONMENTS`, click the :guilabel:`Install` button next to the |NCS| version 2.7.99-cs1.

The |NCS| version 2.7.0 is installed on your machine.
The |NCS| version 2.7.99-cs1 is installed on your machine.
The :guilabel:`Install` button changes to :guilabel:`Open VS Code`.

#. Set up the preferred building method:
Expand Down Expand Up @@ -157,10 +157,10 @@ Both of these terminal emulators start the required :ref:`toolchain environment
Installing nRF Util and its commands
************************************

Using the nRF54H20 DK with the |NCS| v2.7.0 requires the following:
Using the nRF54H20 DK with the |NCS| v2.7.99-cs1 requires the following:

* nRF Util version 7.11.1 or above
* nRF Util ``device`` version 2.4.0
* nRF Util ``device`` version 2.4.6

1. Download the nrfutil executable file from the `nRF Util development tool`_ product page.
#. Add nRF Util to the system path on Linux and MacOS, or environment variables on Windows, to run it from anywhere on the system.
Expand All @@ -180,9 +180,9 @@ Using the nRF54H20 DK with the |NCS| v2.7.0 requires the following:

nrfutil self-upgrade

#. Install the nRF Util ``device`` command to version 2.4.0 as follows::
#. Install the nRF Util ``device`` command to version 2.4.6 as follows::

nrfutil install device=2.4.0 --force
nrfutil install device=2.4.6 --force

For more information, consult the `nRF Util`_ documentation.

Expand All @@ -201,7 +201,7 @@ Programming the BICR
The Board Information Configuration Registers (BICR) are non-volatile memory (NVM) registers that contain information on how the nRF54H20 SoC must interact with other board elements, including the information about the power and clock delivery to the SoC.
To prepare the nRF54H20 DK for first use, you must manually program the values of the BICR using a precompiled BICR binary file (:file:`bicr_ext_loadcap.hex`).

1. Download the `BICR binary file`_ .
1. Download the `BICR new binary file`_.
#. Connect the nRF54H20 DK to your computer using the **DEBUGGER** port on the DK.

.. note::
Expand All @@ -214,17 +214,17 @@ To prepare the nRF54H20 DK for first use, you must manually program the values o

#. Move the BICR HEX file to a folder of your choice, then program the BICR by running nRF Util from that folder using the following command::

nrfutil device program --options chip_erase_mode=ERASE_NONE --firmware bicr_ext_loadcap.hex --core Secure --serial-number <serial_number>
nrfutil device program --options chip_erase_mode=ERASE_NONE --firmware build/zephyr/bicr.hex --core Application --serial-number <serialnumber>

.. rst-class:: numbered-step

Programming the SDFW and SCFW
=============================

After programming the BICR, the nRF54H20 SoC requires the provisioning of a bundle ( :file:`nrf54h20_soc_binaries_v0.5.0.zip`) containing the precompiled firmware for the Secure Domain and System Controller.
After programming the BICR, the nRF54H20 SoC requires the provisioning of a bundle ( :file:`nrf54h20_soc_binaries_v0.6.2.zip`) containing the precompiled firmware for the Secure Domain and System Controller.
To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the firmware bundle to the nRF54H20 DK, do the following:

1. Download the `nRF54H20 firmware bundle v0.5.0`_.
1. Download the `nRF54H20 firmware bundle v0.6.2`_.

.. note::
On MacOS, ensure that the ZIP file is not unpacked automatically upon download.
Expand All @@ -235,32 +235,6 @@ To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the Sys

.. rst-class:: numbered-step

Updating the FICR
=================

.. caution::
This step is required only if your nRF54H20 DK is version PCA10175 v0.7.2 or v0.8.0 ES3.3.
Jump to the next step if your DK is version ES4, meaning v0.8.0 with no ES markings.

After programming the SDFW and SCFW from the firmware bundle, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC.
To update the FICR, you must run a J-Link script:

1. Get the Jlink script that updates the FICR::

curl -LO https://files.nordicsemi.com/artifactory/swtools/external/scripts/nrf54h20es_trim_adjust.jlink

#. Run the script:

* Linux and Mac OS::

JLinkExe -CommanderScript nrf54h20es_trim_adjust.jlink

* Windows::

jlink.exe -CommanderScript nrf54h20es_trim_adjust.jlink

.. rst-class:: numbered-step

Transitioning the nRF54H20 SoC to RoT
=====================================

Expand Down Expand Up @@ -332,27 +306,27 @@ To transition the LCS to ``RoT``, do the following:

.. _ug_nrf54h20_gs_sample:

Programming the sample
**********************
Building and programming the sample
***********************************

The :zephyr:code-sample:`sysbuild_hello_world` sample is a multicore sample running on both the application core (``cpuapp``) and the Peripheral Processor (PPR, ``cpuppr``).
It uses the ``nrf54h20dk/nrf54h20/cpuapp`` board target.

To build and program the sample to the nRF54H20 DK, complete the following steps:

1. Connect the nRF54H20 DK to your computer using the **DEBUGGER** port on the DK.
#. Open nRF Connect for Desktop, navigate to the Toolchain Manager, select the v2.7.0 toolchain, and click the :guilabel:`Open terminal` button.
#. Open nRF Connect for Desktop, navigate to the Toolchain Manager, select the v2.7.99-cs1 toolchain, and click the :guilabel:`Open terminal` button.
#. In the terminal window, navigate to the :file:`zephyr/samples/sysbuild/hello_world` folder containing the sample.
#. Build the sample for application and radio cores by running the following command::

west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpurad .

#. Program the sample.
If you have multiple Nordic Semiconductor devices, make sure that only the nRF54H20 DK you want to program is connected.
You can now program the sample.
If you have multiple Nordic Semiconductor devices, make sure that only the nRF54H20 DK you want to program is connected.

.. code-block:: console
.. code-block:: console
west flash
west flash
The sample will be automatically built and programmed on both the application core and the Peripheral Processor (PPR) of the nRF54H20.

Expand Down
Loading

0 comments on commit 408d986

Please sign in to comment.