arduino mkr1500 interrupt+sleep

Good morning, Lately we have been experimenting with projects with ATmega328P microcontrollers to SAMD21, in this case with the MKR1500 board. My need is to send the board in deep sleep to save consumption and in the meantime to count the impulses of a reed sensor connected to a digital pin via an interrupt. Here problems arise, with this board (at least in my case) when it goes to sleep, interrupts are not counted as arriving in FALLING / RISING mode, instead with HIGH or LOW mode, the board wakes up at the first impulse ... Instead I would like the board to continue to sleep for a certain time, and in the meantime to count the impulses.

My piece of code is as follows:

pinMode(countPin, INPUT_PULLUP);

attachInterrupt(digitalPinToInterrupt(countPin), count_int, FALLING); /*attiva interrupt su pin*/
Serial1.println("Go to sleep...");
detachInterrupt(1);                    /*disattiva interrupt su pin*/
void count_int()

void print_count(void)
  Serial1.print("count:  ");

I apologize in advance for my bad English

Put this in your setup to be able to use Rising, Falling and Change Regardless the Arduino will wake up and you will have to put it back to sleep

    //External Interrupt Clock Configuration
    attachInterrupt(pin, endInterrupt, CHANGE);
    // Configure EIC to use GCLK1 which uses XOSC32K (RTC Clock)
    // This has to be done after the first call to attachInterrupt()