Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

When using make flash, a bunch of uart variables are reported as undeclared.

When using make flash on an SDK11 sketch, s132, pca10040, on Ubuntu 18.04, it successfully builds everything until app_uart.c; when it gets to that point, it outputs the following errors:

Compiling file: app_uart.c
In file included from /home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:14:0:
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c: In function 'app_uart_init':
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:75:31: error: 'UART0_CONFIG_PSEL_TXD' undeclared (first use in this function); did you mean 'UART_CONFIG_HWFC_Msk'?
         .pseltxd            = UART0_CONFIG_PSEL_TXD,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:75:31: note: each undeclared identifier is reported only once for each function it appears in
         .pseltxd            = UART0_CONFIG_PSEL_TXD,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:76:31: error: 'UART0_CONFIG_PSEL_RXD' undeclared (first use in this function); did you mean 'UART0_CONFIG_PSEL_TXD'?
         .pselrxd            = UART0_CONFIG_PSEL_RXD,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:77:31: error: 'UART0_CONFIG_PSEL_CTS' undeclared (first use in this function); did you mean 'UART0_CONFIG_PSEL_RXD'?
         .pselcts            = UART0_CONFIG_PSEL_CTS,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:78:31: error: 'UART0_CONFIG_PSEL_RTS' undeclared (first use in this function); did you mean 'UART0_CONFIG_PSEL_CTS'?
         .pselrts            = UART0_CONFIG_PSEL_RTS,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:80:31: error: 'UART0_CONFIG_HWFC' undeclared (first use in this function); did you mean 'UART_CONFIG_HWFC_Msk'?
         .hwfc               = UART0_CONFIG_HWFC,                                      \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:81:31: error: 'UART0_CONFIG_PARITY' undeclared (first use in this function); did you mean 'UART_CONFIG_PARITY_Pos'?
         .parity             = UART0_CONFIG_PARITY,                                    \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:82:31: error: 'UART0_CONFIG_BAUDRATE' undeclared (first use in this function); did you mean 'UART0_CONFIG_PARITY'?
         .baudrate           = UART0_CONFIG_BAUDRATE,                                  \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/drivers_nrf/uart/nrf_drv_uart.h:83:31: error: 'UART0_CONFIG_IRQ_PRIORITY' undeclared (first use in this function); did you mean 'UART0_CONFIG_PARITY'?
         .interrupt_priority = UART0_CONFIG_IRQ_PRIORITY,                              \
                               ^
/home/voltairine/Documents/SEGGER/nRF5_SDK_11.0.0_a53641a/components/libraries/uart/app_uart.c:58:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
     nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:220: recipe for target '_build/app_uart.o' failed
make: *** [_build/app_uart.o] Error 1

Basically, these seem to all be complaining that a bunch of uart-related variables were never declared. The only advice I could find was in this ticket, where it suggests to go into the corresponding nrf_drv_config.h and set UART0_ENABLED to 1. I have done this in config/ble_app_hrs_s132_pca10040/nrf_drv_config.h and still get the same error.

Parents Reply Children
No Data
Related