This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

printf only sends a single byte?

I'm attempting to use the app_trace module. I've set it up as follows:

int main(void)
{	
    // Setup tracing. Also sets up UART.
    app_trace_init();

    app_trace_log("Starting...\r\n");

I'm using PuTTY to connect (to COM5 in my case) with the following parameters: Speed: 115200 Data bits: 8 Stop bits: 1 Parity: None Flow control: None

These should match the settings that the trace module uses in the 7.1 SDK.

My issue is that app_trace_log() sends only a single byte over the serial line ("S" in my case). Any other calls to app_trace_log() also send only the first byte of the string.

Parents
  • hi,Peter:
    app_trace_init()/app_trace_log() of SDK9.0 i test , it is ok.. in your code, please add while(1) code. otherwise, when you are printing, the main is ended. so you just print the fist char of your message...

    notice: when your print a lots of message , please give some time deleay using nrf_delay_ms(),

    int main(void) {
    // Setup tracing. Also sets up UART. app_trace_init();

    app_trace_log("Starting...\r\n");
    

    while(1){ ; // just wait..

    }

    }

Reply
  • hi,Peter:
    app_trace_init()/app_trace_log() of SDK9.0 i test , it is ok.. in your code, please add while(1) code. otherwise, when you are printing, the main is ended. so you just print the fist char of your message...

    notice: when your print a lots of message , please give some time deleay using nrf_delay_ms(),

    int main(void) {
    // Setup tracing. Also sets up UART. app_trace_init();

    app_trace_log("Starting...\r\n");
    

    while(1){ ; // just wait..

    }

    }

Children
No Data
Related