ESP32, Mac Os, Enter raw repl failes
Hi there,
I was using the micropython 1.17 firmware on an ESP32 and was trying to load a file into memory with the pyboard.py tool. I was doing the same thing on a Linux machine (where the serial port was /dev/tty.USB0) but for some reason the same fails on Mac OS (serial port /dev/tty.usbserial-0001) with the following error:
b'\x9a\x82\xc2\x82\xa2\x82\x82bb\x95\xb9\xe94292\r\nentry 0x400806b0\r\nMicroPython v1.17 on 2021-09-02; ESP32 module with ESP32\r\nType "help()" for more information.\r\n>>> ' Traceback (most recent call last): File "/Users/luca/mambaforge/bin/mpremote", line 8, in <module> sys.exit(main()) File "/Users/luca/mambaforge/lib/python3.9/site-packages/mpremote/main.py", line 414, in main pyb.enter_raw_repl() File "/Users/luca/mambaforge/lib/python3.9/site-packages/mpremote/pyboard.py", line 340, in enter_raw_repl raise PyboardError("could not enter raw repl") mpremote.pyboard.PyboardError: could not enter raw repl
Looking at the pyboard file, it suggest that the activation of the "raw repl" mode is unsuccessful, which is weird since i can use "mpremote connect /dev/tty.usbserial-0001" to get into the normal repl and the use Ctrl-B to access the raw repl mode.
On further investigation it seems like the write does not actually reach or gets interpreted by the microcontroller.
Thanks in advance for any recommendation or resources that might be useful to fix this issue
On OSX, mpremote.transport.TransportError: could not enter raw repl
mpremote can't seem to enter raw repl:
% mpremote ls
b'MicroPython v1.20.0-745-g30ba5e11e-dirty on 2024-01-23; ESP32 module (spiram) with ESP32\r\nType "help()" for more information.\r\n>>>
Traceback (most recent call last):
File "/Users/danielmcshan/Library/Python/3.9/bin/mpremote", line 8, in <module>
sys.exit(main())
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/main.py", line 528, in main
handler_func(state, args)
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/commands.py", line 110, in do_filesystem
state.ensure_raw_repl()
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/main.py", line 470, in ensure_raw_repl
self.transport.enter_raw_repl(soft_reset=soft_reset)
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/transport_serial.py", line 155, in enter_raw_repl
raise TransportError("could not enter raw repl")
mpremote.transport.TransportError: could not enter raw repl
but mpremote connects fine:
% mpremote
Connected to MicroPython at /dev/cu.usbserial-210
Use Ctrl-] or Ctrl-x to exit this shell
MicroPython v1.20.0-745-g30ba5e11e-dirty on 2024-01-23; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>>
% sw_vers
ProductName: macOS
ProductVersion: 13.0
BuildVersion: 22A380
% python3 --version
Python 3.9.6
% mpremote --version
mpremote 1.22.0