Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4000c46c PS : 0x00060730 A0 : 0x800d226c A1 : 0x3ffb1f30
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000400 A5 : 0x00000000
A6 : 0x000000ff A7 : 0x00000040 A8 : 0x800d3ce0 A9 : 0x3ffb1f00
A10 : 0x00000002 A11 : 0x3f4001dc A12 : 0x00000000 A13 : 0x00000064
A14 : 0x00000019 A15 : 0x60013000 SAR : 0x00000017 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x0000003f
ELF file SHA256: 0000000000000000
Backtrace: 0x4000c46c:0x3ffb1f30 0x400d2269:0x3ffb1f40 0x400d1100:0x3ffb1f60 0x400d1295:0x3ffb1f80 0x400d5842:0x3ffb1fb0 0x40086a75:0x3ffb1fd0
- #include <Arduino.h>
- int bootDelay = 1000;
- // SSD1306:
- #include <Wire.h>
- #include <Adafruit_GFX.h>
- #include <Adafruit_SSD1306.h>
- // Screen width, Screen height, Protocol, Oled reset pin
- Adafruit_SSD1306 display(128, 64, &Wire, -1);
- bool SSD1306Initialized = false;
- void SSD1306Initialize();
- Adafruit_SSD1306 display2(128, 64, &Wire, -1);
- bool SSD1306_2Initialized = false;
- void SSD1306_2Initialize();
- // BNO055
- // #include <Wire.h>
- #include <Adafruit_Sensor.h>
- #include <Adafruit_BNO055.h>
- #include <utility/imumaths.h>
- // ID, Address
- Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28);
- bool BNO055Initialized = false;
- sensors_event_t bnoEulerData , bnoGyrData , bnoLinAccData, bnoMagData, bnoAccData, bnoGravData;
- int8_t bnoTempData;
- uint8_t bnoSysStatus, bnoGyrStatus, bnoAccStatus, bnoMagStatus = 0; // Calibration data
- void BNO055Initialize();
- void BNO055GetData();
- void BNO055Display();
- // BME280
- #include <Wire.h>
- // #include <Adafruit_Sensor.h>
- #include <Adafruit_BME280.h>
- #define SEALEVELPRESSURE_HPA (1013.25)
- Adafruit_BME280 bme; // I2C
- unsigned long delayTime;
- bool BME280Initialized = false;
- // m hPa % m
- float bmeTempData , bmePresData , bmeHumiData , bmeAltiData;
- void BME280Initialize();
- void BME280GetData();
- void setup() {
- Serial.begin(115200);
- Serial2.begin(115200);
- //Initialize SSD1306 OLED Screen
- SSD1306Initialize();
- SSD1306_2Initialize();
- //Initiaize BNO055 Sensor
- BNO055Initialize();
- //Initiaize BME280 Sensor
- BME280Initialize();
- delay(bootDelay);
- display.clearDisplay();
- display.display();
- }
- void loop() {
- uint32_t startTime = millis();
- display.clearDisplay();
- // Get BNO055 Data
- BNO055GetData();
- // Get BME280 Data
- BME280GetData();
- uint32_t measurementTime = millis();
- measurementTime = measurementTime - startTime;
- startTime = millis();
- BNO055Display();
- uint32_t displayTime = millis();
- displayTime = displayTime - startTime;
- display.setCursor(0, 56);
- display.printf("time:MS:%i,DISP:%i", measurementTime, displayTime);
- Serial.printf("Measurement Time: %i, Display Time: %i\n", measurementTime, displayTime);
- Serial.println();
- }
- void SSD1306Initialize() {
- SSD1306Initialized = display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // True if successful
- Serial.println(F("SSD1306: Initialization: Begin"));
- if (!SSD1306Initialized) {
- Serial.println(F("SSD1306: Initialization: Failed "));
- } else {
- Serial.println(F("SSD1306: Initialization: Success"));
- display.clearDisplay();
- display.setTextSize(1);
- display.setTextColor(SSD1306_WHITE);
- display.setCursor(0, 0);
- display.cp437(true);
- display.setTextWrap(false);
- display.print(F("CUHAR FC(Debug)"));
- display.display();
- }
- Serial.println(F("SSD1306: Initialization: Done"));
- }
- void SSD1306_2Initialize() {
- SSD1306_2Initialized = display.begin(SSD1306_SWITCHCAPVCC, 0x3D);
- Serial.println(F("SSD1306_2: Initialization: Begin"));
- if (!SSD1306_2Initialized) {
- Serial.println(F("SSD1306: Initialization: Failed "));
- } else {
- Serial.println(F("SSD1306_2: Initialization: Success"));
- display2.clearDisplay();
- display2.setTextSize(1);
- display2.setTextColor(SSD1306_WHITE);
- display2.setCursor(0, 0);
- display2.cp437(true);
- display2.setTextWrap(false);
- display2.print(F("CUHAR FC(Debug),DISP2"));
- display2.display();
- }
- Serial.println(F("SSD1306_2: Initialization: Done"));
- }
- void BNO055Initialize() {
- Serial.println(F("BNO055: Initialization: Begin"));
- BNO055Initialized = bno.begin();
- display.setCursor(0, 8);
- //display2.setCursor(0, 8);
- if (!BNO055Initialized) {
- Serial.println(F("BNO055: Initialization: Failed"));
- display.print(F("BNO055 ... Error"));
- //display2.print(F("BNO055 ... Error"));
- } else {
- Serial.println(F("BNO055: Initialization: Success"));
- display.print(F("BNO055 ... Init"));
- //display2.print(F("BNO055 ... Init"));
- }
- bno.setExtCrystalUse(true);
- Serial.println(F("BNO055: Initialization: SSD1306 Status Set"));
- display.display();
- //display2.display();
- Serial.println(F("BNO055: Initialization: SSD1306 Display()"));
- }
- void BME280Initialize() {
- Serial.println(F("BME280: Initialization: Begin"));
- BME280Initialized = bme.begin(0x77, &Wire);
- display.setCursor(0, 16);
- display2.setCursor(0, 16);
- if (!BME280Initialized) {
- Serial.println(F("BME280: Initialization: Failed."));
- display.print(F("BNO055 ... Error"));
- display2.print(F("BNO055 ... Error"));
- } else {
- Serial.println(F("BME280: Initialization: Success"));
- display.print(F("BME280 ... Init"));
- display2.print(F("BME280 ... Init"));
- }
- bme.setSampling(Adafruit_BME280::MODE_FORCED,
- Adafruit_BME280::SAMPLING_X16, // Temperature
- Adafruit_BME280::SAMPLING_X16, // Pressure
- Adafruit_BME280::SAMPLING_X16, // Humidity
- Adafruit_BME280::FILTER_X16 ); // IIR filter coefficient
- Serial.println(F("BME280: Initialization: SSD1306 Status Set"));
- display.display();
- display2.display();
- Serial.println(F("BME280: Initialization: SSD1306 Display()"));
- }
- void BNO055GetData() {
- bno.getEvent(&bnoEulerData, Adafruit_BNO055::VECTOR_EULER); // Euler angle
- bno.getEvent(&bnoGyrData, Adafruit_BNO055::VECTOR_GYROSCOPE); // Rad/s
- bno.getEvent(&bnoLinAccData, Adafruit_BNO055::VECTOR_LINEARACCEL); // Linear Acceleration
- bno.getEvent(&bnoMagData, Adafruit_BNO055::VECTOR_MAGNETOMETER); // Magnetometer
- bno.getEvent(&bnoAccData, Adafruit_BNO055::VECTOR_ACCELEROMETER); // Accelerometer
- bno.getEvent(&bnoGravData, Adafruit_BNO055::VECTOR_GRAVITY); // Gravity
- bnoTempData = bno.getTemp(); // Sensor temperature
- bno.getCalibration(&bnoSysStatus, &bnoGyrStatus, &bnoAccStatus, &bnoMagStatus);// Calibration status
- }
- void BNO055Display(){
- display.setCursor(0, 0);
- display.printf("CL:S:%i, G:%i, A:%i, M:%i", bnoSysStatus, bnoGyrStatus, bnoAccStatus, bnoMagStatus);
- Serial.printf("BNO055: Data: Calibration Status: System: %i, Gyro:%i, Accel:%i, Mag:%i\n", bnoSysStatus, bnoGyrStatus, bnoAccStatus, bnoMagStatus);
- display.setCursor(0, 8);
- display.printf("E:%.2f,%.2f,%.2f", bnoEulerData.orientation.x, bnoEulerData.orientation.y, bnoEulerData.orientation.z);
- Serial.printf("BNO055: Data: Euler: %.2f,%.2f,%.2f\n", bnoEulerData.orientation.x, bnoEulerData.orientation.y, bnoEulerData.orientation.z);
- display.setCursor(0, 16);
- display.printf("G:%.2f,%.2f,%.2f", bnoGyrData.gyro.x, bnoGyrData.gyro.y, bnoGyrData.gyro.z);
- Serial.printf("BNO055: Data: Gyro: %.2f,%.2f,%.2f\n", bnoGyrData.gyro.x, bnoGyrData.gyro.y, bnoGyrData.gyro.z);
- display.setCursor(0, 24);
- display.printf("L:%.2f,%.2f,%.2f\n", bnoLinAccData.acceleration.x, bnoLinAccData.acceleration.y, bnoLinAccData.acceleration.z);
- Serial.printf("BNO055: Data: Linear Acceleration: %.2f,%.2f,%.2f", bnoLinAccData.acceleration.x, bnoLinAccData.acceleration.y, bnoLinAccData.acceleration.z);
- display.setCursor(0, 32);
- display.printf("M:%.2f,%.2f,%.2f\n", bnoMagData.magnetic.x, bnoMagData.magnetic.y, bnoMagData.magnetic.z);
- Serial.printf("BNO055: Data: Magnetometer: %.2f,%.2f,%.2f", bnoMagData.magnetic.x, bnoMagData.magnetic.y, bnoMagData.magnetic.z);
- display.setCursor(0, 40);
- display.printf("A:%.2f,%.2f,%.2f\n", bnoAccData.acceleration.x, bnoAccData.acceleration.y, bnoAccData.acceleration.z);
- Serial.printf("BNO055: Data: Accelerometer: %.2f,%.2f,%.2f", bnoAccData.acceleration.x, bnoAccData.acceleration.y, bnoAccData.acceleration.z);
- display.setCursor(0, 48);
- display.printf("G:%.2f,%.2f,%.2f\n", bnoGravData.acceleration.x, bnoGravData.acceleration.y, bnoGravData.acceleration.z);
- Serial.printf("BNO055: Data: Gravity: %.2f,%.2f,%.2f", bnoGravData.acceleration.x, bnoGravData.acceleration.y, bnoGravData.acceleration.z);
- Serial.println();
- display.display();
- }
- void BME280GetData() {
- bme.takeForcedMeasurement();
- bmeTempData = bme.readTemperature();
- bmePresData = bme.readPressure();
- bmeHumiData = bme.readHumidity();
- bmeAltiData = bme.readAltitude(SEALEVELPRESSURE_HPA);
- }