This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7e28b6090ba97687d05723c5477f69dd120359b8
Author: Bowen Wang <[email protected]>
AuthorDate: Fri Feb 21 22:19:33 2025 +0800

    drivers/serial/uart_rpmsg: flush the tx buffer once the endpoint is bound
    
    Data written to the tty before the endpoint is bound to the remote
    side stays in the tx buffer until the next write. The nsh prompt is
    written that way, so it does not show up when cu connects. Start a tx
    transfer from the ns_bound callback.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/serial/uart_rpmsg.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/serial/uart_rpmsg.c b/drivers/serial/uart_rpmsg.c
index 9055b9e3bc7..17fd7d143dd 100644
--- a/drivers/serial/uart_rpmsg.c
+++ b/drivers/serial/uart_rpmsg.c
@@ -321,6 +321,13 @@ static bool uart_rpmsg_txempty(FAR struct uart_dev_s *dev)
   return true;
 }
 
+static void uart_rpmsg_ns_bound(struct rpmsg_endpoint *ept)
+{
+  FAR struct uart_dev_s *dev = ept->priv;
+
+  uart_rpmsg_dmatxavail(dev);
+}
+
 static void uart_rpmsg_device_created(FAR struct rpmsg_device *rdev,
                                       FAR void *priv_)
 {
@@ -331,6 +338,7 @@ static void uart_rpmsg_device_created(FAR struct 
rpmsg_device *rdev,
   if (strcmp(priv->cpuname, rpmsg_get_cpuname(rdev)) == 0)
     {
       priv->ept.priv = dev;
+      priv->ept.ns_bound_cb = uart_rpmsg_ns_bound;
       snprintf(eptname, sizeof(eptname), "%s%s",
                UART_RPMSG_EPT_PREFIX, priv->devname);
       rpmsg_create_ept(&priv->ept, rdev, eptname,

Reply via email to