<?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>When using the ble_app_uart example, &amp;quot;Failed receiving NUS message. Error 0x04. &amp;quot; appears</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112293/when-using-the-ble_app_uart-example-failed-receiving-nus-message-error-0x04-appears</link><description>Hi： 
 My environment is: nRF5_SDK_17.1.0_ddde560, keil, s113_nrf52_7.2.0_softdevice When using the ble_app_uart example, &amp;quot;Failed receiving NUS message. Error 0x04. &amp;quot; appears 
 
 After investigation, it was found that `NRF_ERROR_NO_MEM` appeared when </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Jul 2024 01:51:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112293/when-using-the-ble_app_uart-example-failed-receiving-nus-message-error-0x04-appears" /><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/492146?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 01:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7d8d984-6927-4bcd-bd52-ba76ad44c513</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Remove the serial port sending operation from `nus_data_handler` and use timer to trigger serial port sending to solve the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/491471?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2024 06:00:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd2fef1c-f70a-41af-ae21-44cc3e583437</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;During stress testing, it was found that when the Bluetooth signal was poor, the data transmission rate decreased and app_uart_put was more likely to return NRF_ERROR_NO_MEM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/490136?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2024 04:41:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:094efbbd-9746-474e-ab56-cef18df6237d</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Hi Kenneth&lt;/p&gt;
