Hi,
is there any Example to use the UART ? I need an monitor while the application is running, is the UART COM Port the right one for this?
Is there an example with the app_uart?
Best regards Nils
Hi,
is there any Example to use the UART ? I need an monitor while the application is running, is the UART COM Port the right one for this?
Is there an example with the app_uart?
Best regards Nils
You just need to add simple_uart.c to your project and include simple_uart.h headers.
I generally use:
simple_uart_putstring("Some text\r\n");
To send my debugging output.
If you're using the nRF51822-EK, configure the onboard USB UART with:
simple_uart_config (0, 9, 0, 11, false):
And set your baud rate on your terminal program to 38.4K and find the USB CDC serial port that should appear.
I'm embarrassed to say that I didn't even clue-in to the onboard CDC emulation at first :-/
Hope that helps.
-m
@Yalcim , connecting to printf is fairly well explained in the Keil documentation, but I don't know how to do it for GCC.
Although not a perfect solution, if you have simple_uart_putstring() working, then you can do this:
[b] uint8_t text_buffer[128];
sprintf( text_buffer, "Formatted answer %8d %8.3f\n\r",
intvar, floatvar);
simple_uart_putstring( text_buffer );[/b]