Hello there,
I am using nRD52840 PDK and nRF5_SDK_for_Thread_and_Zigbee_v1.0.0 SDK for BLE and Thread development. I am using examples from SDK. I have merged thread coap server code into 'ble_thread_dyn_template'. Which is working well. I can see simultaneous coexistence of BLE and Thread. Now I am trying to merge serial example code(examples\peripheral\serial) into merged 'ble_thread_dyn_template'. As given in serial example, I have enabled serial modules in sdk_config.h using following #defines. I also have modified Makefile accordingly.
#define NRFX_UARTE_ENABLED 1
#define NRFX_UART_ENABLED 1
#define UART_ENABLED 1
#define UART1_ENABLED 1
When I am trying to compile. It shows following error -
../../nRF5_SDK_for_Thread_and_Zigbee_v1.0.0//components/libraries/serial/nrf_serial.c: In function 'nrf_serial_init':
../../nRF5_SDK_for_Thread_and_Zigbee_v1.0.0//components/libraries/serial/nrf_serial.c:208:15: error: 'nrf_drv_uart_config_t' has no member named 'use_easy_dma'
208 | drv_config.use_easy_dma = (p_config->mode == NRF_SERIAL_MODE_DMA);
When I trace back it it goes to - nrf_drv_uart.h. Where NRF_DRV_UART_WITH_UART, NRF_DRV_UART_WITH_UARTE both are undefined.
#if defined(NRF_DRV_UART_WITH_UARTE) && defined(NRF_DRV_UART_WITH_UART)
bool use_easy_dma;
#endif
These 2 macros are defined based on other macros as following, in same file(nrf_drv_uart.h)
#if defined(UARTE_PRESENT) && NRFX_CHECK(NRFX_UARTE_ENABLED)
#define NRF_DRV_UART_WITH_UARTE
#endif
#if defined(UART_PRESENT) && NRFX_CHECK(NRFX_UART_ENABLED)
#define NRF_DRV_UART_WITH_UART
#endif
When I check - UART_PRESENT, UARTE_PRESENT both are defined in - nrf52840_peripherals.h
/* Universal Asynchronous Receiver-Transmitter */
#define UART_PRESENT
#define UART_COUNT 1
/* Universal Asynchronous Receiver-Transmitter with DMA */
#define UARTE_PRESENT
#define UARTE_COUNT 2
NRFX_UARTE_ENABLED and NRFX_UART_ENABLED both are defined in sdk_config.h
#ifndef NRFX_UARTE_ENABLED
#define NRFX_UARTE_ENABLED 1
#endif
// <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance
#ifndef NRFX_UARTE0_ENABLED
#define NRFX_UARTE0_ENABLED 0
#endif
// <o> NRFX_UARTE1_ENABLED - Enable UARTE1 instance
#ifndef NRFX_UARTE1_ENABLED
#define NRFX_UARTE1_ENABLED 0
#endif
#ifndef NRFX_UART_ENABLED
#define NRFX_UART_ENABLED 1
#endif
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
#ifndef NRFX_UART0_ENABLED
#define NRFX_UART0_ENABLED 0
#endif
Interestingly when I remove && NRFX_CHECK(NRFX_UARTE_ENABLED), && NRFX_CHECK(NRFX_UART_ENABLED) (just to check what macros are enabled) it resolves above error and goes further into compilation.
I am not able to find the reason for this issue. Is there other way I can merge serial into ble_thread_dyn_template?
Thanks,
Rajendra