<?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>P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74639/p0-09-and-p0-10-as-gpio-nrf52832-iar-custom-board</link><description>Hello, 
 
 I know this issue has been discussed extensively in different posts, and I believe I read all of them, but still I can&amp;#39;t get it working. 
 
 I&amp;#39;m trying to drive three LEDs on pins P0.09, P0.10 and P0.11 of an nRF52832 on a custom board, using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 21 Sep 2024 21:45:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74639/p0-09-and-p0-10-as-gpio-nrf52832-iar-custom-board" /><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/503338?ContentTypeID=1</link><pubDate>Sat, 21 Sep 2024 21:45:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab555997-6211-4f5d-b62d-507ca1f83795</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&lt;em&gt;Reset_Handler()&lt;/em&gt; should call &lt;em&gt;SystemInit()&lt;/em&gt; either in c code or asm code before invoking &lt;em&gt; &lt;/em&gt;depending on how old the software is. Maybe try an &lt;em&gt;erase all&lt;/em&gt; before testing to see if that works. This may also be an &lt;em&gt;APROTECT&lt;/em&gt; issue, best if Nordic engineers respond on that point; this would depend on the nRF53832 die version see &lt;em&gt;INFO.PART&lt;/em&gt; and &lt;em&gt;INFO.VARIANT&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;As an aside, in rare cases the UICR write number limitation Nwrite (=811 writes)&amp;nbsp; may have been exceeded by something writing periodically to the same flash block, in which case an erase UICR or erase all is required to restart the life count. A double attempt to write once this number has been exceeded may work, but this is unspecified; exceeding Fwrite may result in adjacent bits being adversly affected, or may require more writes to clear a given bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/503319?ContentTypeID=1</link><pubDate>Sat, 21 Sep 2024 03:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:927eedd3-add7-4c35-8077-4a0677b60cb1</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;I have the same question! I also had to call SystemInit() in my main() to get it to work. Why??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/308256?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 23:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d64fc64-8b7b-47e3-8f23-3b73834becd0</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Good news, but&lt;em&gt; SystemInit()&lt;/em&gt; should already have been called from within&lt;em&gt; iar_startup_nrf52.s&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__vector_table
        DCD     sfe(CSTACK)
        DCD     Reset_Handler

Reset_Handler
        LDR     R0, =SystemInit
        BLX     R0
        LDR     R0, =__iar_program_start
        BX      R0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Have you used a different &lt;em&gt;Reset_Handler&lt;/em&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/308128?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 10:05:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85b958ca-eea2-4495-bc3c-2f8de7207b2e</guid><dc:creator>MC9</dc:creator><description>&lt;p&gt;I got it working by calling&amp;nbsp;&lt;em&gt;&lt;strong&gt;SystemInit();&lt;/strong&gt;&lt;/em&gt; in my &lt;em&gt;main.c&lt;/em&gt; !&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/308111?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 09:19:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:302085db-10a7-44a9-ab8c-80b03ea463f6</guid><dc:creator>MC9</dc:creator><description>&lt;p&gt;Thank you for your reply! I have added &lt;strong&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/strong&gt; in the Defined Symbols as you suggested, but it still doesn&amp;#39;t work. Could it be something else?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.09 and P0.10 as GPIO (nRF52832 + IAR + custom board)</title><link>https://devzone.nordicsemi.com/thread/307721?ContentTypeID=1</link><pubDate>Fri, 30 Apr 2021 16:35:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c32fdad6-4f3c-49bb-8f76-7b24cdab671f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Adding the&amp;nbsp;&lt;strong&gt;&lt;em&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/em&gt;&lt;/strong&gt; is correct, but not in &lt;em&gt;main.c&lt;/em&gt;. Instead in IAR add this macro in &lt;strong&gt;&lt;em&gt;Options-&amp;gt;C/C++ Compiler-&amp;gt;Preprocessor-&amp;gt;Defined Symbols&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This macro is then applied in &lt;em&gt;system_nrf52.c&lt;/em&gt; the first time power is applied thus:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* Configure NFCT pins as GPIOs if NFCT is not to be used in your code. If CONFIG_NFCT_PINS_AS_GPIOS is not defined,
       two GPIOs (see Product Specification to see which ones) will be reserved for NFC and will not be available as
       normal GPIOs. */
    #if defined (CONFIG_NFCT_PINS_AS_GPIOS)
        if ((NRF_UICR-&amp;gt;NFCPINS &amp;amp; UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC &amp;lt;&amp;lt; UICR_NFCPINS_PROTECT_Pos)){
            NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // Write Enable
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NRF_UICR-&amp;gt;NFCPINS &amp;amp;= ~UICR_NFCPINS_PROTECT_Msk;
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // Read-only Enable
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            // UICR changes require a reset to be effective
            NVIC_SystemReset();
        }
    #endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>