2 serials problem , help me to fix please

/*=================================CODED-BY-STRIX_DB======================================*/

#include <SoftwareSerial.h>  
#include <TinyGPS++.h>          

SoftwareSerial gsmSerial(6,7); // 6 - rx ; 7 - tx
SoftwareSerial gpsSerial(8,9);  // 8 - rx ; 9 - tx   

TinyGPSPlus gps;

void setup()
{
      Serial.begin(9600);
 while (!Serial) {//serial}
    gpsSerial.begin(9600);  
      delay(500);
    gsmSerial.begin(9600); 
}
  delay(500);
  Serial.print("================CODED=STRIX_DB================"); 
  Serial.println();
  Serial.print("           Waiting for A9G Module...          "); 
  Serial.println();
  Serial.print("       A9G GPS-GPRS Module Ready for work :)  ");
  Serial.println();
  Serial.print("================CODED=STRIX_DB================"); 
  Serial.println();
  delay(500);
}

void loop() 
{
  gpsSerial.listen();
  while (gpsSerial.available() > 0) 
{
   
    if (gps.encode(gpsSerial.read())) 
    {
      delay(1000);
      if (gps.location.isValid()) 
        {
        Serial.print("Latitudine = ");
        Serial.println(gps.location.lat(), 6);
        Serial.print("Longitudine = ");
        Serial.println(gps.location.lng(), 6);
        }
      else
        Serial.println("Coordonate - Invalid");
 
      if (gps.satellites.isValid()) 
        {
        Serial.print("Sateliti GPS = ");
        Serial.println(gps.satellites.value());
        }
      else
        Serial.println("Sateliti - Invalid");
        Serial.println();
    }
  }
}
float *gsm()
{
  gsmSerial.listen();
while(gsmSerial.available())
        {
        gsmSerial.read();
        }
  while(Serial.available())
        {
        Serial.read();
        }
  get_gsm(); 
        
}

/*=================================CODED-BY-STRIX_DB======================================*/

void get_gsm()
{
  gsmSerial.listen();
   while(gsmSerial.available()>0)
   {
   delay(15000); 
  gsmSerial.println("AT"); // 
   delay(1000);
  gsmSerial.println("AT+CMGF=1"); 
   delay(1000);
  gsmSerial.println("AT+CMGS=\"+XXXXXXXXXXX\""); // Numarul de telefon
   delay(1000);
  gsmSerial.print("TEST"); // Mesajul scris in SMS
   delay(1000);
  gsmSerial.write(26); // Cod ASCII CTRL+Z
   delay(1000);
  Serial.println("Trimit SMS");
   delay(1000);
    }
}
   
/*=================================CODED-BY-STRIX_DB======================================*/

I made this code on 2 serials but it doesn't work, but on a serial it works, please help me to fix it, thanks !

denis1337:
, but on a serial it works,

Did you use this
while (!Serial) {//serial}
when it worked?

Nick_Pyner:
Did you use this
while (!Serial) {//serial}
when it worked?

I deleted "while (!Serial) {//serial}" and gpsSerial it's working but gsmSerial doesn't work
I think "while (!Serial) {//serial}" it's for nothing

I'm sure you are right, hence my question and, while I'm not supposing you made it up yourself, it makes your entire code suss. Software serial is fraught with problems at the best of times and using it twice probably just makes a bad situation worse. You might get a better result by using the altsoftserial library instead.
There has been plenty of discussion on this forum about the perils of software serial and the different versions. I guess your GSM and GPS do indeed run at 9600(?).

Only one software serial port can listen at once. See the 2 port receive example.. That may help, but the better solution is to use an Arduino board with more hardware serial ports (Mega for instance).