<?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>BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117119/ble-advertising-cannot-be-stop-without-hardware-crash</link><description>Hye, 
 using the nrf 2.4.2 toolchain 
 i have an unsolvable problem about ble on a nrf52840 based project with imu, i2s strip led, buttons, spi speaker... 
 i have a classic ble enable process at startup after everthing else initialized (i try disabling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Dec 2024 12:52:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117119/ble-advertising-cannot-be-stop-without-hardware-crash" /><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/515484?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 12:52:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a80c029-e6e0-46ea-8e58-0405d8c580a9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Ok, so 0x10 is bit 5, and 0x12 is bit 2 and 5. The &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title35"&gt;RESETREAS&lt;/a&gt;&amp;nbsp;register, that is used for the hwinfo_get_reset_cause is retained, so it is not reset unless you do it in the application (or a power on reset).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bit 2 =&amp;nbsp;RESET_BROWNOUT&lt;br /&gt;Bit 5 =&amp;nbsp;RESET_DEBUG&lt;/p&gt;
&lt;p&gt;From what I can tell, there is nothing in&amp;nbsp;z_impl_hwinfo_get_reset_cause() from the file ncs\zephyr\drivers\hwinfo\hwinfo_nrf.c that can trigger bit 2 (Reset brownout), which makes sense, because there is no bit in the RESETREAS register that will indicate a brownout.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bit 5 (RESET_DEBUG) means:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In case of a power on reset or a brownout reset, the register should be 0x00000000, giving a reset reason = 0. But since it is cumulative, it means that all reset reasons since the last power on/brownout are added to the list.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But I am still not sure how you are able to get bit 2 set in the reset reason number. It should not be possible with an nRF, as there is no check in the hwinfo_get_reset_cause() that sets bit 2.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/515147?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 14:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29519366-bc74-427e-8b5d-c0db4ca70861</guid><dc:creator>iznow</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;uint32_t reset_cause;
int err = hwinfo_get_reset_cause(&amp;amp;reset_cause);&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_HWINFO&lt;/span&gt;&lt;span&gt;&lt;span&gt;=y in prj.conf&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;[quote userid="26071" url="~/f/nordic-q-a/117119/ble-advertising-cannot-be-stop-without-hardware-crash/515130"]unless you are done with this issue, of course.&amp;nbsp;[/quote]&lt;span&gt;i would prefer to understand...&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;will take a moment in DK... if some time to do it...&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/515130?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 13:54:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adef836e-4156-4209-aac1-e05d99e3a0bc</guid><dc:creator>Edvin</dc:creator><description>[quote user="iznow"]i see the reset cause at the beginning of my app after reboot, using the reset cause api.[/quote]
&lt;p&gt;Sorry, this may be obvious, but I have not seen it. Can you please specify what API that is?&lt;/p&gt;
[quote user="iznow"]moving&amp;nbsp;settings_save_one()&amp;nbsp;call before the&amp;nbsp;bt_le_adv_stop() solve the crash ![/quote]
&lt;p&gt;unless you are done with this issue, of course.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And if it is possible to reproduce in a DK, that would make it easier to understand what&amp;#39;s going on.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/515114?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 13:20:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02b94bc1-f4cb-4670-ba5b-383186a4efe5</guid><dc:creator>iznow</dc:creator><description>&lt;p&gt;i see the reset cause at the beginning of my app after reboot, using the reset cause api.&lt;/p&gt;
&lt;p&gt;settings_save_one() call is in my app and was called after the&amp;nbsp;&lt;span&gt;bt_le_adv_stop(). but debugger stop in&amp;nbsp;bt_le_adv_stop() ????&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;moving&amp;nbsp;settings_save_one()&amp;nbsp;call before the&amp;nbsp;bt_le_adv_stop() solve the crash !!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/515097?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 12:56:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:143da58c-b0f0-43af-8866-b9b0cec1be09</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Where do you see 0x12 and 0x10?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And where do you call settings_save_one()? Is this something you added to your application, or is it something that is part of the default&amp;nbsp;&lt;span&gt;bt_le_adv_stop() API?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514999?ContentTypeID=1</link><pubDate>Sun, 15 Dec 2024 18:55:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cfcaf5c-6059-4c6d-8423-d52e37fd1c4f</guid><dc:creator>iznow</dc:creator><description>&lt;p&gt;After insvestigation, it appear that a call to a settings_save_one() function just after the ble stop break the execution without explicite exception and reset cause 0x12 HARDWARE_RESET.&lt;/p&gt;
&lt;p&gt;After disabling watchdog, the same problem reset with cause 0x10 BROWN_OUT.&lt;/p&gt;
&lt;p&gt;Finally i manage to avoid the crash by moving the&amp;nbsp;&lt;span&gt;settings_save_one()&lt;/span&gt; call before the ble stop...&lt;/p&gt;
&lt;p&gt;but i still do not know what&amp;#39;s exactly going on...&lt;/p&gt;
&lt;p&gt;i did not found any irq conflict and tried a lot a configuration variation about it...&lt;/p&gt;
&lt;p&gt;same&amp;nbsp;behaviour with all others sensors disabled and uninitilaized... maybe dts.?&lt;/p&gt;
&lt;p&gt;i didn&amp;#39;t try on DK for now...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514425?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2024 08:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8961bd7-0e17-4eb7-9e74-74ccf95e4461</guid><dc:creator>iznow</dc:creator><description>&lt;p&gt;i agree, the screenshot simply show what happend on a debug session free of breakpoints when i try to stop advertising on the main thread. The debugger stop itself without any exception i can show, but stop anyway. in vscode it stop too but line 1399. i will try in the DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514279?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 13:53:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d45f4e2e-8963-4de8-848d-1ad5bef0cd5c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;And is this something you can replicate on a DK? Preferably without the external sensors attached.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514278?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 13:52:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:084c88b9-9712-44f0-89ab-60902aa70f43</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Your screenshots doesn&amp;#39;t say anything about a crash. Please note that if you put breakpoints in the code after the BLE stack has started, you can break there to monitor parameters, but you need to restart the application after that. It is not able to continue the execution, because it has missed too many timing critical&amp;nbsp;events.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does the log say anything (if you don&amp;#39;t set a breakpoint)?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514221?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 11:41:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fee20c8-2770-4139-906f-c0327e6c5b59</guid><dc:creator>iznow</dc:creator><description>&lt;p&gt;&lt;span&gt;bt_le_adv_stop() do not return precisely because it break inside (see code in the screenshot).&amp;nbsp;&lt;br /&gt;no exception intercepted by debugger ... vscode or ozone the same... logs just stop and the reboot happend with reboot cause 12 (HARDWARE_RESET). i understand there is not much info but it&amp;#39;s a very reproducable case on my side and very problematic. thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising cannot be stop without hardware crash</title><link>https://devzone.nordicsemi.com/thread/514218?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 11:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff68f5ae-183b-401f-9810-7c76eb88719a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t see anything from the information you have posted what the error might be. Does the log say anything? What value does bt_le_adv_stop() return?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>