<?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>NCS QEMU Testing not exiting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92899/ncs-qemu-testing-not-exiting</link><description>I would like to automate some unit tests with NCS. I tried running the native_posix qemu builds, however, this does not support the mac m1 architecture (maybe Linux only?). 
 qemu_x86 works, but it sits in an infinite loop. I want to automate the tests</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Oct 2022 22:39:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92899/ncs-qemu-testing-not-exiting" /><item><title>RE: NCS QEMU Testing not exiting</title><link>https://devzone.nordicsemi.com/thread/391301?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 22:39:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d52df2fb-19ca-4c82-a057-b4fba568d11e</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Here is the way to exit Qemu with a debug exit instruction&lt;/p&gt;
&lt;p&gt;Run qemu with&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; -device isa-debug-exit,iobase=0xf4,iosize=0x04 &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;qemu-system-x86_64 -nographic -serial mon:stdio -kernel build_qemu/zephyr/zephyr.elf -device isa-debug-exit,iobase=0xf4,iosize=0x04 &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Use this function to write to the exit iobase:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void dbg_io_write_8(uint16_t port, uint8_t val)
{
	__asm__ volatile(&amp;quot;outb %0, %1&amp;quot; :: &amp;quot;a&amp;quot; (val), &amp;quot;Nd&amp;quot; (port));
}


dbg_io_write_8(0xF4, 0x4);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS QEMU Testing not exiting</title><link>https://devzone.nordicsemi.com/thread/391300?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 22:37:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cc9f23e-5691-4a9f-8aa3-a06bf965f805</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;The problem is the Unity and Cmock system uses the native_posix build which is not compatible with my system.&lt;/p&gt;
&lt;div class="document" itemscope="itemscope" itemtype="http://schema.org/Article"&gt;
&lt;div itemprop="articleBody"&gt;
&lt;div id="testing-with-unity-and-cmock" class="section"&gt;
&lt;div id="running-the-test" class="section"&gt;
&lt;div class="highlight-default notranslate"&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="n"&gt;west&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="n"&gt;native_posix&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="rst-footer-buttons"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS QEMU Testing not exiting</title><link>https://devzone.nordicsemi.com/thread/390946?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 09:59:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0c3d6b4-3fa8-4bc1-9bea-c6c08d38dfd2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure if this is the right forum to ask but it seems like the qemu are run indefinitely until &lt;a href="https://superuser.com/questions/1087859/how-to-quit-the-qemu-monitor-when-not-using-a-gui"&gt;you exit them&amp;nbsp;&lt;/a&gt;from the command prompt manually.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.0.0/nrf/ug_unity_testing.html"&gt;Unity and CMock&lt;/a&gt; are widely use to test zephyr based funtionality. Most likely you already knew about these?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>