Forum Replies Created
-
AuthorPosts
-
gojimmypi
ParticipantHi –
Interesting information, thanks. The DIO / memory, etc… yes, I’ve wondered whether when I make those change, if they are actually used at programming time. fwiw – In VisualMicro I use DIO, 4M (1M SPIFFS), CPU 80MHz, Flash 40MHz.
So I created a new project (HTTPDemo RTOS), rather than changing existing settings – and curiously I see this error at upload time, immediately after the first step “Programming Firmware”. It never even gets to the “Connecting to GDB stub”
VisualGDB version: 5.2.14.1374
—————— System.NullReferenceException ——————
System.NullReferenceException: Object reference not set to an instance of an object.
at ESP8266DebugPackage.ESP8266StubDebugExtension.StubStartSequence.BuildSequence(String targetPath, Dictionary2 bspDict, Dictionary
2 debugMethodConfig, LiveMemoryLineHandler lineHandler)
at uc.k1(bz a, ICustomStartupSequenceBuilder b)
at uc.l.c(bz a)
at VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.<>c__DisplayClass1_0`1.<RunAction>b__0()I checked the Norton history, and it has not complained since last weekend (perhaps you recall the vgagent false alarm)
Note that if I follow the tutorial exactly, leaving the defaults (in particular the QIO setting)… I am able to upload, but the GDB never works and we are in the infinite loop of exception errors.
So I think we’re really onto something here with those settings.
I’ll continue with your suggestions from prior message later today…
gojimmypi
ParticipantHi –
That’s really awesome you ordered a NodeMCU and plan to post a tutorial! I believe many people will be looking forward to that! Thank you so much đ
Yes, my NodeMCU board is otherwise fully functional when programming via UART via VisualMicro. It works great; no complaints.
Great idea to compare read data to what was expected to be written from VisualGDB.
First though, I went back to known-good code compiled in VisualMicro and loaded it up like this: (from /C/SysGCC/esp8266/esp8266-bsp)
python esptool.py –baud 115200 –port “COM19” write_flash –flash_size=8m 0Â myfile.bin
it gave output like this:
Writing at 0x00000000… (0 %) reply
Writing at 0x00000400… (0 %) reply
Writing at 0x00000800… (1 %) reply
…
Writing at 0x0003b000… (98 %) reply
Writing at 0x0003b400… (99 %) reply
Writing at 0x0003b800… (99 %) reply
Writing at 0x0003bc00… (100 %) replyWritten 245760 bytes in 24.08 seconds (81.65 kbit/s)…
I confirmed the code was operating properly (my code writes a variety of information out Serial UART, so all good there). Note that only one file is written, at 0x0. Not two.
So I attempted to read it back like this:
python esptool.py –baud 115200 –port “COM19” read_flash 0 245760
The files could not be compared, as the source file written was only 244,848 bytes (912 bytes different)
So then I tried that size:
python esptool.py –baud 115200 –port “COM19” read_flash 0 244848
And the files, even though the same size, did not compare… although only 2 differences:
00000002: 02 00
00000003: 40 20Would that be expected? (again, this is known-good code, confirmed to be working properly)
I’m also curious as to why 2 bin files need to be loaded at two different addresses when using VisualGDB? Why the code split?
Just a heads up also, that I then tried erasing my NodeMCU like this:
python esptool.py –baud 115200 –port “COM19” erase_flash
That made the GDB stub quite unhappy when then trying to upload:
VisualGDB version: 5.2.14.1374
—————— System.Exception ——————
System.Exception: Unexpected reply from ESP8266
at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk)
at ESP8266DebugPackage.ESP8266BootloaderClient.Sync()
at ESP8266DebugPackage.ESP8266StubDebugExtension.StubStartSequence.BuildSequence(String targetPath, Dictionary2 bspDict, Dictionary
2 debugMethodConfig, LiveMemoryLineHandler lineHandler)
at uc.k1(bz a, ICustomStartupSequenceBuilder b)
at uc.l.c(bz a)
at ls1.v.p1`1.f(bz a)
at VisualGDB.Add_In.Tool_Windows.WPF.DockedProgressPresenter.c(Action`1 operation, String caption, he1 exceptionHandler, String[] stages)However after I put back my original code:
python esptool.py –baud 115200 –port “COM19” write_flash –flash_size=8m 0 mycode.bin
I was then able to do the GDB upload on top of the non-blank chip. But it got stuck on “The following GDB command is taking too long to complete:Â -exec-continue”
Pressing cancel yields this message:
C:\SysGCC\esp8266\bin\xtensa-lx106-elf-gdb.exe –interpreter mi C:\workspace\NGDB2\VisualGDB\Debug\NGDB2
Warning: could not set a breakpoint on main. ‘Step into new instance’ will not work.
Bogus trace status reply from target: timeout
Loaded image in 42220 ms
Cannot resolve the address of _estack. Skipping stack pointer validity check.
Invalid cast.
The program is not being run.
Cannot access memory at address 0x60000900
Cannot access memory at address 0x60000900
Invalid thread id: 1
No registers.
Invalid thread id: 1Ignoring that message, back to the original question…. yes I can successfully read exactly the bytes written at 0x0 and 0x20000
python esptool.py –baud 115200 –port “COM19” read_flash 0x20000 245523 /c/workspace/NGDB2/VisualGDB/Debug/read-2.bin
python esptool.py –baud 115200 –port “COM19” read_flash 0 32448 /c/workspace/NGDB2/VisualGDB/Debug/read-0.bin
…those files compare exactly to the originals
C:\workspace\NGDB2\VisualGDB\Debug>fc NGDB2-0x00000.bin read-0.bin
Comparing files NGDB2-0x00000.bin and READ-0.BIN
FC: no differences encountered
C:\workspace\NGDB2\VisualGDB\Debug>fc NGDB2-0x20000.bin read-2.bin
Comparing files NGDB2-0x20000.bin and READ-2.BIN
FC: no differences encounteredHowever as previously described, the code is *not* executing properly, rather the ESP8266 is spewing this repeated message out the UART at 74880 baud:
 ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x3ffe8000, len 940, room 16
tail 12
chksum 0xc3
ho 0 tail 12 room 4
load 0x3ffe83b0, len 936, room 12
tail 12
chksum 0xfc
ho 0 tail 12 room 4
load 0x40100000, len 30536, room 12
tail 12
chksum 0xe9
csum 0xe9
OS SDK ver: 1.5.0-dev(950076a) compiled @ Nov 4 2016 19:29:32
rf_cal[0] !=0x05,is 0xFFBut this tells us a LOT! đ The compile code *is* making it onto the chip, but there’s apparently something wrong then with the compiled code not executing properly. (cause:2 = exception)
It is curious that my known-good code, confirmed to be working, has those two bytes changed when read back, and the VisualGDB read back exactly the same. Also curious that 2 separate files are needed – perhaps something wrong at 0x20000? I also don’t see the output from uploading the VisualGDB files, wondering if they too, have a 912 byte difference as when I manually uploaded my known working code?
In the end, I’m wondering if there’s some problem with the compiler, and not GDB &Â not JTAG?
gojimmypi
ParticipantAlso feel free to attach the full gdb log so that we could check for common errors.
here ya go… the whole gdb log:
Your VisualGDB trial expires in 15 days!
C:\SysGCC\esp8266\bin\xtensa-lx106-elf-gdb.exe –interpreter mi C:\workspace\OMC\VisualGDB\Debug\OMC
-gdb-version
=thread-group-added,id=”i1″
~”GNU gdb (GDB) 7.11\n”
~”Copyright (C) 2016 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \”show copying\”\nand \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-pc-mingw32 –target=xtensa-lx106-elf\”.\nType \”show configuration\” for configuration details.”
~”\nFor bug reporting instructions, please see:\n”
~”<http://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”…\n”
~”Reading symbols from C:\\workspace\\OMC\\VisualGDB\\Debug\\OMC…”
~”done.\n”
~”GNU gdb (GDB) 7.11\n”
~”Copyright (C) 2016 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \”show copying\”\nand \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-pc-mingw32 –target=xtensa-lx106-elf\”.\nType \”show configuration\” for configuration details.”
~”\nFor bug reporting instructions, please see:\n”
~”<http://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”.\n”
^done
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”]
-gdb-set disassembly-flavor intel
^error,msg=”No symbol \”disassembly\” in current context.”
-gdb-set print demangle off
^done
-break-insert -f main
&”Function \”main\” not defined.\n”
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”<PENDING>”,pending=”main”,times=”0″,original-location=”main”}
Warning: could not set a breakpoint on main. ‘Step into new instance’ will not work.
-break-delete 1
^done
target remote :3333
&”target remote :3333\n”
~”Remote debugging using :3333\n”
=thread-group-started,id=”i1″,pid=”42000″
=thread-created,id=”1″,group-id=”i1″
~”0x400044b4 in ?? ()\n”
*stopped,frame={addr=”0x400044b4″,func=”??”,args=[]},thread-id=”1″,stopped-threads=”all”
^done
info shared
&”info shared\n”
~”No shared libraries loaded at this time.\n”
^done
mon reset halt
&”mon reset halt\n”
@”JTAG scan chain interrogation failed: all zeroes\n”
@”Check JTAG interface, timings, target power, etc.\n”
@”Trying to use configured scan chain anyway…\n”
@”esp8266.cpu: IR capture error; saw 0x00 not 0x01\n”
@”Bypassing JTAG setup events due to errors\n”
@”xtensa_deassert_reset: ‘reset halt’ is not supported for Xtensa. Have halted some time after resetting (not the same thing!)\n”
@”target state: halted\n”
@”halted: PC: 0x40003b53\n”
@”debug cause: 0x20\n”
^done
-exec-next-instruction
^running
*running,thread-id=”all”
*stopped,reason=”end-stepping-range”,frame={addr=”0x40003b55″,func=”??”,args=[]},thread-id=”1″,stopped-threads=”all”
set $com_sysprogs_esp8266_wdcfg=0
&”set $com_sysprogs_esp8266_wdcfg=0\n”
^done
set $vecbase=0x40000000
&”set $vecbase=0x40000000\n”
^done
set *(0x3fffc200)=0
&”set *(0x3fffc200)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x3fffc200″,len=”0x4″
^done
set $ccompare=0
&”set $ccompare=0\n”
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
print *((int *)0x60000900)
&”print *((int *)0x60000900)\n”
~”$1 = 0″
~”\n”
^done
set *((int *)0x60000900)=0
&”set *((int *)0x60000900)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x60000900″,len=”0x4″
^done
restore C:/SysGCC/esp8266/esp8266-bsp/sysprogs/flashprog/ESP8266FlashProg.bin binary 0x40100000 0 0x1a4
&”restore C:/SysGCC/esp8266/esp8266-bsp/sysprogs/flashprog/ESP8266FlashProg.bin binary 0x40100000 0 0x1a4\n”
~”Restoring binary file C:/SysGCC/esp8266/esp8266-bsp/sysprogs/flashprog/ESP8266FlashProg.bin into memory (0x40100000 to 0x401001a4)\n”
^done
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=0
&”set *((unsigned *)0x3fff8008)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=4096
&”set *((unsigned *)0x3fff800c)=4096\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=4096
&”set *((unsigned *)0x3fff8010)=4096\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
&”warning: \nUnrecognised function prologue. Stack trace cannot be resolved. This message will not be repeated in this session.\n”
&”\n”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=1
&”set *((unsigned *)0x3fff8008)=1\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=0
&”set *((unsigned *)0x3fff800c)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=28864
&”set *((unsigned *)0x3fff8010)=28864\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x00000.bin binary 0x3ffe8008 0x0 0x70c0
&”restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x00000.bin binary 0x3ffe8008 0x0 0x70c0\n”
~”Restoring binary file C:/workspace/OMC/VisualGDB/Debug/OMC-0x00000.bin into memory (0x3ffe8008 to 0x3ffef0c8)\n”
^done
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=2
&”set *((unsigned *)0x3fff8008)=2\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=0
&”set *((unsigned *)0x3fff800c)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=28864
&”set *((unsigned *)0x3fff8010)=28864\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=1
&”set *((unsigned *)0x3fff8008)=1\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=65536
&”set *((unsigned *)0x3fff800c)=65536\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=193956
&”set *((unsigned *)0x3fff8010)=193956\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffe8008 0x0 0x10000
&”restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffe8008 0x0 0x10000\n”
~”Restoring binary file C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin into memory (0x3ffe8008 to 0x3fff8008)\n”
^done
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=2
&”set *((unsigned *)0x3fff8008)=2\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=65536
&”set *((unsigned *)0x3fff800c)=65536\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=65536
&”set *((unsigned *)0x3fff8010)=65536\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffd8008 0x10000 0x20000
&”restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffd8008 0x10000 0x20000\n”
~”Restoring binary file C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin into memory (0x3ffe8008 to 0x3fff8008)\n”
^done
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=2
&”set *((unsigned *)0x3fff8008)=2\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=131072
&”set *((unsigned *)0x3fff800c)=131072\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=65536
&”set *((unsigned *)0x3fff8010)=65536\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffc8008 0x20000 0x2f5a4
&”restore C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin binary 0x3ffc8008 0x20000 0x2f5a4\n”
~”Restoring binary file C:/workspace/OMC/VisualGDB/Debug/OMC-0x10000.bin into memory (0x3ffe8008 to 0x3fff75ac)\n”
^done
flushregs
&”flushregs\n”
~”Register cache flushed.\n”
^done
set $epc2=0x40100074
&”set $epc2=0x40100074\n”
^done
set $ps=0x20
&”set $ps=0x20\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set *((unsigned *)0x3fff8008)=2
&”set *((unsigned *)0x3fff8008)=2\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8008″,len=”0x4″
^done
set *((unsigned *)0x3fff800c)=196608
&”set *((unsigned *)0x3fff800c)=196608\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff800c”,len=”0x4″
^done
set *((unsigned *)0x3fff8010)=62884
&”set *((unsigned *)0x3fff8010)=62884\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8010″,len=”0x4″
^done
set *((unsigned *)0x3fff8014)=4294967295
&”set *((unsigned *)0x3fff8014)=4294967295\n”
=memory-changed,thread-group=”i1″,addr=”0x3fff8014″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
-exec-continue
^running
*running,thread-id=”all”
~”\nProgram”
~” received signal SIGTRAP, Trace/breakpoint trap.\n”
~”0x4010013c in TimerFunction (arg=<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>) at LEDBlink.cpp:35\n”
~”35\t\t\tgpio_output_set(0, BIT1, BIT1, 0);\n”
*stopped,reason=”signal-received”,signal-name=”SIGTRAP”,signal-meaning=”Trace/breakpoint trap”,frame={addr=”0x4010013c”,func=”TimerFunction”,args=[{name=”arg”,value=”<error reading variable: Cannot determine frame base. Please call the current function from a function compiled with frame pointer to allow viewing local variables.>”}],file=”LEDBlink.cpp”,fullname=”C:\\workspace\\OMC\\OMC\\LEDBlink.cpp”,line=”35″},thread-id=”1″,stopped-threads=”all”
-data-evaluate-expression “\*\(\(unsigned\ \*\)0x3fff8014\)”
^done,value=”0″
set $ps=0x20
&”set $ps=0x20\n”
^done
set $epc2=0x40000080
&”set $epc2=0x40000080\n”
^done
set $sp=0x3fffc000
&”set $sp=0x3fffc000\n”
^done
set $vecbase=0x40000000
&”set $vecbase=0x40000000\n”
^done
set *(0x3fffc200)=0
&”set *(0x3fffc200)=0\n”
=memory-changed,thread-group=”i1″,addr=”0x3fffc200″,len=”0x4″
^done
set $intclear=-1
&”set $intclear=-1\n”
^done
set $intenable=0
&”set $intenable=0\n”
^done
set $eps2=0x20
&”set $eps2=0x20\n”
^done
set $icountlevel=0
&”set $icountlevel=0\n”
^done
Loaded image in 12416 ms
-break-insert -h -f *0x40100004
^done,bkpt={number=”2″,type=”hw breakpoint”,disp=”keep”,enabled=”y”,addr=”0x40100004″,at=”<call_user_start>”,thread-groups=[“i1″],times=”0″,original-location=”*0x40100004″}
mon xtensa_no_interrupts_during_steps on
&”mon xtensa_no_interrupts_during_steps on\n”
@”Interrupt suppression during single-stepping is now enabled\n”
^done
mon esp8266_autofeed_watchdog on
&”mon esp8266_autofeed_watchdog on\n”
@”Watchdog feeding during stops is now enabled\n”
^done
info target
&”info target\n”
~”Symbols from \”C:\\workspace\\OMC\\VisualGDB\\Debug\\OMC\”.\n”
~”Remote serial target in gdb-specific protocol:\n”
~”Debugging a target over a serial line.\n”
~”\tWhile running this, GDB does not access memory from…\n”
~”Local exec file:\n”
~”\t`C:\\workspace\\OMC\\VisualGDB\\Debug\\OMC’, file type elf32-xtensa-le.\n”
~”\tEntry point: 0x40100004\n”
~”\t0x3ffe8000 – 0x3ffe8370 is .data\n”
~”\t0x3ffe8370 – 0x3ffe84a8 is .rodata\n”
~”\t0x3ffe84a8 – 0x3ffee760 is .bss\n”
~”\t0x40210000 – 0x4023f5a4 is .irom0.text\n”
~”\t0x40100000 – 0x40106bec is .text\n”
^done
-data-evaluate-expression “&_estack”
^error,msg=”No symbol \”_estack\” in current context.”
-data-evaluate-expression “&__StackLimit”
^error,msg=”No symbol \”__StackLimit\” in current context.”
Cannot resolve the address of _estack. Skipping stack pointer validity check.
set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg
&”set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg\n”
=memory-changed,thread-group=”i1″,addr=”0x60000900″,len=”0x4″
&”warning: \nUnrecognised function prologue. Stack trace cannot be resolved. This message will not be repeated in this session.\n”
&”\n”
^done
-exec-continue
^running
*running,thread-id=”all”
=breakpoint-modified,bkpt={number=”2″,type=”hw breakpoint”,disp=”keep”,enabled=”y”,addr=”0x40100004″,at=”<call_user_start>”,thread-groups=[“i1″],times=”1″,original-location=”*0x40100004″}
~”\n”
~”Breakpoint 2, 0x40100004 in call_user_start ()\n”
*stopped,reason=”breakpoint-hit”,disp=”keep”,bkptno=”2″,frame={addr=”0x40100004″,func=”call_user_start”,args=[]},thread-id=”1″,stopped-threads=”all”
-break-delete 2
^done
set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg
&”set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg\n”
=memory-changed,thread-group=”i1″,addr=”0x60000900″,len=”0x4″
^done
-exec-continue
^running
*running,thread-id=”all”gojimmypi
ParticipantThanks once again for your prompt reply.
I am unable to use the GDB stub. I’m sure the COM port is working, as not only was I able to previously see the error messages from VisualGDB when trying to JTAG program, but I am also able to go back to VisualMicro and do a “Build-Upload” with that COM port with no problems.
I reviewed the steps (twice) and confirmed I followed the tutorial. At F5-debug time, I see this error:
VisualGDB version: 5.2.14.1374
—————— System.Exception ——————
System.Exception: Cannot read reply body
at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk)
at ESP8266DebugPackage.ESP8266BootloaderClient.Sync()
at ESP8266DebugPackage.ESP8266StubDebugExtension.StubStartSequence.BuildSequence(String targetPath, Dictionary2 bspDict, Dictionary
2 debugMethodConfig, LiveMemoryLineHandler lineHandler)
at uc.k1(bz a, ICustomStartupSequenceBuilder b)
at uc.l.c(bz a)
at ls1.v.p1`1.f(bz a)
at VisualGDB.Add_In.Tool_Windows.WPF.DockedProgressPresenter.c(Action`1 operation, String caption, he1 exceptionHandler, String[] stages)Perhaps you’ll recall that not one, but twice I had problems with Norton thinking that various components were bad – so I disabled Norton, ran a repair from VisualGDB-5.2r8-trial.msi and had different results! It still did not work, saying that GDB was taking too long to respond, so after some time I pressed cancel:
Your VisualGDB trial expires in 15 days!
C:\SysGCC\esp8266\bin\xtensa-lx106-elf-gdb.exe –interpreter mi c:\workspace\VGDB\VisualGDB\Debug\VGDB
-gdb-version
=thread-group-added,id=”i1″
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=xtensa-lx106-elf”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from c:\workspace\VGDB\VisualGDB\Debug\VGDB…
done.
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=xtensa-lx106-elf”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
OK
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”]
-gdb-set disassembly-flavor intel
No symbol “disassembly” in current context.
-gdb-set print demangle off
OK
-break-insert -f main
&”Function \”main\” not defined.\n”
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”<PENDING>”,pending=”main”,times=”0″,original-location=”main”}
Warning: could not set a breakpoint on main. ‘Step into new instance’ will not work.
-break-delete 1
OK
set serial baud 74880
&”set serial baud 74880\n”
=cmd-param-changed,param=”serial baud”,value=”74880″
OK
target remote \\.\COM12
&”target remote \\\\.\\COM12\n”
Remote debugging using \\.\COM12
Ignoring packet error, continuing…
&”warning: unrecognized item \”timeout\” in \”qSupported\” response\n”
Ignoring packet error, continuing…
Loaded image in 30583 ms
&”Quit (expect signal SIGINT when the program is resumed)\n”
Quit (expect signal SIGINT when the program is resumed)
System.Exception: GDB has exited prematurely
at VisualGDB.GDBDebugEngine.c(or a, q1 b)I tried yet again, but got this message (confirming Norton auto-protect still disabled):
VisualGDB version: 5.2.14.1374
—————— System.Exception ——————
System.Exception: Mismatching reply from ESP8266
at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk)
at ESP8266DebugPackage.ESP8266BootloaderClient.Sync()
at ESP8266DebugPackage.ESP8266StubDebugExtension.StubStartSequence.BuildSequence(String targetPath, Dictionary2 bspDict, Dictionary
2 debugMethodConfig, LiveMemoryLineHandler lineHandler)
at uc.k1(bz a, ICustomStartupSequenceBuilder b)
at uc.l.c(bz a)
at ls1.v.p1`1.f(bz a)
at VisualGDB.Add_In.Tool_Windows.WPF.DockedProgressPresenter.c(Action`1 operation, String caption, he1 exceptionHandler, String[] stages)I tried both with power cycle while holding down flash button (I don’t kneed to do this with VisualMicro).. and simply a power cycle: same results.
fwiw – I have a single breakpoint on line 128 at “wifi_set_opmode”
I re-confirmed Com12 is the correct port. (it is a CH340-based USB-TTL adapter, that specifically has a jumper for selecting 3.3v)
gojimmypi
ParticipantHi – I had a similar issue, perhaps this thread may be helpful:
https://sysprogs.com/w/forums/topic/where-to-find-esp8266-xtensa-lx-106-elf-for-gdb-stub/
fwiw – I ended up buying Olimex hardware (both the JTAG programmer & ESP8266 EVB) from Mouser Electronics. I had more success, but things still did not work out quite as one might expect.
See also my thread on the Olimex forum that may be of interest:
https://www.olimex.com/forum/index.php?topic=5676.0
I plan to revisit the Segger this weekend & will post my results. One thing that may have been reckless on my part: I used a nice parallel cable with the Olimex, and an octopus of loose wires with the Segger:
https://twitter.com/gojimmypi/status/830173265993674752
Lame, as my background is in electronics and I should know that the alternating parallels of ground wire can significantly reduce the noise and interference on the signal lines.
gojimmypi
Participanthm. interesting. thanks for your detailed response. đ
Do you think if I have an app that is not using interrupts, that I’d get more reliability if I explicitly disabled them?
But I suppose there are many more hidden, unstoppable system interrupts, eh? Although it is my understanding that system background stuff only runs during yield & delay functions… so I’m not sure I’d really call them “interrupts”.
gojimmypi
ParticipantHello & thanks for your reply. I’m not entirely convinced that all of the blame is on the ESP8266 (although ya, it is hard to argue with issues like “undocumented”, eh?)
I created a video on my ESP8266 debugging experience (based on the Olimex per your suggestion. I’ve not yet had a chance to target the NodeMCU) Here you’ll see what I consider “unexpected” operations when single stepping.
You’ll see in the video, VisualGDB seems to do best when “running to breakpoint”, and not so much when single-stepping. This leads me to wonder if when single-stepping, VisualGDB could (in theory) programmatically place similar, pseudo-breakpoints?
If nothing else, perhaps you should tell users about that. So many times when I’d see the “Frame not in module” error – I thought: “game over, not working”.
And ya – I know there are more robust target platforms out there, however <$3 for a complete IoT device is pretty compelling. đ
<edit>fwiw: Here’s a detailed experience I wrote on the Olimex forum, when I thought it might by a problem with my new JTAG hardware: https://www.olimex.com/forum/index.php?topic=5676.msg23470#msg23470 </edit>
-
This reply was modified 8 years, 8 months ago by
gojimmypi. Reason: added link to more detailed description of issues left on Olimex forum :)
gojimmypi
ParticipantJust closing up this issue for anyone else that comes looking: Don’t even bother trying to get the Altera Bus Blaster programming an ESP8266 from VisualGDB. It won’t work. For one – there’s no reset control line.
I did end up buying an Olimex ARM-USB-OCD-H from Mouser Electronics for about $60. Debugging is not very intuitive. The result of single-stepping is a bit unexpected and even unpredictable. It works, you just need to know the tricks. I have a video that demonstrates this: https://youtu.be/9Hid7ixEigM
There’s a longer thread over on the Olimex forum, as I originally thought there was a problem with their device (but not):Â https://www.olimex.com/forum/index.php?topic=5676
Bottom line is many errors can (apparently) be ignored; Debugging may be actually working, even though it looks like it is not.
gojimmypi
ParticipantHello.
Well I ordered an Olimex ARM-USB-OCD-H to try instead of the Segger, and while at it I also took your advice and ordered an Olimex ESP8266-EVB. I’ve spent all day trying to get the JTAG debugging working, with no success. I am able to get GDB debugging working via the serial pins, but not JTAG.
VisualGDB insists on installing only its driver when pressing the “Test Settings” button. However I get this result:
C:\SysGCC\esp8266\esp8266-bsp\OpenOCD\bin\openocd.exe -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f target/esp8266.cfg
Open On-Chip Debugger 0.9.0 (2015-11-04-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
adapter speed: 1000 kHz
stop_wdt
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 1000 kHz
Info : TAP esp8266.cpu does not have IDCODE
Warn : Warning: Target not halted, breakpoint/watchpoint state may be unpredictable.
Info : accepting ‘telnet’ connection on tcp/4444
shutdown command invoked
Info : dropped ‘telnet’ connectionAlthough VisualGDB pops up a dialog box saying that “your settings appear to be valid”… well, given the error, no surprise that I am unable to program or debug via JTAG.
I’ve double, triple, quadruple checked my pin-by-pin connections:
http://visualgdb.com/tutorials/esp8266/
and following this tutorial:
http://visualgdb.com/tutorials/esp8266/openocd/
If I ignore the message and try to debug anyhow, I get this result:
Open On-Chip Debugger 0.9.0 (2015-11-04-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_dra
in connect_deassert_srst
adapter speed: 1000 kHz
stop_wdt
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 1000 kHz
Info : TAP esp8266.cpu does not have IDCODE
Warn : Warning: Target not halted, breakpoint/watchpoint state may
be unpredictable.
Info : accepting ‘gdb’ connection on tcp/3333
undefined debug reason 7 – target needs reset
Warn : target not halted
Info : TAP esp8266.cpu does not have IDCODE
Warn : xtensa_deassert_reset: ‘reset halt’ is not supported for Xte
nsa. Have halted some time after resetting (not the same thing!)
target state: halted
Info : halted: PC: 0x40244a26
Info : debug cause: 0x20
Error: xtensa_step: Timed out waiting for target to finish stepping
.
Warn : target esp8266.cpu is not halted
Info : halted: PC: 0x40244a05
Info : debug cause: 0x20
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Interrupt suppression during single-stepping is now enabled
Watchdog feeding during stops is now enabled
Info : halted: PC: 0x40100004
Info : debug cause: 0x2
Info : halted: PC: 0x4010017d
Info : debug cause: 0x10It actually does stop on my breakpoint! But it is not actually debugging C code, as I drop into the “Frame not in module” message. Sometimes thought, it seems that I can actually step though the assembly language. And although that might be interesting at other times – I’m trying to debug C code.
If I try to force any other drivers with zadig or UsbDriverTool – VisualGDB wants to force its own version when selecting a programmer.
I’ve burned through another week of my eval, and I’d really like this to work… any suggestions would be greatly appreciated.
Thanks
gojimmypi
Participantsince you bring it up, I’ll add my voice that this forum, although responsive from support & containing great information –Â has… well… “things to be desired” from a usability perspective đ
try using google “site” selector, for instance search this site for instances of esp8266:
esp8266Â site:sysprogs.com
January 21, 2017 at 15:36 in reply to: Debug existing project – not created with File – New Embedded Project Wizard? #10149gojimmypi
Participantthat’s a cool feature! the link is to a Linux debug, however I am trying to quick debug an embedded ESP8266 app using a Segger J-Link. Is that possible?
I’m really close, as shown in the pics for setup & test:
https://twitter.com/gojimmypi/status/822808553895247873
However when debugging, I end up with a “Frame not in module, The current stack frame was not found in a loaded module”. Is any additional software needed for ESP8266 quick debugging?
gojimmypi
Participantthanks for your reply. What about the issue of  <span style=”font-family: Thread-0000079c-Id-00000082;”>C:\SysGCC\esp8266</span> vs <span style=”font-family: Thread-0000079c-Id-00000082;”>C:\SysGCC\xtensa-lx 106-elf ? </span>How can I determine if I’m using the correct toolchain? (I don’t have the xtensa-lx 106-elf in the dropdown, even after manually installing the esp8266-gcc5.2.0-r9.exe toolchain download)
Unfortunately I don’t have an Olimex ESP8266-EVB board – however I’ve used the references for that ESP8266 to connect to my NodeMCU equivalent pins. Â See:
https://twitter.com/gojimmypi/status/822571682544185344
btw – given that warning  “if you are using OpenOCD instead of xt-ocd, connect the reset signal to JTAG20 pin 3, not pin 15” – please note I am using pin 3.
thanks again for your help đ
gojimmypi
ParticipantUpon disabling Norton, I was able to install esp8266-gcc5.2.0-r9.exe from
http://gnutoolchains.com/esp8266/
(I had previously also installed esp8266-gcc5.2.0-r8.exe )
I left the defaults, and it appears to have installed to C:\SysGCC\ESP8266 as shown here:
https://twitter.com/gojimmypi/status/820986248969981953
although there’s a C:\SysGCC\esp8266\xtensa-lx106-elf directory. (but not C:\SysGCC\xtensa-lx106-elf as shown in the tutorial)
I’m following the tutorial for OpenOCD on the ESP8266 here:
http://visualgdb.com/tutorials/esp8266/openocd/
And I have a Segger J-Link that I am trying to use, that seems mostly happy (see second pic with pins used):
https://twitter.com/gojimmypi/status/822541791027200002
However when attempting to debug, I see this in the OpenOCD Window:
Open On-Chip Debugger 0.9.0 (2015-11-04-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
adapter speed: 1000 kHz
stop_wdt
Info : J-Link V10 compiled Jan 9 2017 17:48:51
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 101000
Info : J-Link hw type J-Link
Info : J-Link max mem block 22664
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xffffffff
Info : Vref = 3.335 TCK = 1 TDI = 0 TDO = 0 TMS = 0 SRST = 1 TRST = 1
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : TAP esp8266.cpu does not have IDCODE
Info : halted: PC: 0x40003b53
Info : debug cause: 0x20
Info : accepting ‘gdb’ connection on tcp/3333
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: esp8266.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : xtensa_deassert_reset: ‘reset halt’ is not supported for Xtensa. Have halted some time after resetting (not the same thin
g!)
target state: halted
Info : halted: PC: 0x4000dd38
Info : debug cause: 0x20
Info : halted: PC: 0x4000dd3b
Info : debug cause: 0x1
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Info : halted: PC: 0x4010013c
Info : debug cause: 0x8
Interrupt suppression during single-stepping is now enabled
Watchdog feeding during stops is now enabled
Info : halted: PC: 0x40100004
Info : debug cause: 0x2And this in this GDB Session Window:
Your VisualGDB trial expires in 23 days!
C:\SysGCC\esp8266\bin\xtensa-lx106-elf-gdb.exe –interpreter mi C:\workspace\Segger3\VisualGDB\Debug\Segger3
Warning: could not set a breakpoint on main. ‘Step into new instance’ will not work.
Loaded image in 17142 ms
Cannot resolve the address of _estack. Skipping stack pointer validity check.And sure enough, I am unable to stop at breakpoints.
It appears the main problem is that I still am not using the xtensa-lx toolchain, eh?
Any suggestions?
Thanks.
gojimmypi
ParticipantHi.
Thanks for your reply. I have rebooted and still no difference.
I have been unable to upload a picture on the forum here. No errors, but no actual picture appears at end of process – so I tweeted a pic of the toolchains I see here:
https://twitter.com/gojimmypi/status/820986248969981953
I’m using Visual Studio 2015 Version 14.0.25431.01 Update 3 with VisualGDB 5.2
Upon trying to re-run the installation, Norton Anti-virus intervened, claimed it was a virus, and deleted my download file (not sure why it would not have done that the first time around – obviously I was able to download it, and I’m fairly sure it ran successfully without incident).
http://sysprogs.com/files/gnutoolchains/esp8266/esp8266-gcc5.2.0-r9.exe
I tried to download again, and this time Norton immediately deletes the file.
I did not have a problem with the similar process for the MSP430 a few days ago. I still have that file, and Norton Insight says that less than 5 users have used the file (sometimes Norton will think something is bad if there’s no user history). However this MSP430 file is still there, Norton is happy with it, and I was able to successfully install the toolchain to find my specific MSP430FR6989
It would not be the first time that Norton gives a false positive. But before I force the file onto my system, can you confirm the ESP8266 toolchain here is indeed virus free?
Thanks
gojimmypi
ParticipantThanks for your reply. I’m looking at the ESP8266 tutorial here:
http://visualgdb.com/tutorials/esp8266/
I was about to order an Olimex ARM-USB-OCD-H per your suggestion, however:
The end of Step 1 says:
Note that we use the Olimex USB-OCD-H as a USB-to-COM adapter only as the Xtensa JTAG software does not support it (supported devices are listed below).
Which sounds like the OCD-H is *not* being used as JTAG, rather a simple USB-to-TTL (Rx/Tx) port?
Further down in Step 7 there’s a note:
VisualGDB supports 3 debug methods for ESP8266 devices:
- A special OpenOCD port that supports all JTAG programmers supported by the original OpenOCD
- Xtensa OCD Daemon (xt-ocd) that supports ML605, Flyswatter 1/2/3, Jtagkey 2, Olimex tiny-h, Segger J-link, ByteTools Catapult, RVI JTAG and Macraigor probes
- GDB stub from Espressif that does not requre a separate JTAG connection
Note it specifies a *different* Olimex device, the  “Olimex tiny-h” – which is listed as a USB JTAG device here: https://www.olimex.com/Products/ARM/JTAG/ARM-USB-TINY-H/
The ARM-USB-OCD-H is listed as a “3-IN-1 fast USB ARM JTAG, USB-to-RS232 virtual port and power supply 5VDC device” here:
https://www.olimex.com/Products/ARM/JTAG/ARM-USB-OCD-H/
and both of the products say “supported by OpenOCD arm debugger”
Am I misreading the tutorial? Could you please confirm the recommendation for ARM-USB-OCD-H despite what Steps 1 & 7Â say? (I think they may actually be essentially the same device; the more expensive one including the Tx/Rx & power, eh?)
As I have no experience with these Olimex devices, any suggestions or clarifications will be greatly appreciated before I place an order. đ
Thanks
-
This reply was modified 8 years, 8 months ago by
-
AuthorPosts