<?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>send large amount of data over nus</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23962/send-large-amount-of-data-over-nus</link><description>I am using below code to send data over nus. If the data size is 150 bytes, it is OK. However, if the data size is 200 bytes, the nRF51822 will reset. Please tell me how to solve. I am using nRF51822 with softdevie S130. My application is based on ble_uart_app</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Aug 2017 12:46:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23962/send-large-amount-of-data-over-nus" /><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94335?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2017 12:46:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:895cc709-bcf6-40d9-a2a4-3f8983676790</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I am glad to hear you got it working!&lt;br /&gt;
Good luck with your project :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94336?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2017 08:24:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d579cea0-9707-48bf-b94b-298bab7c3477</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;Thanks all. I have solved the problem by moving the code to main function instead of uart rx interrupt routine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94334?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2017 04:22:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:561e2927-0d04-4d7f-afd0-e048d995045c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;do you ever get out of your processing loop to allow the next event to be delivered or do you just spin around and around like in the original code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94333?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2017 03:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:022535d8-cc54-4fae-b16a-2a47838fd2d9</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;I have modified the program to check for Tx complete before sending another packet. I have add below code  at static void on_ble_evt(ble_evt_t * p_ble_evt). However, I found that the BLE_EVT_TX_COMPLETE event is not generated. Please comments.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_EVT_TX_COMPLETE:
     BLETxComplete = true;
    break;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94339?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 13:10:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25f678f5-abab-4dc1-9eb9-fed19c413573</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;&amp;quot;My application is different from the image transfer demo, I have to recive all 200 byte of data from uart and do some processing before sending the data over nus&amp;quot;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see how that makes the image transfer demo incompatible. You should be able to use that in the same way.&lt;/p&gt;
&lt;p&gt;The image transfer demo is based on ble_app_uart, and the main difference is that a flag is set when the BLE_ERROR_NO_TX_PACKETS error occurs, and it will exit the while loop rather than trying to upload packets over and over.&lt;/p&gt;
&lt;p&gt;Once the BLE_GATTS_EVT_HVN_TX_COMPLETE event occurs it will then continue to send more packets, assuming there is still data left in the application buffer.&lt;/p&gt;
&lt;p&gt;It should be possible to modify the ble_app_uart application in the same way, so that you use the BLE_GATTS_EVT_HVN_TX_COMPLETE to continue the data transfer after the BLE_ERROR_NO_TX_PACKETS error occurs.&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: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94338?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 12:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d154d3fc-156a-44c8-8e2c-48aba16c4711</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;just saying &amp;quot;its urgent, help help help help help&amp;quot; doesn&amp;#39;t really do anything at all so perhaps stop that. People are trying to help you and try to remember we have way less information than you do. if the application is resetting in the code you&amp;#39;ve posted, then it&amp;#39;s APP_ERROR_CHECK(), however much you&amp;#39;re sure it&amp;#39;s not. If it&amp;#39;s resetting elsewhere, then it&amp;#39;s in code you haven&amp;#39;t posted.&lt;/p&gt;
&lt;p&gt;So firstly are you sure this is the piece of code in which you are resetting?&lt;/p&gt;
&lt;p&gt;Secondly comment out the APP_ERROR_CHECK() and see if you stop resetting.&lt;/p&gt;
&lt;p&gt;What does your hardfault handler look like, does that have a reset in it, are you going there?&lt;/p&gt;
&lt;p&gt;Chips don&amp;#39;t reset just for fun, they enter a piece of code which calls the NVIC reset function and reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94332?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 10:21:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f955604-498c-4f86-a51a-ec1d1829b78e</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;Can anyone please help in this issue? It is urgent!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94331?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 09:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f6d1743-7a12-414e-8ef5-04c96bc73936</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;12292 means BLE_ERROR_NO_TX_PACKETS, I have change NRF_ERROR_BUSY to  BLE_ERROR_NO_TX_PACKETS on above code , and run the program. Again, the program reset (not reset by  APP_ERROR_CHECK)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94330?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 09:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dd05906-88ac-4133-a9ee-f7cce45e751a</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;If I send less data using above code, again, it is OK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94328?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 09:32:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83adca4b-9058-469c-809f-14eb3cb19191</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;My application is different from the image transfer demo, I have to recive all 200 byte of data from uart and do some processing before sending the data over nus,
I have modify the code as below (based on the image transfer demo), however it return error 12292 at
ble_nus_string_send&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      if(user_m_conn_handle!=BLE_CONN_HANDLE_INVALID)
       {
         i=UserUart.RxBuf[1]+2;
         index = 0;
         while(i&amp;gt;0)
         {
           if(i&amp;gt;20)
           {

              do
              {
                  err_code = ble_nus_string_send(&amp;amp;m_nus, UserUart.RxBuf+index, 20);
                  if ( (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp; err_code!=0 )
                  {
                      APP_ERROR_CHECK(err_code);
                  }
              } while (err_code == NRF_ERROR_BUSY);
             i -= 20;
             index += 20;
           }
           else 
           {
             
              do
              {
                  err_code = ble_nus_string_send(&amp;amp;m_nus, UserUart.RxBuf+index, i);
                  if ( (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY)&amp;amp;&amp;amp; err_code!=0 )
                  {
                      APP_ERROR_CHECK(err_code);
                  }
              } while (err_code == NRF_ERROR_BUSY);
             i = 0;
             
           }
             
         }
       }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94337?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 08:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b71674d4-b17c-48be-ad02-bd97c025a897</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Take a look at the image transfer demo in github,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/nrf52-ble-image-transfer-demo"&gt;github.com/.../nrf52-ble-image-transfer-demo&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94329?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 05:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a3f856b-3f94-45b2-95eb-ae2351b1252a</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;Anyone can help in this issue. It is urgent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94341?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 03:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc1cb279-1b92-4732-8f1b-99dc402f0633</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;There are not unexpected error code input to APP_ERROR_CHECK (I have inserted break point on APP_ERROR_CHECK to check) It seems that that reset is not caused by APP_ERROR_CHECK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send large amount of data over nus</title><link>https://devzone.nordicsemi.com/thread/94340?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 03:00:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d39fd49e-b8bb-481e-95c5-c19fdd2cd272</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well which one of the APP_ERROR_CHECK()s in there are causing the reset, that will tell you what error code is being generated by your calls.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>