<?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>Run Command during Pre-Initialization (early chance to disable UART1)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97926/run-command-during-pre-initialization-early-chance-to-disable-uart1</link><description>Windows 11, WSL2, NCS2, VSCode 
 
 Hi, I believe there&amp;#39;s some way to run code during pre-initiliazation, I think by tagging certain .text areas in the code with pre-processors. Is that how Zephyr does it for some BLE stuff for example? 
 Ultimately I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Mar 2023 09:51:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97926/run-command-during-pre-initialization-early-chance-to-disable-uart1" /><item><title>RE: Run Command during Pre-Initialization (early chance to disable UART1)</title><link>https://devzone.nordicsemi.com/thread/416735?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 09:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4d67a5f-5f84-4a6f-adb5-851d4ce2beaf</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Douglas&lt;/p&gt;
&lt;p&gt;It is odd that P1.00 wouldn&amp;#39;t work, this pin should be available.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try P1.01 as well and see if it&amp;#39;s the same issue?&lt;/p&gt;
&lt;p&gt;How do you configure and use the pin?&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: Run Command during Pre-Initialization (early chance to disable UART1)</title><link>https://devzone.nordicsemi.com/thread/416589?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 14:18:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f22159ec-f69c-4403-bf78-50255cb351bf</guid><dc:creator>douglas.malnati</dc:creator><description>&lt;p&gt;Oh also I have CONFIG_LOG_BACKEND_UART=y and CONFIG_LOG_BACKEND_SWO=n&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run Command during Pre-Initialization (early chance to disable UART1)</title><link>https://devzone.nordicsemi.com/thread/416587?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 14:17:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e241441-bd15-48e8-af8e-ca3d81d2fe71</guid><dc:creator>douglas.malnati</dc:creator><description>&lt;p&gt;Ah thanks, I&amp;#39;m looking into that.&lt;/p&gt;
&lt;p&gt;Ran into another question while doing so, maybe you can help.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to toggle a pin at certain points to know when my code is executing.&lt;/p&gt;
&lt;p&gt;Unfortunately, I see no signal, just a constant HIGH logic level, I think QSPI.&amp;nbsp; I&amp;#39;m using the pin that QSPI (P1.00/TRACEDATA0) would be on if in use, but I didn&amp;#39;t think it was.&lt;/p&gt;
&lt;p&gt;Can you tell me what to look for?&amp;nbsp; I looked and I see&amp;nbsp;&lt;span&gt;CONFIG_NRFX_QSPI defaults to n in my configuration.&amp;nbsp; I tried setting&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FLASH_SHELL&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FLASH&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;But that didn&amp;#39;t do it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run Command during Pre-Initialization (early chance to disable UART1)</title><link>https://devzone.nordicsemi.com/thread/416508?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 11:17:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c75b2a58-3d36-4268-86c1-48dd68b709be</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Douglas&lt;/p&gt;
&lt;p&gt;It seems odd that it would take as much as a second for the system to boot, but anyway this should not happen too often in most applications.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to run code during the boot sequence you can use the SYS_INIT(..) macro, described &lt;a href="https://docs.zephyrproject.org/3.1.0/kernel/drivers/index.html#c.SYS_INIT"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With this macro you can define the level at which the function should be run, which determines where in the boot sequence your code gets executed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you set the level to PRE_KERNEL_1 it should be called very early in the process.&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></channel></rss>