A missing flush in the serial reader implementation for
Linux target was causing input to idf.py monitor to not
be forwarded to the application. This is fixed now.
If self.elf_exists is false, self.gdb_helper is None, which caused this
code to crash. It looks like this guard was missed in e30329ffe2.
Previously the code could crash like this:
Traceback (most recent call last):
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 376, in <module>
main()
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 367, in main
monitor.main_loop()
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 163, in main_loop
self._main_loop()
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 268, in _main_loop
super()._main_loop()
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 203, in _main_loop
self.serial_handler.handle_commands(data, self.target, self.run_make, self.console_reader,
File "/usr/local/src/esp-idf/tools/idf_monitor_base/serial_handler.py", line 203, in handle_commands
run_make_func('encrypted-flash' if self.encrypted else 'flash')
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 150, in run_make
run_make(target, self.make, self.console, self.console_parser, self.event_queue, self.cmd_queue,
File "/usr/local/src/esp-idf/tools/idf_monitor.py", line 237, in __exit__
self.serial_reader.gdb_exit = self.gdb_helper.gdb_exit # write gdb_exit flag
AttributeError: 'NoneType' object has no attribute 'gdb_exit'
Add idf.py monitor argument --no-reset (-R) to prevent resetting the CPU on monitor startup
idf.py monitor: fix type signature
idf.py monitor: fix reset key shortcut when --no-reset (-R) argument is used
idf.py monitor: change --no-reset (-R) argument descriptions in help
idf.py monitor: simplify --no-reset (-R) argument checks
idf.py monitor: add warning if --no-reset is used, but --port is not given
idf.py monitor: ignore --no-reset if --port is not given
Fix a regression of b77addea2f: The ANSI
color converter returns a class on Windows instead of an object so its
methods won't be callable and will result in a not so helpful error
message: "idf_monitor failed with exit code 120"
This follows a similar approach as UART core dump handling in
idf_monitor. Panic handler message is detected in the output,
collected into a file, and the file is passed to the decoding script.
In this case, the decoding script acts as a tiny GDB server, so we
can ask GDB to perform the backtrace.
This commit make idf_monitor overwrite the ESPPORT environment variable
with the port it's using, and re-run make with the modified environment
variable. In this way, the make invoked will inherit the idf_monitor's
port.
Closes https://github.com/espressif/esp-idf/issues/4591
The GDB uses CreateFile to open COM port on Windows. However this
function requires COM path to be `\\.\COMx` to open COM port whose
number is larger than 10.
Replace the port name from `COM` to `\\.\COM` when on Windows to fix
this.
This adds detection of UART core dumps to IDF monitor. By default,
core dumps are not printed to the console, but are processed by
espcoredump.py using 'info_corefile' command. The result is printed
to stdout.
This feature can be disabled in menuconfig.
In the future this can be extended to allow running espcoredump.py
with 'dbg_corefile' argument, which is similar to the current GDB Stub
behavior.
Related to IDF-52.
implemented workaround in idf_monitor for known usbser.sys bug which
causes changes in RTS signal to only be sent if DTR signal also changes.
Works by forcing a dummy change in DTR signal (re-assigning its current
value, as it has previously been done in the flashing tool)
Closes https://github.com/espressif/esp-idf/pull/4676
Windows Console write or flush may fail (throwing WindowsError, a subclass of OSError) if the data
written can't be displayed. This may be the case if the serial port is producing garbage bytes.
Ignore the error, in the hope that the serial port may "come good" and write non-garbage later.
Currently, the only way of exiting the idf_monitor program is to hit the CTRL+] button, if your keyboard doesn't have that key unless you hit another modifier key, it's not super trivial to exit.
This change adds the option to exit with CTRL+T (for menu) then hitting X (or CTRL+X) for exiting.
Closes https://github.com/espressif/esp-idf/pull/4167
Closes https://github.com/espressif/esp-idf/issues/4129