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

About multiple interrupts

There is something I want you to tell.
Do you know how to allow other interrupts (specifically IRQ pin) while interrupting app_timer? I studied variously, but I can not find concrete measures.

Parents
  • Hi,

    You can adjust the interrupt priorities to achieve this. You can give higher priority (lower number) to GPIOTE_CONFIG_IRQ_PRIORITY than APP_TIMER_CONFIG_IRQ_PRIORITY in the projects sdk_config.h.

  • Hi Einar.

    Thank you for your reply.

    I wanted to use interrupt of IRQ terminal to feed WDT, so it was saved.
    However, in SDK 14.2.0 GPIOTE_CONFIG_IRQ_PRIORITY can only be set to 5.
    0,1 and 4 result in compile error.

    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest)
    
    // <1=> 1
    // <2=> 2
    // <3=> 3
    // <4=> 4
    // <5=> 5
    // <6=> 6
    // <7=> 7
    
    #ifndef GPIOTE_CONFIG_IRQ_PRIORITY
    #define GPIOTE_CONFIG_IRQ_PRIORITY 5
    #endif

    Please let me know one more thing.

    There is another problem, I think that a feed of WDT is necessary when doing DFU, but is it valid even if DFU is running if it is set by the boot loader main () function

  • Hi,

    You (the application) should not use priority 5 on the nRF52, nor 0, 1 or 4 if you use the SoftDevice. As you can see from the comment you pasted these are all reserved for the SoftDevice only. The application should only use 2, 3, 6 or 7. The compiler error comes from the INTERRUPT_PRIORITY_VALIDATION() macro, whose purpose is exactly this - to give you a compile error when you have selected an invalid interrupt priority.

    I am not sure I understood the WDT and DFU question correctly. Generally, if you enable the watchdog in your application you must either use a very long timeout or ensure that you feed the watchdog in the bootloader as well. This is supported out of the box in SDK 15, but you can find some information about how to do it for older versions in for example this thread.

Reply
  • Hi,

    You (the application) should not use priority 5 on the nRF52, nor 0, 1 or 4 if you use the SoftDevice. As you can see from the comment you pasted these are all reserved for the SoftDevice only. The application should only use 2, 3, 6 or 7. The compiler error comes from the INTERRUPT_PRIORITY_VALIDATION() macro, whose purpose is exactly this - to give you a compile error when you have selected an invalid interrupt priority.

    I am not sure I understood the WDT and DFU question correctly. Generally, if you enable the watchdog in your application you must either use a very long timeout or ensure that you feed the watchdog in the bootloader as well. This is supported out of the box in SDK 15, but you can find some information about how to do it for older versions in for example this thread.

Children
Related