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

Error : Wrong configuration.

I would like to add the UART part to my application. But I will get these errors:

..........\components\libraries\uart\app_uart_fifo.c(109): error: #20: identifier "UART0_CONFIG_PSEL_TXD" is undefined

..........\components\libraries\uart\app_uart_fifo.c(109): error: #20: identifier "UART0_CONFIG_PSEL_CTS" is undefined

etc...

They are all defined in nrf_drv_uart.h. And this file is included to the project. A did also a rebuild.

And from nrf_drv_uart.c I will get this error:

error: #35: #error directive: "Wrong configuration."

#if (defined(UARTE_IN_USE) && defined(UART_IN_USE))
// UARTE and UART combined
#define CODE_FOR_UARTE(code) if (m_cb.use_easy_dma) { code }
#define CODE_FOR_UART(code)   else { code }
#elif (defined(UARTE_IN_USE) && !defined(UART_IN_USE))
// UARTE only
#define CODE_FOR_UARTE(code) { code }
#define CODE_FOR_UART(code)
#elif (!defined(UARTE_IN_USE) && defined(UART_IN_USE))
// UART only
#define CODE_FOR_UARTE(code)
#define CODE_FOR_UART(code) { code }
#else
#error "Wrong configuration."     <--------- WHY?
#endif

Do I have to define something more, to be able to use UART?

And what means wrong configuration? I didnt change anything.

Parents
  • If you had previously not included UART at all, you will need to go to config folder under your project and find the corresponding folder to your chip (for example, nRF51 DK to PCA10028, nRF52 DK to PCA10040), and modify nrf_drv_config.h to enable UART module.

    #define UART0_ENABLED 1
    #if (UART0_ENABLED == 1)
    #define UART0_CONFIG_HWFC         NRF_UART_HWFC_DISABLED
    #define UART0_CONFIG_PARITY       NRF_UART_PARITY_EXCLUDED
    #define UART0_CONFIG_BAUDRATE     NRF_UART_BAUDRATE_115200
    #define UART0_CONFIG_PSEL_TXD 6
    #define UART0_CONFIG_PSEL_RXD 8
    #define UART0_CONFIG_PSEL_CTS 7
    #define UART0_CONFIG_PSEL_RTS 5
    #define UART0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
    #ifdef NRF52
    #define UART0_CONFIG_USE_EASY_DMA false
    //Compile time flag
    #define UART_EASY_DMA_SUPPORT     1
    #define UART_LEGACY_SUPPORT       1
    #endif //NRF52
    #endif
    
Reply Children
No Data
Related