Skip to content

soc: nordic: nrf54h: Add option to use NFCT pins as GPIOs #86280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nordic-krch
Copy link
Collaborator

Protection circuit must be disabled to use NFCT antenna pins as GPIOs. It can be done by adding nfct-pins-as-gpios to nfct node in the devicetree in cpuapp. Node must be disabled as NFCT is not used. In legacy platforms same property was added to uicr node because that information was stored in UICR. In nrf54h20 it is not part of UICR so property is part of nfct node.

Protection circuit must be disabled to use NFCT antenna pins
as GPIOs. It can be done by adding nfct-pins-as-gpios to nfct
node in the devicetree in cpuapp. Node must be disabled as
NFCT is not used. In legacy platforms same property was added
to uicr node because that information was stored in UICR. In
nrf54h20 it is not part of UICR so property is part of nfct
node.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
@@ -151,6 +152,11 @@ static int nordicsemi_nrf54h_init(void)
nrf_spu_periph_perm_dmasec_set(spu, nrf_address_slave_get(ccm030_addr), true);
#endif

if (DT_NODE_HAS_STATUS(DT_NODELABEL(nfct), disabled) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the NFCT node be reserved rather than disabled ?

status == reserved ensures that ownership of NFCT peripheral is assigned to given local domain.
On the other hand, status == okay should not be used because it might implicitly activate NFCT driver (not an issue now, but to be future-proof)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NFCT is by default assigned to cpuapp so it can access NFCT registers by default no need to reserving.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This limits use of NFCT pins to cpuapp.

When I try to use that GPIOs by cpurad I see:

  • cpurad not booting because it tries to access registers of NFCT that it doesn't own
&nfct {
	compatible = "nordic,nrf-nfct-v2";
	status = "disabled";
	nfct-pins-as-gpios;
};
  • NFC not disabled because condition from line 155 is not meet
&nfct {
	compatible = "nordic,nrf-nfct-v2";
	status = "okay";
	nfct-pins-as-gpios;
};

@nordic-krch
Copy link
Collaborator Author

@masz-nordic @anangl can you take a look?

@fabiobaltieri fabiobaltieri merged commit 7249fac into zephyrproject-rtos:main Mar 12, 2025
26 checks passed
nordic-segl added a commit to nordic-segl/sdk-nrf that referenced this pull request May 20, 2025
Align to changes made in
zephyrproject-rtos/zephyr#86280

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
nordic-piks pushed a commit to nrfconnect/sdk-nrf that referenced this pull request May 21, 2025
Align to changes made in
zephyrproject-rtos/zephyr#86280

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
@kapi-no
Copy link
Collaborator

kapi-no commented Jun 6, 2025

Requires the following change in the Kconfig option that represents the DTS configuration for NFCT:

config HAS_HW_NRF_NFCT
	def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT))

->

config HAS_HW_NRF_NFCT
	def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT)) || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT_V2))

@nordic-krch
Copy link
Collaborator Author

@kapi-no done:
#91274
nrfconnect/sdk-zephyr#2942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants