Unexpected reply from ESP8266

Sysprogs forums Forums VisualGDB Unexpected reply from ESP8266

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #7253
    Han Vertegaal
    Participant

    I’m trying to run the HTTPDemo sample on an ESP8266. It is mounted on a Nodemcu DevKit (1.0) with the Nodemcu firmware loaded. Following the instructions, I press F5 an then press the reset button while holding the flash button. After I click Ok in the VisualGDB prompt window the error message ‘Unexpected reply from ESP8266’ appears.

    Changing the baudrates for the GDB stub or the bootloader doesn’t help. The GDB raw log is appended to this message.

    Can you give me a hint where I should go from here?

    —————————–

    VisualGDB is licensed to Han Vertegaal at Acoustics Engineering
    C:\SysGCC\xtensa-lx106-elf\bin\xtensa-lx106-elf-gdb.exe –interpreter mi C:\Users\Han\Documents\Projects\ESP8266-test\ESP8266-test/Debug/ESP8266-test.elf
    -list-features
    =thread-group-added,id=”i1″
    ~”GNU gdb (GDB) 7.5.1\n”
    ~”Copyright (C) 2012 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\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\”.\nFor bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/>&#8230;\n”
    ~”Reading symbols from C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\Debug\\ESP8266-test.elf…”
    ~”done.\n”
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”]
    -gdb-set stop-on-solib-events 1
    ^done
    -gdb-set disassembly-flavor intel
    ^error,msg=”No symbol \”disassembly\” in current context.”
    -gdb-set print demangle off
    ^done
    -gdb-version
    ~”GNU gdb (GDB) 7.5.1\n”
    ~”Copyright (C) 2012 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\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\”.\nFor bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ^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
    info target
    &”info target\n”
    ~”Symbols from \”C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\Debug\\ESP8266-test.elf\”.\n”
    ~”Local exec file:\n”
    ~”\t`C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\Debug\\ESP8266-test.elf’, file type elf32-xtensa-le.\n”
    ~”\tEntry point: 0x40100004\n”
    ~”\t0x3ffe8000 – 0x3ffe83aa is .data\n”
    ~”\t0x3ffe83b0 – 0x3ffe873c is .rodata\n”
    ~”\t0x3ffe8740 – 0x3fff0388 is .bss\n”
    ~”\t0x40100000 – 0x40106789 is .text\n”
    ~”\t0x40240000 – 0x4027b7e3 is .irom0.text\n”
    ^done
    -break-insert -f C:/Users/Han/Documents/Projects/ESP8266-test/ESP8266-test/HTTPDemo.cpp:125
    ^done,bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x401002ad”,func=”user_init()”,file=”HTTPDemo.cpp”,fullname=”C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\HTTPDemo.cpp”,line=”125″,times=”0″,original-location=”C:/Users/Han/Documents/Projects/ESP8266-test/ESP8266-test/HTTPDemo.cpp:125″}
    -break-info 2
    ^done,BreakpointTable={nr_rows=”1″,nr_cols=”6″,hdr=[{width=”7″,alignment=”-1″,col_name=”number”,colhdr=”Num”},{width=”14″,alignment=”-1″,col_name=”type”,colhdr=”Type”},{width=”4″,alignment=”-1″,col_name=”disp”,colhdr=”Disp”},{width=”3″,alignment=”-1″,col_name=”enabled”,colhdr=”Enb”},{width=”10″,alignment=”-1″,col_name=”addr”,colhdr=”Address”},{width=”40″,alignment=”2″,col_name=”what”,colhdr=”What”}],body=[bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x401002ad”,func=”user_init()”,file=”HTTPDemo.cpp”,fullname=”C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\HTTPDemo.cpp”,line=”125″,times=”0″,original-location=”C:/Users/Han/Documents/Projects/ESP8266-test/ESP8266-test/HTTPDemo.cpp:125″}]}
    -break-after 2 0
    ^done
    info symbol 0x401002ad
    &”info symbol 0x401002ad\n”
    ~”user_init + 29 in section .text\n”
    ^done
    info line *0x401002ad
    &”info line *0x401002ad\n”
    ~”Line 125 of \”HTTPDemo.cpp\” starts at address 0x401002ad <user_init()+29> and ends at 0x401002bc <user_init()+44>.\n”
    ^done
    -file-list-exec-source-files
    ^done,files=[{file=”HTTPDemo.cpp”,fullname=”C:\\Users\\Han\\Documents\\Projects\\ESP8266-test\\ESP8266-test\\HTTPDemo.cpp”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/extra_include/xtensa/config/core.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\extra_include\\xtensa\\config\\core.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/extra_include/xtensa/hal.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\extra_include\\xtensa\\hal.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/lwip/lwip/sockets.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\lwip\\lwip\\sockets.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/lwip/ipv4/lwip/inet.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\lwip\\ipv4\\lwip\\inet.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/espressif/esp_softap.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\espressif\\esp_softap.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/espressif/esp_wifi.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\espressif\\esp_wifi.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/espressif/esp_misc.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\espressif\\esp_misc.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/lwip/ipv4/lwip/ip4_addr.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\lwip\\ipv4\\lwip\\ip4_addr.h”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/include/espressif/c_types.h”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\include\\espressif\\c_types.h”},{file=”c:\\sysgcc\\xtensa-lx106-elf\\xtensa-lx106-elf\\sys-include/stdint.h”,fullname=”c:\\sysgcc\\xtensa-lx106-elf\\xtensa-lx106-elf\\sys-include\\stdint.h”},{file=”/home/wjg/Repo/esp-open-sdk/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/ieee754-sf.S”},{file=”/home/wjg/Repo/esp-open-sdk/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/ieee754-sf.S”},{file=”/home/wjg/Repo/esp-open-sdk/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/ieee754-sf.S”},{file=”/home/wjg/Repo/esp-open-sdk/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/lib1funcs.S”},{file=”/home/wjg/Repo/esp-open-sdk/crosstool-NG/.build/src/gcc-4.8.2/libgcc/config/xtensa/lib1funcs.S”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/GDBStub\\gdbstub-entry.S”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\GDBStub\\gdbstub-entry.S”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/sysprogs/stubs.c”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\sysprogs\\stubs.c”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/examples/driver_lib/driver/uart.c”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\examples\\driver_lib\\driver\\uart.c”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/examples/driver_lib/driver/hw_timer.c”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\examples\\driver_lib\\driver\\hw_timer.c”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/RTOS-SDK/examples/driver_lib/driver/gpio.c”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\RTOS-SDK\\examples\\driver_lib\\driver\\gpio.c”},{file=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp/GDBStub/gdbstub.c”,fullname=”C:\\SysGCC\\xtensa-lx106-elf\\esp8266-bsp\\GDBStub\\gdbstub.c”}]
    set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg
    &”set *((int *)0x60000900)=$com_sysprogs_esp8266_wdcfg\n”
    &”Invalid cast.\n”
    ^error,msg=”Invalid cast.”
    -exec-continue
    ^error,msg=”The program is not being run.”
    set $com_sysprogs_esp8266_wdcfg=*((int *)0x60000900)
    &”set $com_sysprogs_esp8266_wdcfg=*((int *)0x60000900)\n”
    &”Cannot access memory at address 0x60000900\n”
    ^error,msg=”Cannot access memory at address 0x60000900″
    set *((int *)0x60000900)=0
    &”set *((int *)0x60000900)=0\n”
    &”Cannot access memory at address 0x60000900\n”
    ^error,msg=”Cannot access memory at address 0x60000900″
    -stack-list-frames –thread 1
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames
    ^error,msg=”No registers.”
    -stack-list-frames –thread 1 0 0
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames 0 0
    ^error,msg=”No registers.”
    -data-evaluate-expression –thread 1 “\$pc”
    ^error,msg=”Invalid thread id: 1″
    -data-evaluate-expression “\$pc”
    ^error,msg=”No registers.”
    -stack-list-frames –thread 1
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames
    ^error,msg=”No registers.”
    -stack-list-frames –thread 1 0 0
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames 0 0
    ^error,msg=”No registers.”
    -data-evaluate-expression –thread 1 “\$pc”
    ^error,msg=”Invalid thread id: 1″
    -data-evaluate-expression “\$pc”
    ^error,msg=”No registers.”
    -stack-list-frames –thread 1
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames
    ^error,msg=”No registers.”
    -stack-list-frames –thread 1 0 0
    ^error,msg=”Invalid thread id: 1″
    -stack-list-frames 0 0
    ^error,msg=”No registers.”
    -data-evaluate-expression –thread 1 “\$pc”
    ^error,msg=”Invalid thread id: 1″
    -data-evaluate-expression “\$pc”
    ^error,msg=”No registers.”

     

    #7258
    freeck
    Participant

    Hi, first time you downloaded new firmware? If so, did you ground GPIO15 as well?

    • This reply was modified 9 years ago by freeck.
    #7260
    Han Vertegaal
    Participant

    Hello,

    Yes GPIO15 is wired to ground through a resistor. Also, I have been able to use the ESP8266Flasher (https://github.com/nodemcu/nodemcu-flasher) to flash the nodemcu firmware.

    #7266
    freeck
    Participant

    After pressing reset & flash what is the response of te target?
    Should be: “ets Jan 8 2013,rst cause:2, boot mode:(1,7)”

    If not the target was probably in a different mode. I got the same response as you did when I was stuck in a previous debugsession.

    #7267
    Han Vertegaal
    Participant

    When listening at 74880 bps after flash & reset, I get the following:

    “ets Jan   8 2013,rst cause:2, boot mode:(1,6)”

    #7270
    freeck
    Participant

    Humm… “boot mode:(1,6)” should work as well, as the ‘1’ corresponds to flash download mode….
    As flashing worked well with another flashtool, it seems not to be an hardware issue.. I my case powering down/up the device sometimes worked, but I assume you have already tried these obvious things :).

    Perhaps Sysprogs has any thoughts?

    #7274
    Han Vertegaal
    Participant

    Update: I installed the Arduino IDE and tried a few samples. It flashes the device without any problems, and it even exercises the DTR and CTS lines of the CP2102 USB/UART bridge such that it is not necessary to hold the flash key to place the module in flash programming mode.

    This leads me to conclude that there is nothing wrong with my hardware setup, but rather a problem with the debug settings in the project properties (I have tried most permutations), or that there exists some deeper incompatibility between VisualGDB and the nodemcu devkit 1.0.

    #7283
    support
    Keymaster

    Hi,

    Please try running the bootloader test program from here.

    Run BootloaderTest <COM port> 74880.

    Does it report a successful sync? If not, what exact output does it show? Can you double-check that the state of GPIO0, GPIO2 and GPIO15 boots your board into the UART download mode as described here?

    #7295
    Han Vertegaal
    Participant

    This is the output from the test program:

    C:\Users\Han\Desktop\ESP8266\BootloaderTest\bin\Debug>BootloaderTest COM3 74880

    Connecting…
    Syncing…
    <<<0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    >>> 0d
    Exception: System.Exception: Unexpected reply from ESP8266
    at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk) in C:\Users\Han\Desktop
    \ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 66
    at ESP8266DebugPackage.ESP8266BootloaderClient.Sync() in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266Bootloade
    rClient.cs:line 162
    Extra output from COM port:

    ets Jan 8 2013,rst cause:2, boot mode:(3,6)

    load 0x40100000, len 28740, room 16
    tail 4
    chksum 0xcd
    load 0x3ffe8000, len 2888, room 4
    tail 4
    chksum 0xbc
    load 0x3ffe8b50, len 15252, room 4
    tail 0
    chksum 0x4f
    csum 0x4f
    ? ?? ? ?? ? ???? ??? ??? ?? ?????? ? ? ? ??? ?????? ?? ?? ? ? ??? ? ? ????????? ? ???
    ? ? ?? ? ?????? ? ??? ? ? ? ? ?? ? ??? ?? ???? ? ———————–

    The boot mode:(3,6) seems incorrect, but when I use use a terminal and start in download mode, I see:

    ets Jan 8 2013,rst cause:2, boot mode:(1,6)

    ESP8266BootloaderClient::Sync manipulates the DTR and RTS lines, but not in a way that initiates flash programming. (see this schematic). However, I don’t know if that was the intent.

     

     

    #7303
    support
    Keymaster

    Hi,

    The sequence we used in the bootloader test program and in the VisualGDB was taken from esptool.py:

                self._port.setDTR(False)
                self._port.setRTS(True)
                time.sleep(0.05)
                self._port.setDTR(True)
                self._port.setRTS(False)
                time.sleep(0.05)
                self._port.setDTR(False)

    We assumed that it corresponds to the wiring diagram of most of the ESP8266 modules. Have you managed to get it to boot into the bootloader by modifying the sequence according to the schematics?

    #7304
    3dot3
    Participant

    I have same setup as Han Vertegaal has, and also same problem.
    Bazis: can you please try use espressif official flash download tool logic sequence to do this?
    http://bbs.espressif.com/viewtopic.php?f=5&t=433

    #7312
    Han Vertegaal
    Participant

    It seems the GPIO0 signal was held low for too short a time. The RC network (12k/100nF) on the reset input causes the reset to rise rather slowly. A delay of 50 ms gets the board in the correct mode reliably.

    The output from the bootloader test program then becomes as follows:

    Connecting…
    Syncing…
    <<<0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    Exception: System.Exception: Timeout reading reply
    at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk) in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 60
    at ESP8266DebugPackage.ESP8266BootloaderClient.Sync() in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 179
    Extra output from COM port:
    ———————–
    <<<0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    Exception: System.Exception: Timeout reading reply
    at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk) in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 60
    at ESP8266DebugPackage.ESP8266BootloaderClient.Sync() in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 179
    Extra output from COM port:
    ———————–
    <<<0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    Exception: System.Exception: Timeout reading reply
    at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk) in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 60
    at ESP8266DebugPackage.ESP8266BootloaderClient.Sync() in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 179
    Extra output from COM port:
    ———————–
    <<<0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    Exception: System.Exception: Timeout reading reply
    at ESP8266DebugPackage.ESP8266BootloaderClient.RunCommand(Command op, Byte[] data, Int32 chk) in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 60
    at ESP8266DebugPackage.ESP8266BootloaderClient.Sync() in C:\Users\Han\Desktop\ESP8266\BootloaderTest\ESP8266BootloaderClient.cs:line 179
    Extra output from COM port:

    #7322
    support
    Keymaster

    Hi,

    Wow, thanks a lot for trying this out. This is definitely not something we could have figured out without the hardware. We can certainly add an option to configure the delay in the debugging plugin.

    Just to double-check: did you manage to get the bootloader test tool to repoer a successful sync? The output you shared still says “timeout reading reply”. Does it get even more reliable if you increase the delay to 100 ms?

    #7341
    Han Vertegaal
    Participant

    No, unfortunately there is no successful sync. I do see the message ‘ets Jan  8 2013,rst cause:2, boot mode:(1,6)’ appear after the reset, but nothing happens after that.

    #7344
    support
    Keymaster

    Hi,

    Strange. The boot mode should be “1,7” for the bootloader. Can you put breakpoints on the Sleep() calls after _Port.EscapeFunction() calls in the bootloader test program and check the state of GPIO0, GPIO2, GPIO15 and RESET at each sleep() call? Does it perform a device reset and does it hold the “UART Download Mode” (0/1/0) once reset is released?

Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.