<?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>DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19852/dfu-peripheral-to-central</link><description>Hi all 
 Is possible have DFU in the peripheral side to update a Central app program? Is there example doing it? 
 I have a Peripheral (custom board nRF52 dongle) connected to a PC, and I want to update the application program in the Central side (remote</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Feb 2017 17:02:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19852/dfu-peripheral-to-central" /><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77216?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2017 17:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87c77c0e-8ba4-4af0-89fd-7b662284bc5e</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for the suggestion I am going to switch the roles for testing the current consumption :)&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77215?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2017 08:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:831d9cf3-4af7-441c-84f2-62f9678b597a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;It could consume more power with your setup. Also as for now we only support peripheral to connect to one central at a time, so if there are a central scanning when your peripheral already connect to another central then it won&amp;#39;t be able to connect. The central, on the other hand, can connect to several (8) peripherals at a time.&lt;/p&gt;
&lt;p&gt;I would suggest you to switch the central and peripheral role. This way you can also keep the role when you do DFU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77214?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2017 16:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab5d72da-158c-47ff-8474-4719de7ada3e</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I have only one peripheral advertising all the time (it is attached to a PC), and I have a variable number the remote central devices monitoring the temperature and self-battery state. Every 10 mins each central wake up from system_off starts to scan for 1 sec for a connectable peripheral and sent the temperature and seft battery level over BLE.&lt;/p&gt;
&lt;p&gt;Setup:&lt;/p&gt;
&lt;p&gt;Advertising interval 20ms&lt;/p&gt;
&lt;p&gt;Peripheral power 4dBm&lt;/p&gt;
&lt;p&gt;payload 10bytes&lt;/p&gt;
&lt;p&gt;battery 3v&lt;/p&gt;
&lt;p&gt;DCDC enabled on the Central side(remote)&lt;/p&gt;
&lt;p&gt;Connection every 10mins and scanning window for 1 second&lt;/p&gt;
&lt;p&gt;Connection event: send the payload and close the connection as quicky as possible.&lt;/p&gt;
&lt;p&gt;The central scan for 1 sec, in a testing scenario the time is lower around 50-100ms to detect the peripheral and send the payload and it goes to system off.&lt;/p&gt;
&lt;p&gt;My concern is if in this setup the battery can actually have a longer life. If it is otherwise I could switch the central and peripheral roles&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77211?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2017 08:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dd2198a-5773-436f-adca-2dd6dc881940</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I would need to have a little more information about your peripheral. How many peripheral do you have ? How often do you need to connect and exchange data between the peers ?&lt;/p&gt;
&lt;p&gt;Staying in RX mode for one second consume way more data than advertising in one second, even with shortest advertising interval.&lt;/p&gt;
&lt;p&gt;Note that when advertising, the peripheral doesn&amp;#39;t send data all the time, the minimum normal advertising interval is 20ms and the device only stay up about 4ms to send data before it sleeps the rest of the time (16ms).
As in the power calculator tool, you can easily find the average current consumption is only about 400uA compare to 7-8mA when staying in RX mode constantly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77213?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 19:25:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7288ed10-227f-4686-8578-59329537a940</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Regarding to the Central power consumption I have it very controlled by a RTC making the Central active 1 second waiting for a RX BLE event and the central most time is into sd_power_system_off mode.&lt;/p&gt;
&lt;p&gt;The Central is listening 1 second or less (in case the any RX BLE event it goes to system_off) every 10mins, the rest of time the central is into sd_power_system_off.&lt;/p&gt;
&lt;p&gt;If I compare 1 second a peripheral in advertising data mode (is the same that transmitting right?) vs 1 central listening 1 sec the central has a major power consumption?. If it is the case please tell me because I am using the &lt;a href="https://devzone.nordicsemi.com/power/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; and the datasheet power consumption to have a better idea&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77212?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2017 10:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68b9346c-c310-4467-a378-2e811950f5bc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Arepa,&lt;/p&gt;
&lt;p&gt;Actually it&amp;#39;s the opposite, the central usually consume more power consumption. The central usually have to listen most of the time, and staying in RX mode can consume even more than when transmitting.&lt;/p&gt;
&lt;p&gt;Note that the peripheral only need to switch to TX mode when it want to send something, and this can be very short period in time.&lt;/p&gt;
&lt;p&gt;So, usually the central should be the one more power hungry than the peripheral. You should consider running the device connect to PC in central mode.&lt;/p&gt;
&lt;p&gt;Regaring the DFU master,  we don&amp;#39;t have an example that you can run the DFU master on the nRF52 directly as a central. The example we have, as described, to have connectivity firmware on the nRF52 and all the code running on the PC. You can have  a look at the source code of nrfutil on github as the reference code.&lt;/p&gt;
&lt;p&gt;Other source is to have a look at the code of DFU library in NRFToolbox app for Android/iOS. But the best is just to follow the documentation of the DFU protocol in the SDK on Infocenter.&lt;/p&gt;
&lt;p&gt;How do you plan to send data from your PC to your nRF52 connected to PC ? Do you have plan to simply use connectivity firmware on the nRF52 and then use BLE driver to control it from PC. It&amp;#39;s then much easier to do DFU that way. You still can use PC to create a normal peripheral. There are several example provided. Have a look &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77209?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 18:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e98a1bc4-42f0-40aa-8617-69cd190815de</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;There is any reference I can use for DFU master part?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77210?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 17:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f1faa0b-5548-4500-95ee-bc76e93396fa</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I think the remote device running in central role could be more battery efficient because the most time it is listening instead of transmiting (advertising data). Please correct me If I am wrong.&lt;/p&gt;
&lt;p&gt;In case the keep my current setup (Central as remote device and Peripheral for a linux PC) That is what I was thinking about switch roles to perform the DFU, but I will make more &amp;quot;complex&amp;quot; the code.&lt;/p&gt;
&lt;p&gt;The Idea is if a future I need a update for the Remote devices. I will sent the update using the peripheral attached to the PC. This same peripheral in normal operation is monitoring the remote devices.&lt;/p&gt;
&lt;p&gt;So I may switch the PC attached peripheral to central, and the remote Central to Peripheral then perform the DFU over the air&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Peripheral to Central?</title><link>https://devzone.nordicsemi.com/thread/77208?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 11:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4d7c3f5-fb85-43f3-84ac-e45873787132</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Arepa,&lt;/p&gt;
&lt;p&gt;Does it have to be the remote device running in central mode when you are doing DFU ?&lt;/p&gt;
&lt;p&gt;We currently don&amp;#39;t have an example for that.&lt;/p&gt;
&lt;p&gt;But please be noted that the S132 is capable of running in both central and peripheral. So there is an option that you run your device in central mode, then you send a command from the peripheral connected PC that the remote device switch to bootloader and starts as a peripheral. You then can also switch the peripheral into central mode to do DFU update.&lt;/p&gt;
&lt;p&gt;With this solution you only need to make the DFU master part which run on the PC. (We don&amp;#39;t have this part yet). Alternatives are you can update using a phone or from PC via nrfutil tool (if you run the dongle with connectivity firmware).&lt;/p&gt;
&lt;p&gt;If you really have to keep the remote device in central role, then you need to implement your own bootloader. You can reuse many parts from the default bootloader, you can set up a GATT server on the central side and receive image to that server. Only difference here is the DFU master advertise, the DFU target connects instead of the other way around.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>