This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

printf and nrf_serial_write

Hi,

      In previous project, we enable RETARGET flag and include app_uart.h. After uart init we can use printf function to print some debug message very well.

Now, we have new project, this project need to exchange some data with other MCU by UART port. So I want to use nrf_serial function like nrf_serial_write()

But unfortunately I can't use printf. Below is my source code 

I can send Hello........to PC but I can't see "Sense App Start"

//Open real com port
    err_code = nrf_serial_init(&serial_uart, &m_uart0_drv_config, &serial_config);
    APP_ERROR_CHECK(err_code);
    //uart_init();
    
    
    static char tx_message[] = "Hello nrf_serial!\n\r";

    err_code = nrf_serial_write(&serial_uart,
                           tx_message,
                           strlen(tx_message),
                           NULL,
                           NRF_SERIAL_MAX_TIMEOUT);
    
        
    printf("Sense App Start\r\n");
 

Is there any way I can use both?

Thank you.

John.

Related