<?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>Issue with Bare-Metal Programming of nRF52-DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31064/issue-with-bare-metal-programming-of-nrf52-dk</link><description>Hey everyone, 
 I&amp;#39;ve been trying to get this basic bare-metal application to work. I don&amp;#39;t need a softdevice as I&amp;#39;m just trying to turn on an LED. The application compiles just fine, I can step through the code with the debugger, but the registers don</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Mar 2018 13:34:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31064/issue-with-bare-metal-programming-of-nrf52-dk" /><item><title>RE: Issue with Bare-Metal Programming of nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/122835?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 13:34:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad1bbe89-2bfb-400c-90a1-e1881cf7880d</guid><dc:creator>Aaron Feys</dc:creator><description>&lt;p&gt;Hi @MartinBL,&lt;/p&gt;
&lt;p&gt;I just tried it with that code, and everything worked! No idea...&lt;/p&gt;
&lt;p&gt;Thanks for the help!&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;~Aaron&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with Bare-Metal Programming of nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/122832?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 13:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70017373-f74b-4fed-b089-33a20f513fa8</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Seems to work for me. Can you try to read out the GPIO-&amp;gt;PIN_CNF[11] register with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;nrfjprog --memrd 0x5000072C&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;before and after you configure the GPIO?&lt;/p&gt;
&lt;p&gt;My output is 00000002 &lt;em&gt;before&lt;/em&gt; the configuration and&amp;nbsp;00000303 after, which is the correct configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This code toggles LED_2 on my nRF52 DK kit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;board.h&amp;quot;
#include &amp;quot;basics.h&amp;quot;

int main(void) {
  init(); // Test

  while (1) {
    GPIO-&amp;gt;PIN_CNF[18] = ((uint32_t) GPIO_PIN_CNF_DIR_OUTPUT &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos) |
      ((uint32_t) GPIO_PIN_CNF_INPUT_DISCONNECT &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) |
      ((uint32_t) GPIO_PIN_CNF_NOPULL &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos) |
      ((uint32_t) GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) |
      ((uint32_t) GPIO_PIN_CNF_NOSENSE &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
    GPIO-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; 18);
    GPIO-&amp;gt;OUTCLR = (1UL &amp;lt;&amp;lt; 18);
  }

  return 0;
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with Bare-Metal Programming of nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/122812?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 12:17:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dce7007-9c3d-404b-88fc-1b3643182b8d</guid><dc:creator>Aaron Feys</dc:creator><description>&lt;p&gt;Hi @MartinBL,&lt;/p&gt;
&lt;p&gt;Thanks for your response. That&amp;#39;s definitely a step in the right direction! Now, if we change that entire&amp;nbsp;section to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;GPIO-&amp;gt;PIN_CNF[11] = ((uint32_t) GPIO_PIN_CNF_DIR_OUTPUT &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos) |
    ((uint32_t) GPIO_PIN_CNF_INPUT_DISCONNECT &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) |
    ((uint32_t) GPIO_PIN_CNF_NOPULL &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos) |
    ((uint32_t) GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) |
    ((uint32_t) GPIO_PIN_CNF_NOSENSE &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
GPIO-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; 11);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll notice that it doesn&amp;#39;t work again! I don&amp;#39;t understand! The definition of those register types have all volatile members.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;~Aaron&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with Bare-Metal Programming of nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/122759?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 08:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a60e89fa-4269-4dc6-b5fd-5b0503ded9b7</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tested your code and saw the same behaviour. Adding the &amp;#39;volatile&amp;#39; keyword to *ptr seemed to fix it.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;volatile uint32_t* ptr = (uint32_t*) 0x5000072C;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m no compiler expert so I can&amp;#39;t explain why though. I just a had hunch.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>