Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Can't flash MOS to ESP8266

I have ESP8266 (ESP-01) module and I'am not able to upload mos into it.
I receive the following output:

mos flash --port /dev/cu.usbmodemFD121 ~/Downloads/mos-esp8266.zip 
Loaded mjs_base/esp8266 version 1.0 (20170224-110701/???)
Opening /dev/cu.usbmodemFD121...
Connecting to ESP8266 ROM, attempt 1 of 10...
Connecting to ESP8266 ROM, attempt 2 of 10 (inverted)...
Connecting to ESP8266 ROM, attempt 3 of 10...
Connecting to ESP8266 ROM, attempt 4 of 10 (inverted)...
Connecting to ESP8266 ROM, attempt 5 of 10...
Connecting to ESP8266 ROM, attempt 6 of 10 (inverted)...
Connecting to ESP8266 ROM, attempt 7 of 10...
Connecting to ESP8266 ROM, attempt 8 of 10 (inverted)...
Connecting to ESP8266 ROM, attempt 9 of 10...
Connecting to ESP8266 ROM, attempt 10 of 10 (inverted)...
Error: failed to run flasher: failed to create ROM client: failed to connect to ROM: failed to connect to ESP8266 ROM

Connection between ESP and computer is OK, I'am able to talk with ESP using AT-commands. When attempt flashing, ESP is switched to programming mode by setting GPIO0 to ground.

