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

implementation UART to examples from SDK

Hello, 

I have problem with implementing UART to simple_coap_client example, but there is too much problems. Some issues have been solved, but it still is not all. 

defines in sdk_config.h  -solved 

uart0 - used by openthread lib -solved

Can you help me with best way to use COAP and UART in same project?  

 

nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac

Linux ubuntu 18.04

Segger studio

  • defines in sdk_config.h  -solved 

    uart0 - used by openthread lib -solved

     

    Can you please describe what the issue is? What is your progress?

    Best regards,

    Edvin

  • when I compile project simple_coap_client from SDK 

    -added uart switches to sdk_config

    -added include directories and c files to project

    -disable uart 0 enable uart 1

    multiple definition of `UARTE0_UART0_IRQHandler'

    ../../../../../../external/openthread/lib/gcc/libopenthread-nrf52840-sdk.a(libopenthread_nrf52840_sdk_a-uart.o): In function `UARTE0_UART0_IRQHandler':

  • I think should be exist guide how to add UART to example project because  it is important but so complicated

  • Your compiler output should also tell you something like:

    previous definition here: <path to other place it is defined>.

    How did you "Disable uart 0 enable uart 1"?

    It looks like you still have enabled uart 0 somewhere in your project. Maybe in sdk_config.h?

  • this defines was copied from sdk_config of project peripherals/serial_uartes and I disable uart0 

    #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

    ...

    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif

    ...

    #ifndef UART_EASY_DMA_SUPPORT
    #define UART_EASY_DMA_SUPPORT 1
    #endif

    // <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode

    #ifndef UART_LEGACY_SUPPORT
    #define UART_LEGACY_SUPPORT 1
    #endif

    ....

    #ifndef UART0_ENABLED
    #define UART0_ENABLED 0
    #endif

    #ifndef UART1_ENABLED
    #define UART1_ENABLED 1
    #endif

Related