<?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>Minimalist setup for nrf5340 programming - almost works....</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79003/minimalist-setup-for-nrf5340-programming---almost-works</link><description>Hello, 
 I am learning how to program my nrf5340DK 
 I started using the ncs setup but it is too much overhead for me and I wanted to try a more bare setup and I dont mind if I have to work on a low level. 
 
 The following seems to work if I only want</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Aug 2021 14:09:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79003/minimalist-setup-for-nrf5340-programming---almost-works" /><item><title>RE: Minimalist setup for nrf5340 programming - almost works....</title><link>https://devzone.nordicsemi.com/thread/327258?ContentTypeID=1</link><pubDate>Mon, 30 Aug 2021 14:09:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcbbb625-2e8a-4bfc-97a2-df774bf6d984</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hey Jonas!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad you figured it out! Yes, you should use the secure partition. And I think the NCS setup wont be too much overhead, especially starting out. It would also result in an easier time for us providing you with support. But good thing that you found something that works for you!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Minimalist setup for nrf5340 programming - almost works....</title><link>https://devzone.nordicsemi.com/thread/327067?ContentTypeID=1</link><pubDate>Sat, 28 Aug 2021 18:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65c6d83b-9e00-4e18-8ad9-de8537bc6aa1</guid><dc:creator>JonasForssell</dc:creator><description>&lt;p&gt;I am replying to my own post in order to share the answer.&lt;br /&gt;&lt;br /&gt;Here is an example of a simple LED1 blink.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*********************************************************************
*                    SEGGER Microcontroller GmbH                     *
*                        The Embedded Experts                        *
**********************************************************************

-------------------------- END-OF-HEADER -----------------------------

File    : main.c
Purpose : Generic application start

*/

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;nrf.h&amp;gt;
#include &amp;lt;nrf5340_application.h&amp;gt;
#include &amp;lt;nrf5340_application_peripherals.h&amp;gt;

#define PIN_GPIO  (28UL)  // Use pin 28 on the board which also is LED1

int main(void)
{

  // Configure GPIO pin as output with standard drive strength.
  NRF_P0_S-&amp;gt;PIN_CNF[PIN_GPIO] = (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos) |
                                (GPIO_PIN_CNF_DRIVE_S0S1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) |
                                (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) |
                                (GPIO_PIN_CNF_PULL_Disabled &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos) |
                                (GPIO_PIN_CNF_SENSE_Disabled &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
  
  
  // Toggle GPIO ON/OFF.
  while (1)
  {
    uint32_t volatile tmo;
    
    tmo = 1000000;
    while (tmo--);
    NRF_P0_S-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; PIN_GPIO);    
    
    tmo = 1000000;
    while (tmo--);
    NRF_P0_S-&amp;gt;OUTCLR = (1UL &amp;lt;&amp;lt; PIN_GPIO);  
  }
}

/*************************** End of file ****************************/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In general, there are two main things I needed to fix.&lt;/p&gt;
&lt;p&gt;The first was to realize that the old NRF_GPIO register is now replaced by NRF_P0_S and NRFP1_S (there is also NS) to refer to the two banks of GPIO pins.&lt;/p&gt;
&lt;p&gt;The second is that I needed to use the S appendix and not NS. By default Segger uploads to the Secure area.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For those who like to start with nrf53 and want to understand the low level things first, perhaps this can be a way. It can be a bit much with the nrfx library and Zephyr on top of that when you come from the arduino world.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>