<?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>Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92981/product-crash-with-nrf51822-peripheral-s130-2-0-1-how-to-get-logs-or-more-information</link><description>Dear Mr/Mrs, 
 Our commercialized product currently have a default: some (luckily rare) clients get a crash after the 1st configuration - sometimes hours after but always while being connected. The product is totally blocked, and need a hard reset to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Oct 2022 09:35:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92981/product-crash-with-nrf51822-peripheral-s130-2-0-1-how-to-get-logs-or-more-information" /><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/392558?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 09:35:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577c98f3-2cbb-4227-a2c4-cc728f2bd4cf</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;I used the&amp;nbsp;&lt;span&gt;HARDFAULT_HANDLER, and a new release is on its way.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I think we can clode this ticket.&lt;/p&gt;
&lt;p&gt;Thanks again !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/392035?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 07:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e68d0f9-9713-4779-bd11-bddefba3caf2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;br /&gt;Yes you are correct by default hardfault handler will make it stay in an infinite loop. You can have a look at &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/an-introduction-to-error-handling-in-nrf5-projects"&gt;this guide.&amp;nbsp;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can either enable&amp;nbsp;HARDFAULT_HANDLER module in sdk_config.h (you would need to include hardfault_implementation.c file)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Of implement your own&amp;nbsp;HardFault_Handler to overwrite the weak definition of it in ses_startup_nrf52.s (if you are using SES)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391946?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 15:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdd3a3fd-5eba-47e0-aa0e-02b6c508f9ce</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Ok, thanks.&lt;/p&gt;
&lt;p&gt;I reproduced a similar issue while in debug using a low stack size setting to see what&amp;#39;s happens, and I can see I get an &amp;quot;hardfault&amp;quot;&lt;/p&gt;
&lt;p&gt;From what I see, the&amp;nbsp;&lt;span&gt;hardfault produce an infinite loop (while others&amp;nbsp;faults produce a reset by default).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I guess for future use, it&amp;#39;ll be a good idea for me to change this behavior, and have a reset too in case of&amp;nbsp;hardfault...&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This infinite loop by default is for debug purpose, am I right ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391856?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 11:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b8e5c51-c88b-4cda-a5f7-28484410e569</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;br /&gt;Unfortunately I don&amp;#39;t know. But it&amp;#39;s better not to go under what required by the spec.&lt;/p&gt;
&lt;p&gt;I am not sure not using bond can reduce the peak number of byte the stack need. I suspect&amp;nbsp;it doesn&amp;#39;t.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391831?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 09:52:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e24f908-b578-44b4-9fcd-0b9873014e4d</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Thanks again, we successfully reached&amp;nbsp;1944 bytes for the stack without major modifications, and we are still testing it (so far no crash).&lt;/p&gt;
&lt;p&gt;About the stack size for the softdevice, so you know if the&amp;nbsp;stack use is&amp;nbsp;decreased (below 1536 bytes) if the bonding is not used ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391797?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 08:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b3051f4-9892-400d-b28f-251d71864edf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;br /&gt;It could be the root cause. I wouldn&amp;#39;t give just 1536 bytes but slightly more, maybe 2kB. You may want to run some memory analysis to know how much application&amp;#39;s stack required.&amp;nbsp; For example:&amp;nbsp;&lt;a href="https://www.segger.com/products/development-tools/embedded-studio/technology/code-analysis/#stack-usage"&gt;https://www.segger.com/products/development-tools/embedded-studio/technology/code-analysis/#stack-usage&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391716?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 14:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9923229-bfda-4ff3-873a-6f01e6cc646a</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Thanks !&lt;/p&gt;
&lt;p&gt;The current configuration is (only) 1280 bytes for the stack size. We are also testing a new version with&amp;nbsp;1792 bytes (it&amp;#39;s difficult to go further, we use a lot of RAM, but we can&amp;#39;t reproduce on this version so far). Our previous firmware had 2KB.&lt;/p&gt;
&lt;p&gt;We do not use heap (set to 0)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So it may be the root cause of our crash ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391712?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 14:14:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af1300b-c5a4-46f1-a383-045970276bd9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;br /&gt;Could you give the exact call stack configuration you have in your project&amp;nbsp; ?&amp;nbsp;&lt;br /&gt;S130 requires at least 1536 bytes. The stack configuration in your project is shared between softdevice and application. So it also depends on how many bytes your application using. Have you tried to reduce heap and increase stack ?&amp;nbsp;&lt;br /&gt;By default we don&amp;#39;t use HCI mem pool in most of our examples so&amp;nbsp;I don&amp;#39;t think it&amp;#39;s an issue. I assume you don&amp;#39;t use it in your application ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391605?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 10:11:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88ec9bd6-d71c-4f1d-85a2-03b52f0d8ade</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;We are trying to&amp;nbsp;&lt;span&gt;reproduce&amp;nbsp;with debug and/or logs, but it&amp;#39;s very difficult, and we didn&amp;#39;t managed&amp;nbsp;so far.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One tip:&amp;nbsp;we were able to reproduce the issue with all notifications deactivated. So it seems it&amp;#39;s not linked to notifications. And the trace show exactly&amp;nbsp;the same stop in the the same service request.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One question : do you think that an issue in the stack allocated size may produce this kind of crash ? Due to ram limitation (we are pretty full on RAM side), we needed to reduce the stack size compare to previous firmware version.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also here is the sdk config we used, I don&amp;#39;t know if this could help :&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7635.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../7635.sdk_5F00_config.h&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We are wondering if&amp;nbsp;HCI_MEM_POOL_ENABLED set to 0 may have a link to our problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another question : Where can I find more details on what&amp;#39;s happening during the service discovery&amp;nbsp;process ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again !&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Julien&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391508?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 16:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feeeed97-7a8d-4a09-a6c7-efbb1a7b243d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the sniffer. Yes it looked like a crash right after a read by type request. But what causing this we don&amp;#39;t know.&amp;nbsp;&lt;br /&gt;If you managed to find a way to reproduce the issue please try to debug and check the log.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can also take more sniffer trace with a central that you have more control over (for example nRF Connect Dekstop on PC or nRF5 as a central) so that you can control when you want to do service discovery. By having that we can be sure if it was because of service discovery or not.&amp;nbsp;&lt;br /&gt;Usually service discovery is handled by the softdevice and should not cause any issue.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391451?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 13:33:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9f54343-7955-4b17-a3e5-989f9e180ee0</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;I&amp;#39;m more thinking about a bad parameter we send to the softdevice... Or a race condition somewhere. But it&amp;#39;s still very unclear to me.&lt;/p&gt;
&lt;p&gt;Here is a sniffer trace we just manage to get !&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/capture-crash-ride.pcapng"&gt;devzone.nordicsemi.com/.../capture-crash-ride.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After a series of connection/restart, the last command send by nrfconnect (at the end of the file) seems to be:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6743&lt;span&gt; &lt;/span&gt;1148.847139&lt;span&gt; &lt;/span&gt;Master_0xaf9a959f&lt;span&gt; &lt;/span&gt;ATT&lt;span&gt; &lt;/span&gt;37&lt;span&gt; &lt;/span&gt;Sent Read By Type Request, GATT Characteristic Declaration, Handles: 0x000c..0x0013&lt;span&gt; &lt;/span&gt;Slave_0xaf9a959f&lt;/p&gt;
&lt;p&gt;There is no answer, and the peripheral device is then totally blocked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391443?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 13:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f497613-c312-483e-b8d3-ecb22cdd0499</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;br /&gt;No, not really. The softdevice S130 is&amp;nbsp;pretty robust and it&amp;#39;s been using in millions of devices for many years (almost 10 years). I am not aware of any&amp;nbsp;report about the softdevice being crashed and keep the CPU in an infinite loop, no. If there is any crash, it would either throw a fault or go straight to a hardfault and reset.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regarding the log, it seems that the connection is terminated before discovery completed but it&amp;#39;s hard to tell what exactly wrong here. If you can capture &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;a sniffer trace&lt;/a&gt; when the issue happen it would be very useful.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391435?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 12:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c4ddc13-cd25-4080-b6aa-15f39d3677c2</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Thanks for you answer !&lt;/p&gt;
&lt;p&gt;Currently we can not reproduce the issue with the log (it&amp;#39;s very difficult to reproduce), but we are still trying.&lt;/p&gt;
&lt;p&gt;On the application side, everything is blocked (software-blinking leds stopped for example - even if PWMs are still active) - without a reset.&lt;/p&gt;
&lt;p&gt;Thanks about the&amp;nbsp;&lt;span&gt;softdevice_fault_handler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But as far as I can see,&amp;nbsp;softdevice_fault_handler or other faults will generate a reset (I did not changed app_error_fault_handler, and I&amp;#39;m not in DEBUG) - and it&amp;#39;s not the case here.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Have you ever heard about a possible crash or infinite loop during the&amp;nbsp;Discovering services on the periph side ? It may be linked to a bonding process (bonding should not append, but it&amp;#39;s not forbidden and&amp;nbsp;not correctly managed either) and/or a cold start (it seems for us easiest to reproduce the issue after a cold start) and/or a possible notification send (at the same time ?)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We are thinking about an issue there because logs from nrfconnect seems to show a time out on the discovering services request :&lt;/span&gt;&lt;/p&gt;
&lt;pre class="aLF-aPX-K0-aPE"&gt;V	17:49:23.129	Connecting to EA:A3:51:3B:C8:AB...
D	17:49:23.130	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	17:49:23.625	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D	17:49:23.640	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	17:49:23.640	Connected to EA:A3:51:3B:C8:AB
V	17:49:23.640	Discovering services...
D	17:49:23.640	gatt.discoverServices()
I	17:49:23.965	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	17:49:29.145	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I	17:49:29.145	Disconnected
D	17:49:29.173	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED&lt;/pre&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391382?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 10:21:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8247e525-5e72-4507-891a-41938e2779cd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Julien,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you see anything in the log ? Was the application continue to work (without BLE) after the fault happened&amp;nbsp; ?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;In most case if the softdevice crash or has a fault it will call the&amp;nbsp;softdevice_fault_handler() function with the info and fault ID about the fault.&amp;nbsp;&lt;br /&gt;You may need to&amp;nbsp;define&amp;nbsp;&amp;nbsp;app_error_fault_handler() so that it overwrite the weak declaration in the app_error_weak.c if you want to print more log. But if you can reproduce the issue you can just put a breakpoint inside&amp;nbsp;app_error_fault_handler() in&amp;nbsp;&lt;span&gt;app_error_weak.c.&lt;br /&gt;&lt;br /&gt;If you have a look inside nrf_sdm.h you can find&amp;nbsp;NRF_FAULT_ID_SD_RANGE_START it&amp;#39;s where the fault ID for softdevice start.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Product crash with nrf51822 peripheral s130 2.0.1 : how to get logs or more information ?</title><link>https://devzone.nordicsemi.com/thread/391276?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 16:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a28b1107-d995-435b-90e2-f294d2b39e42</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;One update : the crash may occurs during the &amp;quot;Discovering services&amp;quot; request (send by the central - here a phone using nrfconnect). It&amp;#39;s also possible that a notification occurs pretty fast after the connection, and so maybe during the discovering service (I don&amp;#39;t know if it&amp;#39;s possible, and/or may result to a crash on the periph side).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>