Skip to content

Stack dump received - not sure why #2983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjs513 opened this issue Feb 19, 2017 · 0 comments
Closed

Stack dump received - not sure why #2983

mjs513 opened this issue Feb 19, 2017 · 0 comments

Comments

@mjs513
Copy link

mjs513 commented Feb 19, 2017

Basic Infos

Hardware

Hardware: ESP8266EX (LinkNode D1)
Core Version: 2,3,0

Description

All of sudden getting a stack dump after updating installing Edison platform in ide. (only changes to ide made) Was working before that. The iCompass.h file referenced works fine when being loaded from a standalone sketch (no wifi). Happens right after connection established

Any and all help would be appreciated.
thanks
Mike

Settings in IDE

Module: LinkNode D1
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: DIO
Flash Frequency: 4M (3M SPIFFS)
Upload Using: SERIAL
Reset Method: ?ck / nodemcu?

Sketch

/**
 * FreeIMU library serial communication protocol
*/
//These are optional depending on your IMU configuration

#include <ADXL345.h>
#include <HMC58X3.h>
#include <LSM303.h>
#include <LPS.h> 
#include <L3G.h>
#include <ITG3200.h> //note LPS library must come before ITG lib
#include <bma180.h>
#include <MS561101BA.h> //Comment out for APM 2.5
#include <BMP085.h>
#include <I2Cdev.h>
#include <MPU60X0.h>
#include <AK8975.h>
#include <AK8963.h>
//#include <SparkFunLSM9DS1.h>  // Uncomment for LSM9DS1
#include <SFE_LSM9DS0.h>  // Uncomment for LSM9DS0 Chosse one or the othe ST IMUs
#include <BaroSensor.h>
//#include <AP_Baro_MS5611.h>  //Uncomment for APM2.5


//These are mandatory
#include <AP_Math_freeimu.h>
#include <Butter.h>    // Butterworth filter
#include <iCompass.h>
#include <MovingAvarageFilter.h>

#include <Wire.h>
#include <SPI.h>

//#define DEBUG
#include "DebugUtils.h"
#include "FreeIMU.h"
#include "DCM.h"
#include "FilteringScheme.h"
#include "RunningAverage.h"


//Intel Edison, Arduino 101, Arduino Due, Arduino Zero: no eeprom 
#if defined(__SAMD21G18A__) || defined(__SAM3X8E__) || defined(__ARDUINO_ARC__) || defined(__SAMD21G18A__) || defined(ESP32)
  #define HAS_EEPPROM 0
#else
  #include <EEPROM.h>
  #define HAS_EEPPROM 1
#endif

#define M_PI 3.14159
#define BaudRate 115200


float q[4];
int raw_values[11];
float ypr[3]; // yaw pitch roll
char str[128];
float val[14];
float val_array[21]; 


// Set the FreeIMU object and LSM303 Compass
FreeIMU my3IMU = FreeIMU();

#include <ESP8266WiFi.h>  //use for ESP8266
#include <WiFiUdp.h>
#include <elapsedMillis.h>

elapsedMillis sendData1;
#define sendInterval 100

const char* ssid = "xxxx";
const char* password = "xxxxxxxx";
WiFiUDP Udp;
WiFiUDP UdpS;

unsigned int localUdpPort = 4210;  // local port to listen on
unsigned int localUdpPortS = 4211;
char incomingPacket[255];  // buffer for incoming packets
String payload;

//The command from the PC
char tempCorr;
String cmd;

void setup() {
  Serial.begin(BaudRate);
  Wire.begin();
  Wire.setClock(4000000L);
  
  //#if HAS_MPU6050()
  //    my3IMU.RESET();
  //#endif
  
  my3IMU.init(true);
  
  Serial.println();
  Serial.printf("Connecting to %s ", ssid);

  // delete old config
  WiFi.disconnect(true);
  
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println(" connected");
  Udp.begin(localUdpPort);
  UdpS.begin(localUdpPortS);
  Serial.printf("Now listening at IP %s, UDP port %d\n", WiFi.localIP().toString().c_str(), localUdpPort);
  Serial.printf("Now listening at IP %s, UDP port %d\n", WiFi.localIP().toString().c_str(), localUdpPortS);
  WiFi.localIP().toString().c_str(), localUdpPort;
  WiFi.localIP().toString().c_str(), localUdpPortS;
  
  // LED
  pinMode(13, OUTPUT);  //
  //pinMode(5, OUTPUT);  //for eps32 thing from sparkfun
}