&lt;p&gt;There is one thing I didn&amp;#39;t make clear. I used app_uart_fifo.c.&lt;br /&gt;First, if I change it as you said above, the uart will lose data. So I used fifo. The code is in nRF5_SDK_17.1.0_ddde560\components\libraries\uart\app_uart_fifo.c +221 in the sdk, and it does return that the fifo is full.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t app_uart_put(uint8_t byte)
{
    uint32_t err_code;
    err_code = app_fifo_put(&amp;amp;m_tx_fifo, byte);
    if (err_code == NRF_SUCCESS)
    {
        // The new byte has been added to FIFO. It will be picked up from there
        // (in &amp;#39;uart_event_handler&amp;#39;) when all preceding bytes are transmitted.
        // But if UART is not transmitting anything at the moment, we must start
        // a new transmission here.
        if (!nrf_drv_uart_tx_in_progress(&amp;amp;app_uart_inst))
        {
            // This operation should be almost always successful, since we&amp;#39;ve
            // just added a byte to FIFO, but if some bigger delay occurred
            // (some heavy interrupt handler routine has been executed) since
            // that time, FIFO might be empty already.
            if (app_fifo_get(&amp;amp;m_tx_fifo, tx_buffer) == NRF_SUCCESS)
            {
                err_code = nrf_drv_uart_tx(&amp;amp;app_uart_inst, tx_buffer, 1);
            }
        }
    }
    return err_code;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/490119?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2024 18:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0043ba4-dc1b-49cd-a4f1-18863926a89c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Looking at the implementation of&amp;nbsp;app_uart_put() it looks like app_uart_put() changes&amp;nbsp;NRF_ERROR_BUSY to&amp;nbsp;NRF_ERROR_NO_MEM, see here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t app_uart_put(uint8_t byte)
{
    tx_buffer[0] = byte;
    ret_code_t ret =  nrf_drv_uart_tx(&amp;amp;app_uart_inst, tx_buffer, 1);
    if (NRF_ERROR_BUSY == ret)
    {
        return NRF_ERROR_NO_MEM;
    }
    ...
    ...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So that means in main() you also need to replace&amp;nbsp;NRF_ERROR_BUSY to&amp;nbsp;&lt;span&gt;NRF_ERROR_NO_MEM also. Looks like line 238 and 243 must do this change.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/490117?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2024 15:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8737260c-0c74-4a4e-9d10-9d5663c39648</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;This example is to test the Bluetooth transmission rate. The problem I am facing now is that the data received by BLE is sent through UART, and the FIFO is full, as mentioned in the title.&lt;/p&gt;
&lt;p&gt;I have tested it without changing any code, and the problem still occurs. I changed the code just to print the BLE receiving rate.&lt;/p&gt;
&lt;p&gt;This zip does have a problem, and I also tried it. You can directly use the code sent by Sigurd Hellesvik for testing.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/490075?ContentTypeID=1</link><pubDate>Sat, 22 Jun 2024 10:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78d37783-0353-4789-915c-9bce549b77be</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The zip seems to be corrupt/invalid, I am not able to open. I suggest to first verify that the example works as-is before you do any modification. I highly recommend to order yourself a DK for comparison.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489672?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2024 03:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:913d3cd3-ada6-4dd9-816b-70205ff21edb</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;This is the code I modified and used on my board. I don&amp;#39;t have a development board here. If possible, can you help me verify it? My verification logic is as follows&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:192px;max-width:571px;" src="https://devzone.nordicsemi.com/resized-image/__size/1142x384/__key/communityserver-discussions-components-files/4/pastedimage1718767538752v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/usr_5F00_ble_5F00_app_5F00_uart_5F00_throughput.zip"&gt;devzone.nordicsemi.com/.../usr_5F00_ble_5F00_app_5F00_uart_5F00_throughput.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489671?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 17:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff2f44c-189f-44cf-9838-3a62f41d0ef8</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;I tried this example and still the same problem occurs, I added the data rate print received by bluetooth&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1718729766651v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489670?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 14:28:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53bd6c7e-5f8b-4726-919e-8cd7c59c8ddd</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Sigurd Hellesvik"]Aha, so it does not appear always, just when you send a lot of data at once, right?[/quote]
&lt;p&gt;Here is an example for sending a lot of data via the NUS sample:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8865.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip"&gt;devzone.nordicsemi.com/.../8865.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See that to learn how to increase performance.&lt;/p&gt;
[quote user="guojf"]By the way, what could be the reason why ncs cannot be downloaded?[/quote]
&lt;p&gt;This can happen in China due to firewall issues i think&lt;br /&gt;Try to &lt;a href="https://www.nordicsemi.com/About-us/Contact-Us"&gt;Contact&lt;/a&gt; your local sales people. They may have some tips to how to fix this, as they are in the same country.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489669?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 09:58:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e00f4958-ea13-485e-bf9e-6e077722f6ff</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;By the way, what could be the reason why ncs cannot be downloaded?&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;recover and&amp;nbsp;readregs is ok&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/8836.pastedimage1718704629861v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7331.pastedimage1718704668869v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489668?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 09:37:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:838d1082-1a17-4d69-bcfe-4adc941550f2</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Yes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489667?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 09:27:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa8064cd-bbb9-47d5-a8f7-303273e4b57f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Aha, so it does not appear always, just when you send a lot of data at once, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489666?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 07:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e0a5d1a-3461-408e-8cf3-9e1cef3493f5</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;By the way, I also changed the connection interval&lt;/p&gt;
&lt;p&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)&amp;nbsp;&lt;br /&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489665?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 07:49:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34e23172-7a4e-41a3-ab17-1f00330bdb61</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Sometimes it even appears at around 8KB/s&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489664?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 07:44:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c192954-8871-4790-a717-fab647a27033</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;To verify this problem, I used the example, changed the pin of UART, enabled UARTE, and realized the transparent transmission between BLE&amp;lt;-&amp;gt;UART&amp;lt;-&amp;gt;CP2102&amp;lt;-&amp;gt;PC.&lt;/p&gt;
&lt;p&gt;Deleted the code related to button and LED, and checked that there was no conflict between pin and UART pin.&lt;/p&gt;
&lt;p&gt;It is easy to appear when approaching 115200bps, and it will appear during the sending and receiving process. It has never appeared when only sending or only receiving.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489663?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 07:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:589da985-717f-4986-b4d5-1ea56d17121c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Alright, lets do nRF5 then.&lt;/p&gt;
&lt;p&gt;You say your ble_app_uart example fails.&lt;br /&gt;What do you use on the other side to communicate with it?&lt;br /&gt;Did you change anything in the sample?&lt;br /&gt;Does it fail no matter how little text you send?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489662?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 07:27:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b04cfbfc-a3b9-402d-8c01-10710196bf0a</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Since yesterday, I have been trying ncs, and now I have been unable to download the code. I think it will take some time to implement the original project on ncs. If possible, I would like to solve this problem on nrf5 now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489661?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 06:45:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03268323-747f-4db6-9f4f-6eb95596b7b6</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;If you want to continue using the nRF5 SDK instead, I can help you. Just wanted to let you know that the new one is new.&lt;br /&gt;Which SDK do you choose?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489660?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 14:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68786cda-b190-440b-aa51-76553758bae9</guid><dc:creator>guojf</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Sigurd Hellesvik:&lt;/p&gt;
&lt;p&gt;Thanks for your reply. The reason why I chose nrf5sdk is that keil development is easy to use and debugging is also convenient. I have already developed a product. I will try to verify this issue using nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using the ble_app_uart example, "Failed receiving NUS message. Error 0x04. " appears</title><link>https://devzone.nordicsemi.com/thread/489659?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 11:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b121c927-6703-4b54-86a8-30d11cea3a37</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see that this is your first ticket, and that you are using the nRF5 SDK.&lt;/p&gt;
&lt;p&gt;If you do not have a reason to use this, I recommend that you use our new SDK instead, the nRF Connect SDK.&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;See the &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement" rel="noopener noreferrer" target="_blank"&gt;nRF Connect SDK and nRF5 SDK statement&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;&lt;span style="margin:0;padding:0;text-align:left;"&gt;I recommend the &lt;a href="https://academy.nordicsemi.com/" rel="noopener noreferrer" target="_blank"&gt;Nordic Developer Academy&lt;/a&gt; as an excellent place to start learning the nRF Connect SDK. &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>