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

How to use UARTE1 for mesh serial DFU instead of UARTE0?

Current situation:

    I am using uarte to communicate over UART, at Individual level this works.
    I have serial mesh DFU implemented in my application and at individual level this works. (I see the serial_uart_init uses NRF_UART0 directly)

Now I have to integrate both in same application. I tried it and I'm getting following error

1> build/aio_Debug/obj/nrfx_uarte.o: In function `UARTE0_UART0_IRQHandler':
1> /home/shubham/aio/nRF_SDKs/nRF5_SDK_15.2.0_9412b96/modules/nrfx/drivers/src/nrfx_uarte.c:575: multiple definition of `UARTE0_UART0_IRQHandler'
1> build/aio_Debug/obj/serial_uart.o:/home/shubham/aio/nRF_SDKs/nrf5SDKforMeshv310src/mesh/serial/src/serial_uart.c:60: first defined here
Build failed


Rather I would like to know how to use both UARTs is there any simpler way to integrate both usages?

Parents
  • Hi Shubham, 

    Could you tell what you use UART for? If you use UART for purely logging and debugging, I would suggest to use RTT.

    If you user UART for communication, you would need to chose to use either nrfx_uarte.c or serial_uart.c 

    I would suggest to use serial_uart.c (serial.c)  to not to break the DFU features that included inside the serial library of Mesh. 

    In that case you would need to adapt your protocol to into the m_cmd_handlers[] list as defined in serial.c 

    x Is it possible to use different UART ? You may think of using UART instead of UARTE ? 

    If you want to use the same UART/UARTE, one option is to use a flag, so you will have single UARTE0_UART0_IRQHandler() but depend on the flag, you can call either the handler inside the nrfx_uarte.c or the handler inside serial_uart.c 

    What is your exact use case ? 

  • Thanks Hung,

    I am not using UART for logging purpose, it is used for cummunicating with another MCU.
    NRF52 has to talk with another MCU for DFU as well as communication.

    Ok i'll try to change UARTE usage to serial_uart.

    May I know who makes the call to `UARTE0_UART0_IRQHandler()` ?

  • UARTE0_UART0_IRQHandler is called inside serial_uart.c , the events are then processed inside serial_uart_process(). 

    The list of command ranges is declared in m_cmd_handlers[] inside serial.c you may want to add your extra commands here. 

Reply Children
Related