<?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>Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20248/multi-packets-in-sdk-7-2-0-bootloader</link><description>Hi,
We are doing DFU updates through a nrf51422 dongle (data passing from UART to BLE), using our own code, based on the multilink central example. 
 The DFU peripherals are nrf51822, s110 7.0.0, SDK 7.2.0.
The central unit is nrf51422 dongle, s130</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 26 Mar 2017 11:59:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20248/multi-packets-in-sdk-7-2-0-bootloader" /><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78884?ContentTypeID=1</link><pubDate>Sun, 26 Mar 2017 11:59:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f78afe44-b2dc-4eab-b75b-e7bb6923b079</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;We had to implement our own UART handling on the central side in order to have better UART throughput and avoid UART activity during radio events (this caused some collisions appaerntly).&lt;/p&gt;
&lt;p&gt;Eventually, after optimization on both sides, we managed to get a throughput of ~10KBps.&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78882?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 15:52:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2499b3b-3633-420e-b48f-aedbcbcef7ad</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I see, we do have the buffer to store the incoming data, but we write each packet to flash separately. I assume to avoid the CPU being halted for long time (CPU is halted when doing flash writing).&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think we have anything better than uart fifo. On nRF51 the CPU have to feed the UART peripheral on byte-byte basis. On nRF52 we have UARTE which has EasyDMA so the UARTE can access the memory directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78883?ContentTypeID=1</link><pubDate>Sun, 19 Mar 2017 13:42:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9add303-5cf4-43ab-80db-ca77c29c0f42</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;Hi Hung,
We&amp;#39;ve managed to get things working at 11.25 ms and 6 packets per interval, but we had to change the flash sequence. Instead of writing each packet to flash, we are storing them in a temp buffer and writing all of them in a single request at the end of the interval. Each flash operation (with pstorage) has a lot of overhead, so writing each packet separately was very slow.
For now, it seems that what&amp;#39;s holding us back is the UART on the central side.
Is there a more efficient module other than uart fifo? maybe one that can work with chunks of data instead of byte-byte?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78876?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2017 13:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24ac7ff1-aeb5-4e5d-b8b5-9137d86936ef</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gili,&lt;/p&gt;
&lt;p&gt;You are correct [0x10 0x03 0x06] tells operation failed when receiving image.&lt;/p&gt;
&lt;p&gt;If you have a look at the release note of SDK v7 (known issue section) you can find that we only tested to work with minimum connection interval of 11.25ms. Most likely 7.5ms would be too short to do flash operation.&lt;/p&gt;
&lt;p&gt;Could you try to increase the connection interval to 11.25ms and also change the packet notification to let&amp;#39;s say 20 packets ? Make sure your central stops transmitting after every 20 packets to wait for the notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78878?ContentTypeID=1</link><pubDate>Sun, 12 Mar 2017 10:05:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4228aa82-9bf0-4cb7-b771-78c28ddae49c</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;One more question. What versions of BL/SD/Central are you using?&lt;/p&gt;
&lt;p&gt;Basically, our BL is the regular BL code, with minor changes (no changes to the DFU flow though).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78877?ContentTypeID=1</link><pubDate>Sun, 12 Mar 2017 07:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7616c66-566b-4884-b4a8-974fe15fc83e</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;Hi Hung,
Here are two sniffer traces:
&lt;a href="https://drive.google.com/open?id=0B-iwgKUKCIo_RnhoWXRGZHNoY28"&gt;2 packets per interval&lt;/a&gt; - successful with a pretty stable flow
&lt;a href="https://drive.google.com/open?id=0B-iwgKUKCIo_SnVIdV93YV8yQVk"&gt;4 packets per interval&lt;/a&gt; - fails pretty quick&lt;/p&gt;
&lt;p&gt;Both traces are at ~7ms interval with a 100 packets notification.
Only difference is 2 or 4 packets per interval.&lt;/p&gt;
&lt;p&gt;From what I understand in the bootloader code, the [0x10 0x03 0x06] response packets indicate an error on the memory/flash write operation. Is this correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78881?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 15:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16a2be88-48e0-44a9-b0eb-ec36fed7574e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gili,&lt;/p&gt;
&lt;p&gt;Are you using Keil or use GCC, could you attach your bootloader project ? Have you modified anything in the bootloader ?&lt;/p&gt;
&lt;p&gt;What you saw in the hvx.data is normal. It&amp;#39;s the acknowledge for DFU command, and the packet receipt notification with the number of byte received.&lt;/p&gt;
&lt;p&gt;Could you capture a sniffer trace that actually show the DFU target crash ? The one you attached showing it was the DFU master didn&amp;#39;t want to send data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78880?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 13:41:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e4bd6ae-26ad-434a-a4dc-100d8491917d</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;It seems like the bootloader is failing on hci_mem_pool_rx_produce, in app_data_process.
It returns a NO_MEM error. I assume we&amp;#39;re writing too fast to the flash.
I there a way to resolve this so we could get a faster throughput?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78879?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 11:21:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7913406-30a0-48b4-b76c-c963aebff103</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;The hci_mem_pool_internal.h is identical.
Is it possible that I get different HVX events in the central?
I tried printing the data from p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data, based on the length in the same member. Mostly I get:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  [0x10 0x03 0x06]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but every few events I get something like these:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  [0x11 0x40 0x1F 0x00 0x00]
  [0x11 0x10 0x27 0x00 0x00]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As for the number of packets, our procedure in the central is as follows (for X packets notification):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;call sd_ble_gattc_write for each packet.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;if we get BLE_ERROR_NO_TX_PACKETS, retry every 1ms for up to 1 sec.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;after sending X packets, wait for notification to arrive (up to 4 sec wait).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;after notification is received, go back to #1.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78874?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 14:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06502765-61e7-4a6c-97b4-5111982f2ccf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gili,&lt;/p&gt;
