• Hi all,

    I see this issue has gone around the houses a few times. I've followed all the threads and tried all the variations of esptools settings. I've also tried a few different versions of Espruino it's something in the flashing process / settings I think.

    Board is as so:

    $ esptool.py --port /dev/tty.wchusbserial14220 --baud 115200 flash_id
    esptool.py v2.8
    Serial port /dev/tty.wchusbserial14220
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 84:f3:eb:5a:85:df
    Uploading stub...
    Running stub...
    Stub running...
    Manufacturer: 68
    Device: 4016
    Detected flash size: 4MB
    Hard resetting via RTS pin...
    

    Erasing looks like so:

    $ esptool.py --port /dev/tty.wchusbserial14220 --baud 115200 erase_flash
    esptool.py v2.8
    Serial port /dev/cu.wchusbserial14220
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 84:f3:eb:5a:85:df
    Uploading stub...
    Running stub...
    Stub running...
    Erasing flash (this may take a while)...
    Chip erase completed successfully in 5.7s
    Hard resetting via RTS pin...
    

    Flashing via best practice examples (1V99 combined):

    $ esptool.py --port /dev/cu.wchusbserial14220 --baud 115200 write_flash --flash_freq 80m --flash_mode dio --flash_size 4MB-c1 0x0000 espruino_1v99_esp8266_4mb_combined_4096.bin
    esptool.py v2.8
    Serial port /dev/cu.wchusbserial14220
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 84:f3:eb:5a:85:df
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash params set to 0x026f
    Compressed 4194304 bytes to 353774...
    Wrote 4194304 bytes (353774 compressed) at 0x00000000 in 31.5 seconds (effective 1065.0 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    

    Screen output:

    $ screen /dev/tty.wchusbserial14220 115200
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    dl sl����n�r��n|�lddd`��s�$��
     ____                 _ 
    |  __|___ ___ ___ _ _|_|___ ___ 
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     1v99 (c) 2018 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0x68 chip 0x4016
    
    >
    

    Flashing to latest (2v04):

    $ esptool.py --port /dev/tty.wchusbserial14220 --baud 115200 write_flash --flash_freq 80m --flash_mode dio --flash_size 4MB-c1 0x0000 espruino_2v04_esp8266_4mb_combined_4096.bin
    esptool.py v2.8
    Serial port /dev/cu.wchusbserial14220
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 84:f3:eb:5a:85:df
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash params set to 0x026f
    Compressed 4194304 bytes to 351432...
    Wrote 4194304 bytes (351432 compressed) at 0x00000000 in 31.3 seconds (effective 1072.3 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    

    Screen Output

    $ screen /dev/tty.wchusbserial14220 115200
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    R��b�&A��-�B�1�����B�R2-����y�$!c������sll��|�d�<�d�c|����{�#�b��gg�dog���cx��drl{d8�o��lco�|��c��oo�d��l`�nol or���o��d`x�'�s�����c'�|�ǎ�c��gn�l`�gd`'s���g�$p�o�{�ܜ���lbo�|���c��og�$`�gd`'{���g�l`{ےg�l sl��'���gg����soog�d�c�l��l�����dll~{$��$dlo���؄~�`��l��n�g�o��dl�c��ldp#�cp���crcp���bbld��n�g���gl�|cdd`sd����o�s��o|�dlll`c��|{�d�o��g�$`��s�$�l�
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v04 (c) 2019 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0x68 chip 0x4016
    
    >
    

    In all cases I can connect via the screen terminal app. It spits out garbage at the top but otherwise works. I can use the REPL no problem. However when I use the IDE the connection never fails or succeeds, it always looks like the screenshot provided, hung.

    I've done a few things too:

    • I've messed with the flash_frequency and other params
    • I've used CU instead of TTY drivers
    • I've used non combined files in all tests too (just in case)
    • I've used tried qio (that makes it worse)

    Anyone have any suggestions on what to try next?

  • Hi Robin, thanks for your response, to answer you questions in order:

    • Otherwise means I can connect to it via a terminal app, I still get garbage but the REPL is usable when I connect with "screen /my/port/here " for instance. If I do a reset(true) in the repl the restart happens and I get no garbage (I only get garbage on connection), again only via a terminal session.

    • I cannot use the IDE left hand (or right hand at all). The reset bit is a hold over and should not be considered (I simply didn't clear out the editor before screenshot. When in the IDE, neither left or right pane worked as the device is always stuck in "connecting" mode. The splash loads but otherwise the repl is hung.

    • Yes, I erase using the same baud as I flash too (I don't know if that makes a difference)

    • Yes and also later threads where "4m-c1" is used (based on observing my chip code and using the reference in the docs). Interestingly my board(s) needs dio, not qio to be set to flash properly.

    • OSX (esptool v2.8)

About

Avatar for Robin @Robin started