Skip to content

Conversation

nordic-krch
Copy link
Contributor

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 <[email protected]>
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
Contributor

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
Contributor 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
Contributor

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
Contributor 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
nordic-piks pushed a commit to nrfconnect/sdk-nrf that referenced this pull request May 21, 2025
@kapi-no
Copy link
Contributor

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
Contributor 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