<?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>TWI transfert stuck</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71160/twi-transfert-stuck</link><description>Hi, 
 
 I&amp;#39;m communicate with my sensor by using TWI ( i2c) driver. Most of the time, no problem. 
 But yesterday , i was debugging, and and ble disconnect event happen ( it print in the console). After that, i was surprised to see that my programmin were</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Feb 2021 07:42:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71160/twi-transfert-stuck" /><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293469?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 07:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d84f0718-898d-45f0-8b15-d254ce59cc1c</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;I agree , i understand , i already move quiet a lot from original subject, new ticket is already created , thanks a lot !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293468?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 07:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c857c9f-ed97-4d50-9ac4-15b86833638f</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My understanding is that the original problem regarding the TWI has been solved. We are happy to help you with the issue regarding pairing but would prefer that you made a new ticket for it. That makes it easier for other users on this forum to follow this thread when they have a similar twi problem etc..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293376?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 15:01:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09606463-730c-4539-a027-1533ea9ca4c1</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;You point exactly the probleme i&amp;#39;m faced at the moment:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was working on pairing because i have this strange issue:&lt;/p&gt;
&lt;p&gt;My program is based on hrs example + dfu merging.&lt;/p&gt;
&lt;p&gt;I was thinking that, by using pairing protection with 6 digit fixed pathkey( no other choice cause no IO), i would&amp;nbsp;not be able to read/write my characteriqtics. But with nrfConnect, if you are fast enough, when bounding window pops up , and you click cancel and really fast after, you are able to click on the row to read a characteristics, the connexion is&amp;nbsp;maintained and you have access to all , without been securly paired !!!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I know i can protect each caracteristic by using :&amp;nbsp;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM , what i did.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But a side effect appears: after first pairing on the phone by writing the 6 digit passkey, the same windows pops up FOR EACH characteristic you read ( only the first time) ... so it s a bit anoying because you have the feeling to have paired at connexion step , but in fact it has absolutely no impact on security.&lt;/p&gt;
&lt;p&gt;If you click cancel you are still connected and if fast enough you can even have access to all. If you paired successfully, you will have to enter this same path key for each characteristic you have protected, what give a strange effect to the final user, he has the feeling that first pairing didn&amp;#39;t worked.&lt;/p&gt;
&lt;p&gt;What i need is :&amp;nbsp;ask pairing&amp;nbsp;after connect. If&amp;nbsp;android user enter correct path kay&amp;nbsp;, no more ask user to enter pathkey. If no or cancel, close connexion or retry but doesn&amp;#39;t give access. Only paired device should have access.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But now i get this error when i want to enter the passkey on android phone:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x13.
&amp;lt;error&amp;gt; peer_manager_sm: Could not perform security procedure. smd_params_reply() or smd_link_secure() returned NRF_ERROR_INVALID_ADDR. conn_handle: 0
&amp;lt;error&amp;gt; peer_manager_handler: Unexpected fatal error occurred: error: NRF_ERROR_INVALID_ADDR
&amp;lt;error&amp;gt; peer_manager_handler: Asserting.
&amp;lt;error&amp;gt; app: ERROR 16 [NRF_ERROR_INVALID_ADDR] at C:\nordic\nRF5SDK160098a08e2\components\ble\peer_manager\peer_manager_handler.c:294
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293371?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 14:48:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a498f96-1468-4140-90a1-6edda368f16b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Ok. Just want to comment that you need to start capturing before the link is decrypted. The sniffer trace doesn&amp;#39;t fully show the communication as the link is encrypted. You have either turn off pairing or capture a trace when they pair so that the key can be sniffed by the sniffer and so that it can decrypt the link.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612795693057v1.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293293?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 10:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49ae7223-aa25-417b-8d5e-544facd84f69</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;HI Jared ,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Our connexion latency is solved ( it was linked to our system).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will open dedicated topics for other issue i have , and there is ... &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/293142?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 14:56:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9bc9a36-3c35-4de5-a1d4-33ec8f467ed7</guid><dc:creator>Olfox</dc:creator><description>[quote userid="73165" url="~/f/nordic-q-a/71160/twi-transfert-stuck/292962#292962"]The best method would be to do a direct advertising during start up. You should also use a short scan interval, short scan window, and a short advertising interval.&amp;nbsp;[/quote]
&lt;p&gt;HI Jared,&lt;/p&gt;
&lt;p&gt;Ok I see , most of the time my system sleeps. With accelerometre it wakes up and start to advertise. My settings are:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define APP_ADV_INTERVAL                100//fle debug300                                         /**&amp;lt; The advertising interval (in units of 0.625 ms. This value corresponds to 187.5 ms). */
#define APP_ADV_DURATION                1000 //180 00 :180sec , 100 :1sec            /**&amp;lt; The advertising duration (180 seconds) in units of 10 milliseconds. */

