<?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>bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100687/bt_nus_send-failed-with-error-code-0xffffff80</link><description>The following are log messages. What is meaning of error code 0xffffff80? How can I solve this issue? 
 # SEGGER J-Link RTT Viewer V7.88e Terminal Log File # Compiled: 16:33:38 on May 31 2023 # Logging started @ 12 Jun 2023 14:24:29 00&amp;gt; *** Booting Zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Jun 2023 13:38:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100687/bt_nus_send-failed-with-error-code-0xffffff80" /><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/431800?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2023 13:38:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79a60821-a24d-4fa3-9fb8-e787fbbc09ad</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/431761?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2023 12:01:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0641b6ab-18a8-4838-87e3-ea5bcfd1443e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sounds very similar to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/90449/problem-with-async-uart-example-from-peripheral_uart"&gt;this &lt;/a&gt;thread.&lt;/p&gt;
&lt;p&gt;Make sure to set the callback handler&amp;nbsp;set. It seems like you are passing NULL to&amp;nbsp;uart_callback_set&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430892?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 06:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c3c57e1-4a4d-46e1-99a9-8a02f6327c2a</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2766.minimal_5F00_log_5F00_nus.zip"&gt;devzone.nordicsemi.com/.../2766.minimal_5F00_log_5F00_nus.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430891?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 06:43:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c264e981-cfbb-426d-87f1-8025b561563d</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0333.custom_5F00_nrf52832.zip"&gt;devzone.nordicsemi.com/.../0333.custom_5F00_nrf52832.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430888?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 06:38:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa5923fb-b130-4708-b34e-0b75f1eff2ff</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your suggestion! I have integrated source code of&amp;nbsp;peripheral_uart project. But now I encounter another problem. That is &amp;quot;&amp;lt;err&amp;gt; nus: Cannot initialize UART callback -88&amp;quot;. What is meaning of error code&amp;nbsp;&lt;span&gt;-88? And how can I fix this issue?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The following is log messages.&lt;/p&gt;
&lt;p&gt;00&amp;gt; *** Booting Zephyr OS build v3.2.99-ncs2 ***&lt;br /&gt;00&amp;gt; Starting button Test example&lt;br /&gt;00&amp;gt; configure AFE4900_RDY pin as input&lt;br /&gt;00&amp;gt; configure AFE4900_RESET pin as output&lt;br /&gt;00&amp;gt; configure POWER_UP pin as output&lt;br /&gt;00&amp;gt; configure LED_G pin as output&lt;br /&gt;00&amp;gt; set POWER_UP pin&lt;br /&gt;00&amp;gt; clear AFE4900_RESET pin, 0&lt;br /&gt;00&amp;gt; set AFE4900_RESET pin&lt;br /&gt;00&amp;gt; [00:00:00.010,986] &amp;lt;err&amp;gt; nus: Cannot initialize UART callback -88&lt;br /&gt;00&amp;gt; btInit() e&lt;br /&gt;00&amp;gt; bt_passkey_set(123456)&lt;br /&gt;00&amp;gt; _btReady(0) e&lt;br /&gt;00&amp;gt; Bluetooth initialized&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Function that prints&amp;nbsp;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;lt;err&amp;gt; nus: Cannot initialize UART callback -88&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;int uart_init(void) {&lt;br /&gt; int err;&lt;br /&gt; int pos;&lt;br /&gt; uart_data_t *rx;&lt;br /&gt; uart_data_t *tx;&lt;/p&gt;
&lt;p&gt;if (!device_is_ready(uart)) {&lt;br /&gt; printk(&amp;quot;uart device isn&amp;#39;t ready\n&amp;quot;);&lt;br /&gt; return -ENODEV;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (IS_ENABLED(CONFIG_USB_DEVICE_STACK)) {&lt;br /&gt; err = usb_enable(NULL);&lt;br /&gt; if (err &amp;amp;&amp;amp; (err != -EALREADY)) {&lt;br /&gt; LOG_ERR(&amp;quot;Failed to enable USB&amp;quot;);&lt;br /&gt; return err;&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;rx = k_malloc(sizeof(*rx));&lt;br /&gt; if (rx) {&lt;br /&gt; rx-&amp;gt;len = 0;&lt;br /&gt; } else {&lt;br /&gt; return -ENOMEM;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;k_work_init_delayable(&amp;amp;uart_work, uart_work_handler);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; if (IS_ENABLED(CONFIG_BT_NUS_UART_ASYNC_ADAPTER) &amp;amp;&amp;amp; !uart_test_async_api(uart)) {&lt;br /&gt; /* Implement API adapter */&lt;br /&gt; uart_async_adapter_init(async_adapter, uart);&lt;br /&gt; uart = async_adapter;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;err = uart_callback_set(uart, uart_cb, NULL);&lt;br /&gt; if (err) {&lt;br /&gt; k_free(rx);&lt;br /&gt; LOG_ERR(&amp;quot;Cannot initialize UART callback %d&amp;quot;, err);&lt;br /&gt; return err;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (IS_ENABLED(CONFIG_UART_LINE_CTRL)) {&lt;br /&gt; LOG_INF(&amp;quot;Wait for DTR&amp;quot;);&lt;br /&gt; while (true) {&lt;br /&gt; uint32_t dtr = 0;&lt;/p&gt;
&lt;p&gt;uart_line_ctrl_get(uart, UART_LINE_CTRL_DTR, &amp;amp;dtr);&lt;br /&gt; if (dtr) {&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt; /* Give CPU resources to low priority threads. */&lt;br /&gt; k_sleep(K_MSEC(100));&lt;br /&gt; }&lt;br /&gt; LOG_INF(&amp;quot;DTR set&amp;quot;);&lt;br /&gt; err = uart_line_ctrl_set(uart, UART_LINE_CTRL_DCD, 1);&lt;br /&gt; if (err) {&lt;br /&gt; LOG_WRN(&amp;quot;Failed to set DCD, ret code %d&amp;quot;, err);&lt;br /&gt; }&lt;br /&gt; err = uart_line_ctrl_set(uart, UART_LINE_CTRL_DSR, 1);&lt;br /&gt; if (err) {&lt;br /&gt; LOG_WRN(&amp;quot;Failed to set DSR, ret code %d&amp;quot;, err);&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;tx = k_malloc(sizeof(*tx));&lt;/p&gt;
&lt;p&gt;if (tx) {&lt;br /&gt; pos = snprintf(tx-&amp;gt;data, sizeof(tx-&amp;gt;data), &amp;quot;Starting Nordic UART service example\r\n&amp;quot;);&lt;br /&gt; if ((pos &amp;lt; 0) || (pos &amp;gt;= sizeof(tx-&amp;gt;data))) {&lt;br /&gt; k_free(rx);&lt;br /&gt; k_free(tx);&lt;br /&gt; LOG_ERR(&amp;quot;snprintf returned %d&amp;quot;, pos);&lt;br /&gt; return -ENOMEM;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;tx-&amp;gt;len = pos;&lt;br /&gt; } else {&lt;br /&gt; k_free(rx);&lt;br /&gt; return -ENOMEM;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;err = uart_tx(uart, tx-&amp;gt;data, tx-&amp;gt;len, SYS_FOREVER_MS);&lt;br /&gt; if (err) {&lt;br /&gt; k_free(rx);&lt;br /&gt; k_free(tx);&lt;br /&gt; LOG_ERR(&amp;quot;Cannot display welcome message (err: %d)&amp;quot;, err);&lt;br /&gt; return err;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;err = uart_rx_enable(uart, rx-&amp;gt;data, sizeof(rx-&amp;gt;data), 50);&lt;br /&gt; if (err) {&lt;br /&gt; LOG_ERR(&amp;quot;Cannot enable uart reception (err: %d)&amp;quot;, err);&lt;br /&gt; /* Free the rx buffer only because the tx buffer will be handled in the callback */&lt;br /&gt; k_free(rx);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;return err;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430727?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c59c23f-9e31-44ed-b520-3c574f500b81</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;span&gt;k_fifo_put(&amp;amp;fifo_uart_rx_data, buf) is called in uart_cb(). But I don&amp;#39;t have any idea when&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;uart_cb() is called?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;static int uart_init(void)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;err = uart_callback_set(uart, uart_cb, NULL);&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static void uart_cb(const struct device *dev, struct uart_event *evt, void *user_data)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;case UART_RX_BUF_RELEASED:&lt;br /&gt; LOG_DBG(&amp;quot;UART_RX_BUF_RELEASED&amp;quot;);&lt;br /&gt; buf = CONTAINER_OF(evt-&amp;gt;data.rx_buf.buf, struct uart_data_t,&lt;br /&gt; data);&lt;/p&gt;
&lt;p&gt;if (buf-&amp;gt;len &amp;gt; 0) {&lt;br /&gt; k_fifo_put(&amp;amp;fifo_uart_rx_data, buf);&lt;br /&gt; } else {&lt;br /&gt; k_free(buf);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;break;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430708?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a292829e-75dc-4e3f-9f38-717e9d1ec395</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Establishing the connection is not the problem. Your application that you shared can already connect to the central. The issue fencing your bt_nus_send with logic that would not unnecessarily try to send the notification when not needed. It also seems like you have no proper trigger to send the notification.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;In our samples&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;void ble_write_thread(void)
{
	/* Don&amp;#39;t go any further until BLE is initialized */
	k_sem_take(&amp;amp;ble_init_ok, K_FOREVER);

	for (;;) {
		/* Wait indefinitely for data to be sent over bluetooth */
		struct uart_data_t *buf = k_fifo_get(&amp;amp;fifo_uart_rx_data,
						     K_FOREVER);

		if (bt_nus_send(NULL, buf-&amp;gt;data, buf-&amp;gt;len)) {
			LOG_WRN(&amp;quot;Failed to send data over BLE connection&amp;quot;);
		}

		k_free(buf);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;you see that we use k_fifos to both change the context, serialize data and not call notification when there is no data. You have that part missing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are few threads in your application that I do not understand as well. I would recommend you to take the peripheral_uart sample as template and build your code on top of it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430704?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:11:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:491385ee-aafb-46a3-9a4f-879071caccbb</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;_gBtNusThread is created after&amp;nbsp;&lt;span&gt;connected() callback function is called. Do you mean no connection exist even&amp;nbsp;connected() callback function is called?&amp;nbsp;Do you have sample code for&amp;nbsp;establishing a connection?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BT_CONN_CB_DEFINE(conn_callbacks) = {&lt;br /&gt; .connected = connected,&lt;br /&gt; .disconnected = disconnected,&lt;br /&gt;#ifdef CONFIG_BT_NUS_SECURITY_ENABLED&lt;br /&gt; .security_changed = security_changed,&lt;br /&gt;#endif&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;static void connected(struct bt_conn* conn, uint8_t err) {&lt;br /&gt; char addr[BT_ADDR_LE_STR_LEN];&lt;/p&gt;
&lt;p&gt;if (err) {&lt;br /&gt; printk(&amp;quot;Connection failed (err %u)&amp;quot;, err);&lt;br /&gt; return;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));&lt;br /&gt; printk(&amp;quot;Connected %s\n&amp;quot;, addr);&lt;/p&gt;
&lt;p&gt;_gCurrentConn = bt_conn_ref(conn);&lt;/p&gt;
&lt;p&gt;const int ret = bt_conn_set_security(conn, BT_SECURITY_L2);&lt;br /&gt; if (ret != 0) {&lt;br /&gt; printk(&amp;quot;Failed to set security (err %d)\n&amp;quot;, ret);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; btNusSetState(BT_NUS_STATE_CONNECT);&lt;br /&gt; btNusThreadCreate();&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430700?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:04:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0aaef63-6bf8-4296-a21c-1210cdbb0101</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It looks like you are trying to send a notification even without any connection established.&lt;br /&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/pastedimage1686654028219v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I do not understand the state machine of your application. You cannot just loop sending the notification without establishing a connection. You also need to wait for the notifications to be enabled.&lt;/p&gt;
&lt;p&gt;If you look at the&amp;nbsp;nrf\subsys\bluetooth\services\nus.c you see that bt_nus_send receives the data from the buffer allocated in the message queue. This is a correct way to to create a consumer/producer situation for the data to be handled. If you have problem designing an architecture for your application, then I strongly recommend you to take the NUS sample as a template and build on the top of it. I am not sure why you need to create your own library for NUS if this is already handled by our service library in&amp;nbsp;nrf\subsys\bluetooth\services\nus.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430527?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 13:51:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91cfb639-9f50-4d2a-ba87-9a2f1d4c9804</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your great support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430419?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48cea1f5-b066-420e-a804-76801ba63388</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I managed to compile your application, I will try to debug this later today and comeback to you when I have some findings to share.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430410?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 09:28:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46c727b2-8e77-47eb-b80b-d62c7a8f004b</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;ret = bt_nus_send(btGetConnectHandle(), sbuf, len); // return error code -22&lt;/p&gt;
&lt;p&gt;ret = bt_nus_send(NULL, sbuf, len); // return error code 0xffffff80&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can see code snippet by doing the following procedure.&lt;/p&gt;
&lt;p&gt;1. Unzipping 8055.minimal_log_nus.zip&lt;/p&gt;
&lt;p&gt;2. Checking function _btNusSend() of src/bt_nus.c&lt;/p&gt;
&lt;p&gt;uint32_t _btNusSend(void) {&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = bt_nus_send(btGetConnectHandle(), sbuf, len);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ret &amp;lt; 0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printk(&amp;quot;bt_nus_send(%p, %p, len=%u) failed, %d\n&amp;quot;, btGetConnectHandle(), sbuf, len, ret);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ret;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printk(&amp;quot;bt_nus_send(%p, %p, len=%u) ok\n&amp;quot;, btGetConnectHandle(), sbuf, len);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430393?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 08:46:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63a2c02e-4f4a-4a1f-bb4e-3620efef0381</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;In your &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100691/bt_nus_send-0x20001db0-len-128-failed-wirh-error-code--22"&gt;other &lt;/a&gt;thread you have&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; BT NUS thread starts running
00&amp;gt; bt_nus_send(0x20001db0, len=128) failed, -22&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Why do you have two different prints giving different error value in your two different runs?&lt;/p&gt;
&lt;p&gt;-22 means&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/lib/libc/minimal/include/errno.h#L61"&gt;&lt;span&gt;EINVAL&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;22&lt;/span&gt;&lt;/a&gt;&lt;span&gt; &amp;nbsp; /* Invalid argument */&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You need to check your arguments sent to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/services/nus.html#c.bt_nus_send"&gt;bt_nus_send &lt;/a&gt;function to see if they are valid arguments as documented.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There is&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/89346/best-way-to-debug-bt_nus_send"&gt; another thread&lt;/a&gt; that helps you with similar issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I do not see any source files in the project you attached. Can you please provide the code snippet for bt_nus_send so that I can focus on the contents of what you are sending through nus.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430351?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 06:42:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f27e4f56-6a52-4572-9594-1198f0ff8ab8</guid><dc:creator>snowuyl</dc:creator><description>&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/image_5F00_123986672_2800_2_2900_.JPG" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430350?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 06:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99db509d-33e4-4125-bbab-db3a8f1b3be9</guid><dc:creator>snowuyl</dc:creator><description>&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/4745.image_5F00_123986672.JPG" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430349?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 06:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d90c7bc-77cd-4359-b8ff-9a79f7058365</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8055.minimal_5F00_log_5F00_nus.zip"&gt;devzone.nordicsemi.com/.../8055.minimal_5F00_log_5F00_nus.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_nus_send() failed with error code 0xffffff80</title><link>https://devzone.nordicsemi.com/thread/430348?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 06:36:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc5af472-5b38-4191-b118-5e4ef3deb08b</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7673.custom_5F00_nrf52832.zip"&gt;devzone.nordicsemi.com/.../7673.custom_5F00_nrf52832.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>