Skip to content

tools/mpremote: During soft reboot wait long enough for 115200 data. - #8240

Closed
andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:mpremote_soft_reboot_timeout
Closed

andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:mpremote_soft_reboot_timeout

Conversation

@andrewleech

Copy link
Copy Markdown
Contributor

When using mpremote with an esp32 using a standalone Silabs CP210x USB Uart at 115200 on Windows 10 I get a repeatable failure during soft-reboot

MPY: soft reboot
Traceback (most recent call last):
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote.py", line 6, in <module>
    sys.exit(main.main())
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\main.py", line 512, in main
    do_repl(pyb, args)
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\main.py", line 380, in do_repl
    do_repl_main_loop(
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\main.py", line 307, in do_repl_main_loop
    pyb.soft_reset_with_mount(console_out_write)
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\pyboardextended.py", line 647, in soft_reset_with_mount
    self.exec_(fs_hook_code)
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\pyboard.py", line 465, in exec_
    ret, ret_err = self.exec_raw(command, data_consumer=data_consumer)
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\pyboard.py", line 456, in exec_raw
    self.exec_raw_no_follow(command)
  File "W:\home\anl\mpy_iot\src\micropython\tools\mpremote\mpremote\pyboard.py", line 453, in exec_raw_no_follow
    raise PyboardError("could not exec command (response: %r)" % data)
mpremote.pyboard.PyboardError: could not exec command (response: b'R\x01')

It appears the startup message flush is being read / timeout too fast, not always waiting long enough for the next byte.
Simply increasing the per-byte timeout appears to resolve this issue reliably.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #8240 (2612ec4) into master (517e82e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8240   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files         153      153           
  Lines       20145    20145           
=======================================
  Hits        19838    19838           
  Misses        307      307           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 517e82e...2612ec4. Read the comment docs.

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Feb 1, 2022
@dpgeorge

dpgeorge commented Feb 4, 2022

Copy link
Copy Markdown
Member

Merged in 5a86d8d

@dpgeorge dpgeorge closed this Feb 4, 2022
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Aug 1, 2023
…8239

boards/beetle-esp32-c3: fix sdkconfig minor typo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants