<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CONFIG_NFCT_PINS_AS_GPIOS=y doesn&amp;#39;t work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94197/config_nfct_pins_as_gpios-y-doesn-t-work</link><description>Hi, 
 I&amp;#39;m using an ISP2053 (nrf5340) chip on a custom board and debugging using the nrf5340dk. I&amp;#39;d like to use P0.02, P0.03 as part of an SPI bus. 
 I set up a simple experiment where I set `CONFIG_NFCT_PINS_AS_GPIOS=y` in my prj.conf and some code to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Jul 2025 03:00:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94197/config_nfct_pins_as_gpios-y-doesn-t-work" /><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/541393?ContentTypeID=1</link><pubDate>Fri, 04 Jul 2025 03:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fddafc3-b7c3-474b-a85e-ad474a3e36ff</guid><dc:creator>Kelso</dc:creator><description>&lt;p&gt;Found something important not covered in any of the tickets I&amp;#39;ve seen on this:&lt;/p&gt;
&lt;p&gt;1. CONFIG_NFCT_PINS_AS_GPIOS=y is required&lt;/p&gt;
&lt;p&gt;2. Power cycling the board (as opposed to simply resetting it after a firmware update) was necessary to change the NFC pin state.&lt;br /&gt;&lt;br /&gt;It&amp;#39;s not clear to me if there&amp;#39;s a different route to making the NFC peripheral transition modes without requiring a power cycle, but this was sufficient to correct the issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To Nico7&amp;#39;s question, SYS_INIT is a macro from include/zephyr/init.h that allows initialization code to run before main.&amp;nbsp; It&amp;#39;s important to know where it&amp;#39;s being used in modules since an error in a SYS_INIT registered function can be hard to debug otherwise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/529600?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2025 17:32:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c80d1dc-0744-4bd5-80ba-d2a75c6af1a7</guid><dc:creator>cjh39</dc:creator><description>&lt;p&gt;Im using a nrf52840 , Segger with the nrf SDK.&lt;/p&gt;
&lt;p&gt;How do I use the NFC pins as GPIO ? There must be a simple solution to this. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ive added #define CONFIG_NFCT_PINS_AS_GPIOS 1 to the sdk_config.h and also I added the CONFIG_NFCT_PINS_AS_GPIOS here&lt;/p&gt;
&lt;p&gt;&lt;img style="cursor:zoom-in;max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1184.pastedimage1743097718776v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I check the nrfjprog --memrd 0x10001000 --n 512, Im getting all F&amp;#39;s&lt;/p&gt;
&lt;p&gt;&lt;img style="cursor:zoom-in;max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1588.pastedimage1743097773703v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/482889?ContentTypeID=1</link><pubDate>Sat, 11 May 2024 08:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:780afd58-ba1f-418d-b7d2-2857c0c52350</guid><dc:creator>Nico7</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure where SYS_INIT is. Could you please say how you solved this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/460635?ContentTypeID=1</link><pubDate>Fri, 15 Dec 2023 20:02:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97359a57-1bfa-4fbc-870f-2ba30f143c28</guid><dc:creator>Brett_G</dc:creator><description>&lt;p&gt;I just ran into a similar issue, where simple&amp;nbsp;GPIO&amp;nbsp;toggling of the NFC P0.03 was not working despite having&amp;nbsp;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS=y&amp;nbsp;and seeing it being properly implemented in the UICR registers.&lt;br /&gt;&lt;br /&gt;After a bit of debugging I found that the initialization of the GPIO was occurring&amp;nbsp;within a SYS_INIT call, and calling the initialization function from main&amp;nbsp;instead, would allow it to work fine.&lt;br /&gt;&lt;br /&gt;Other non-nfc gpios called within that SYS_INIT worked fine, so it seems to only conflict with the NFC gpio configuration for some reason.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hopefully this helps&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/459887?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 10:26:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c7cc9c0-641a-40d6-9ec7-4d7731ffc182</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please open a new ticket and include information about your setup, such as whether you are using a Nordic development kit or a custom board, what chip variant, and describe how you are attempting to configure the pin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/459865?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 08:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca3ed4f3-1748-44d4-ada5-1a719327729d</guid><dc:creator>creative.industry.ag</dc:creator><description>&lt;p&gt;Hello&lt;br /&gt;I have the same issue.&amp;nbsp;&lt;br /&gt;Does anybody solve this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/444480?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2023 11:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:181438d9-6f1b-4f12-b7ac-aef074dd80fe</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please open a new ticket and include information about your setup (e.g. if you are using a nordic dev kit, or a custom board,..) and how you are trying to configure the pin.&lt;/p&gt;
&lt;p&gt;Your UICR register readout confirms that the CONFIG_NFCT_PINS_AS_GPIOS=y setting was applied correctly, so that is not the problem in your case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/444471?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2023 10:51:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af8cc27a-547d-482a-8320-e815e9ee7911</guid><dc:creator>Surendra Amina</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;br /&gt;&lt;br /&gt;I am seeing the same issue on nrf5340. I cant use PIN 0.02 as GPIO.&lt;br /&gt;$ nrfjprog --memrd 0xff8028&lt;br /&gt;0x00FF8028: FFFFFFFE&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have also set&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS=y&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/399007?ContentTypeID=1</link><pubDate>Mon, 05 Dec 2022 14:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0fff4cd-5211-4031-9839-6fc36b194819</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Rohan,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please read the&amp;nbsp;&lt;a title="NFCPINS" href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/uicr/doc/uicr.html?cp=3_0_0_4_3_2_0_6#register.NFCPINS"&gt;NFCPINS&lt;/a&gt;&amp;nbsp;register value with your debugger to see if it has been configured or not.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With nrfjprog:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;$ nrfjprog --memrd 0xff8028&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/398960?ContentTypeID=1</link><pubDate>Mon, 05 Dec 2022 12:23:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae69857f-ecf1-4d64-ba36-925e9c93f86c</guid><dc:creator>rdey</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I am also having the same problem. I have set &lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/span&gt;&lt;span&gt;=y and&amp;nbsp;&lt;/span&gt;building the code for secure domain (nrf5340_cpuapp) for my custom board with nrf5340.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;found that the if statement on line 180 fails&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/mdk/system_nrf5340_application.c#L180"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/mdk/system_nrf5340_application.c#L180&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What am I missing?&lt;/p&gt;
&lt;p&gt;I am trying to use the P0.03 pin as an input pin. Detail of my issue can be found&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/94320/nrf5340-use-nfc-pins-as-gpio-input/397864"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Rohan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/397746?ContentTypeID=1</link><pubDate>Sat, 26 Nov 2022 14:08:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bec8a103-7a44-4ba8-a658-901aad7ffc71</guid><dc:creator>HFrg</dc:creator><description>&lt;p&gt;Thank you, that was the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_NFCT_PINS_AS_GPIOS=y doesn't work</title><link>https://devzone.nordicsemi.com/thread/397324?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 08:29:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e43bfac3-e7e8-47eb-a7c8-56c55a32eeb9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you building the app for the non-secure domain? In that case, you will&amp;nbsp;need to&amp;nbsp;apply&amp;nbsp;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS=y to the image which runs in the secure domain instead. The reason for this is that the UICR register is only accessible from the secure domain.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the&amp;nbsp;startup file where the UICR register gets written:&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/mdk/system_nrf5340_application.c#L178"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/mdk/system_nrf5340_application.c#L178&lt;/a&gt;. Notice the if statement at line ~74 which checks if the code is run in secure domain or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>