<?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>import a library which invoke kernel function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102533/import-a-library-which-invoke-kernel-function</link><description>Hi, 
 I have two projects. 
 One of them is a library, another is an application for products. 
 
 Library project is built in zephyr environment, and calls k_msgq_get and k_msgq_put in somewhere of the code. 
 If the application imports the library as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Aug 2023 09:51:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102533/import-a-library-which-invoke-kernel-function" /><item><title>RE: import a library which invoke kernel function</title><link>https://devzone.nordicsemi.com/thread/440269?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2023 09:51:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54cbabb7-6ecf-4305-a64f-2809034984ee</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So you mean to say that the lib file is exactly the same in both cases,&amp;nbsp;but including it in a slightly different way in the CMakeLists.txt file makes the difference?&lt;/p&gt;
&lt;p&gt;The debug output is interesting. It seems like the values are offset by one word in the case of the msgq pointer, while the &amp;amp;mpsl_msgq variable has the correct values.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For instance the&amp;nbsp;msg_size value&amp;nbsp;of 8 moved down to&amp;nbsp;max_msgs, the original max_msgs value of 15 moved down to buffer_start and so on.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Would you be able to check the register values as well, and show the memory printout starting at address 0x2000105C?&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: import a library which invoke kernel function</title><link>https://devzone.nordicsemi.com/thread/440041?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2023 06:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80023930-9974-4efe-b640-4141f0e6dcbb</guid><dc:creator>jhc</dc:creator><description>&lt;p&gt;The mpsl_msgq is defined:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;K_MSGQ_DEFINE&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;mpsl_m&lt;/span&gt;&lt;span&gt;sgq&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;sizeof&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;_MPSL_MSGQ_ITEM&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and called in a thread:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;err&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;k_msgq_get&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;mpsl_msgq&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;msgi&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; K_FOREVER&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;I debug and trace the&amp;nbsp;mpsl_msgq, the WATCH window shows mpsl_msgq variable has the same address with parameter mpsl_msgq passed to&amp;nbsp;k_msgq_get, but its members have different values!&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&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/pastedimage1691397606991v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am so confused by this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: import a library which invoke kernel function</title><link>https://devzone.nordicsemi.com/thread/440022?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2023 01:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37225a41-c2e3-46fc-844b-3042f844e485</guid><dc:creator>jhc</dc:creator><description>&lt;p&gt;Sorry, it is a&amp;nbsp;typo error.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;INTERCONN should be INTER.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: import a library which invoke kernel function</title><link>https://devzone.nordicsemi.com/thread/439938?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2023 13:46:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40f6c82c-903f-4d9d-9d56-5b8d7a8e6841</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks to me like the main difference is that the non working version uses libLIB_INTER.a while the working version uses libLIB_INTERCONN.a ?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t recognize either of these libraries (and the names yield zero hits on Google) so I assume you made these libraries yourself?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the difference between the &amp;#39;INTER&amp;#39; and the &amp;#39;INTERCONN&amp;#39; variants?&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>