<?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>Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93155/toggle-led-in-custom-application</link><description>I&amp;#39;m trying to do something extremely simple but can&amp;#39;t get it to work. Through the dev academy, I successfully loaded up and executed exercise 1. However, when I then try to &amp;quot;Create a New Application&amp;quot; (rather than &amp;quot;Add and existing appliction), running</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Nov 2022 13:09:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93155/toggle-led-in-custom-application" /><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/393883?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 13:09:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e748e5-c4a9-4aea-a8a2-791ac1fd0410</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jamie&lt;/p&gt;
&lt;p&gt;I am glad I could be of help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you have any more questions related to this topic just let me know. For other questions just open a new ticket.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/393844?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 11:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:910204a3-f465-4a7d-957d-2e0165423b31</guid><dc:creator>jmilliken</dc:creator><description>&lt;p&gt;Thank you. This is great information. I&amp;#39;ll take some time to digest it and see if I have any further questions, but I think I have everything I need to proceed at this point. Thanks for all the help.&lt;/p&gt;
&lt;p&gt;-Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/393673?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ba767bc-ec41-4bac-8b69-1c37ce9753e4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jamie&lt;/p&gt;
&lt;p&gt;Simon is currently unavailable, so I will help you out instead.&amp;nbsp;&lt;/p&gt;
[quote user="jmilliken"]1) Why was this code inserted and from where is network_gpio_allow() called since it is clearly not called from main()?[/quote]
&lt;p&gt;The only reference to this function I can find is in the main.c file of the empty_app_core example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The assumption is that if you are not running any code in the app core you want all the GPIO&amp;#39;s available to the network core, since this is where you&amp;#39;re running all your code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the end it is up to the app core to decide which pins are assigned to which core, which is why the app core has to run this during boot.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The SYS_INIT macro allows you to schedule code to be run during the boot process of the Zephyr kernel, before the main thread or any other application code has started.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The call to the various SYS_INIT functions will come from the init.c file in the zephyr\kernel folder, more specifically &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/kernel/init.c#L447"&gt;this line&lt;/a&gt;.&lt;/p&gt;
[quote user="jmilliken"]Where are the initialization calls taking place since?[/quote]
&lt;p&gt;Essentially this is triggered by the z_cstart(void) function in the init.c file I mentioned earlier.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The various modules in your system that needs some kind of boot time initialization can define init functions using either the SYS_INIT macro, or one of the DEVICE macros for device drivers, as described &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.1/zephyr/kernel/drivers/index.html"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
[quote user="jmilliken"]3) In STM32 applications, we also get an assembly file - e.g.&amp;nbsp;startup_stm32h743zitx.s - which, upon reset, initializes all the memory then jumps to main. Where does this occur in Zephyr?[/quote]
&lt;p&gt;The reset code is implemented in &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/arch/arm/core/aarch32/cortex_m/reset.S"&gt;/zephyr/arch/arm/core/aarch32/cortex_m/reset.S&lt;/a&gt;, which in turn calls the z_arm_prep_c() function in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/arch/arm/core/aarch32/prep_c.c"&gt;/zephyr/arch/arm/core/aarch32/prep_c.c&lt;/a&gt;, which among other things call the z_cstart() function in init.c that I mentioned earlier.&amp;nbsp;&lt;/p&gt;
[quote user="jmilliken"]4) Does Zephy code adhere to CMSIS conventions? [/quote]
&lt;p&gt;Yes,&amp;nbsp;all the hardware registers have CMSIS definitions available.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe you need to include &amp;lt;device.h&amp;gt; to get access to them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that all peripheral in the nRF devices use the NRF_ prefix, eg:&lt;/p&gt;
&lt;p&gt;NRF_TIMER0-&amp;gt;TASKS_START = 1;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/393137?ContentTypeID=1</link><pubDate>Sun, 30 Oct 2022 22:06:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4cb96b3-bd80-4bf6-b10d-9033e5545fa1</guid><dc:creator>jmilliken</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;Hi Simon&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;So I have solved my problem, but it brought up some other questions. First, the solution to what was happening is that the auto-generated main() function for the two non-functional examples had this code hanging around below main() that I hadn&amp;#39;t noticed (somehow!):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;/** &lt;/span&gt;&lt;span&gt;@brief&lt;/span&gt;&lt;span&gt; Allow access to specific GPIOs for the network core.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;* Function is executed very early during system initialization to make sure&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;* that the network core is not started yet. More pins can be added if the&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;* network core needs them.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;network_gpio_allow&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;ARG_UNUSED&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; /* When the use of the low frequency crystal oscillator (LFXO) is&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* enabled, do not modify the configuration of the pins P0.00 (XL1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* and P0.01 (XL2), as they need to stay configured with the value&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Peripheral.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;start_pin&lt;/span&gt;&lt;span&gt; = (&lt;/span&gt;&lt;span&gt;IS_ENABLED&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;CONFIG_SOC_ENABLE_LFXO&lt;/span&gt;&lt;span&gt;) ? &lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt; : &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; /* Allow the network core to use all GPIOs. */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;start_pin&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &amp;lt; &lt;/span&gt;&lt;span&gt;P0_PIN_NUM&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;++) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;NRF_P0_S&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;PIN_CNF&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;] = (&lt;/span&gt;&lt;span&gt;GPIO_PIN_CNF_MCUSEL_NetworkMCU&lt;/span&gt;&lt;span&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;GPIO_PIN_CNF_MCUSEL_Pos&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &amp;lt; &lt;/span&gt;&lt;span&gt;P1_PIN_NUM&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;++) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;NRF_P1_S&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;PIN_CNF&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;] = (&lt;/span&gt;&lt;span&gt;GPIO_PIN_CNF_MCUSEL_NetworkMCU&lt;/span&gt;&lt;span&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;GPIO_PIN_CNF_MCUSEL_Pos&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;SYS_INIT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;network_gpio_allow&lt;/span&gt;&lt;span&gt;, PRE_KERNEL_1, &lt;/span&gt;&lt;span&gt;CONFIG_KERNEL_INIT_PRIORITY_OBJECTS&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;So at start-up, all pins were assigned to the network core via this embedded function call before main even had a chance to execute. Commenting out the last line (&amp;quot;SYS_INIT&amp;quot;) fixes the problem and I/Os are under control. However, this brings up the following quesitons:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;1) Why was this code inserted and from where is network_gpio_allow() called since it is clearly not called from main()?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;2) Using STM32 applications as an example, in their main files we get something like the following:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1667167235445v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;So each of these HAL functions is called from main which makes it very easy to jump into the generated code and see exactly what registers are being set, etc, to configure a peripheral. In Zephyr code, this seems to be very obfuscated. Where are the initialization calls taking place since?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;3) In STM32 applications, we also get an assembly file - e.g.&amp;nbsp;startup_stm32h743zitx.s - which, upon reset, initializes all the memory then jumps to main. Where does this occur in Zephyr?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;4) Does Zephy code adhere to CMSIS conventions? Again, citing STM32 code (sorry, I&amp;#39;ve just written a lot of that so it makes comparison easy for me), if I want to change a register in a timer, for example, I can write:&amp;nbsp;TIM3-&amp;gt;CNT = 0; which would access the count register of Timer 3 directly. Can I do the same for Zephyr code?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Jamie&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392803?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 11:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69389a3d-ed63-4f5a-8173-7035fdb2d418</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I guess P0.29 is forwarded to the netcore using the dts compatible &lt;code&gt;nordic,nrf-gpio-forwarder&lt;/code&gt;, like explained in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/91965/no-output-to-uart-console-when-config_bt-y/387363"&gt;this reply&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Try to disable forwarding pins to the netcore by doing&amp;nbsp;adding the following to a file nrf5340dk_nrf5340_cpuapp (I assume you&amp;#39;re not using cpuapp&lt;strong&gt;_ns&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	gpio_fwd: nrf-gpio-forwarder {
		compatible = &amp;quot;nordic,nrf-gpio-forwarder&amp;quot;;
		status = &amp;quot;disabled&amp;quot;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t work, try&amp;nbsp;to open the file &amp;lt;sample&amp;gt;/build/zephyr/zephyr.dts and search for&amp;nbsp;&amp;quot;nordic,nrf-gpio-forwarder&amp;quot;, and see what name the compatible is within. For example if it is within &amp;quot;some_name: nrf-gpio-forwarder&amp;quot; instead, use that in your overlay.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392719?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 01:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46132b5c-8bfe-4975-8d22-2437050effc1</guid><dc:creator>jmilliken</dc:creator><description>&lt;p&gt;I&amp;#39;ve gotten a little closer to the root of the problem but still need some help. Looking at the registers for the pin, with the application that can successfully toggle the LED, I see this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1666834364568v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the application that cannot, I see this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1666834488626v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So somehow the pin control is being assigned to the network core, not the application core. I verified that for both projects, the build configuration is the same (UBX_EVKNORAB10_NRF5340 Application MCU). So what project settings assign pins to the different cores and how do I set that up? In my application, at least for now, I have no need for the Network MCU to control pins directly, so all should be assigned to the Application core.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392666?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 14:05:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9980778c-68f5-4126-a7d7-44deae729318</guid><dc:creator>Simon</dc:creator><description>[quote user="jmilliken"]To answer your question, I am using the NORA-B106 EVK from U-blox:[/quote]
