<?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 read/write synchronization</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102914/ble-read-write-synchronization</link><description>Hi! I would like to clarify next scenario: I have one read/write-notify characteristic, my device write and read data into it, and my mobile app read and write into it, following this, could be a situation in which mobile app receive write data to characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Aug 2023 11:05:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102914/ble-read-write-synchronization" /><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/442750?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 11:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:136dc036-0c6b-46c0-8f72-e68b4b422b12</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Is the mobile app a custom one you are developing as well? If so are you able to see what the mobile is doing with this data exactly? And do you get a confirmation that the data the nRF52 device writes to the mobile app is indeed forgotten/erased afterwards, so new data isn&amp;#39;t overwritten and makes this the &amp;quot;garbage&amp;quot; data? I think you need to confirm that it is in fact erased between writes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/442339?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 14:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64feac2a-a771-4bc9-97bc-536a312b16d7</guid><dc:creator>Polek</dc:creator><description>&lt;p&gt;I do periodically write data (116 bytes) to characteristic on a device side, mobile app receives this data and write back to its characteristic some data (4 bytes). Writing data from device is performed&amp;nbsp;&lt;span&gt;periodically without waiting any seq/packet from mobile, just write and forget, but mobile use the same characteristic for writing themself data&amp;nbsp;independently from device. Maybe in the last sentence error is located...?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/442253?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 10:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4aaecff-7a86-464d-9291-54332eada742</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, thank you for the update. From what you&amp;#39;ve provided, the code looks simple enough and correct&amp;nbsp;from what&amp;nbsp;I can tell, and we don&amp;#39;t think the ble_evt_handler is doing something wrong here, but rather that some garbage or corrupted data is being written into the characteristic and then reading this value back. Can you provide some information on what you&amp;#39;re writing into the characteristic on your end?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/442014?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 07:18:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3bbc1cf-7f2a-4f30-9101-df44f2f55241</guid><dc:creator>Polek</dc:creator><description>&lt;p&gt;nRF5_SDK_16.0.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/442004?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 06:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:835eafde-38ec-4a86-81f8-df5c78b7abca</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What SDK and version are you using for development here?&amp;nbsp;I think setting the &lt;strong&gt;ram_start&lt;/strong&gt; here to 0 might be what&amp;#39;s causing issues.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/441877?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 13:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08665ba0-8eb8-40b3-be56-b3d5216a6b9f</guid><dc:creator>Polek</dc:creator><description>&lt;p&gt;I receive this garbage from:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;in&amp;nbsp;&lt;em&gt;p_ble_evt&lt;/em&gt; already garbage on &lt;em&gt;write event&lt;/em&gt;...&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;And here is example how I setup ble stack:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p class="p1"&gt;&lt;strong&gt;static void init_ble()&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;ret_code_t ec = nrf_sdh_enable_request();&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;APP_ERROR_CHECK(ec);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p2"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;uint32_t ram_start = 0U;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;ec = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;APP_ERROR_CHECK(ec);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p2"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;ec = nrf_sdh_ble_enable(&amp;amp;ram_start);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;APP_ERROR_CHECK(ec);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p2"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;NRF_SDH_BLE_OBSERVER(s_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, nullptr);&lt;/strong&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&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;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE read/write synchronization</title><link>https://devzone.nordicsemi.com/thread/441851?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 11:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ae420a5-76b4-49db-9908-bd6f4c4d051d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;How do you store this data exactly? Could it be that your buffers or flash addresses are being filled or overwritten causing the received characteristics data to seem like garbage. Can you provide some details of the service and characteristics you&amp;#39;re trying to use, and what the issue is exactly, as I&amp;#39;m not sure I understand you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>