Problem SoftwareSerial and PinChangeInt

Hi all and merry Christmas,
I have a problem whit my project because I'm using SoftwareSerial library and PinChangeInt function.
Software Serial works on 2 and 3 pin, and I have to read a change state on PD7. Unluckily I can't change pin.
When i try compile, I recive an error "multiple definition of `__vector_5".
I reed other topics but I diden't find a solution. Anyone have any ideas?
This is my code:

// Librerie da includere
#include <SoftwareSerial.h>
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/interrupt.h>
 


//Modulo BLE
#define PIN_P2_0  8  // Input 0 --> Test mode  ; 1 --> App mode 
#define PIN_P1_3  9  // Digitale I/O
#define PIN_P1_6  4  // Digitale --> UART RX Indication (Va basso)
#define PIN_P2_7  5  // Digitale Output --> 0 --> Prima dell'inizio della trasmissione; 1 --> fine della trasmisisone dell'UART  
#define PIN_P1_7  6  // Digitale --> BOO!!

#define PIN_P0_0  ?  // Digitale I/O ; Default: Input; Pulled-high. (PE1 micro)
#define PIN_P1_2  ?  // Digitale I/O ; Default: Input; Pulled-high. (PE2 micro)
#define PIN_P3_6  ?  // Digitale I/O ; Default: Input; Pulled-high. (PE3 micro) Da vedere meglio

//PIN PER LA SERIALE DEL BLE SoftwareSerial
#define PIN_RX_BLE  2  // RX BLE   
#define PIN_TX_BLE  3  // TX BLE 


// Creo la seconda seriale digitale tramite la libreria SoftwareSerial per leggere il  BLE

SoftwareSerial mySerial_BLE(PIN_TX_BLE, PIN_RX_BLE); // RX, TX (RX -->TX_BLE ; TX --> RX_BLE)

 int secondi=0;

// The setup function runs once when you press reset or power the board
void setup() {
  
  pinMode(PIN_P2_0, OUTPUT); 
  pinMode(PIN_P1_6, OUTPUT);
  pinMode(PIN_P2_7, INPUT);
  pinMode(7, INPUT_PULLUP);
  pinMode(13, OUTPUT);
  
  digitalWrite(13, HIGH);
 
 
 Serial.begin(57600); // Seriale HW
 while (!Serial); // wait for serial port to connect. Needed for native USB port only 
  }

void loop() {
 delay(3000);
  secondi++;
  
  Serial.print("Attivo da ");
  Serial.print(secondi, DEC);
  Serial.println(" s.");
  mySerial_BLE.println("Active");
  
            if(secondi == 3) {
              Serial.println("Sleep!");
              mySerial_BLE.println("Sleep!");
              delay(200);
              secondi = 0;
              enterSleep();
            }                                     
}

void enterSleep(void)
{
  /* Setup pin2 as an interrupt and attach handler. */
  
  PCICR = 0b00000100;    // turn on port d               -->    PCICR = PCICR | 0b00000100;  Questa instruzione è simile PCICR =  0b00000100;
  PCMSK2 = 0b10000000;    // turn on pins PD7, PCINT23
  
  digitalWrite(13, LOW);  
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  sleep_enable();  
  sleep_mode();
  /* Il programma riprende qui. */
  sleep_disable();   
}

ISR(PCINT2_vect){ // Port D, PCINT16 - PCINT23
   
digitalWrite(13, HIGH);  
 }

Looks like something I had done once upon a time... :wink:

//Sleeping arduino
/*
When the arduino UNO is in SLEEP_MODE_PWR_DOWN the only way to wake it is with either
 - a watchdog timer interrupt,
 - a level interrupt on pins 2 or 3, or
 -  a Pin Change interrupt
 */

#include <avr/sleep.h>
#include <SoftwareSerial.h>

#define RXPIN 2
#define TIMEOUT 1000UL

SoftwareSerial mySerial(RXPIN, 4); //pin2 RX, pin4 TX

unsigned long oldtime = 0;

void wakeUpNow()        // here the interrupt is handled after wakeup
{
  sleep_disable();         // first thing after waking from sleep:
  // disable sleep...
  detachInterrupt(digitalPinToInterrupt(RXPIN));      // disables interrupt 0 on pin 2 so the

  Serial.println("Woken!");

  sei();

  mySerial.begin(9600);
  mySerial.print("w"); //tx 'w' so indicate device in awake and ready to receive
  oldtime = millis();

  while (millis() - oldtime < TIMEOUT) { //wait for 1000ms for sender to reply
    if (mySerial.available()) {
      char c = mySerial.read();
      if (c == 'W') {
        Serial.println("WakeUp Acknowledged!");
        break;
      }
    }
  }
  
  if (millis() - oldtime > TIMEOUT){
    sleepNow();
  }
}

void sleepNow() {

  sleep_enable();

  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  /* Trigger mode of the interrupt pin. can be:
                   LOW        a low level triggers
                   CHANGE     a change in level triggers
                   RISING     a rising edge of a level triggers
                   FALLING    a falling edge of a level triggers

       In all but the IDLE sleep modes only LOW can be used.
  */

  Serial.println("Sleeping Now");
  delay(500);
  mySerial.end();

  attachInterrupt(digitalPinToInterrupt(RXPIN), wakeUpNow, LOW); // wakeUpNow when pin 2 gets LOW

  sleep_mode();
}

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  pinMode(RXPIN, INPUT_PULLUP);
}

void loop() {
  // put your main code here, to run repeatedly:

  if (millis() - oldtime < TIMEOUT) { //go to sleep if no data received by TIMEOUT
    if (mySerial.available()) {
      oldtime = millis();
      char c = mySerial.read();
      Serial.println(c); //print RX data in serial monitor (as ASCII)
    }
  }
  else {
    mySerial.print("s"); //tells sender it is going to sleep
    sleepNow();
  }
}

hope that helps...

Thanks Sherzaad,
I solved it by removing the ISR function. :wink: