<?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>The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111624/the-bt_mgmt_init-function-returns-an-error</link><description>I am creating a program using the nRF5340 Audio sample source. I am debugging using VSCODE instead of a script. 
 The bt_mgmt_init function returns error code -11. 
 Tracing it, I find that -11 is returned at err = bt_dev.drv-&amp;gt;open(); in hci_core.c. Tracing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Jun 2024 08:18:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111624/the-bt_mgmt_init-function-returns-an-error" /><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/487646?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 08:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efb08fe9-7038-4de5-a24a-439b09ebd444</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Junichi"]Digging into the bt_mgmt_init() function, I found that the error is occurring in the part where the k_sem_take function acquires a semaphore.[/quote]
&lt;p&gt;Could you point to the relevant code where you think the error occurs?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/487473?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2024 10:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9697a4dc-7c49-4a03-98e5-a31385c1aad9</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Digging into the bt_mgmt_init() function, I found that the error is occurring in the part where the k_sem_take function acquires a semaphore.&lt;/p&gt;
&lt;p&gt;Why does it fail to acquire the semaphore?&lt;/p&gt;
&lt;p&gt;The same source does not cause an error on a DK board, etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/487393?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2024 00:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:703e63b2-f779-49b0-90dd-ee1b99d9d30d</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Please continue here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/487383?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2024 19:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f594b84-c826-41c4-877e-419e54a75896</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;It seems that you opened a new case related to the same bt_mgmt_init() issue.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/111750/nrf5340-dcdc-mode"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/111750/nrf5340-dcdc-mode&lt;/a&gt;&lt;br /&gt;As a general note, opening new cases related to the original issue usually does not lead to a faster resolution. I suggest that you stay within the same case as long as your questions stay inside initial problem description.&amp;nbsp;&lt;br /&gt;Would you like to continue here or in your newly opened case?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/487005?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2024 00:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a34b67fa-24c6-4549-9d82-e426ef34e9d7</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;I was wrong about &amp;quot;sometimes&amp;quot;.&lt;/p&gt;
&lt;p&gt;In the same source code, the bt_mgmt_init(); function does not return an error when using the MDBT53-DB board, but returns an error code when using a customer board.&lt;/p&gt;
&lt;p&gt;The customer board has a RAYTAC MDBT53-1M.&lt;/p&gt;
&lt;p&gt;The difference is that the customer board does not have coils installed on the DCCD, DCCH, or DCC terminals, so it cannot operate in DCDC mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/486489?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 14:05:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee5e41fd-9495-4b79-bfc1-807b06551898</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The bt_mgmt_init function returns error code -11.[/quote]
&lt;p&gt;Can you show full log including the error?&lt;/p&gt;
[quote user=""]I think the bt_mgmt_init function is a Bluetooth initialization function[/quote]
&lt;p&gt;Function bt_mgmt_init() initializes Bluetooth management module. Bluetooth subsystem is&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/bluetooth-dev.html#initialization"&gt;initialized&lt;/a&gt; using function &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/gap.html#c.bt_enable"&gt;bt_enable()&lt;/a&gt;.&lt;/p&gt;
[quote user=""]When debugging, sometimes the function no longer gives an error, and once it no longer gives an error, it works normally for a while, but when I do something else and try to run it again, the error comes back.[/quote]
&lt;p&gt;How often is &amp;quot;sometimes&amp;quot;? Do you do anything that could trigger different behavior? What do you refer to as &amp;quot;something else&amp;quot;? You could try to make smaller changes before debugging so that you could narrow down your potential issue.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The bt_mgmt_init function returns an error.</title><link>https://devzone.nordicsemi.com/thread/486383?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 10:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56cfb3c3-bb79-4787-a3c9-830f5bf4e2a7</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Additional information.&lt;/p&gt;
&lt;p&gt;I have two nRF5340 Audio DK boards, two MDBT53-DB boards made by RAYTAC, and two customer boards.&lt;/p&gt;
&lt;p&gt;I am developing software that uses the source code of nRF5340 Audio in VSCODE.&lt;/p&gt;
&lt;p&gt;With the same source code, the bt_mgmt_init(); function does not return an error when using the MDBT53-DB board, but an error code is returned when using the customer board.&lt;/p&gt;
&lt;p&gt;The customer board has a RAYTAC MDBT53-1M mounted on it.&lt;/p&gt;
&lt;p&gt;The difference is that the customer board does not have coils mounted on the DCCD, DCCH, or DCC terminals, so it cannot operate in DCDC mode.&lt;/p&gt;
&lt;p&gt;However, even when the MDBT53-1M is set to LDO mode, the mgmt_init(); function does not return an error.&lt;/p&gt;
&lt;p&gt;What could this be?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>