Problem using a RN42 bluetooth with Seeeduino XIAO

Hi, for the project I’m working on, I’m required to use a bluetooth module with a Seeeduino XIAO.
I’m testing the components by sending “A” and “B” by keyboard (through CoolTerm) with the RN42 so that a simple vibromotor connected to the Seeeduino gets activated.
At the beginning I tried this code on a Arduino Uno and it worked perfectly:

//REMEMBER AT FIRST YOU LOAD THE SKETCH WITHOUT TX AND RX THEN YOU CONNECT RX AND TX


void setup() {
  pinMode(9, OUTPUT);

  // set baudrate to match BT module:
  Serial.begin(115200);

}

void loop() {
  String t;// String to hold data from BT module:
  while(Serial.available()){// keep reading bytes while they are still more in the buffer
    t+=(char)Serial.read(); // read byte, convert to char, and append it to string
    }
   if(t.length()){ //if the string is not empty do the following

    if(t == "A\r\n"){ 
      Serial.print("Brrrr!\n");
      digitalWrite(9, HIGH);
      delay(1000);
      digitalWrite(9, LOW);
    }
      else if(t == "B\r\n"){
        Serial.print("Brr Brr\n");
        digitalWrite(9, HIGH);
        delay(500);
        digitalWrite(9, LOW);
        delay(500);
        digitalWrite(9, HIGH);
        delay(500);
        digitalWrite(9, LOW);
        }
      delay(1000);
    }
    delay(20);
}

I simply connected the module to 3.3 V, GND, RX and TX of Arduino Uno board, I used the following options on CoolTerm and everthing worked.

I tried to repeat the same procedure on the Seeeduino, but when I type “A” or “B” on CoolTerm nothing happens.
Someone told me that probably by connecting the Seeeduino with the USB- type C cable the port gets busy, so I tried using a software serial:

//REMEMBER AT FIRST YOU LOAD THE SKETCH WITHOUT TX AND RX THEN YOU CONNECT RX AND TX


#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 10); // RX, TX
void setup() {
  pinMode(6, OUTPUT);

  // set baudrate to match BT module:
  
  mySerial.begin(115200);
}
//void loop()
//{
//  if (mySerial.available())
//    Serial.write(mySerial.read());
//  if (Serial.available())
//    mySerial.write(Serial.read());
//}
void loop() {
  String t;// String to hold data from BT module:
  while(mySerial.available()){// keep reading bytes while they are still more in the buffer
    t+=(char)mySerial.read(); // read byte, convert to char, and append it to string
    }
   if(t.length()){ //if the string is not empty do the following

    if(t == "A\r\n"){ 
      mySerial.print("Brrrr! \n");
      digitalWrite(6, HIGH);
      delay(1000);
      digitalWrite(6, LOW);
    }
      else if(t == "B\r\n"){
        mySerial.print("Brr Brr\n");
        digitalWrite(6, HIGH);
        delay(500);
        digitalWrite(6, LOW);
        delay(500);
        digitalWrite(6, HIGH);
        delay(500);
        digitalWrite(6, LOW);
        }
      delay(1000);
    }
    //else{
     // Serial.print("Syntax Error\n");
     // }
    delay(20);
}

but nothing changes.
I also tried to avoid using the USB cable and I gave power to the Seeeduino through Arduino Uno by connecting the 5 V pins and GND with the first code I posted, but it still doesn’t work.
What is the problem? Did I use the sofware serial correctly?

First picture: RN42 connected to Seeeduino’s serial port made by pins 7 and 6: the red jumper goes from 3.3 V to VDD, the yellow jumper goes from Seeeduino’s RX to RN42’s TX, the blue jumper goes from Seeeduino’s TX to RN42’s RX and the grey one connects the two grounds.

Second picture: RN42 connected to Seeeduino’s software serial port made by pins 10(TX) and 9(RX): the red jumper goes from 3.3 V to VDD, the yellow jumper goes from Seeeduino’s 9 to RN42’s TX, the blue jumper goes from Seeeduino’s 10 to RN42’s RX and the grey one connects the two grounds.

The third picture shows the connections to the module.
The module’s led blinks when it is connected and then stays on when I enable the connection with CoolTerm.

I have made a little progress, with the following code:

#include <SoftwareSerial.h>

// Set up a new SoftwareSerial object with RX in digital pin 10 and TX in digital pin 11
SoftwareSerial portOne(0, 1);

void setup() {
    // Set the baud rate for the Serial port
    Serial.begin(115200);

    // Set the baud rate for the SerialSoftware object
    portOne.begin(115200);
}

void loop() {
//    if (portOne.isListening()) { 
//        Serial.println("portOne is listening!");
//        
//    }
    //char c = portOne.read();
    char s = portOne.peek();
   // Serial.println(c);
    Serial.println(s);
//     if (portOne.available()) { 
//        Serial.println("portOne is available!");
//        
//    }
}
    // ...

I was able to receive a character through the software serial port, as we can see on the serial monitor:


but this works only with the function peek, read doesn’t work at all, the monitor remains blank.
With a previous test I’ve seen that

if (portOne.isListening()) { 
     Serial.println("portOne is listening!");

works as well, while

if (portOne.available()) { 
       Serial.println("portOne is available!");   
   }

doesn’t work.

The solution of the problem can be seen here: Problem using a RN42 bluetooth with Seeeduino XIAO [SOLVED!] - #14 by alessandro_capresi - Project Guidance - Arduino Forum