Accelerometer and GPS problem

Good morning,
I try to acquire data from an accelerometer MPU6050 and a GPS Ublox Neo 6m with an Arduino Uno.
The connection between the devices are:
-Accelerometer and GPS Vcc are connected to 3.3V
-GPS TX connected to digital pin 2, GPS RX connected to digital pin 3
-MPU6050 SCL connected to analog input 5, MPU6050 SDA connected to input 4
I can load my code but the board doesn't work; in particular it seems that there are some incompatibilities with I2C and Serial protocol because the excecution stops in the setup section when the I2C communication is initialized.
Here there is my code.

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


const int8_t ACC=0x68;
const int8_t POWER=0x6B;
const int8_t ACC_CONFIG=0x1C;
const int8_t ACC_LIMIT=0x00;
const int8_t ACC_X_MSB=0x3B;
const int8_t PIN_RX=2;
const int8_t PIN_TX=3;
const int8_t BAUD=9600;
double quad=2;
float ms_to_s=1./1000;

SoftwareSerial gpsSerial(PIN_RX,PIN_TX);
TinyGPSPlus gps;
double conv=1./16384;
double g=9.81;
void setup() {
  Wire.beginTransmission(ACC);
  Wire.write(POWER);
  Wire.write(0);
  Wire.endTransmission();
  Wire.beginTransmission(ACC);
  Wire.write(ACC_CONFIG);
  Wire.write(ACC_LIMIT);
  Wire.endTransmission();
  Serial.begin(BAUD);
 gpsSerial.begin(BAUD);
}

void loop() {
    
    while (gpsSerial.available() > 0){
    gps.encode(gpsSerial.read());
    }
    double LAT=gps.location.lat();
    double LONG=gps.location.lng();
    double SPEED=gps.speed.kmph();
    unsigned long currtime=millis();
    float time1=currtime*ms_to_s; 
    Wire.beginTransmission(ACC);
    Wire.write(ACC_X_MSB);
    Wire.endTransmission();
    Wire.requestFrom(ACC,6);
    ////accelerazione x MSB
    int16_t acc_x=Wire.read()<<8|Wire.read();
    
    ////accelerazione y MSB
    int16_t acc_y=Wire.read()<<8|Wire.read();

    ////accelerazione z MSB
    int16_t acc_z=Wire.read()<<8|Wire.read();
    
    /// conversione in m/s^2
    double acc_x_real=acc_x*conv*g;
    double acc_y_real=acc_y*conv*g;
    double acc_z_real=acc_z*conv*g;
    double gravity=square(acc_x_real)+square(acc_y_real)+square(acc_z_real);
    double gravity1=sqrt(gravity);
    //// scrittura sul monitor
 
    Serial.print(String(acc_x_real));
    Serial.print("\t");
    Serial.print(String(acc_y_real));
    Serial.print("\t");
 
    Serial.print(String(acc_z_real));
    Serial.print("\t");
    Serial.print(String(LAT));
    Serial.print("\t");
    Serial.print(String(LONG));
    Serial.print("\t");
    Serial.print(String(SPEED));
    Serial.println("done ");
    Serial.print(String(gravity1));
    Serial.print("\t");
    Serial.print(String(square(acc_x_real)));
    Serial.print("\t");
    Serial.print(String(square(acc_y_real)));
    Serial.print("\t");
    Serial.print(String(square(acc_z_real)));
    Serial.print("\t");
    Serial.print(String(gravity));
    Serial.println(" ");
 }

If I try to acquire GPS and accelerometer data separately (only one device connected to Arduino Uno) the board works very well.
I have also noticed that if the GPS or the accelerometer are acquired separately the Arduino UNO's TX led blinks regurarly but if I load the code shown before this led never blinks.
Thank you in advance if someone can give me some suggestions.

-Accelerometer and GPS Vcc are connected to 3.3V
-GPS TX connected to digital pin 2, GPS RX connected to digital pin 3
-MPU6050 SCL connected to analog input 5, MPU6050 SDA connected to input 4

That Vcc connection indicates that the two sensor boards are running on 3V3. This usually means you cannot connect them directly to a 5V Arduino or you may damage the sensor chips. The I2C connection may work but that depends on the circuit you use. As you failed to provide schematics for the two boards it's on you to check that.

I can load my code but the board doesn't work; in particular it seems that there are some incompatibilities with I2C and Serial protocol because the excecution stops in the setup section when the I2C communication is initialized.

How do you know that?

You should not use the String class on AVR Arduinos.

If I try to acquire GPS and accelerometer data separately (only one device connected to Arduino Uno) the board works very well.

Check the power consumption of the two boards. Does UNO board supply enough current on the 3V3 pin? The Arduino UNO (original from Arduino Italy) provides about 50mA on that pin.

Post links to the exact modules you have.

Some MPU6050 modules have a 5V to 3.3V regulator, and do not work if powered by 3.3V.

Plan on running into problems if you connect 5V Arduinos to 3.3V devices without using logic level shifters.

These two devices are connected in parallel with the 3.3V, so it is possible that the current is not enough for both of them.
The datasheet of Ublox Neo 6m contains the following features:
-power supply voltage: min. 2.7 V max. 3.6V
-average supply current: 47 mA
The datasheet of MPU6050 contains the following features:
-power supply voltage: min. 2.375 V max. 3.46V
-normal operating current: 3.9mA
Here the links of my devices.

https://www.ebay.it/itm/A17-Modulo-Giroscopio-Accelerometro-3-assi-Arduino-MPU-6050-GY-521/232487386016?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

JacMec93:
The datasheet of Ublox Neo 6m contains the following features:
-power supply voltage: min. 2.7 V max. 3.6V
-average supply current: 47 mA

Thats for the GPS itself, you likley have a module with other components added ?

What you need to know is not the average current but the peak, which can be from 55mA to 60mA for the Ublox6 breakout boards I have tested.

The module has not other components added. The GPS is active when I try to acquire contemporary these two devices, because the led (that shows if the satellities are available) blinks.
So It seems that my problem is not an incompatibilities between I2C and Serial communication but a power supply problem: so can I try to power the MPU with a voltage divider powered by 5 volt?

so can I try to power the MPU with a voltage divider powered by 5 volt?

No.

Please read reply #2, and the product page for the sensor, which states that it runs on 5V.

I have solved my problem in this way:
-MPU powered directly by 5V
-Neo 6m powered by 3.3V
-I have noticed that the compiler says that there was an overflow in the variable that contains the baud rate, so I declare it as a const int16_t instead of const int8_t

const int8_t

With a maximum value of 127, such a declaration would not work for any sensible Baud rate.