Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By hrshovon
#20827 Hello all,
I have downloaded the latest esp8266 toolchain via Boards manager in Arduino 1.6.5.While doing random testing,I came across an issue.I wrote a simple code to test the GPIO of ESP8266.This code was tested on both ESP-01 and ESP-07 module.
Code: Select allvoid setup() {
  // put your setup code here, to run once:
  pinMode(2,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(2,LOW);
  delayMicroseconds(1);
  digitalWrite(2,HIGH);
  delayMicroseconds(1);
}

here,the frequency should be around 500KHz or if not,it should at least be a square wave with 50% duty cycle.The scope output has been attached.
It seems that the loop is taking ~7uS at he end of the loop.
am I doing something wrong here or is this a bug?
The attached output is from ESP-01 module.
You do not have the required permissions to view the files attached to this post.
User avatar
By cal
#20829 Moin,

Despite my little espduino understanding I guess that the espduino does some standard esp8266 SDK.

That means no user task must use the cpu exclusively for some time.

<1s if you want top avoid a watchdog reset.
<10ms if you want proper wifi access.

I guess what you measure here is the other SDK tasks that run inbetween any of your loop runs.
If you want to do us a favour lookup the call of "loop()" up in espduino and tell us about your findings.

Cal

P.S.
Try blocking the loop for longer than about 1s and you should get a wdt reset.
User avatar
By GerryKeely
#20840 Hi

Yes there is some delay introduced at the end of the loop, to avoid this use "while" to speed it up eg

Code: Select allvoid loop() {
  // put your main code here, to run repeatedly:
while(1){
  digitalWrite(2,LOW);
  delayMicroseconds(1);
  digitalWrite(2,HIGH);
  delayMicroseconds(1);
}
}


Gerry