<?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>Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113841/issues-in-modifying-an-nrf52840-based-peripheral-uart-program-to-host_only</link><description>I wanted to change the Peripheral UART program in the nrf samples to the host_only version, and I made some attempts. I added the following code to the prj.conf file: 
 
 In the app.overlay file I added the following code: 
 
 After build and flash, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Aug 2024 11:20:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113841/issues-in-modifying-an-nrf52840-based-peripheral-uart-program-to-host_only" /><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498443?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 11:20:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d593b186-14cb-4b53-8ea0-2db9891c7d54</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The reason is that the beacon sample doesn&amp;#39;t use UART for communicate with end user (receive and send data from UART to BLE).&lt;/p&gt;
&lt;p&gt;The code for UART in peripheral_uart doesn&amp;#39;t support hw flow control as far as I know.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498428?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 10:20:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c740a59-d06c-4dc4-9519-c0a6a2c090ae</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much. The program is functioning properly. However, during the testing of the beacon, I did not activate hw-flow-control and the program still operated normally. I would like to understand in detail when hw-flow-control is necessary.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498258?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 11:44:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cd4df05-1707-4311-aa4e-dab4684fa83a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;hw-flow-control; on uart0 could be the problem there.&amp;nbsp;&lt;br /&gt;Please try the attached projects. I compiled them using SDK v2.6.0. I tested using 2 nRF52840DKs.&amp;nbsp;&lt;br /&gt;The compiled hex files is also provided in each project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hci_5F00_uart.zip"&gt;devzone.nordicsemi.com/.../hci_5F00_uart.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/peripheral_5F00_uart_5F00_hci.zip"&gt;devzone.nordicsemi.com/.../peripheral_5F00_uart_5F00_hci.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498223?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 09:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22f57cc0-8601-44c3-8eeb-dcddb5dd2441</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;&lt;span&gt;I have verified that my pins are connected correctly. I conducted tests using the same configuration file and overlay file as you did, with no other changes made. When using the serial assistant on PC to capture the TX pin of uart1, I found no output information. My suspicion is that bt_enable() is not being executed effectively. Do you utilize the aforementioned files in the peripheral_uart routine to enable communication between host and controller? Have there been any additional modifications to either the host or controller?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; In any case, my objective is to troubleshoot why debugging isn&amp;#39;t functioning so that I can identify and address the issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498197?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 07:51:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a328a48-fbff-4ac6-8efe-a3e9939098cc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Please try to check the log (RTT log or UART log).&amp;nbsp;&lt;br /&gt;Have you made sure you connect the controller board to the right UART pins ? I used P0.28, P0.29, P0.30, P0.31 for the UART connection.&amp;nbsp;&lt;br /&gt;The 4 lights turn off most likely because it&amp;#39;s no longer assert with uart_init but it can&amp;#39;t communicate with the BLE controller board.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498168?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 06:38:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33003a9-a289-4a41-94a6-847249782dd5</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Using the configuration file and overlay file you gave me, I still can&amp;#39;t get peripheral_uart to execute as host. However, when the program flash to the development board, the situation changed. The original program will cause all 4 leds on the 52840 development board to light up, according to the program, this is the process into the error cycle. Now, all four leds are out, indicating that the program is not being executed correctly.&lt;/p&gt;
&lt;p&gt;In addition, when these two files are modified, my debug program cannot execute normally, VScode feedback information as shown in the following figure.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7838.debug_5F00_error.png" /&gt;&lt;/p&gt;
&lt;p&gt;(PS:In case the picture is not clear enough, the relevant text excerpts in the picture are as follows: You don&amp;#39;t have an extension for debugging Devicetree. Should we find a&amp;nbsp; Devicetree extension in the Marketplace? )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/498033?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 12:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cc7881b-8b9c-4096-89b8-b5317dbad778</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi hahaha,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found that it was an issue of conflicting between bt-uart and nus-uart but this time on the driver.&amp;nbsp;&lt;br /&gt;When you select&amp;nbsp;&lt;span&gt;CONFIG_BT_H4&lt;/span&gt;&lt;span&gt;=y it will select&amp;nbsp;UART_INTERRUPT_DRIVEN and this will force both UART0 and UART1 to interrupt driven. When with nus-uart it&amp;#39;s UART asynchronous.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You would need to force UART0 to asynchronous. Please add&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_0_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_0_ASYNC&lt;/span&gt;&lt;span&gt;=y&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;to the prj.conf.&amp;nbsp;&lt;br /&gt;Here is what I used:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y

CONFIG_SERIAL=y
CONFIG_UART_EXCLUSIVE_API_CALLBACKS=n
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
CONFIG_GPIO=y

# Make sure printk is printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;Nordic_UART_Service&amp;quot;
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more stack
CONFIG_MAIN_STACK_SIZE=1152
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_PRINTK=n

CONFIG_ASSERT=y
CONFIG_BT_HCI=y
CONFIG_BT_CTLR=n
CONFIG_BT_H4=y
CONFIG_UART_0_INTERRUPT_DRIVEN=n
CONFIG_UART_0_ASYNC=y&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;Overlay:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	uart1_default: uart1_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 28)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 29)&amp;gt;;
		};
		group2 {
			psels = &amp;lt;NRF_PSEL(UART_RX, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 31)&amp;gt;;
			bias-pull-up;
		};
	};

	uart1_sleep: uart1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 28)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RX, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 29)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 31)&amp;gt;;
			low-power-enable;
		};
	};
};
&amp;amp;uart0 {
	compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;115200&amp;gt;;
	hw-flow-control;
};
&amp;amp;uart1 {
    compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    current-speed = &amp;lt;1000000&amp;gt;;
    hw-flow-control;
    pinctrl-0 = &amp;lt;&amp;amp;uart1_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};