void loop() {

  int packetSize = Udp.parsePacket();
  if (packetSize)
  {
    // receive incoming UDP packets
    Serial.printf("Received %d bytes from %s, port %d\n", packetSize, Udp.remoteIP().toString().c_str(), Udp.remotePort());
    int len = Udp.read(incomingPacket, 255);
    if (len > 0)
    {
      incomingPacket[len] = 0;
    }
    Serial.printf("UDP packet contents: %s\n", incomingPacket);
	
	cmd = incomingPacket[0];
    if(cmd=="v") {
      sprintf(str, "FreeIMU library by %s, FREQ:%s, LIB_VERSION: %s, IMU: %s", FREEIMU_DEVELOPER, FREEIMU_FREQ, FREEIMU_LIB_VERSION, FREEIMU_ID);
      Serial.print(str);
      Serial.print('\n');
    }
    else if(cmd=="1"){
      my3IMU.init(true);
    }
    else if(cmd=="2"){
      my3IMU.RESET_Q();           
    }
    else if(cmd=="g"){
      my3IMU.initGyros();
    }
    else if(cmd=="t"){
      //available opttions temp_corr_on, instability_fix
      my3IMU.setTempCalib(1);   
    }
    else if(cmd=="f"){
      //available opttions temp_corr_on, instability_fix
      my3IMU.initGyros();
      my3IMU.setTempCalib(0);
    }
  }

	if(sendData1 > sendInterval){
		float val_array[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
		my3IMU.getQ(q, val);
        val_array[15] = my3IMU.sampleFreq;        
        //my3IMU.getValues(val);       
        val_array[7] = (val[3] * M_PI/180);
        val_array[8] = (val[4] * M_PI/180);
        val_array[9] = (val[5] * M_PI/180);
        val_array[4] = (val[0]);
        val_array[5] = (val[1]);
        val_array[6] = (val[2]);
        val_array[10] = (val[6]);
        val_array[11] = (val[7]);
        val_array[12] = (val[8]);
        val_array[0] = (q[0]);
        val_array[1] = (q[1]);
        val_array[2] = (q[2]);
        val_array[3] = (q[3]);
        //val_array[15] = millis();
        val_array[16] = val[9];
        val_array[18] = val[11];
        val_array[19] = val[12];
        
        #if HAS_PRESS()
           // with baro
           val_array[17] = val[10];
           val_array[13] = (my3IMU.getBaroTemperature());
           val_array[14] = (my3IMU.getBaroPressure());
        #elif HAS_MPU6050()
           val_array[13] = (my3IMU.DTemp/340.) + 35.;
        #elif HAS_MPU9150()  || HAS_MPU9250()
           val_array[13] = ((float) my3IMU.DTemp) / 333.87 + 21.0;
        #elif HAS_LSM9DS0()
            val_array[13] = 21.0 + (float) my3IMU.DTemp/8.; //degrees C
        #elif HAS_ITG3200()
           val_array[13] = my3IMU.rt;
        #elif HAS_CURIE()
           val_array[13] = (my3IMU.DTemp/512.0) + 23.0;
        #endif

		    payload = "";
		    serialPayloadFloatArr(val_array, 20);
		    payload += "\r\n";
  
		    int payloadLen = payload.length();
		    byte message[payloadLen];  
		    payload.getBytes(message,payloadLen);

        UdpS.beginPacket(UdpS.remoteIP(), UdpS.remotePort());
        UdpS.write(message,sizeof(message));
        UdpS.endPacket();
        
        sendData1 = 0;
	}

}


//==========================================================
void serialPayloadFloatArr(float * arr, int length) {
  for(int i=0; i<length; i++) {
    serialPayloadPrint(arr[i]);
    payload += ",";
  }
}


void serialPayloadPrint(float f) {
  byte * b = (byte *) &f;
  for(int i=0; i<4; i++) {
    
    byte b1 = (b[i] >> 4) & 0x0f;
    byte b2 = (b[i] & 0x0f);
    
    char c1 = (b1 < 10) ? ('0' + b1) : 'A' + b1 - 10;
    char c2 = (b2 < 10) ? ('0' + b2) : 'A' + b2 - 10;
    
    payload += (c1);
    payload += (c2);
  }
}

Debug Messages

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
Decoding 8 results
0x40206f84: UdpContext::_reserve(unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiUdp.cpp line 67
:  (inlined by) UdpContext::append(char const*, unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src\include/UdpContext.h line 237
:  (inlined by) WiFiUDP::write(unsigned char const*, unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiUdp.cpp line 204
0x40206f7a: UdpContext::_reserve(unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiUdp.cpp line 67
:  (inlined by) UdpContext::append(char const*, unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src\include/UdpContext.h line 237
:  (inlined by) WiFiUDP::write(unsigned char const*, unsigned int) at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiUdp.cpp line 204
0x40203922: iCompass::iround(float, float) at C:\Users\CyberPalin\Documents\Arduino\libraries\iCompass/iCompass.cpp line 12
0x40202638: loop at C:\Users\CyberPalin\Desktop\UDP\FreeIMU_serial_UDP_ESP8266/FreeIMU_serial_UDP_ESP8266.ino line 211
0x402025f1: String::length() const at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h line 79
:  (inlined by) loop at C:\Users\CyberPalin\Desktop\UDP\FreeIMU_serial_UDP_ESP8266/FreeIMU_serial_UDP_ESP8266.ino line 205
0x40207de4: loop_wrapper at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/core_esp8266_main.cpp line 56
0x40100718: cont_norm at C:\Users\CyberPalin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/cont.S line 109
@mjs513 mjs513 closed this as completed Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant