<?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>softdevice controller use</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70843/softdevice-controller-use</link><description>Hi, 
 I&amp;#39;m trying to make the softdevice controller work on NuttX RTOS. I followed the SDK example code to reproduce initialization. All calls are returning 0 (no error). However, once I send the first HCI command (a controller RESET) I don&amp;#39;t receive SWI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jan 2021 02:20:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70843/softdevice-controller-use" /><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291402?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 02:20:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82b052da-40cc-40d7-a6d7-ca025196b003</guid><dc:creator>protobits</dc:creator><description>&lt;p&gt;Actually I see that the example code mostly does the same: it triggers event handling right after sending, by posting the same semaphore that is posted when the signal is received from MPSL:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int cmd_handle(struct net_buf *cmd)
{
        BT_DBG(&amp;quot;&amp;quot;);

        int errcode = MULTITHREADING_LOCK_ACQUIRE();

        if (!errcode) {
                errcode = hci_internal_cmd_put(cmd-&amp;gt;data);
                MULTITHREADING_LOCK_RELEASE();
        }
        if (errcode) {
                return errcode;
        }

        k_sem_give(&amp;amp;sem_recv);

        return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void host_signal(void)
{
        /* Wake up the RX event/data thread */
        k_sem_give(&amp;amp;sem_recv);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It would be good if you could clarify as to why this is needed. In other words, what kind of events will trigger the signal and which will not. Also, I think that this should be better documented as it is not evident from the documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291400?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 02:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9480fbd5-221a-49d5-bbe2-5010e181cf6e</guid><dc:creator>protobits</dc:creator><description>&lt;p&gt;I continued testing by manually calling by sd_hci_signal() handler, which let me complete host layer initialization by receiving all &amp;quot;command complete&amp;quot; events that were being generated during setup. Once I started advertising I got the SWI5 interrupt.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m beginning to think that this signaling is not used for all HCI events or maybe there&amp;#39;s some HCI command which triggers the signaling to start. Or maybe there&amp;#39;s some issue in MPSL/SDC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291369?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 18:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:071cd6b2-64aa-40e5-afc4-7d562fda0a85</guid><dc:creator>protobits</dc:creator><description>&lt;p&gt;Yes, that is part of normal NuttX boot. As I mentioned, I can manually trigger an interrupt (up_trigger_irq) and it will go to the handler as expected. The problems is that SDC does not seem to be interacting with MPSL so that MPSL itself triggers the IRQ.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291364?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 18:42:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28e4124f-ca2e-44f5-8d98-73c666fefd15</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Do you know if&amp;nbsp;&lt;span&gt;up_irqinitialize() is being called somewhere in your project/code ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291145?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 21:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cbd4c24-212e-4794-b6ed-18cb956e685a</guid><dc:creator>protobits</dc:creator><description>&lt;p&gt;No, that handler is not called (even when I can manually verify that there&amp;#39;s a pending HCI event). I understand that to trigger that call, mpsl should pend the configured interrupt (in this case, SWI5) from which I would call mpsl_low_priority_process(), but that interrupt is not triggered. Finally, If I call &lt;span&gt;mpsl_low_priority_process&lt;/span&gt;() manually, the handler passed to sdc_enable() is not called either. So it would seem that mpsl is not aware that sdc has a pending HCI event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: softdevice controller use</title><link>https://devzone.nordicsemi.com/thread/291144?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 21:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:203285fc-776f-430f-beee-c7da101e975c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="92543" url="~/f/nordic-q-a/70843/softdevice-controller-use"] I don&amp;#39;t receive SWI interrupt which would lead to signaling for available HCI EVT.[/quote]
&lt;p&gt;The callback function you pass to&amp;nbsp;sdc_enable()&amp;nbsp;will be executed when HCI data or and HCI&amp;nbsp;&lt;span&gt;event is available.&amp;nbsp;The callback will be executed in&amp;nbsp;the same context as mpsl_low_priority_process.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From your code snippet, your callback function is named&amp;nbsp;sdc_hci_signal(). Does sdc_hci_signal() execute/trigger when send the first HCI command?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>