Multiple definition of `UARTE0_UART0_IRQHandler':

Hello All, 

I am using nRF52840 Dev-kit and SDK 4.0 for Zigbee and thread. Due to some functions, we are using SDK 4.0 for this project which is not present in SDK 4.1.

I interfacing the UART0 in my thread example. I am getting the below errors. 

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

multiple definition of `UARTE0_UART0_IRQHandler'; Output/Executable_1 Release External/Obj/nrfx_prs.o:D:\Project\Eurotronics\Thread_Radiator\nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b\examples\thread\Thread_VAS_20211024/../../../modules/nrfx/drivers/src/prs/nrfx_prs.c:81: first defined here"

I have used thread MTD as a reference example - I have removed the cli library to make UART free. I have all the procedures to make UART0 free for my application. 

Before this I tried to use UART in the freeRTOS_Blinky example and which worked successfully. So I decided to port in thread example. But I am getting the above-mentioned error. 

Also, I referred to some nordic forum links regarding the same error, I tried the suggested in sdk_config.h file but still getting the same error. 

And, if I tried to exclude the "nrf_prs" then I get these below errors. 

"1> c:/program files (x86)/gnu arm embedded toolchain/10 2021.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: missing --end-group; added as last command line option
1> c:/program files (x86)/gnu arm embedded toolchain/10 2021.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: Output/Executable_1 Release External/Obj/nrfx_uart.o: in function `nrfx_uart_init':
1> D:\Project\Eurotronics\Thread_Radiator\nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b\examples\thread\Thread_VAS_20211024/../../../modules/nrfx/drivers/src/nrfx_uart.c:189: undefined reference to `nrfx_prs_acquire'
1> c:/program files (x86)/gnu arm embedded toolchain/10 2021.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: Output/Executable_1 Release External/Obj/nrfx_uarte.o: in function `nrfx_uarte_init':
1> D:\Project\Eurotronics\Thread_Radiator\nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b\examples\thread\Thread_VAS_20211024/../../../modules/nrfx/drivers/src/nrfx_uarte.c:235: undefined reference to `nrfx_prs_acquire'
1> collect2.exe: error: ld returned 1 exit status"

Let me know how to resolve this issue, 

Thanks and Regards

Rohit R

Parents Reply Children
  • Hi Rohit R,

    I am sorry for the late reply. The default compile settings for the OpenThread stack uses UART0 instance. You can try to use another UART instance, for example you can try using UART1 instead?

    Best regards,

    Marjeris

  • Hi Marjeris,

    Thanks for the feedback. 

    But is it not possible to rebuild the library and make UART0 free for our option. I need UART0 as I have already developed a function on it and using in Zigbee and other protocols. We need to keep it the same for all protocols of the nRF devices. 

    Please share the details to make the library file rebuild procedure and make UART0 free. 

    Thanks for understanding.

    Regards,

    Rohit R

  • Hi Marjeris,

    Thanks for the feedback. 

    But is it not possible to rebuild the library and make UART0 free for our option. I need UART0 as I have already developed a function on it and using in Zigbee and other protocols. We need to keep it the same for all protocols of the nRF devices. 

    Please share the details to make the library file rebuild procedure and make UART0 free. 

    Thanks for understanding.

    Let me know your feedback as early as possible. Already 3 days late feedback. 

    Regards,

    Rohit R

  • Hi,

    - I have removed the cli library to make UART free

    Removing the CLI libraries if you are not using it should be fine. Can I ask what have you removed so far and which example are you basing your application on? You may need to remove prs and other source files.

    You can also use this guide for recompiling the library and remove the UART0 files: https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_ot_libraries_building.html

    Best regards,

    Marjeris

  • Hello Marjeris,

    Removing the CLI libraries if you are not using it should be fine. Can I ask what have you removed so far and which example are you basing your application on? You may need to remove prs and other source files.

    - Removed the cli library fle

    - Excluded nrfx_prs.c, nrfx_uarte.c files. 

    But still getting below error,

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

    multiple definition of `UARTE0_UART0_IRQHandler'; Output/Executable_1 Release External/Obj/nrfx_uart.o:D:\Project\Eurotronics\Thread_Radiator\nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b\examples\thread\Thread_VAS_20211024/../../../modules/nrfx/drivers/src/nrfx_uart.c:649: first defined here"

    I have created examples from scratch with an external toolchain and included nRF libraries which are required for my project.

    - For the nRF library, I referred to the freeRTOS_coap and cli_mtd example to enable thread, freertos parts in code.

    And,

    We are using UART0 in our legacy hardware product.

    When we built our application using nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8,we had similar issue with the 4.1 version where there was an error with libopenthread-nrf52840-transport.a.
    When I posted on the DevZone I was advised:
    1. Remove - libopenthread-cli-mtd.a file from project.
    2. Replace - libopenthread-nrf52840-transport.a with libopenthread-nrf52840-transport-none.a file in project.
    3. In project->option->common-> preprocessor->preprocessor_definition remove this UART0_ENABLED=0 in project.
    The suggestion worked for me. I did not have to build any library for me.
    For some reasons I have to downgrade to version 4.0 of the SDK for this varient of the product.
    Now I am getting an error with libopenthread-nrf52840-SDK.a. Per your suggestion I need to rebuild the library with UART1 so that UART0 is available for my application.
    However, I do not have the necessary Python environment to build the library to my requirement. I could not locate any document that explains the Python requirements including modules.

    I would appreciate if you could point to a pre-built library file that excludes UART0 from the Library similar to libopenthread-nrf52840-transport-none.a in SDK version 4.1

    Thanks in advance for your assistance and understanding of our issue.

    Regards,

    Rohit R

Related