&amp;amp;spi1 {
	status = &amp;quot;disabled&amp;quot;;
};
/ {
   chosen {
		nordic,nus-uart = &amp;amp;uart0;
		zephyr,bt-uart = &amp;amp;uart1;
	
   };
};
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497952?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 08:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8840bb64-dfc5-42b1-b61e-3975b0e18fbc</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I attempted to follow your instructions, but the UART initialization function still encountered failure. I am unable to identify the exact issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I comprehend the functionality of each part of the program, but I have yet to fully grasp its underlying operation.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497938?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 07:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3307acd-b1d9-40bf-91b5-cf22d497bd47</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;I assume you are familiar with the peripehral_uart sample. You can just disable the uart part (not the hci uart) and see if it works. Make sure the hci uart uses UART1 and the normal uart uses UART0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check if you see any error log in UART/RTT. You may want to open a terminal on PC. I suspect that due to no terminal opened on PC to connect to UART0 , the sample doesn&amp;#39;t run.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497927?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 06:51:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9af213c-9c27-473f-a301-6f68d6f70475</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Using the overlay file you gave me, I can make the lbs program work as a host. But this doesn&amp;#39;t seem to work for the peripheral_uart program, and the old problems remain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497854?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 14:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c4f5d1b-798a-4f0b-ae02-187ea6ca29ed</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Have you checked if you configure the UART1 pins correctly ?&amp;nbsp;&lt;br /&gt;You would need to have RTS and CTS pin configured.&amp;nbsp;&lt;br /&gt;I did a quick test with peripheal_lbs and uart1 for HCI_UART seems to work with the following overlay:&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	uart1_default: uart1_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 28)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 29)&amp;gt;;
		};
		group2 {
			psels = &amp;lt;NRF_PSEL(UART_RX, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 31)&amp;gt;;
			bias-pull-up;
		};
	};

	uart1_sleep: uart1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 28)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RX, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 29)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 31)&amp;gt;;
			low-power-enable;
		};
	};
};

&amp;amp;uart1 {
    compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    current-speed = &amp;lt;1000000&amp;gt;;
    hw-flow-control;
    pinctrl-0 = &amp;lt;&amp;amp;uart1_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};
/ {
   chosen {
        zephyr,bt-uart = &amp;amp;uart1;
   };
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497783?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 11:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a203cbc6-afcf-4a15-9028-98326751117a</guid><dc:creator>Cookie_can</dc:creator><description>&lt;p&gt;I&amp;#39;m terribly sorry. I forgot to reply. With your help, I have successfully &lt;span&gt;made the beacon sample worked as the host&lt;/span&gt;.&lt;br /&gt;I enabled uart1 in the overlay file with the intention of using UART 1 as HCI uart. When the overlay file is configured with the following code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
	current-speed = &amp;lt;115200&amp;gt;;
	// hw-flow-control;
};
&amp;amp;uart1 {
    compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    current-speed = &amp;lt;115200&amp;gt;;
    pinctrl-0 = &amp;lt;&amp;amp;uart1_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};
/ {
    chosen {
        nordic,nus-uart = &amp;amp;uart0;
        // zephyr,console = &amp;amp;uart0;
        // zephyr,shell-uart = &amp;amp;uart0;
        zephyr,bt-uart = &amp;amp;uart1;
        zephyr,bt-c2h-uart = &amp;amp;uart1;
    };
 };
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the program has the same problem.&amp;nbsp;I don&amp;#39;t know what the problem is with this project.&lt;/p&gt;
&lt;p&gt;Looking forward to your reply.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues in Modifying an nRF52840-based Peripheral UART Program to Host_Only</title><link>https://devzone.nordicsemi.com/thread/497780?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 11:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d24175a-d1e8-4bfc-a3e3-56a78bd80bd9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please let me know if you managed to make the beacon sample worked as the host when you connect to the controller&amp;nbsp; ?&lt;br /&gt;When you use the peripheral uart there can be a conflict as the sample uses UART to receive command (from human user) and the UART you are using for HCI communication.&amp;nbsp;&lt;br /&gt;In your case you are using uart0 for both normal nus-uart and HCI UART. You should choose for example nus-uart to use UART0 and HCI uart to use UART 1.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>