Comments

  • SergeySergey Dublin, Ireland

    ESP-01 has 512k flash and thus cannot run mOS.
    A minimum of 1M flash is required.

  • SergeySergey Dublin, Ireland
    edited February 2017

    esp-01 cannot run mOS, full stop.
    use modules with bigger flash.
    for your information, esp8266 micro does NOT have built-in flash: flash memory is external, installed by the maker of the module.

    I'll update the page to avoid confusion.

  • chafoschafos Reading, UK

    I have the same problem on NodeMCU module - are the multiple versions? How can one check the amount of flash and/or RAM on module one has?

    I am running mos on Ubuntu 14.04.

  • SergeySergey Dublin, Ireland

    nodemcu should be ok.
    whats your error?

  • chafoschafos Reading, UK

    Basically same as the original post, i.e.

    chafos@chafos-vbox-14:~/.mos/bin$ ./mos flash --port /dev/ttyUSB0 --firmware https://mongoose-os.com/downloads/mos-esp8266.zip
    Fetching https://mongoose-os.com/downloads/mos-esp8266.zip...
    Loaded mjs_base/esp8266 version 1.0 (20170321-182631/???)
    Opening /dev/ttyUSB0...
    Connecting to ESP8266 ROM, attempt 1 of 10...
    Connecting to ESP8266 ROM, attempt 2 of 10 (inverted)...
    Connecting to ESP8266 ROM, attempt 3 of 10...
    Connecting to ESP8266 ROM, attempt 4 of 10 (inverted)...
    Connecting to ESP8266 ROM, attempt 5 of 10...
    Connecting to ESP8266 ROM, attempt 6 of 10 (inverted)...
    Connecting to ESP8266 ROM, attempt 7 of 10...
    Connecting to ESP8266 ROM, attempt 8 of 10 (inverted)...
    Connecting to ESP8266 ROM, attempt 9 of 10...
    Connecting to ESP8266 ROM, attempt 10 of 10 (inverted)...
    Error: failed to run flasher: failed to create ROM client: failed to connect to ROM: failed to connect to ESP8266 ROM

    With increased verbosity

    `chafos@chafos-vbox-14:~/.mos/bin$ ./mos flash --port /dev/ttyUSB0 --firmware https://mongoose-os.com/downloads/mos-esp8266.zip --v 9 --logtostderr
    Fetching https://mongoose-os.com/downloads/mos-esp8266.zip...
    I0322 19:16:24.985488 12725 report.go:13] Fetching https://mongoose-os.com/downloads/mos-esp8266.zip...
    Loaded mjs_base/esp8266 version 1.0 (20170321-182631/???)
    Opening /dev/ttyUSB0...
    I0322 19:16:25.260009 12725 report.go:13] Opening /dev/ttyUSB0...
    Connecting to ESP8266 ROM, attempt 1 of 10...
    I0322 19:16:25.281378 12725 report.go:13] Connecting to ESP8266 ROM, attempt 1 of 10...
    I0322 19:16:25.463489 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:25.463540 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:25.473889 12725 slip.go:43] <= (34) 08240707122055555555555555555555555555555555555555555555555555555555
    I0322 19:16:25.673898 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:25.673938 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:25.684034 12725 slip.go:43] <= (30) 082407555555555555555555555555555555555555555555555555555555
    I0322 19:16:25.884099 12725 rom_client.go:96] Sync #1 failed: error reading sync response #1: error reading response: error reading: EOF
    Connecting to ESP8266 ROM, attempt 2 of 10 (inverted)...
    I0322 19:16:25.884168 12725 report.go:13] Connecting to ESP8266 ROM, attempt 2 of 10 (inverted)...
    I0322 19:16:26.080262 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:26.080309 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:26.091100 12725 slip.go:43] <= (38) 0824070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:26.489842 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:26.489919 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:26.510730 12725 slip.go:43] <= (36) 080712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:26.710226 12725 rom_client.go:96] Sync #2 failed: error reading sync response #1: error reading response: error reading: EOF

    ... cut for brevity - removed repeated information...

    Connecting to ESP8266 ROM, attempt 10 of 10 (inverted)...
    I0322 19:16:31.626411 12725 report.go:13] Connecting to ESP8266 ROM, attempt 10 of 10 (inverted)...
    I0322 19:16:31.821924 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:31.821989 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:31.833549 12725 slip.go:43] <= (28) 55555555555555555555555555555555555555555555555555555555
    I0322 19:16:32.033444 12725 rom_client.go:104] => {cmd:Sync(8) csum:0 arg(36):"0707122055555555555555555555555555555555555555555555555555555555..."}
    I0322 19:16:32.033504 12725 slip.go:87] => (44) 0008240000000000070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:32.047164 12725 slip.go:43] <= (38) 0824070712205555555555555555555555555555555555555555555555555555555555555555
    I0322 19:16:32.246193 12725 rom_client.go:96] Sync #10 failed: error reading sync response #1: error reading response: error reading: EOF
    I0322 19:16:32.246300 12725 main.go:199] Error: failed to run flasher: failed to create ROM client: failed to connect to ROM: failed to connect to ESP8266 ROM
    /go/src/cesanta.com/mos/flash/esp/rom_client.go:100: failed to connect to ESP8266 ROM
    /go/src/cesanta.com/mos/flash/esp/rom_client.go:64: failed to connect to ROM
    /go/src/cesanta.com/mos/flash/esp/flasher_client.go:62: failed to create ROM client
    /go/src/cesanta.com/mos/flash/esp/flasher.go:120: failed to run flasher
    /go/src/cesanta.com/mos/flash.go:130:
    /go/src/cesanta.com/mos/main.go:114:
    Error: failed to run flasher: failed to create ROM client: failed to connect to ROM: failed to connect to ESP8266 ROM`

    So seems that sync is failing

    Thanks
    /Charles

  • rojerrojer Dublin, Ireland

    data read from serial makes no sense - it looks like chopped up data that we sent.
    response to sync should look like this:

    slip.go:47] <= (10) 01080200070712200000
    

    can you post output of stty -a -F /dev/ttyUSB0?

  • chafoschafos Reading, UK

    Exactly my thought too. I was using Linux on a virtualbox VM, so do be certain I repeated on a real linux machine - the behaviour is the same. stty output follows

    chafos@chafos-vbox-14:~/git/mongoose-os$ stty -a -F /dev/ttyUSB0
    speed 115200 baud; rows 0; columns 0; line = 0;
    intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = <undef>; stop = <undef>;
    susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = <undef>; flush = <undef>; min = 1; time = 5;
    -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
    ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
    -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
    -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
  • chafoschafos Reading, UK

    I have another module arriving today, from a different vendor, just to check its not a broken device. Will post findings.

  • rojerrojer Dublin, Ireland

    stty output looks normal. i was thinking maybe echo got turned on somehow, though that still wouldn't explain why it's not straight echo but kinda-sorta echo.
    sorry, no idea whatsoever. i should say that serial ports generally work fine in VM and nodemcu modules in particular are very well tested - we all use them and we use mac and linux constantly. i'm leaning towards module being faulty at this point.

  • chafoschafos Reading, UK

    New board works as expected on VM and native Linux - think we have to put this down to bad hardware...

    Thanks for your help
    /Charles

  • rojerrojer Dublin, Ireland

    good, glad it finally worked for you!

Sign In or Register to comment.