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

POWER_CLOCK_IRQHandler

Hi,

Using SDK 15, I' having the following issue:

My project works with USB and softdevice (among many other features)

1. I included the file nrfx_power_clock.c in my project - yet the handler - POWER_CLOCK_IRQHandler for some reason is not linked!

And so USB is not functioning.

If I'm taking it out to my project file the handler is linked.

I do not see anything special about the way this handler is taken care by Nordic( not other than GPIOTE_IRQHandler for instance...).

Yet for some reason that handler is not linked - please your help....

Regards,

Lior.

Parents
  • Hi,

    Which toolchain do you use to build your project? We have seen issues with GCC 7.x.x and LTO, where the linker sometimes uses the weak ISR implementation from the startup file instead of the proper implementation. We still test the SDK with GCC version 6.3.1 for that reason.

  • Hi,

    I'm using IAR 7.5 - is that happening also on other handlers (as far as you know)?

  • I have not heard of this issue in IAR, so I am tempted to think that there is another issue here. Have you set NRFX_POWER_ENABLED and NRFX_CLOCK_ENABLED to 1 in your projects sdk_config.h? If not, nrfx_power_clock_irq_handler() will be stripped out by the preprocessor.

  • I did set them both to 1.

    In the following code I can see the following line:

    priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;

    executing...

    #ifndef SUPPRESS_INLINE_IMPLEMENTATION
    __STATIC_INLINE void nrfx_power_clock_irq_init(void)
    {
        uint8_t priority;
    #if NRFX_CHECK(NRFX_POWER_ENABLED) && NRFX_CHECK(NRFX_CLOCK_ENABLED)
        #if NRFX_POWER_CONFIG_IRQ_PRIORITY != NRFX_CLOCK_CONFIG_IRQ_PRIORITY
        #error "IRQ priority for POWER and CLOCK have to be the same. Check <nrfx_config.h>."
        #endif
        priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;
    #elif NRFX_CHECK(NRFX_POWER_ENABLED)
        priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;
    #elif NRFX_CHECK(NRFX_CLOCK_ENABLED)
        priority = NRFX_CLOCK_CONFIG_IRQ_PRIORITY;
    #endif

        if (!NRFX_IRQ_IS_ENABLED(POWER_CLOCK_IRQn))
        {
            NRFX_IRQ_PRIORITY_SET(POWER_CLOCK_IRQn, priority);
            NRFX_IRQ_ENABLE(POWER_CLOCK_IRQn);
        }
    }
    #endif // SUPPRESS_INLINE_IMPLEMENTATION

Reply
  • I did set them both to 1.

    In the following code I can see the following line:

    priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;

    executing...

    #ifndef SUPPRESS_INLINE_IMPLEMENTATION
    __STATIC_INLINE void nrfx_power_clock_irq_init(void)
    {
        uint8_t priority;
    #if NRFX_CHECK(NRFX_POWER_ENABLED) && NRFX_CHECK(NRFX_CLOCK_ENABLED)
        #if NRFX_POWER_CONFIG_IRQ_PRIORITY != NRFX_CLOCK_CONFIG_IRQ_PRIORITY
        #error "IRQ priority for POWER and CLOCK have to be the same. Check <nrfx_config.h>."
        #endif
        priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;
    #elif NRFX_CHECK(NRFX_POWER_ENABLED)
        priority = NRFX_POWER_CONFIG_IRQ_PRIORITY;
    #elif NRFX_CHECK(NRFX_CLOCK_ENABLED)
        priority = NRFX_CLOCK_CONFIG_IRQ_PRIORITY;
    #endif

        if (!NRFX_IRQ_IS_ENABLED(POWER_CLOCK_IRQn))
        {
            NRFX_IRQ_PRIORITY_SET(POWER_CLOCK_IRQn, priority);
            NRFX_IRQ_ENABLE(POWER_CLOCK_IRQn);
        }
    }
    #endif // SUPPRESS_INLINE_IMPLEMENTATION

Children
Related