These are chat archives for esp8266/Arduino

24th
May 2016
Ivan Grokhotkov
@igrr
May 24 2016 01:02
@9H5G which atomics are you interested in?
John
@9H5G
May 24 2016 05:16
@igrr only ATOMIC_BLOCK(ATOMIC_RESTORESTATE) at the moment.
Ivan Grokhotkov
@igrr
May 24 2016 05:36
oh, you mean AVR's atomic.h
I though you meant Linux one
John
@9H5G
May 24 2016 05:37
@igrr sorry
Ivan Grokhotkov
@igrr
May 24 2016 05:37
AFAICT ATOMIC_RESTORESTATE is quite AVR-specific, i don't see how it would map on Xtensa...
John
@9H5G
May 24 2016 05:38
yes - that's my understanding and my experience is insufficient to allow me to work around it.
Ivan Grokhotkov
@igrr
May 24 2016 05:40
Would using something like an InterruptLock (see interrupts.h) make sense in your context?
#include "interrupts.h"

some_code();
{
  InterruptLock lock;
  some_code_in_critical_section();
}
outside_of_critical_section();
John
@9H5G
May 24 2016 05:42
possibly, I'll have to take a look - It seems that that is all that is required.
Ivan Grokhotkov
@igrr
May 24 2016 05:42
just make sure you don't disable interrupts for more than 20 microseconds.
if you need to disable some specific interrupts, it is also possible to mask them individually
John
@9H5G
May 24 2016 05:43
its for a FIFO buffer for an AFSK modem
Ivan Grokhotkov
@igrr
May 24 2016 05:43
that will allow WiFi HW interrupts to run freely, and remove the 20 microsecond requirement.
John
@9H5G
May 24 2016 05:44
Thats a very useful pointer - thank you Ivan.
I think the timing should work since the esp is much faster than the AVR
hreintke
@hreintke
May 24 2016 06:36
This message was deleted
aneek231
@aneek231
May 24 2016 15:00

hi! I am using gdb stub for ESP8266 as described here "https://github.com/esp8266/Arduino/tree/master/libraries/GDBStub" ad I am stucked. It is giving me the following error when I tried this command "xtensa-lx106-elf-gdb /path/to/Sketch.cpp.elf -ex "target remote :9980".

Remote debugging using :9924
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout

Thanks in advance. :/

Ivan Grokhotkov
@igrr
May 24 2016 15:00
Do you see reply from the ESP to the GDB stub over serial?
Hmm, also you use target remote :9980 but gdb output says Remote debugging using :9924...
aneek231
@aneek231
May 24 2016 15:02

This is what I see

Connected by ('127.0.0.1', 49010)
rl\x00l\x9c\x9e|\x00\x8cl\xe0|\x02\x0c\x0c\x0c\x8c\x0cl\xec\x0cb|\x8e\x82\x02\xec\x12\x92r\x92bl\x0cb\x8c\xf2nn\x9elnn\x9c\xe2\xec\x0cb\x1cp\xec\x8elrlrlp\xf2n\xe0\x10\x02\x0c\x0c\x82\x0cl\x0c\x8c\x9c\x0c\x0c\x0cb\x0cn\xe2|\x02l\x8c\x8c\x8e\x8eb\x8c\xf2nn\xee\x00l\x8c\x8el\x02\x90\x12\x12nn\x0cl\x02\x0e\x02nr\x8e\x92\x92n\x0c\x0c\x02\x8c\x9c\x0el\x0er\x92\x92n\x0c\x0c\x02\x8c\x9c\x0el\xfc\x82n\x9c\x02+$qSupported:multiprocess+;qRelocInsn+#2a$qSupported:multiprocess+;qRelocInsn+#2a$qSupported:multiprocess+;qRelocInsn+#2a$qSupported:multiprocess+;qRelocInsn+#2a---+$Hg0#df$Hg0#df$Hg0#df$Hg0#df---+$?#3f$?#3f$?#3f$?#3f---+$Hc-1#09$Hc-1#09$Hc-1#09$Hc-1#09---+$qC#b4$qC#b4$qC#b4$qC#b4---+$qAttached#8f$qAttached#8f$qAttached#8f$qAttached#8f---+$qOffsets#4b$qOffsets#4b$qOffsets#4b$qOffsets#4b---+
Disconnected
Waiting for connection on 9924...

I have written by mistake its 9924. I changed the port to see if it might work.
Ivan Grokhotkov
@igrr
May 24 2016 15:04
Looks like there is no reply from ESP side
What does the ESP say when the exception happens?
aneek231
@aneek231
May 24 2016 15:05
Yes, it didnt reply for any packet
Ivan Grokhotkov
@igrr
May 24 2016 15:06
Can you check serial output from the ESP when the exception happens? I.e. does it actually reach GDBStub?
aneek231
@aneek231
May 24 2016 15:10
Can you first tell me that if we have to initialize GDBStub somewhere
or only need to include the headrer
GDBStub.h
Ivan Grokhotkov
@igrr
May 24 2016 15:15
Should be enough to include "GDBStub.h" from the main sketch file
aneek231
@aneek231
May 24 2016 15:18