&lt;p&gt;Ah, okay.&amp;nbsp;I thought you were using the nR5340 DK.&lt;/p&gt;
[quote user="jmilliken"]Okay, I will try this tonight and let you know.[/quote]
&lt;p&gt;Sounds good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392658?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 13:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:946a8f9f-8ed5-4354-b0ca-9e2b354a5706</guid><dc:creator>jmilliken</dc:creator><description>&lt;p&gt;Okay, I will try this tonight and let you know. To answer your question, I am using the NORA-B106 EVK from U-blox:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.digikey.com/en/products/detail/u-blox/EVK-NORA-B106/13534375"&gt;www.digikey.com/.../13534375&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392631?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 13:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8f4edc7-b255-40ad-8a19-67beceb25e7b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hmm.. that is strange. What nRF5340 DK version do you have?&lt;/p&gt;
&lt;p&gt;Are you able to get any output from any other pins? Try toggling P0.25 or P0.26 for example and connect a logic analyzer to the header and check if you can see any activity.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:300px;max-width:640px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1280x600/__key/communityserver-discussions-components-files/4/0486.pastedimage1666789353188v1.png" /&gt;&lt;/p&gt;
[quote user="jmilliken"] I went into debug mode to add a breakpoint at line 27 (from your code snippet above) but it would not let me add a breakpoint there. In fact, if I click to add a breakpoint there, it automatically inserts it at line 34 above, indicating that it must have optimized out the lines for getting the device tree reference. Any ideas?[/quote]
&lt;p&gt;Try setting CONFIG_DEBUG_OPTIMIZATIONS=y in the prj.conf and do a pristine build.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392501?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 01:36:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac842f99-cf0c-4801-a764-34933d36c924</guid><dc:creator>jmilliken</dc:creator><description>&lt;p&gt;Hi. Going back to the application generated from the hello world template, I have verified that the prj.conf has the following:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_GPIO&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;main.c has the following includes:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;drivers/gpio.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;drivers/spi.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Also, I added the code snippet above but still no LED. I went into debug mode to add a breakpoint at line 27 (from your code snippet above) but it would not let me add a breakpoint there. In fact, if I click to add a breakpoint there, it automatically inserts it at line 34 above, indicating that it must have optimized out the lines for getting the device tree reference. Any ideas?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;-Jamie&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392156?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 12:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1778708-6b6c-48e9-a29f-dcc30261b880</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I applied the following modifications to the hello world sample in NCS v2.1.0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/samples/hello_world/prj.conf b/samples/hello_world/prj.conf
index b2a4ba5910..d63ffc4391 100644
--- a/samples/hello_world/prj.conf
+++ b/samples/hello_world/prj.conf
@@ -1 +1,2 @@
 # nothing here
