I'm migrating a project from SDK 14.2.0 to SDK 15.3.0 and using the UART (not the UARTE). I want to use the legacy UART driver. I'm hitting these errors when compiling
app_uart_fifo.c, which includes nrf_drv_uart.h:
Compiling file: app_uart_fifo.c
In file included from /usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:44:0:
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:127:13: error: unknown type name 'nrf_uarte_baudrate_t'
typedef nrf_uarte_baudrate_t nrf_uart_baudrate_t;
^~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:132:13: error: unknown type name 'nrf_uarte_error_mask_t'
typedef nrf_uarte_error_mask_t nrf_uart_error_mask_t;
^~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:135:13: error: unknown type name 'nrf_uarte_hwfc_t'
typedef nrf_uarte_hwfc_t nrf_uart_hwfc_t;
^~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:138:13: error: unknown type name 'nrf_uarte_parity_t'
typedef nrf_uarte_parity_t nrf_uart_parity_t;
^~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:139:13: error: unknown type name 'nrf_uarte_task_t'
typedef nrf_uarte_task_t nrf_uart_task_t;
^~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:140:13: error: unknown type name 'nrf_uarte_event_t'
typedef nrf_uarte_event_t nrf_uart_event_t;
^~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c: In function 'app_uart_init':
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:141:41: error: 'NRF_UARTE_PSEL_DISCONNECTED' undeclared (first use in this function); did you mean 'NRF_UART_PSEL_DISCONNECTED'?
#define NRF_UART_PSEL_DISCONNECTED NRF_UARTE_PSEL_DISCONNECTED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:217:27: note: in expansion of macro 'NRF_UART_PSEL_DISCONNECTED'
.pseltxd = NRF_UART_PSEL_DISCONNECTED, \
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:151:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:141:41: note: each undeclared identifier is reported only once for each function it appears in
#define NRF_UART_PSEL_DISCONNECTED NRF_UARTE_PSEL_DISCONNECTED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:217:27: note: in expansion of macro 'NRF_UART_PSEL_DISCONNECTED'
.pseltxd = NRF_UART_PSEL_DISCONNECTED, \
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:151:36: note: in expansion of macro 'NRF_DRV_UART_DEFAULT_CONFIG'
nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:133:41: error: 'NRF_UARTE_HWFC_DISABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_DISABLED'?
#define NRF_UART_HWFC_DISABLED NRF_UARTE_HWFC_DISABLED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:154:13: note: in expansion of macro 'NRF_UART_HWFC_DISABLED'
NRF_UART_HWFC_DISABLED : NRF_UART_HWFC_ENABLED;
^~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:134:41: error: 'NRF_UARTE_HWFC_ENABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_ENABLED'?
#define NRF_UART_HWFC_ENABLED NRF_UARTE_HWFC_ENABLED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:154:38: note: in expansion of macro 'NRF_UART_HWFC_ENABLED'
NRF_UART_HWFC_DISABLED : NRF_UART_HWFC_ENABLED;
^~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:137:41: error: 'NRF_UARTE_PARITY_INCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_INCLUDED'?
#define NRF_UART_PARITY_INCLUDED NRF_UARTE_PARITY_INCLUDED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:156:49: note: in expansion of macro 'NRF_UART_PARITY_INCLUDED'
config.parity = p_comm_params->use_parity ? NRF_UART_PARITY_INCLUDED : NRF_UART_PARITY_EXCLUDED;
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:136:41: error: 'NRF_UARTE_PARITY_EXCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_EXCLUDED'?
#define NRF_UART_PARITY_EXCLUDED NRF_UARTE_PARITY_EXCLUDED
^
/usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/uart/app_uart_fifo.c:156:76: note: in expansion of macro 'NRF_UART_PARITY_EXCLUDED'
config.parity = p_comm_params->use_parity ? NRF_UART_PARITY_INCLUDED : NRF_UART_PARITY_EXCLUDED;
^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [_build/app/app_uart_fifo.c.o] Error 1
This seems to be because NRFX_CHECK(NRFX_UART_ENABLED) evaluates to false. So I added a pragma like this:
Which gives me:
/usr/local/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy/nrf_drv_uart.h:49:9: note: #pragma message: NRFX_UART_ENABLED: (1 && (0 && 1))
#pragma message "NRFX_UART_ENABLED: " STR(NRFX_UART_ENABLED)
I have no idea where that 0 is coming from. apply_old_confog.h has only this to say about it:
My sdk_config.h is simply <SDK>/config/nrf52832/config/sdk_config.h - I don't have one in my own project. Instead I have an app_config.h in my own project and that looks like this: