Cannot flash ESP8266

Sysprogs forums Forums VisualGDB Cannot flash ESP8266

Tagged: 

This topic contains 9 replies, has 2 voices, and was last updated by  Dschadu 3 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #25631

    Dschadu
    Participant

    Hi,

    today i tried to Flash a ESP8266. First I used the RTOS examples, and I was able to Flash the Code and it worked.
    But now I’m trying to use a Arduino Project, but without success. I cannot Flash the device. With the Arduino studio it works just perfectly. I tried using different¬†presets, but withou success. I restarted my Computer and assigned another COM-Port, no success. I’m out if ideas… I could need some help. Thanks in advance!

    VisualGDB Version: 5.4R12 build 3242
    VS2019 Version 15.7.3

    GDB Session:

    VisualGDB is licensed to Martin Klein
    -gdb-version
    =thread-group-added,id="i1"
    ~"GNU gdb (GDB) 8.2.50.20180723-git\n"
    ~"Copyright (C) 2018 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."
    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.
    ~"\nType \"show copying\" and \"show warranty\" for details.\n"
    ~"This GDB was configured as \"--host=i686-w64-mingw32 --target=xtensa-lx106-elf\".\n"
    ~"Type \"show configuration\" for configuration details.\n"
    ~"For 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/>."
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    ~"\n\n"
    ~"For help, type \"help\".\n"
    ~"Type \"apropos word\" to search for commands related to \"word\"...\n"
    ~"Reading symbols from D:/Elektronik/Mikrocontroller/ArduinoProject2/Output/Generic_ESP8266_Module/Release/ArduinoProject2.ino.elf..."
    ~"done.\n"
    ~"GNU gdb (GDB) 8.2.50.20180723-git\n"
    ~"Copyright (C) 2018 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."
    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.
    ~"\nType \"show copying\" and \"show warranty\" for details.\n"
    ~"This GDB was configured as \"--host=i686-w64-mingw32 --target=xtensa-lx106-elf\".\n"
    ~"Type \"show configuration\" for configuration details.\n"
    ~"For 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/>."
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    ~"\n\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
    -target-disconnect
    ^error,msg="You can't do that when your target is exec'"
    -gdb-exit
    ^exit
    </code>

    Exception Details:

    <code>
    System.Exception: esptool.py failed to program the FLASH memory. See VisualGDB diagnostics console for details.
    at i.e(IExternalToolInstance e, fk1 d, Regex a, Int32 b, Int32 c)
    at gi.ProgramFLASHMemoryUsingExternalTool(ProgramMode a)
    at ESP8266DebugPackage.ESP8266StubDebugController.GDBStubInstance.DoConnect(IDebugStartService service, ISimpleGDBSession session, ESP8266GDBStubSettings settings, String comPort, Boolean programFLASH)
    at ESP8266DebugPackage.ESP8266StubDebugController.GDBStubInstance.ConnectGDBToStub(IDebugStartService service, ISimpleGDBSession session)
    at fk1.c1(hc1 a, pz1 d, dh c, EmbeddedTraceSettings b)
    at wq.d2(DebugCustomizationSettings a)
    at lk2.t2()
    at ko.p1()
    at VisualGDB.GDBDebugEngine.b1(ch1 a, m1 b)
    </code>

    Exception Details for only programming Flash:

    <code>
    VisualGDB version: 5.4.112.3242
    ------------------ System.Exception ------------------
    System.Exception: Failed to upload the compiled sketch
    at g9.y.a(rt1 a)
    at VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.<>c__DisplayClass2_2
    1.<RunAction>b__0()

    Details:


    C:\Users\darki\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1\python "C:\Users\darki\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py" --chip esp8266 --port "COM4" --baud "115200" "" version --end --chip esp8266 --port "COM4" --baud "115200" "" write_flash 0x0 "D:\Elektronik\Mikrocontroller\ArduinoProject2\Output\Generic_ESP8266_Module\Release/ArduinoProject2.ino.bin" --end
    usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
    [--before {default_reset,no_reset,no_reset_no_sync}]
    [--after {hard_reset,soft_reset,no_reset}] [--no-stub]
    [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
    {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version}
    ...
    esptool: error: argument operation: invalid choice: '' (choose from 'load_ram', 'dump_mem', 'read_mem', 'write_mem', 'write_flash', 'run', 'image_info', 'make_image', 'elf2image', 'read_mac', 'chip_id', 'flash_id', 'read_flash_status', 'write_flash_status', 'read_flash', 'verify_flash', 'erase_flash', 'erase_region', 'version')

    • This topic was modified 3 months, 3 weeks ago by  Dschadu.
    • This topic was modified 3 months, 3 weeks ago by  Dschadu.
    • This topic was modified 3 months, 3 weeks ago by  Dschadu.
    #25635

    Dschadu
    Participant

    I’m sorry for the formatting – I tried to fix it three times, but the Forum screws it up all the time.

    Edit:
    It looks like the Package “esp8266 V2.5.2” is the issue. A friend of mine used the V2.4.2 and as soon as he updated it, it stopped working for him, too.

    And I also made a mistake with my VS version. Its VS2019 Version 16.2.1

    • This reply was modified 3 months, 3 weeks ago by  Dschadu.
    #25638

    support
    Keymaster

    Hi,

    It looks like the latest ESP8266 Arduino package might be broken. Could you please quickly recheck whether it works with Arduino Studio? If not, please consider filing a bug report with Espressif.

    #25641

    Dschadu
    Participant

    Hi,

    it works just fine with Arduino Studio and Version 2.5.2

    #25649

    support
    Keymaster

    We have investigated the problem and it looks like a bug in the ESP8266 Arduino package triggered by the verbose mode enabled by VisualGDB.

    We have created a Github issue in the ESP8266 Arduino repository suggesting a workaround. Please try patching the <HOME>\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.5.2\platform.txt file as described on the Github page, then reload the project via the context menu to ensure VisualGDB picks up the updated programming command line template.

    #25663

    Dschadu
    Participant

    Thanks for the investigation!
    But that did not solve the issue for me with 2.5.2.
    I modified the file as you wrote, but still the same message.

    I deleted the old 2.4.2, downloaded the 2.5.2 and created a new blank project with the NodeMCU 1.0 as Board.

    Please find attached my platform.txt. Maybe I did something wrong?

    Attachments:
    You must be logged in to view attached files.
    #25666

    support
    Keymaster

    The platform.txt file appears correct, so most likely your project is still using the old cached command line.

    Please ensure you don’t have any other versions of the ESP8266 package installed and try reproducing the problem on a new project created from scratch. If the new project works, please try reloading the existing project as we suggested earlier in order to reset its cached values.

    #25668

    Dschadu
    Participant

    I removed everything in the esp8266 folder an re-downloaded the version 2.5.2 (see Image_1 and Image_2)

    As I wrote in my reply, I created a new blank project:

    – File -> New -> VisualGDB Project
    – Arduino Project Wizard -> Add
    – Project Type -> No changes -> Next
    – Arduino Device: NodeMCU 1.0 (ESP-12E Module) -> COM1 -> Next
    – Debug Method: No change -> Finish
    – No change to anything -> Build and Program Arduino sketch into FLASH memory

    Build is okay, but flashing fails (see Image_3 and Image_4)

    Attachments:
    You must be logged in to view attached files.
    #25673

    support
    Keymaster

    Strange, now it looks like the {upload.verbose} got expanded to an empty string. Please try removing the¬†“{upload.verbose}” part completely from the programming command line (also remove the quotes).

    #25675

    Dschadu
    Participant

    Thanks! That did the trick!
    If anyone has this issue in the future, please find attached the working platform.txt

    Attachments:
    You must be logged in to view attached files.
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.