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

where is the "uart_legacy.h" ?

In nrf51_sdk_v4_4_1_31827\nrf51822\Source\console\console.c,

#include "uart_legacy.h"

But there is no "uart_legacy.h" file in the SDK. I have to modify to "app_uart.h" and change the uart interface functions by myself...
EVERY TIME :( !!!

  • Sorry for the late answer, but this module seems to be a leftover from an early version. It isn't really used for anything any longer, and hence isn't really tested. However, it should be fairly easy to wrap up for example simple_uart to provide more or less the same functionality currently provided by hal_uart.

  • Hi, I now use new SDK 5.1.0 and I fall into same trap. Why the console.c is still included there when uart_legacy.h and hal_uart.h is missing? It's confusing. What module do you reccomend for UART API? simple_uart.c is very basic so should I rather use app_uart.c or app_uart_fifo.c ?

  • I'd normally recommend using app_uart or app_uart_fifo, but if you just need UART for example for debug outputting, simple_uart() may be easier to get started with.

  • I will probably use it also for link with MCU so it's better if it would be buffered/non-blocking. I also want to set different baudrate and simple_uart has hardcoded 38400. So I'm going to study app_uart...

  • Well, FIFO printf() and receiving on event APP_UART_DATA_READY finally works (uuuuuiii FIFO size must be 2^n...)