+CONFIG_GPIO=y
diff --git a/samples/hello_world/src/main.c b/samples/hello_world/src/main.c
index 8676d8940b..0e61e7a84d 100644
--- a/samples/hello_world/src/main.c
+++ b/samples/hello_world/src/main.c
@@ -5,8 +5,33 @@
  */
 
 #include &amp;lt;zephyr/zephyr.h&amp;gt;
+#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
+
+#define SLEEP_TIME_MS 500
 
 void main(void)
 {
 	printk(&amp;quot;Hello World! %s\n&amp;quot;, CONFIG_BOARD);
+	const struct device *dev0;
+    const int PIN=29;
+    int ret;
+
+    dev0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
+
+    if (dev0==NULL) {
+        printk(&amp;quot;device not found&amp;quot;);
+    }
+
+    if (!device_is_ready(dev0)) {
+        printk(&amp;quot;GPIO controller not ready&amp;quot;);
+    }
+
+    ret = gpio_pin_configure(dev0, PIN, GPIO_OUTPUT);
+    if(ret){
+        printk(&amp;quot;gpio_pin configure failed: %d\n&amp;quot;, ret);
+    }
+    while(1) {
+        gpio_pin_toggle(dev0, PIN);
+        k_msleep(SLEEP_TIME_MS);
+    }
 }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then I programmed it onto the board nrf5340dk_nrf5340_cpuapp, and LED2 blinked as expected.&lt;/p&gt;
&lt;p&gt;Here is the complete sample:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2248.hello_5F00_world_5F00_blinky.zip"&gt;devzone.nordicsemi.com/.../2248.hello_5F00_world_5F00_blinky.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle LED in custom application</title><link>https://devzone.nordicsemi.com/thread/392004?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 02:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3af0b7e4-2bce-4f38-aae9-0b8236a3def5</guid><dc:creator>jmilliken</dc:creator><description>&lt;p&gt;Update - I have recreated the application three different ways using different Application templates.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Created with nrf/samples/nrf5340/empty_app_core - LED toggle does not work.&lt;/li&gt;
&lt;li&gt;Created with zephry/samples/hello_world - LED does not work.&lt;/li&gt;
&lt;li&gt;Created with zephyr/samples/basic/blinky - LED works.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I should note that it is not just the LED that doesn&amp;#39;t toggle, I also have SPI transciever code and I can see that the GPIOs associated with clock, chip select, and data lines also do not work (i.e. they are always held low) in 1 and 2 above, but work in 3 above.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So my pins are under control now, which is great. But so that I can understand, what is going on &amp;quot;behind the scenes&amp;quot; that causes the first two applications to fail and the third to work? What options or configurations do I need to enable to make 1 and 2 work?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>