<?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 Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84680/ble-multiple-central-single-peripheral-scenario</link><description>Hi, 
 I’m currently experiencing some periodic MCU resets while testing the BLE Multiple central single peripheral scenario, whose root cause is not clear to me, except that the reset reason is watchdog related and happening in specific situations. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Mar 2022 12:09:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84680/ble-multiple-central-single-peripheral-scenario" /><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/356565?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 12:09:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:792acfde-9972-4b86-ae8f-3e5657ed51dc</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Luis&lt;/p&gt;
&lt;p&gt;Thanks for sharing the solution.&lt;/p&gt;
&lt;p&gt;Good to hear you found the issue &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&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: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/355838?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 13:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5d7194b-12d3-49ce-9523-25b9a9aa8ab0</guid><dc:creator>LuisSilva</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks a lot for your continuous support. This thread can be now closed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The watchdog issue is solved. It was being triggered because I was not periorically resetting (feeding) the WDT while in sleep.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Luis Silva&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/353316?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 10:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ae5ddbe-a28a-4465-9620-3d648cc64bf2</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Luis&lt;/p&gt;
&lt;p&gt;1) What happens if you disable the watchdog then? Is the application running OK?&lt;/p&gt;
&lt;p&gt;How fast is the watchdog set to time out?&lt;/p&gt;
[quote user="LuisSilva"]Not sure but it may be that I&amp;#39;m sending the device to sleep too soon and then SD triggers the wdt!?! Can it be?[/quote]
&lt;p&gt;The important thing when using a watchdog is to ensure to reset it often enough during normal operation, so you only get a watchdog reset if something abnormal happens (such as a deadlock in the code).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the watchdog is running in sleep you need to make sure you wake up often enough to reset it.&amp;nbsp;&lt;/p&gt;
[quote user="LuisSilva"]Are there any general guidelines to follow prior to putting the device to sleep when it supports BLE connectivity?&amp;nbsp;[/quote]
&lt;p&gt;No, normally going to sleep should not pose any problems. All our standard examples go to sleep as soon as the application has finished all its processing, handled any events etc.&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><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/353114?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 13:56:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e0432e-a241-418b-aac5-9bcb112da270</guid><dc:creator>LuisSilva</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks a again for all the support.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) Crashing is really only happening when trying to emulate mesh, i.e., when having a device changing its role.&amp;nbsp;&lt;/span&gt;&lt;span&gt;It is due to a watchdog (triggers receive wdt_event_handler) and apparently when changing from Central to Peripheral and then quickly to Central again to report the status to the Peripheral.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, the crash sometimes happens not on the device that changes from Central&amp;lt;-&amp;gt;Peripheral but also at its Peripheral, which only acts as Peripheral.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;I&amp;#39;m also trying to assure any advertising before changing/acting as a Central role temporarely. Can advertising while in&amp;nbsp; Central role trigger a watchdog?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;span&gt;Not sure but it may be that I&amp;#39;m sending the device to sleep too soon and then SD triggers the wdt!?! Can it be?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Are there any general guidelines to follow prior to putting the device to sleep when it supports BLE connectivity?&amp;nbsp;&lt;/span&gt;I.e., I really want to assure that I just put the device to sleep if it would not cause any watchdog from BLE (if it would be really the case, not sure).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;2) Prettry clear now. I was considering it wrongly before.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Luis&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/353014?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 07:25:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c6628e9-1e06-4fd4-a503-e5151d8a621d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Luis&lt;/p&gt;
&lt;p&gt;1) Ok, so&amp;nbsp;it is when you change roles from peripheral to central or vice versa that you get crashes?&lt;/p&gt;
&lt;p&gt;2) The critical aspect is to know that the PERIPHERAL or CENTRAL link count defines refer to the local role (what role you are running), not the role of the devices you connect to.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to connect to a central device you need to be a peripheral, and you need to increase the peripheral link count locally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4) Debugging when running a SoftDevice is not easy, as you can not start the code again once you stop (without first doing a reset), but&amp;nbsp;it should be possible to set a breakpoint if you know where the error happens.&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><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/352964?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 16:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e67c8919-248a-4eab-a780-cc87fc0d45bd</guid><dc:creator>LuisSilva</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks a lot for the feedback support. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It surely helps narrow down the troubleshooting and I had already identified some problems in my code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) If I do not emulate mesh, then I have no issue with specifying only one central and one peripheral but in fact using Peripheral 1: 2 Central.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Probably I have been very lucky, since even forcing high data exchange rate I could not have a crash.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) Thanks for the clarification. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Specification only states maximum peripheral or central count, but I wanted to confirm its real meaning. I.e.,&amp;nbsp;NRF_SDH_BLE_(as a Central I can connect to)PERIPHERAL_LINK_COUNT and&amp;nbsp;NRF_SDH_BLE_(as Periheral I can accept)CENTRAL_LINK_COUNT.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) Ok. Thanks anyway&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4) Yes, but it is not been easy testing BLE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again for the support.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rgds,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Luis Silva&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Multiple Central single Peripheral scenario</title><link>https://devzone.nordicsemi.com/thread/352837?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 10:29:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a935d80-3315-47b4-aeb1-d2a4286fff19</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
[quote user=""]&amp;nbsp; -- Initially, I still have not considered any multiple concurrent (Central) connections approach without success, meaning the Peripheral would crash.[/quote]
&lt;p&gt;So you mean to say that even in the scenario where you only run either central or peripheral (not both at the same time) you will experience crashes?&lt;/p&gt;
[quote user=""]&lt;p&gt;#1 – Is it still important to have multi concurrent connection support if not having Peer Management?&lt;/p&gt;
&lt;p&gt;I.e., in which situations would it really fail for my initial approach?&amp;nbsp;&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;I am not sure I understand this question. If you only want to switch between peripheral and central role, or run one of each, you just need to set&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT&amp;nbsp; to 1,&amp;nbsp;NRF_SDH_BLE_CENTRAL_LINK_COUNT to 1 and the total count to 2.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]#2 – What is the correct SDH_BLE_&amp;lt;PERIPHERAL|CENTRAL|TOTAL&amp;gt;_LINK_COUNT setting and its use in the initialization when willing to support single Peripheral device and 5 Central devices reporting to the Peripheral device?[/quote]
&lt;p&gt;In order to be connected to 5 central devices (as a peripheral) and 1 peripheral device (as central) you need the following settings:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1&lt;br /&gt;NRF_SDH_BLE_CENTRAL_LINK_COUNT 5&lt;br /&gt;NRF_SDH_BLE_TOTAL_LINK_COUNT&amp;nbsp;6&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user=""]&amp;nbsp;Moreover, when initializing the Queue Write (which I do not used, i.e., NRF_BLE_QWR_ENABLED 1 but NRF_BLE_QWR_MAX_ATTR 0), do we have to consider only 5 or 6 (the total) connections?[/quote]
&lt;p&gt;Are you planning to use queued writes at all?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If not you don&amp;#39;t need to use this module.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]#3 – Do you recommend any example code emulating mesh, i.e., where a device behaves as a Peripheral to receive status but after aggregating some statuses, change its role to Central in order to communicate to its own Peripheral and only then change back to Peripheral?[/quote]
&lt;p&gt;Unfortunately we don&amp;#39;t have any good examples showing how to establish a mesh using standard Bluetooth connections.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We have support for Bluetooth mesh, but his is based on advertise packets rather than connections, and we have support for mesh through our Zigbee and Thread examples.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]#4 - Is there any configuration (e.g., from sdk_config.h) which could help understand where the MCU was hanged before watchdog being triggered?[/quote]
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Did you try to use the debugger?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Then you should be able to check where in the code you end up when the crash happens.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>