-->
Page 1 of 2

ESP resets on readvdd33()

PostPosted: Wed Jul 01, 2015 11:20 am
by costo
I use Arduino IDE 1.6.5 and have ESP-add-on version 1.6.4-673g8cd3697 installed (copied in the hardware folder).
I want to read the 3,3 volt so I added this code:

Code: Select allextern "C" {     
  #include "user_interface.h"
  uint16 readvdd33(void);
}

and made :

void readVdd()
{
  char buf[6];                                  // temporary buffer
  float  vdd = readvdd33()/1000.0;
  dtostrf( vdd, 1 ,3, buf);                     // convert float to string
  sendStrXY(buf,7,10);                         // print string on OLED
}


I call readVdd() in setup() and it perfectly prints the string on the display, so far so good but only in setup().

When I do this in the loop then the ESP resets most of the time with message: wdt reset ... etc .... etc
no difference if I ommit the dtostrf() and sendStrXY() functions, the vdd = readvdd33()/1000.0 make the ESP crash.

Is this a feature ;) or is this not (yet) fully implemented in the ESP add-on ?

Re: ESP resets on readvdd33()

PostPosted: Thu Jul 02, 2015 2:22 am
by tytower
Got the full code so I can try it quickly ?
First thought was get some brackets around (readvdd33()/1000.0) but I dont think you need to divide it by 1000 do you? Try it without and see what happens

Re: ESP resets on readvdd33()

PostPosted: Fri Jul 03, 2015 11:57 am
by costo
It's weird but I'm not able anymore to reproduce this phenomenon. 2 days ago ESP crashed all the time with this readVdd33() call inside the loop() , whichever sketch I used. Today nothing is wrong and I can use the vdd33 call without any pain.
I was thinking it was my setup, I was using a I2C OLED and I2C master/slave communication when the ESP crashed. So today I tried different ESP's, the 07 and the 01 versions and all sort of I2C setups. All works fine , the symptoms have disappeared overnight, after my PC was powerless for a day.

Have checked the powersupply but that must be fine with a 5V/3.3V breadboard PSU print and plenty of capacitors on the powerrails of the breadboard.
Resetpin of the ESP has a 10nF directly soldered from the RST_pin to the metal case, it is very stable and never resets spontaneous.
Hopefully it never happens again.

Re: ESP resets on readvdd33()

PostPosted: Fri Jul 03, 2015 9:08 pm
by Eyal
With the LUA firmware I get this crash whenever I readvdd33() a few times.
I just do not do it (I read once). This uses SDK 0.9.5 and I am waiting for a v1 series LUA release to see if the problem goes away.