-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi all,
I'm experiencing crashes attempting to initialize an LSM303AGR compass. This crash occurs during begin() and seems to be due to
an uninitialized pointer being deleted on line 71 of Adafruit_LSM303_Accel.cpp. begin() seems to work fine if i2c_dev is initialized to NULL.
Code:
LSM303AGR()
{
#if DEBUG == 1
Serial.println("Compass LSM303AGR::LSM303AGR: Initializing");
#endif
if (!_CompassMagnetometer.begin())
{
Serial.println("Compass LSM303AGR::LSM303AGR: Magnetometer not found");
}
#if DEBUG == 1
Serial.println("_CompassMagnetometer Initialized");
#endif
if (!_CompassAccelerometer.begin())
{
Serial.println("Compass LSM303AGR::LSM303AGR: Accelerometer not found");
}
Serial.println("Compass LSM303AGR::LSM303AGR: Initialized");
}
-
Arduino board: ESP32-WROOM-32E(16MB)
-
Arduino IDE version (found in Arduino -> About Arduino menu): arduino-esp32 2.0.16 in platformio
-
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): -
Create Adafruit_LSM303_Accel_Unified object
-
Program crashes upon accel.begin() for using a bad free().
Metadata
Metadata
Assignees
Labels
No labels