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

How can I use "Esb" and "App timer" at the same time?

Hi,

I an try to use "Esb function" and "App timer function (app_timer_create() and app_timer_start()" in the same project, but there have one following link error message.

.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol SWI0_EGU0_IRQHandler multiply defined (by nrf_esb.o and app_timer.o).

How can I solve this problem.

Thank you,

Chianglin

Parents
  • Hi Ives

    You can change the software interrupt handler used in nrf_esb.h, to avoid the conflict with the app timer library. 

    A common trick is to hijack the interrupt vector off a peripheral that you don't need in the application, to avoid using all the software interrupts. 

    As an example, the QDEC peripheral is very specialized and is usually not required by the application. If this is the case for you also just change lines 137-138 in nrf_esb.h as such:

    #define ESB_EVT_IRQ QDEC_IRQn //!< The ESB event IRQ number when running on an nRF5 device.
    #define ESB_EVT_IRQHandler QDEC_IRQHandler //!< The handler for @ref ESB_EVT_IRQ when running on an nRF5 device.

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thank you for your answer.

    Please reference the attach file.

    I am trying to create timer to trigger task "RxPacketProcess_timeout_handler()", which can print a message "(0001)" via UART interface every two seconds.

    But, it can not print "(0001)" message to my PC via UART interface.

    Would you please tell me how to modify it?

    Code.7z

    Thank you,

    Chianglin

  • Hi Torbjørn,

    Would you please give me a sample which can use ESB and "App_Timer" function at the same time?

     

    Thank you,

    Chianglin

  • Hi Ives

    Sorry for the slow response. I started work on an example, but ran into a weird Keil issue that I didn't have time to figure out (the example would only run without optimization enabled). I am preparing for a workshop tomorrow and have little time for Devzone right now. 

    If I can't solve the issue by the end of the day I will send you what I have anyway, and you can have a look at it. Next week I will be back in the office with more time to assist you if there are still issues. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thank you for your assistance. I wish you all the best in the seminar tomorrow.

    Best Regards,

    Chianglin

  • Hi Ives

    Thanks a lot, the seminar went fine ;)

    I have attached the example I made. It's for SDK v15.2, and I tested it on the nRF52DK (nRF52832). 
    esb_template_app_timer.zip

    The ESB PTX example is changed to use an app_timer to schedule packet transmissions, rather than using a delay in the main loop. 
    The PRX example is not changed from the original. 

    I copied the ESB files into a local folder to avoid having to change the SDK files directly. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thank you for your source code.

    When I use your code, I have some problems. Would you please tell me: What steps have I missed?

    Following is my process step by step:

    1. After I copy your code into directory ".\examples\proprietary_rf\NordicCode" and rebuild all.  The compiler will print following error message:

    linking...
    .\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol SWI0_EGU0_IRQHandler multiply defined (by nrf_esb.o and app_timer.o).
    Not enough information to list image symbols.
    Not enough information to list load addresses in the image map.
    Finished: 2 information, 0 warning and 1 error messages.
    ".\_build\nrf52832_xxaa.axf" - 1 Error(s), 0 Warning(s).
       So I reference your suggestion and change the content of nrf_esb.h

    #define ESB_EVT_IRQ QDEC_IRQn //!< The ESB event IRQ number when running on an nRF5 device.
    #define ESB_EVT_IRQHandler QDEC_IRQHandler //!< The handler for @ref ESB_EVT_IRQ when running on an nRF5 device.
       After do this, the code can compiler with no error.

    2. There have use many "NRFX_LOG_INFO()" function to print debug message in main.c.  Does this debug message in print into RTT interface?  Can I print it via UART interface?  How to set it's TX, RX pin and baudrate?

    Thank you,

    Chianglin

Reply
  • Hi Torbjørn,

    Thank you for your source code.

    When I use your code, I have some problems. Would you please tell me: What steps have I missed?

    Following is my process step by step:

    1. After I copy your code into directory ".\examples\proprietary_rf\NordicCode" and rebuild all.  The compiler will print following error message:

    linking...
    .\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol SWI0_EGU0_IRQHandler multiply defined (by nrf_esb.o and app_timer.o).
    Not enough information to list image symbols.
    Not enough information to list load addresses in the image map.
    Finished: 2 information, 0 warning and 1 error messages.
    ".\_build\nrf52832_xxaa.axf" - 1 Error(s), 0 Warning(s).
       So I reference your suggestion and change the content of nrf_esb.h

    #define ESB_EVT_IRQ QDEC_IRQn //!< The ESB event IRQ number when running on an nRF5 device.
    #define ESB_EVT_IRQHandler QDEC_IRQHandler //!< The handler for @ref ESB_EVT_IRQ when running on an nRF5 device.
       After do this, the code can compiler with no error.

    2. There have use many "NRFX_LOG_INFO()" function to print debug message in main.c.  Does this debug message in print into RTT interface?  Can I print it via UART interface?  How to set it's TX, RX pin and baudrate?

    Thank you,

    Chianglin

Children
  • Hi Chianglin

    1. Can you let me know which of the project files you opened?
    I will double check on my end if I remembered to update the project with my modified files. 

    2. I have set up the project to print log info over the UART. 
    The TX pin is set by the NRF_LOG_BACKEND_UART_TX_PIN define in sdk_config.h, and the baudrate is set by the NRF_LOG_BACKEND_UART_BAUDRATE define. 
    The RX pin is not set since it is not used by the log module. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    1. My project is '.\nRF5_SDK_15.2.0_9412b96\examples\proprietary_rf\NordicCode\ptx\pca10040\blank\arm5_no_packs\esb_ptx_pca10040.uvprojx".

    2. About the problem of UART, UART can print debug message after I modify NRF_LOG_BACKEND_UART_TX_PIN define. Thank you,

    And I found some strange problem:

    1. After I download the binary code by press "load" button (please found following screen), the UART can not print any Debug message.

        Does it means the program doesn't execute?

    2. If I use"start / stop debug session" to execute in debug session ans exit then exit it (please find following screen",

        then the UART will start to print debug message.

    Wound you please tell me what the different between "direct download code into nRF52832 device" and "execute code in debug session mode"?

    Thank you,

    Chianglin

  • Hi Chianglin

    1. My bad. It seems the project didn't include the right header files, even though I changed the project settings. This should be corrected now:
    esb_template_app_timer_v2.zip

    2. Could you try to press the IF BOOT/RESET button on your DK after flashing from Keil?
    It is possible that it is not working because the chip is not being reset after the download. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Sorry for reply so late. Thank you for your kindly answer.

    I know the reason why nrf52832 device can not auto reset, it is because my segger JTAG interface is damaged.

    If I have some question about "switch ESB RF mode between PTX and PRX", do you suggest I ask you in this case, or create a new case?

    Thank you,

    Chianglin

  • Hi Chianglin

    If the question is not related to the app_timer discussion earlier I suggest you open a new case. 

    It is harder to keep track of cases when the threads get longer. 

    Best regards
    Torbjørn

Related