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

NRF Toolbox with NRF52 Eval Board

I am using nRF52810 Eval board for our project. I am using NRF toolbox UART function to control the PWM and UARTE function . I have tested PWM and UART separately with NRF toolbox UART App and working fine.

 

I try to combine both feature but while compile finding issues. Please refer the errors below i get for more details.

 

1.UARTE0_UART0_IRQHandler function is working without nrfx_prs.c and nrfx_uart.c under nrf drivers sections

2.PWM is working with nrfx_prs.c and nrfx_uart.c under nrf drivers sections

3.When i combine both PWM and uarte in ble_app_hts_pca10040_s132 iam getting compilation error as:

  multiple definition of `UARTE0_UART0_IRQHandler';

  Output/Release/Obj/ble_app_hts_pca10040_s132/nrfx_prs.o:

  C:\Users\99002568\Downloads\DeviceDownload     new\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\modules\nrfx\drivers\src\prs/nrfx_prs.c:81: first defined here

4.if i delete nrfx_prs.c and nrfx_uart.c files in ble_app_hts_pca10040_s132 to make the UARTE0_UART0_IRQHandler work

  iam getting compilation error as:

    Linking ble_app_hts_pca10040_s132.elf

    Output/Release/Obj/ble_app_hts_pca10040_s132/nrf_log_backend_uart.o: in function  `nrf_drv_uart_tx':

    undefined reference to `nrfx_uart_tx'

    Output/Release/Obj/ble_app_hts_pca10040_s132/nrf_log_backend_uart.o: in function `nrf_drv_uart_uninit':

    undefined reference to `nrfx_uart_uninit'

    Output/Release/Obj/ble_app_hts_pca10040_s132/nrf_drv_uart.o: in function `nrf_drv_uart_init':

    undefined reference to `nrfx_uart_init'

    Output/Release/Obj/ble_app_hts_pca10040_s132/nrfx_uarte.o: in function `nrfx_uarte_init':

    undefined reference to `nrfx_prs_acquire'

    Output/Release/Obj/ble_app_hts_pca10040_s132/nrfx_uarte.o: in function `nrfx_uarte_uninit':

    undefined reference to `nrfx_prs_release'

    Build failed

Can you please guide us to fix the issue.

 

SDK version : nRF5SDK1702d674dde
file used for PWM and UARTE : ble_app_hts

Parents
  • Hello,

    Please try to disable the UART legacy support as Jørgen suggests in this post: https://devzone.nordicsemi.com/f/nordic-q-a/48318/multiple-definition-of-uarte0_uart0_irqhandler.  This should fix the multiple definition error you're getting for the IRQ handler.

    Best regards,

    Vidar

  • hi,

    I tried disabling the UART legacy support and also followed the link which you shared but still same issue.

  • Hi,

    Maybe it's a different issue then. Are you able to share your project here so I can take a look?

  • Hi,

    Are you using the nRF52 DK (pca10040)? The project you sent me is configured for the nRF52832 chip, not the nRF58210 as stated initially. You should have started with the "pca10040e" project if you are targetting the nRF52810 (see Developing for nRF52810 for more information)

  • Sorry, it is nRF52832 chip NOT nRF52810

    (N52832 OFAAB0 1740JK)

  • No problem, thanks for confirming. There are multiple declarations of the UART IRQ handler because there are 2 driver implementions in your project, one SDK driver, and one custom. PRS is also not needed here  (what is PRS?)

    Here are the changes I had to make to build your project:

    diff --git a/pca10040/s132/config/sdk_config.h b/pca10040/s132/config/sdk_config.h
    index 03ec1a5..2534118 100644
    --- a/pca10040/s132/config/sdk_config.h
    +++ b/pca10040/s132/config/sdk_config.h
    @@ -2696,7 +2696,7 @@
     // <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
     //==========================================================
     #ifndef NRFX_PRS_ENABLED
    -#define NRFX_PRS_ENABLED 1
    +#define NRFX_PRS_ENABLED 0
     #endif
     // <q> NRFX_PRS_BOX_0_ENABLED  - Enables box 0 in the module.
      
    @@ -7605,7 +7605,7 @@
     // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
     //==========================================================
     #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    -#define NRF_LOG_BACKEND_RTT_ENABLED 0
    +#define NRF_LOG_BACKEND_RTT_ENABLED 1
     #endif
     // <o> NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. 
     // <i> Size of the buffer is a trade-off between RAM usage and processing.
    @@ -7638,7 +7638,7 @@
     // <e> NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
     //==========================================================
     #ifndef NRF_LOG_BACKEND_UART_ENABLED
    -#define NRF_LOG_BACKEND_UART_ENABLED 1
    +#define NRF_LOG_BACKEND_UART_ENABLED 0
     #endif
     // <o> NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin 
     #ifndef NRF_LOG_BACKEND_UART_TX_PIN
    diff --git a/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject b/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    index 3687504..457e017 100644
    --- a/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    +++ b/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    @@ -88,9 +88,6 @@
           <file file_name="../../../../../../modules/nrfx/soc/nrfx_atomic.c" />
           <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_clock.c" />
           <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_gpiote.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/prs/nrfx_prs.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uart.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uarte.c" />
         </folder>
         <folder Name="Board Support">
           <file file_name="../../../../../../components/libraries/bsp/bsp.c" />
    

    Notice that logging over UART has to be disabled as well as it depends on the nordic UART driver. You can use RTT instead.

Reply
  • No problem, thanks for confirming. There are multiple declarations of the UART IRQ handler because there are 2 driver implementions in your project, one SDK driver, and one custom. PRS is also not needed here  (what is PRS?)

    Here are the changes I had to make to build your project:

    diff --git a/pca10040/s132/config/sdk_config.h b/pca10040/s132/config/sdk_config.h
    index 03ec1a5..2534118 100644
    --- a/pca10040/s132/config/sdk_config.h
    +++ b/pca10040/s132/config/sdk_config.h
    @@ -2696,7 +2696,7 @@
     // <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
     //==========================================================
     #ifndef NRFX_PRS_ENABLED
    -#define NRFX_PRS_ENABLED 1
    +#define NRFX_PRS_ENABLED 0
     #endif
     // <q> NRFX_PRS_BOX_0_ENABLED  - Enables box 0 in the module.
      
    @@ -7605,7 +7605,7 @@
     // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
     //==========================================================
     #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    -#define NRF_LOG_BACKEND_RTT_ENABLED 0
    +#define NRF_LOG_BACKEND_RTT_ENABLED 1
     #endif
     // <o> NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. 
     // <i> Size of the buffer is a trade-off between RAM usage and processing.
    @@ -7638,7 +7638,7 @@
     // <e> NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
     //==========================================================
     #ifndef NRF_LOG_BACKEND_UART_ENABLED
    -#define NRF_LOG_BACKEND_UART_ENABLED 1
    +#define NRF_LOG_BACKEND_UART_ENABLED 0
     #endif
     // <o> NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin 
     #ifndef NRF_LOG_BACKEND_UART_TX_PIN
    diff --git a/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject b/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    index 3687504..457e017 100644
    --- a/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    +++ b/pca10040/s132/ses/ble_app_hts_pca10040_s132.emProject
    @@ -88,9 +88,6 @@
           <file file_name="../../../../../../modules/nrfx/soc/nrfx_atomic.c" />
           <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_clock.c" />
           <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_gpiote.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/prs/nrfx_prs.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uart.c" />
    -      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uarte.c" />
         </folder>
         <folder Name="Board Support">
           <file file_name="../../../../../../components/libraries/bsp/bsp.c" />
    

    Notice that logging over UART has to be disabled as well as it depends on the nordic UART driver. You can use RTT instead.

Children
Related