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

SDK 15 legacy UART header problem

I'm converting an SDK 14.2.0 project to SDK 15.0.0, initially using the legacy layer. 

The documentation states that:

"The UART default configuration is located in sdk_config.h. If UARTE is present on the chip, the driver can be configured at runtime to support UART mode, UARTE mode, or both. The following example shows how to configure the driver to support both modes in runtime and have legacy mode as the default:

#ifdef NRF52
#define UART0_USE_EASY_DMA        false
#define UART_EASY_DMA_SUPPORT     1
#define UART_LEGACY_SUPPORT       1
#endif //NRF52

However legacy mode appears to only allow either UART_EASY_DMA_SUPPORT or UART_LEGACY_SUPPORT to be set to 1, not both. If both are set to 1, the legacy layer header apply_old_config.h sets both NRFX_UART_ENABLED and NRFX_UARTE_ENABLED to 1. This in turn means that the contents of both nrfx_uart.c and nrfx_uarte.c are compiled, and the linker then complains that there are multiple definitions of function UARTE0_UART0_IRQHandler(), which are actually renamed functions nrfx_uart_0_irq_handler() and nrfx_uarte_0_irq_handler().

If I set only one of the UART_EASY_DMA_SUPPORT and UART_LEGACY_SUPPORT options to 1, the project compiles and links without any problems.

Parents
  • Hi,

     

    The example $sdk15_path/examples/peripheral/uart/pca10040 will do exactly this, by enabling run-time usage of either UARTE or the UART peripheral.

    I am not able to reproduce this issue at my end, by setting UART_EASY_DMA_SUPPORT '1' and UART_LEGACY_SUPPORT '1'. I can confirm that both nrfx_uart.c and nrfx_uarte.c are linked in properly by looking at the .map file.

     

    Could you try the same operation with the uart example, and diff your config with the stock sdk_config.h for that example and see if there's anything that stands out?

     

    Kind regards,

    Håkon

     

  • Hi  Håkon,

    I want back to my SDK 14 project and converted it again from scratch using the 12k-line sdk_config.h containing everything that the nRF52832 can do, and it's working fine now. I can't reproduce it either with the new SDK. Through time I've moved the sdk_config.h over from 13.0 to 14.0 to 14.2 and I think I missed some essential new value that hadn't been important until SDK 15. Sorry for wasting your time.

Reply
  • Hi  Håkon,

    I want back to my SDK 14 project and converted it again from scratch using the 12k-line sdk_config.h containing everything that the nRF52832 can do, and it's working fine now. I can't reproduce it either with the new SDK. Through time I've moved the sdk_config.h over from 13.0 to 14.0 to 14.2 and I think I missed some essential new value that hadn't been important until SDK 15. Sorry for wasting your time.

Children
No Data
Related