Skip to content

Commit 4615985

Browse files
bjarki-andreasencarlescufi
authored andcommitted
doc: ug_nrf54h20: add architecture_pinmap section
Document how pins can and should be mapped/routed, and why. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent a2fc85c commit 4615985

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

doc/nrf/app_dev/device_guides/nrf54h/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ Zephyr and the |NCS| provide support and contain board definitions for developin
4646
ug_nrf54h20_mcuboot_dfu
4747
ug_nrf54h_ecies_x25519
4848
ug_nrf54h20_pm_optimization
49+
ug_nrf54h20_architecture_pinmap
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. _ug_nrf54h20_architecture_pinmap:
2+
3+
nRF54H20 Pin mapping
4+
####################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
The pins of the nRF54H20 SoC are spread across domains, like the peripherals.
11+
The nRF54H20 SoC manages power to both peripherals and pins automatically and efficiently, when both the mapped peripheral and pins are in the same domain.
12+
The SoC also supports mapping pins across domains.
13+
This comes at the cost of additional management by the firmware, thus additional latency and power consumption.
14+
The following sections describe how pins are powered, which domains they are in, and how to map and handle them.
15+
16+
Pin groups
17+
----------
18+
19+
A pin group is a group of pins designated by an index, like P0.x, where P0 is the group containing [P0.0, P0.1, ...].
20+
The pin group P0 is distinct from the GPIO controller with the same instance of P0.
21+
The P0 peripheral is routed to pins in the pin group P0, but is not necessarily in the same domain as the pin group P0.
22+
23+
The following table shows which domains the pin groups belong to.
24+
25+
.. list-table:: Pin group domains
26+
:header-rows: 1
27+
28+
* - Pin group
29+
- Domain
30+
* - P0
31+
- SLOW_MAIN
32+
* - P1
33+
- SLOW_MAIN
34+
* - P2
35+
- SLOW_MAIN
36+
* - P6
37+
- FAST_ACTIVE_1
38+
* - P7
39+
- FAST_ACTIVE_1
40+
* - P9
41+
- SLOW_MAIN
42+
43+
Pin group power
44+
===============
45+
46+
Pins require power to drive their output, and the multiplexers routing a pin to a peripheral require power.
47+
This power is provided by the domain where the pin and the multiplexers are.
48+
If a pin is configured as an output, the output value will be retained even when the power domain is suspended.
49+
50+
Peripheral domains
51+
------------------
52+
53+
Peripherals with an instance ending in 120, like UARTE120, PWM120, SPIS120, are in the FAST_ACTIVE_1 domain.
54+
The rest are in the SLOW_MAIN and SLOW_ACTIVE domains.
55+
56+
Pin group power management
57+
--------------------------
58+
59+
If a pin and the peripheral it is routed to are in the same domain, the peripheral forces the domain on when in use, thus powering the pin and the required multiplexers, as well.
60+
If a pin and the peripheral it is routed to are in different domains, the peripheral can only force on its own domain, not the domain the pin is in.
61+
62+
Peripherals in the FAST_ACTIVE_1 domain must be routed to pins in the FAST_ACTIVE_1 domain.
63+
Other peripherals must be routed to pins in the SLOW_MAIN domain.
64+
65+
You can route pins across domains, but it is not recommended because of the following reasons:
66+
67+
* A fast peripheral in the FAST_ACTIVE_1 domain is limited by the slower slew rate of pins in the slow domain.
68+
* The firmware must force on the domain the pins are in before the peripheral is used if power management (:kconfig:option:`CONFIG_PM`) is enabled.
69+
70+
To force on either the FAST_ACTIVE_1 or SLOW_MAIN power domain, use power management as follows:
71+
72+
.. code-block:: c
73+
74+
#include <zephyr/pm/device_runtime.h>
75+
76+
static const struct device *fast_active_pd = DEVICE_DT_GET(DT_NODELABEL(gdpwr_fast_active_1));
77+
static const struct device *slow_main_pd = DEVICE_DT_GET(DT_NODELABEL(gdpwr_slow_main));
78+
79+
int main(void)
80+
{
81+
/*
82+
* Reference counted API to force FAST_ACTIVE_1 power domain on, this operation is slow
83+
* and must be done from a thread, thus call it once before use of the peripheral,
84+
* and release it after.
85+
*/
86+
pm_device_runtime_get(fast_active_pd);
87+
88+
/*
89+
* Use peripheral in SLOW_MAIN domain with pins routed to fast domain,
90+
* like GPIO controller P6
91+
*/
92+
93+
/* Release reference */
94+
pm_device_runtime_put(fast_active_pd);
95+
}
96+
97+
If power management is not enabled, all power domains will be constantly powered on, so no additional management is
98+
required.

0 commit comments

Comments
 (0)