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

Facing issues with multiple interrupts

Dear all,

I am using the following peripherals in our product.

1. TWI Sensor 

2. BLE

3. APP timer (1. to poll a gpio pin & as RTC)

4. SPI flash

5. 2 Edge sensitive GPIO pins.

6. 2 ADCs

Initially I need to wait for APP timer to create a low interrupt on GPIO pin & RTC. Then I establish the BLE Communication. Then I read sensor values and ADC values and GPIO edge interrupts to flash. Also the gpio pn low edges will be transmitted to another BLE device.

After filling the contents of the flash, I send the same values to another BLE device.

The problem that I am facing is setting the interrupt priority. If I set higher priority  for BLE followed by APP_TIMER, followed by sensors and ADC, the RTC & APP timer key press are not updated. Once the BLE stops, the RTC and GPIO edges are detected fine.

Please suggest me prority setting so that I am able to do all above functionality without any issues isr intterupt.

Parents
  • You need to adhere to the SoftDevic specification's Interrupt priority levels

    I then suggest you use Priority 7 and use the app_scheduler to schedule your tasks, there you can set priorities for the individual tasks where they will still execute in priority 7.
    I believe the underlying HW drivers use prio 6, so that they can execute whatever they need to, when they need to. Use the HW driver's callback function to schedule your tasks. 

  • Is there any sample application codes available ?

    I checked many a files which use app_scheduler.

    All the files calls " APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);" and then calls "app_sched_execute();".

    Is the above said things are sufficient or we need to do anything else.

    In my current approach, I am using the following priorities in addition to softdevice.

    1. App_timer (Soft RTC & Reads switch )  assigned priority 2

    2. SPI flash uses priority - 4

    3. Sensors (TWIM & GPIO interrupt) -- 2

    4. ADC -- priority - 3

    5. Clock is assigned priority - 6.

    Will changing the interrupt levels help me?

    thanks & regards,

    Kotteeswaran.E

Reply
  • Is there any sample application codes available ?

    I checked many a files which use app_scheduler.

    All the files calls " APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);" and then calls "app_sched_execute();".

    Is the above said things are sufficient or we need to do anything else.

    In my current approach, I am using the following priorities in addition to softdevice.

    1. App_timer (Soft RTC & Reads switch )  assigned priority 2

    2. SPI flash uses priority - 4

    3. Sensors (TWIM & GPIO interrupt) -- 2

    4. ADC -- priority - 3

    5. Clock is assigned priority - 6.

    Will changing the interrupt levels help me?

    thanks & regards,

    Kotteeswaran.E

Children
Related