拓拔野 发表于 2018-3-8 11:32:23

串口能够接收到数据,但是发送数据调试助手接收不到?

本帖最后由 拓拔野 于 2018-3-8 13:05 编辑

我用nrf52832的串口外设程序直接测试,可是调试助手能够发送数据给板子,板子也能够接收到数据;但是当板子发送数据给调试助手是,调试助手却不能显示数据,程序都没有更改。请问有没有大神知道怎么办?@admin

ltkks 发表于 2018-3-8 17:23:57

流控的问题,把它关掉!

admin 发表于 2018-3-9 16:26:51

ltkks 发表于 2018-3-8 17:23
流控的问题,把它关掉!

正解

拓拔野 发表于 2018-3-9 19:37:42

ltkks 发表于 2018-3-8 17:23
流控的问题,把它关掉!

关掉还是不行,就是改成APP_UART_FLOW_CONTROL_DISABLED?

拓拔野 发表于 2018-3-9 19:41:39

admin 发表于 2018-3-9 16:26
正解

改成这个APP_UART_FLOW_CONTROL_DISABLED,串口调试助手还是不能显示

拓拔野 发表于 2018-3-9 19:59:31

本帖最后由 拓拔野 于 2018-3-9 20:01 编辑

admin 发表于 2018-3-9 16:26
正解
改过后的main函数
int main(void)
{
    LEDS_CONFIGURE(LEDS_MASK);
    LEDS_OFF(LEDS_MASK);

    uint32_t err_code;
    const app_uart_comm_params_t comm_params =
      {
          RX_PIN_NUMBER,
          TX_PIN_NUMBER,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          APP_UART_FLOW_CONTROL_DISABLED,
          false,
          UART_BAUDRATE_BAUDRATE_Baud115200
      };

    APP_UART_FIFO_INIT(&comm_params,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_error_handle,
                         APP_IRQ_PRIORITY_LOW,
                         err_code);

    APP_ERROR_CHECK(err_code);

//#ifndef ENABLE_LOOPBACK_TEST
                        
   printf("\r\nStart0000000000000154564646:\r\n");

    while (true)
    {      
      uint8_t cr;
      while(app_uart_get(&cr) != NRF_SUCCESS);
                //      printf(cr);
      while(app_uart_put(cr) != NRF_SUCCESS);
                              //LEDS_INVERT(LEDS_MASK);
                            LEDS_OFF(LEDS_MASK);
                        
      if (cr == 'q' || cr == 'Q')
      {
                                        nrf_delay_ms(500);
            printf("\n\rExit!Start0000000000000154564646\n\r");
                                        LEDS_ON(LEDS_MASK);
                                        nrf_delay_ms(500);
                                        //LEDS_ON(LEDS_MASK);
                //      printf("Start646\n\r");
    }
//#else
/*
    // This part of the example is just for testing the loopback .
    while (true)
    {
      uart_loopback_test();
    }
                */
//#endif
}
}

拓拔野 发表于 2018-3-9 20:00:08

本帖最后由 拓拔野 于 2018-3-9 20:02 编辑

ltkks 发表于 2018-3-8 17:23
流控的问题,把它关掉!
改过后的main函数
int main(void)
{
    LEDS_CONFIGURE(LEDS_MASK);
    LEDS_OFF(LEDS_MASK);

    uint32_t err_code;
    const app_uart_comm_params_t comm_params =
      {
          RX_PIN_NUMBER,
          TX_PIN_NUMBER,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          APP_UART_FLOW_CONTROL_DISABLED,
          false,
          UART_BAUDRATE_BAUDRATE_Baud115200
      };

    APP_UART_FIFO_INIT(&comm_params,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_error_handle,
                         APP_IRQ_PRIORITY_LOW,
                         err_code);

    APP_ERROR_CHECK(err_code);

//#ifndef ENABLE_LOOPBACK_TEST
                        
   printf("\r\nStart0000000000000154564646:\r\n");

    while (true)
    {      
      uint8_t cr;
      while(app_uart_get(&cr) != NRF_SUCCESS);
                //      printf(cr);
      while(app_uart_put(cr) != NRF_SUCCESS);
                              //LEDS_INVERT(LEDS_MASK);
                            LEDS_OFF(LEDS_MASK);
                        
      if (cr == 'q' || cr == 'Q')
      {
                                        nrf_delay_ms(500);
            printf("\n\rExit!Start0000000000000154564646\n\r");
                                        LEDS_ON(LEDS_MASK);
                                        nrf_delay_ms(500);
                                        //LEDS_ON(LEDS_MASK);
                //      printf("Start646\n\r");
    }
//#else
/*
    // This part of the example is just for testing the loopback .
    while (true)
    {
      uart_loopback_test();
    }
                */
//#endif
}
}

页: [1]
查看完整版本: 串口能够接收到数据,但是发送数据调试助手接收不到?