#define APP_BLE_OBSERVER_PRIO           3                                           /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */
#define APP_BLE_CONN_CFG_TAG            1                                           /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(10, UNIT_1_25_MS)            /**&amp;lt; Minimum acceptable connection interval (0.1 seconds). */
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(20, UNIT_1_25_MS)            /**&amp;lt; Maximum acceptable connection interval (0.2 second). */
#define SLAVE_LATENCY                   0                                           /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)             /**&amp;lt; Connection supervisory timeout (4 seconds). */

#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000)                       /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000)                      /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                           /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */

#define SEC_PARAM_BOND                  1                                           /**&amp;lt; Perform bonding. */
#define SEC_PARAM_MITM                  1                                           /**&amp;lt; Man In The Middle protection not required. */
#define SEC_PARAM_LESC                  0                                           /**&amp;lt; LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS              0                                           /**&amp;lt; Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_DISPLAY_ONLY                        /**&amp;lt; No I/O capabilities. */
#define SEC_PARAM_OOB                   0                                           /**&amp;lt; Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE          7                                           /**&amp;lt; Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE          16                                          /**&amp;lt; Maximum encryption key size. */

#define DEAD_BEEF                       0xDEADBEEF    
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have to admit i&amp;#39;m sure of what is doing what, that could explain the time to connect also. Do you think i can improve some of these setting to be more efficient ? What could be the impact in terme of consumption increasing?&lt;/p&gt;
&lt;p&gt;I join you a sniffer trace :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/with_5F00_nrfConnect.pcapng"&gt;devzone.nordicsemi.com/.../with_5F00_nrfConnect.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292962?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 15:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2e42613-2828-42dd-a15f-10b894f1107e</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Aha, I understand. So, the data length can be changed by either the peripheral itself or by the peer. I assume that the app acts a central and would therefore have the final say regarding the connection parameters. A sniffer trace would clarify which device that asks for the change in data length.&amp;nbsp; The benefit of a small MTU is that it has less chance of interference. Interference would cause you to re-transmit the whole data pack, which is not good if you have a large data pack such as 247 bytes. It&amp;#39;s therefore typical that the data length changes accordingly to the size of the data that is sent.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If you referring to the application timer, then It won&amp;#39;t generate any events after you have stopped it. Yes, the safest would be to stop the timer and initialize it again with new timer period, and then restart it.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Ok&lt;/li&gt;
&lt;li&gt;The best method would be to do a direct advertising during start up. You should also use a short scan interval, short scan window, and a short advertising interval.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292818?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 07:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99b51ff2-66f1-47b8-9bfd-3b3fd26981d4</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;1. In the log you see that MTU is set to 247, but then, it go back to 27. It has no effect and works, but i&amp;#39;m surprised to see this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Good if Timer will not generate interrupt once stopped. I have read it will go until the end ( but may be without generate int). In fact, i can change the timer period on the fly by writing the characteristic, even&amp;nbsp; when it is running. So, to avoid changing the variable period on the fly while timer is running, my idea was to stopped the timer, update the variable, and start the timer again. Is it the good way to do or if I change the timer period variable while it is running it will just take into account the new value after interupt ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3.Yes invalid error was linked to advertise while it is advertising, my state machine was not robust. It depends on advertising timeout setting&amp;nbsp; and i didn&amp;#39;t reach adevertising timeout that i start a new one...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4.New question: I have a lot of trouble to connect fast. It always take 2 or 3 second with nrf connect, and even worth with our custom app where it could take 6 or 7 second resulting of no connecxion and advertising timeout when i set advertising timeout to 5sec. As now i have sniffer, how can i improve&amp;nbsp;this connexion time (ideally in one second max) or how can i check how is the slowest on my systeme ?&lt;/p&gt;
&lt;p&gt;Thank you !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292743?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 15:59:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef316037-ce7c-421b-8e6f-75d6aecf9063</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve read through your recent replies but I&amp;#39;m not sure what to conclude. It seems that you have solved some of the issues but still have some questions you would like to get answered:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Olfox"]&lt;p&gt;Q1:But when i&amp;#39;m looking the log i see this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;I can&amp;#39;t see that the log is actually reporting any errors? Anything specifically about it you were wondering about?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Olfox"]&lt;p&gt; In my characteristics, i update timer periode by first stopping, change variable, and start again. It seems to not generate interupt anymore. After using stopped timer function, isa&amp;nbsp; last interupt rasied before to be totally inactive ? In that case it will be dangerous because when i stop a timer, i also switch off sensors, so if a last interupt occurs after switch off, it will not be good at all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Concerning the TWI issue, i think it was a side effect of all this combinaison of problems and was certainly not directly linked to this. I also avod to try to communicate with this missing device by searching for it one time a initialisation step. If missing, all communication with it will not be done in all code, to avoid wasting time and getting errors. It will also never be hot plugged so no problem.&lt;/p&gt;
&lt;p&gt;For the product with the sensors, i will try to re create issu by removing it once in communication to see if program get stucked in case of nack of adress or data because i dont like to let a while like this that coud block all the system...&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;I&amp;#39;m not sure if I understood this correctly. The application timer will not generate another interrupt after the timer has been stopped.&amp;nbsp;&lt;/p&gt;
[quote user="Olfox"] concerning disconnexion, i was responsible of it with the fw. Our app set a field that toogle the product in a mode where we disconnect all connexion and advertise each minute, then sleep again. I was juste not aware that this field was set by our app at this time ... lol. How is it possible to know if we are advertising, is here a function to know it ? or if we are advertising, to relaunch an advertising sequence ( exemple, i&amp;#39;m advertising for already 8sec/10 after timeout, i want to restart adverting for 10sec without waiting the end of the first sequence without triggered this error that i have at the moment:&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Then you have to stop advertising, and then start it again with a new set of advertising parameters that has the new timeout. Trying to start advertising when it&amp;#39;s already advertising will result in a INVALID STATE error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;happy to help! &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;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292579?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 23:21:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d7a452a-cea2-46bb-be36-0af14b69e5de</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Ok i found the issue, it came from breakpoint ... i had to clear all breakpoint. Now i can debug without generating each time the setting.page.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also make progress. There is a link&amp;nbsp;between&amp;nbsp;disconnection and the fact that our app try to write more than 20bytes into our characteristic. on this we do some stroke to managae each field individually and update some variable.&lt;/p&gt;
&lt;p&gt;So i have updated the NRF_SDH_BLE_GATT_MAX_MTU_SIZE in file sdk_config.h&lt;/p&gt;
&lt;p&gt;And i get an error on&amp;nbsp;build:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612301677313v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;After updating the RAM start and size:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612301822154v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;receive all my char !&lt;/p&gt;
&lt;p&gt;Q1:But when i&amp;#39;m looking the log i see this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612302169465v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It works anyway...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Q2: In my characteristics, i update timer periode by first stopping, change variable, and start again. It seems to not generate interupt anymore. After using stopped timer function, isa&amp;nbsp; last interupt rasied before to be totally inactive ? In that case it will be dangerous because when i stop a timer, i also switch off sensors, so if a last interupt occurs after switch off, it will not be good at all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Concerning the TWI issue, i think it was a side effect of all this combinaison of problems and was certainly not directly linked to this. I also avod to try to communicate with this missing device by searching for it one time a initialisation step. If missing, all communication with it will not be done in all code, to avoid wasting time and getting errors. It will also never be hot plugged so no problem.&lt;/p&gt;
&lt;p&gt;For the product with the sensors, i will try to re create issu by removing it once in communication to see if program get stucked in case of nack of adress or data because i dont like to let a while like this that coud block all the system...&lt;/p&gt;
&lt;p&gt;Q3: concerning disconnexion, i was responsible of it with the fw. Our app set a field that toogle the product in a mode where we disconnect all connexion and advertise each minute, then sleep again. I was juste not aware that this field was set by our app at this time ... lol. How is it possible to know if we are advertising, is here a function to know it ? or if we are advertising, to relaunch an advertising sequence ( exemple, i&amp;#39;m advertising for already 8sec/10 after timeout, i want to restart adverting for 10sec without waiting the end of the first sequence without triggered this error that i have at the moment:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612308076742v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for your help Jared, Nordic is really the best for support , i don&amp;#39;t regret my choice to move from NXP to you :D&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292554?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 18:21:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a99ba50-7b58-4ba9-8bab-8545f6a6b21a</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;i remeber i add to set ram and flash adress in the past , may be it has move?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;here my&amp;nbsp;bootloader that i flash:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612290017003v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;here section settings of the bootloader&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612290070695v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;i&amp;#39;m working with nrf52833&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here when i flash my application:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612290263539v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m really not confident with dfu bootloader, setting , checked signature, CRC etc ... it is a bit a weak point that i need to work on&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292553?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 18:15:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ce86508-0eb2-41d2-ab95-85c36bc31d48</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. I have installed the ble siniffer on my 10100 dev kit (52833 but seems to work with 52832 .hex)&lt;/p&gt;
&lt;p&gt;------------&lt;/p&gt;
&lt;p&gt;But i&amp;#39;m totally stuck at the moemnt with bootloader. As i&amp;#39;m using dfu, i have bootloader dfu . But as it checked every time crc i decided to move on debug bootloader that normally doesn&amp;#39;t check. But now i&amp;#39;m unable to debug my fw, it is programmed, but normally after that there is a breakpoint in the main entry point but here nothing happen, the programm seems to run but nothing happen i can&amp;#39;t debug anymore...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Even when i come back on secure bootloader and generate settings, i can&amp;#39;t start debugging my fw.&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-------------&lt;/p&gt;
&lt;p&gt;For the TWI bug, in fact i realise it happen on the board where the sensor is not connected ( i have to type of board , but one software). So when error happen, it jump to adress NACK in the handler twi, but goes nowhere after that. May be should i clear an error flag or something?&lt;/p&gt;
&lt;p&gt;------------&lt;/p&gt;
&lt;p&gt;I will ry your proposal a soon as i&amp;#39;m able to debug again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292420?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 09:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f86f118b-840e-4e9d-b747-ebce55d069a1</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Olfox"]&lt;p&gt;With our app, it seems to read the characteristic and then, make occurs a disconnection of the nrf52833.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;So the application is probably hitting an error when you try to write to the characteristic from your own custom app. This error is probably causing&amp;nbsp;&lt;span&gt;sd_ble_gap_disconnect() to be called somewhere in your code resulting in the disconnect. This is somehow affecting the TWI communication.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What I would like to know about the ble communication is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What kind of error is causing the disconnection?&amp;nbsp;Set a breakpoint in the ble handler where you call sd_ble_gap_disconnect() and check what event that is causing the disconnect. Could you also take a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html?cp=9_4"&gt;nRF Sniffer trace&lt;/a&gt; while you reproduce the error? Upload the trace here.&amp;nbsp;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;What is the state of the application after it has disconnected? Is it stuck in the error handler?&amp;nbsp; Does the application reset? Is it stuck somewhere else in your application? This can easily be verified by using a debugger.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What I would like to know about the TWI&amp;nbsp;communication is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you reset the Nordic IC. Does the TWI slave respond again?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Could you upload a trace of the SDA and SCL line when application is stuck?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Could you print something in the beginning of the&amp;nbsp;twi_handler() before the switch case and see if the handler is called at all after the disconnection.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;You&amp;#39;re missing a break; in the error handler in the&amp;nbsp;NRF_DRV_TWI_EVT_DATA_NACK case.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As you may understand, I need to know a lot more of what exactly happens to find the root cause. I would appreciate it if you answered the questions above to the best of your capability.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;br /&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292323?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 16:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30382f1a-9b01-436b-a6c3-6ab0eb3b4e77</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Hi Jared, thanks for fast reply.&lt;/p&gt;
&lt;p&gt;There is no problem with communication with the sensor. I can connect, disconnect without having issue with communication in &amp;quot;normal mode&amp;quot;.&lt;/p&gt;
&lt;p&gt;Good point is that i can reproduce on demand the problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It happens always , when with our own flutter app, we read a certain characteristic.&lt;/p&gt;
&lt;p&gt;With nrfConnect android app, it never happens by reading this same caracteristic.&lt;/p&gt;
&lt;p&gt;With our app, it seems to read the characteristic and then, make occurs a disconnection of the nrf52833.&lt;/p&gt;
&lt;p&gt;When we read other characteristics, no problem.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m surprised, first because with nrfConnect there is no problem, and then, why does it produce an effect on twi. It is stucked on this while waiting for the flag to be set by the TWI Event Handler, that in the three possible case, should set this flag to true, event if there is an error:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void twi_handler(nrf_drv_twi_evt_t const * p_event, void * p_context)
{
    switch (p_event-&amp;gt;type)
    {
        case NRF_DRV_TWI_EVT_DONE:
            if (p_event-&amp;gt;xfer_desc.type == NRF_DRV_TWI_XFER_RX)
            {
               m_xfer_done = true;
            }
            m_xfer_done = true;
            break;
        case NRF_DRV_TWI_EVT_DATA_NACK:
            NRF_LOG_ERROR(&amp;quot;i2C data NACK&amp;quot;);
            m_xfer_done = true;                 //to not be stuck, even if there is an issue
       case NRF_DRV_TWI_EVT_ADDRESS_NACK:
            NRF_LOG_ERROR(&amp;quot;i2C adress NACK&amp;quot;);
            m_xfer_done = true;                //false to adresse means no device connected
            m_xfer_ack_adress_ok = false;
            break;
        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s mean, when the disconnect event occurs, i&amp;#39;m not able to reach the TWI event anymore.&lt;/p&gt;
&lt;p&gt;Witch register can i checked to understand the problem ? Could be a priority that avoid TWI to create an event or something like this may be ?&lt;/p&gt;
&lt;p&gt;thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI transfert stuck</title><link>https://devzone.nordicsemi.com/thread/292265?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 14:05:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfb6ca1a-2e82-4348-8149-435f6922b31b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can always use the &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/application-timer-tutorial"&gt;application timer library&lt;/a&gt;&amp;nbsp;and start a timer before the loop that sets the flag to true after a certain time has elapsed. However, I think it would be better to find the root cause of the issue.&amp;nbsp;Is the application resetting when the the ble disconnects? Could it be that the I2C bus is left in a invalid state such as &lt;a href="https://www.i2c-bus.org/i2c-primer/analysing-obscure-problems/blocked-bus/"&gt;this&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>