this is how my main file looks like

include <Arduino.h>

include <GDBStub.h>

void setup(void) {

Serial.begin(115200);
Serial.println("\n\n");
Serial.println("________System Started_________");
Serial.println("--------Init Routines----------");

}

void loop(void) {
tone(13,1000,50);
delay(10000);
tone(13,1000,50);
delay(10000);
tone(13,1000,50);
delay(10000);
}

i can seet these println when i invoke target remote :9924
Ivan Grokhotkov
@igrr
May 24 2016 15:20
Does the sketch actually crash?
aneek231
@aneek231
May 24 2016 15:20
no
i can still listen the tone from buzzer
Ivan Grokhotkov
@igrr
May 24 2016 15:20
Because it will enter GDBStub only on an exception...
aneek231
@aneek231
May 24 2016 15:21
so how to enter the exception
Ivan Grokhotkov
@igrr
May 24 2016 15:21
what are you trying to do, anyway? :)
GDB into a working program?
aneek231
@aneek231
May 24 2016 15:22
:D
Ivan Grokhotkov
@igrr
May 24 2016 15:22
Anyway, you can force it to break into gdb...
extern "C" void gdbstub_do_break();
somewhere before setupfunction
and then call gdbstub_do_break from your setup function
this will force it to enter GDB
__asm__ __volatile__ ("break 0,0"); should work as well
aneek231
@aneek231
May 24 2016 15:28
thankyou . Let me try :)
aneek231
@aneek231
May 24 2016 15:39
the problem is still the same
Waiting for connection on 9924...
Connected by ('127.0.0.1', 49034)
rl\x00l\x9c\x9e|\x00\x8cl\xe0|\x02\x0c\x0c\x0c\x8c\x0cl\xec\x0cb|\x8e\x82\x02\xec\x12\x92r\x92bl\x0cb\x8c\xf2nn\x9elnn\x9c\xe2\xec\x0cb\x1cp\x8c\x8elrlrlp\xf2n\xe0\x10\x02\x0c\x0c\x82\x0cl\x0c\x8c\x9c\x0c\x0c\x0cb\x0cn\xe2|\x02l\x8c\x8c\x8e\x8eb\x8c\xf2nn\xee\x00l\x8c\x8el\x02\x90\x12\x12nn\x0cl\x02\x0e\x02nr\x8e\x92\x92n\x0c\x0c\x02\x8c\x9c\x0el\x0er\x92\x92n\x0c\x0c\x02\x8c\x9c\x0el\xfc\x82n\x9c\x02\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n+$qSupported:multiprocess+;qRelocInsn+#2a$qSupported:multiprocess+;qRelocInsn+#2a$qSupported:multiprocess+;qRelocInsn+#2a\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n$qSupported:multiprocess+;qRelocInsn+#2a--\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n-+$Hg0#df$Hg0#df$Hg0#df$Hg0#df\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n---+$?#3f\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n$?#3f$?#3f$?#3f\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n---+$Hc-1#09$Hc-1#09\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n$Hc-1#09$Hc-1#09-\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n--+$qC#b4$qC#b4$qC#b4\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n$qC#b4--\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n-+$qAttached#8f$qAttached#8f$qAttached#8f$qAttached#8f\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n---+$qOffsets#4b\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n$qOffsets#4b$qOffsets#4b$qOffsets#4b\r\n ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x0f\r\ncsum 0x0f\r\n~ld\n---+
Disconnected
Reading symbols from /mnt/hgfs/rystaFirmware/UnitTest/gdbStub/.pioenvs/esp12e/firmware.elf...done.
Remote debugging using :9924
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
(gdb)
Ivan Grokhotkov
@igrr
May 24 2016 15:42
ets Jan 8 2013,rst cause:4, boot mode:(3,6)\r\n\r\nwdt reset the thing is going into watchdog reset
which version of ESP8266 Arduino core are you using, by the way?
aneek231
@aneek231
May 24 2016 15:49
Espwroom-02
yeah, I don't have this update.
aneek231
@aneek231
May 24 2016 17:05
Hi Ivan , I am still getting the same issue although I have got the new repo "https://github.com/esp8266/Arduino/tree/master/libraries/GDBStub". When I call gdbstub_do_break(); wdt is reset.
aneek231
@aneek231
May 24 2016 17:28
I have also checked with "asm volatile ("break 0,0"); ". I am having the same isssue . watchdog timer is resetting
aneek231
@aneek231
May 24 2016 18:02
If it has something to do with -ggdb , -Og flags ?