<?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>hello_world will not compile</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102102/hello_world-will-not-compile</link><description>I&amp;#39;m trying to compile hello_world from the template files on the nRF9160-DK. 
 My computer is running Ubuntu 22.04.02. I have updated everything via nRF Connect for Desktop v4.1.2. 
 I am using VSCode and used the &amp;quot;Build&amp;quot; button in the Actions box. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Jul 2023 15:30:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102102/hello_world-will-not-compile" /><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/438346?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2023 15:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:579a5e6e-b11f-4d6b-a31b-23c445b82efa</guid><dc:creator>Brian Fuller</dc:creator><description>&lt;p&gt;Thank you Vidar,&lt;/p&gt;
&lt;p&gt;The switch position was correct but I had not been careful when I built the .config file and the nRF52... was selected rather than the nRF9160. In the US we call that a &amp;quot;rookie mistake&amp;quot; or simply not paying adequate attention to the software parameters.&lt;/p&gt;
&lt;p&gt;OK, I am up and running. Thank you again.&lt;/p&gt;
&lt;p&gt;Brian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/438226?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2023 10:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:541a9950-cb48-47d3-9902-34f84d6bfa21</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am glad to hear that you were able to resolve the build error. The nrfjprog error indicates that you are trying to program a nRF52 project to a nRF9160 target. Did you build the hello world sample for &amp;#39;nrf9160dk_&lt;strong&gt;nrf52840&amp;#39; &lt;/strong&gt;instead of&amp;nbsp;&lt;span&gt;nrf9160dk_&lt;/span&gt;&lt;strong&gt;nrf9160&amp;#39; &lt;/strong&gt;maybe?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please make sure the switch on your 9160 DK is set to the correct position.&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/pastedimage1690368432280v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/438137?ContentTypeID=1</link><pubDate>Tue, 25 Jul 2023 22:16:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa46e619-cdde-4b90-909c-648f0d6dffd8</guid><dc:creator>Brian Fuller</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;I restored the system via rebuilding. I can compile hello-world but still cannot link, but now for a different reason that I also do not understand. Again, I am running under Ubuntu.&lt;/p&gt;
&lt;p&gt;Here is the source code, I added the for loop so that there would be something more in the serial terminal window.&lt;/p&gt;
&lt;p&gt;*&lt;br /&gt; * Copyright (c) 2012-2014 Wind River Systems, Inc.&lt;br /&gt; *&lt;br /&gt; * SPDX-License-Identifier: Apache-2.0&lt;br /&gt; */&lt;/p&gt;
&lt;p&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;&lt;/p&gt;
&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; int i;&lt;br /&gt;&amp;nbsp;&amp;nbsp; for(i=0; i&amp;lt;100; i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printk(&amp;quot;Hello World_01! %s\n&amp;quot;, CONFIG_BOARD);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Here is the Build output in the terminal window:&lt;/p&gt;
&lt;p&gt;Building hello_world_01&lt;br /&gt;/bin/sh -c west build --build-dir /nordicsemi/myapps/hello_world_01/build /nordicsemi/myapps/hello_world_01&lt;/p&gt;
&lt;p&gt;[1/11] Building C object CMakeFiles/app.dir/src/main.c.obj&lt;br /&gt;[2/11] Linking C static library app/libapp.a&lt;br /&gt;[3/11] Linking C executable zephyr/zephyr_pre0.elf&lt;/p&gt;
&lt;p&gt;[4/11] Generating dev_handles.c&lt;br /&gt;[5/11] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/dev_handles.c.obj&lt;br /&gt;[6/11] Linking C executable zephyr/zephyr_pre1.elf&lt;/p&gt;
&lt;p&gt;[7/11] Generating linker.cmd&lt;br /&gt;[8/11] Generating isr_tables.c, isrList.bin&lt;br /&gt;[9/11] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj&lt;br /&gt;[10/11] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj&lt;br /&gt;[11/11] Linking C executable zephyr/zephyr.elf&lt;br /&gt;Memory region Used Size Region Size %age Used&lt;br /&gt; FLASH: 22920 B 1 MB 2.19%&lt;br /&gt; RAM: 7552 B 256 KB 2.88%&lt;br /&gt; IDT_LIST: 0 GB 2 KB 0.00%&lt;br /&gt; * Terminal will be reused by tasks, press any key to close it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And here is the output from Flash:&lt;/p&gt;
&lt;p&gt;Executing task: nRF Connect: Flash: hello_world_01/build (active)&lt;/p&gt;
&lt;p&gt;Flashing build to 960025583&lt;br /&gt;/bin/sh -c west flash -d /nordicsemi/myapps/hello_world_01/build --skip-rebuild --dev-id 960025583&lt;/p&gt;
&lt;p&gt;-- west flash: using runner nrfjprog&lt;br /&gt;-- runners.nrfjprog: Flashing file: /nordicsemi/myapps/hello_world_01/build/zephyr/zephyr.hex&lt;br /&gt;[error] [ Client] - Encountered error -5: Command read_device_info executed for 1 milliseconds with result -5&lt;br /&gt;[error] [ Worker] - Encountered unexpected debug port ID 6, expected 2&lt;br /&gt;[error] [ Client] - Encountered error -5: Command read_memory_descriptors executed for 127 milliseconds with result -5&lt;br /&gt;Failed to read device memories.&lt;br /&gt;[error] [ nRF52] - Device memory generation failed.&lt;br /&gt;[error] [ Worker] - Detected CPU core &amp;quot;235012351&amp;quot; does match expected CPU core &amp;quot;234881279&amp;quot;&lt;br /&gt;ERROR: The --family option given with the command (or the default from&lt;br /&gt;ERROR: nrfjprog.ini) does not match the device connected.&lt;br /&gt;NOTE: For additional output, try running again with logging enabled (--log).&lt;br /&gt;NOTE: Any generated log error messages will be displayed.&lt;br /&gt;FATAL ERROR: command exited with status 18: nrfjprog --program /nordicsemi/myapps/hello_world_01/build/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 960025583&lt;/p&gt;
&lt;p&gt;* The terminal process terminated with exit code: 18. &lt;br /&gt; * Terminal will be reused by tasks, press any key to close it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is some additional important information:&lt;/p&gt;
&lt;p&gt;I get the same flash error message when I try to flash hello_world under Windows 11 and I get the same flash error message when I try to flash after change the board from the nRF9160-DK to a Thingy:91 linked via a Segger JLink.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/437724?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2023 16:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cb65cf6-194b-4960-816e-2e7baf796e89</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;Bare hyggelig / you&amp;#39;re welcome. Yes, I don&amp;#39;t see any other explanation than the header file must have been modified or corrupted somehow. If you want to save some time, it should be quicker to do a &amp;#39;git reset --hard&amp;#39; inside the /v2.3.0/modules/hal/nordic/ directory to restore the files rather than re-installing the SDK (if that&amp;#39;s what you meant by rebuilding your environment).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/437721?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2023 16:15:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29d4944f-8c43-423c-8499-afd2accbfca2</guid><dc:creator>Brian Fuller</dc:creator><description>&lt;p&gt;Thank you Vidar,&lt;/p&gt;
&lt;p&gt;Nothing was changed in the .h files on my system. I am the only person working on the system so I would know that no one else did it either. I wonder if the source files from Nordic Semi were corrupted somehow. I will rebuild my environment from scratch and try again and let you know the results.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards og tusen takk,&lt;/p&gt;
&lt;p&gt;Brian&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hello_world will not compile</title><link>https://devzone.nordicsemi.com/thread/437640?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2023 11:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e73f6687-eb2b-4cff-ae2a-4085c738ce99</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote userid="118006" url="~/f/nordic-q-a/102102/hello_world-will-not-compile"]/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/hal/nrf_uarte.h:489:1: error: unknown type name &amp;#39;namespace&amp;#39;[/quote]
&lt;p&gt;We don&amp;#39;t use &amp;#39;namespace&amp;#39; in the nrf_uarte.h header, so it seems like the header file may have been modified. This is what is supposed to be at line 489:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/4ee20fd6ca25cd4bf78918f4fffee016a4ef47b9/nrfx/hal/nrf_uarte.h#L489"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/4ee20fd6ca25cd4bf78918f4fffee016a4ef47b9/nrfx/hal/nrf_uarte.h#L489&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To see what&amp;#39;s changed, you can open a terminal and change directory to&amp;nbsp;/v2.3.0/modules/hal/nordic and use git:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ git status
$ git diff&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>