Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By schufti
#26818 Hi guys,

I need the info of rst_info.reason but am not fit enough to get the struct thingie right ;)

would really appreciate a relevant snippet of code.

that is how far I get:
Code: Select allvoid setup() {
  rst_info *xyz;
  Serial.begin(115200);
  xyz = ESP.getResetInfoPtr();
  Serial.println((*xyz).reason);

and I get this error:
Code: Select allmy_am2321.ino: In function 'void setup()':
my_am2321.ino:42:24: error: invalid use of incomplete type 'struct rst_info'
In file included from D:\arduino\portable\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/Arduino.h:248:0,
                 from D:\arduino\portable\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\libraries\SPI/SPI.h:24,
                 from my_am2321.ino:2:
D:\arduino\portable\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/Esp.h:125:16: error: forward declaration of 'struct rst_info'
         struct rst_info * getResetInfoPtr();
                ^
invalid use of incomplete type 'struct rst_info'

thanks,
schufti
Last edited by schufti on Sun Aug 23, 2015 3:28 pm, edited 1 time in total.
User avatar
By schufti
#26861 Hi,
could you show your includes? I am on staging 1044 version with only one sdk installation (1.20.0-26-gb404fb9-2)
I tried user_interface.h but it doesn't really help ... now defaulted to define the struct myself but not yet checked if it is working (compiled ok) ...

Code: Select allstruct rst_info{
   uint32 reason;
   uint32 exccause;
   uint32 epc1;
   uint32 epc2;
   uint32 epc3;
   uint32 excvaddr;
   uint32 depc;
};
void setup() {
  rst_info *xyz;
  Serial.begin(115200);
  xyz = ESP.getResetInfoPtr();
  Serial.println((*xyz).reason);
}

void loop() {
  // put your main code here, to run repeatedly:

}


tnx,
schufti