&lt;p&gt;Our test with 11ms connection event, and 6 packets per connection event worked fine.&lt;/p&gt;
&lt;p&gt;I suspect there could be a problem with the configuration of the buffer, please check the hci_mem_pool_internal.h you included in your bootloader and check if it looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TX_BUF_SIZE       4u    /**&amp;lt; TX buffer size in bytes. */
#define RX_BUF_SIZE       32u   /**&amp;lt; RX buffer size in bytes. */

#define RX_BUF_QUEUE_SIZE 8u    /**&amp;lt; RX buffer element size. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The packet receipt notification contain the number of byte the target receives. For example first notification in your case it has value = 240 (20x12).&lt;/p&gt;
&lt;p&gt;Looking at your sniffer trace I don&amp;#39;t really understand what was the problem ? I can see that the central stopped writing data after it sent 7 packets after the last notification. The DFU bootloader expect 12packets before it sends the next one.&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s the central crashed not the peripheral ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78873?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 13:12:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48d3d5d0-c3c6-4e66-bc55-ddd155d124e6</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;I&amp;#39;ve managed to use the sniffer after reverting back to Jlink driver 5.12.
I attached the sniffer trace to the main post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78875?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 08:44:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bff69c1d-9028-4840-a3b0-815786ca30ab</guid><dc:creator>Gili Elias</dc:creator><description>&lt;p&gt;Hi Hung,
Thanks for the reply.
We used the S130 that came with SDK12.2. You are right, it is 2.0.1. My mistake.&lt;/p&gt;
&lt;p&gt;Packet notification was at 100 packets, which didn&amp;#39;t work.
I&amp;#39;ve managed to get 4 packets per interval when I set the notification to 4 packets as well, but this slows the throughput (it&amp;#39;s takes 2 intervals for 4 writes and a notification).&lt;/p&gt;
&lt;p&gt;Does the packet notification indicate that X packets were just received or does it also indicate that they were written to flash?&lt;/p&gt;
&lt;p&gt;Is there a way to increase the DFU buffer size?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to run a sniffer trace using a PCA10000, but it doesn&amp;#39;t seem to work (no data incoming to wireshark). I noticed the sniffer app is pretty old and not maintained. Is it possible it doesn&amp;#39;t work with the latest JLink drivers (6.12j)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi packets in SDK 7.2.0 bootloader</title><link>https://devzone.nordicsemi.com/thread/78872?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 12:56:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5a02b1d-7b9f-424e-a7b1-c37ff1c616db</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gili,&lt;/p&gt;
&lt;p&gt;S110 supports up to 6 packet per connection event.&lt;/p&gt;
&lt;p&gt;Which S130 version you are using ? We don&amp;#39;t have S130 v3.0
If you are talking about S130 v2.0 then it also support 6 packets per connection event.&lt;/p&gt;
&lt;p&gt;I suspect it&amp;#39;s the buffer overflow on the DFU bootloader application.&lt;/p&gt;
&lt;p&gt;Do you have the issue right when it started or it&amp;#39;s in the middle of the process ?
Could you capture a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;sniffer trace&lt;/a&gt; ?&lt;/p&gt;
&lt;p&gt;Have you enabled packet notification ? You can avoid packet overflow by using packet notification, try to set it at 10 for example, just for testing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>