The actual output from the build tool (CMake/Ninja) may or may not
contain color escape codes, depending on various factors. The output
written to the log file should never include color escape codes,
though. This is because color escape codes in files are usually not
rendered as "color" in editors, and complicate reading. Also escape
codes would break the regular expressions used to display hints for
compilation errors.
If stdout is a TTY (meaning that the output is not redirected), tell
the build tool (GNU Make or Ninja) to enable colorized output.
GNU Make and Ninja also check if their stdout is redirected and
strip color escape sequences in that case. CLICOLOR_FORCE environment
variable overrides this behavior.
With this change, if the compiler was launched with the
-fcolor-diagnostics flag and idf.py output is not redirected, the
final output in the terminal will be colorized.
(-fcolor-diagnostics is handled at CMake level by the previous commit)
This fixes the issue with build output not being colorized on Windows,
while the hints messages are colorized.
The issue occurred because sys.stdout and sys.stderr get overridden
by colorama.init() at runtime, but the default argument
output_stream=sys.stdout holds the reference to the"original"
sys.stdout.
colorama.init() (which, by the way, gets called via a curious chain
of imports, via idf_component_tools.manifest and tqdm package)
overrides standard streams, on Windows only. The overridden streams
contain logic to convert ANSI color codes into Windows Console API
calls to colorize the text.
Since read_and_write_stream function used the default value of
output_stream evaluated at module loading time, it was using the
original sys.stdout, not the one overridden by colorama.
One extra note is that while this does fix the coloring issue, the
solution is a bit fragile, as it relies on one of the following
(on Windows):
- colorama.init() is called (this can change if idf-component-manager
stops importing tqdm)
- Sufficiently new version of Windows 10 is used, and ANSI color codes
support is enabled in the Registry.
The actual output from the build tool (CMake/Ninja) may or may not
contain color escape codes, depending on various factors. The output
written to the log file should never include color escape codes,
though. This is because color escape codes in files are usually not
rendered as "color" in editors, and complicate reading. Also escape
codes would break the regular expressions used to display hints for
compilation errors.
If stdout is a TTY (meaning that the output is not redirected), tell
the build tool (GNU Make or Ninja) to enable colorized output.
GNU Make and Ninja also check if their stdout is redirected and
strip color escape sequences in that case. CLICOLOR_FORCE environment
variable overrides this behavior.
With this change, if the compiler was launched with the
-fcolor-diagnostics flag and idf.py output is not redirected, the
final output in the terminal will be colorized.
(-fcolor-diagnostics is handled at CMake level by the previous commit)
This adds CSV support to idf_size.py and idf.py size actions and using the --format argument which accepts 'text', 'json' or 'csv' as input.
idf_size.py --json argument is deprecated but left to avoid a breaking change.
For idf.py size actions OUTPUT_JSON environment variable set at configuration time is overriden at target build time if --format is used.
Additionally, this commit refactors big parts of code, unified usage of json_dict and manually generated dictionaries for textual output and improves code quality in many parts.
hints are added:
- to indicate that esp_cpu_ccount_t must be replaced by esp_cpu_cycle_count_t
- to indicate that esp_cpu_get/set_ccount must be replaced by esp_cpu_get/set_cycle_count
- to indicate that soc/cpu.h and compare_set.h were removed and user must include esp_cpu.h instead
- to indicate that esp_intr.h was removed and user must include esp_intr_alloc.h instead
- to indicate that esp_panic.h was made private and user must use the functionalities from esp_debug_helper.h instead
- to indicate that spilock.h, clk_ctrl_os.h and rtc_wdt.h must be included without the soc/
- to indicate that soc_log.h was renamed esp_hw_log.h and made private
Since both chips have built-in JTAG functionality, and there are no
official boards with FT2232H for these chips, use the built-in JTAG
by default.
To use them with esp-prog, set:
OPENOCD_COMMANDS="-f board/esp32c3-ftdi.cfg"
or pass this via the --openocd-commands argument to idf.py.
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
GDB with python support will automatically load freertos-gdb python module.
It comes to GDB with commands starting with 'freertos' to show human-readable
tables with freertos task/queue/timer information
Python module URL: https://pypi.org/project/freertos-gdb
MSYS/Mingw was deprecated since v4.0 and it is removed in v5.0. Please
follow the getting started guide of the documentation to set up a
Windows Command Line or Power Shell based environment.
Add docs subcommand with options:
--no-browser - Prints url for current documentation instead of opens browser with documentation
--language - Select documentation language
--starting-page - Choice section of documentation to open
--version - Choice version of esp-idf
--target - Choice model of your target
ROM will erase the region a partition is in as soon as it receives the
first bit of the data that is in the partition. For large partitions it
takes more than 5 seconds to erase which is a hard-coded limit in
dfu-utils.
This splits large binaries and adds them by chunks which should avoid
timing-out during flashing.
Closes https://github.com/espressif/esp-idf/issues/6999
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.
* add toolchain file
* add linux to preview targets
* add stub for dfu number in cmake
* excluded unity runner per default
* Added esp_attr.h and esp_partition.h linux stubs
* component.cmake check list for emptyness
* added switch for linux in unity cmake file
* Added Linux host example app
When idf.py gdb starts, it expects openocd was started in the background
and creates a thread to watch for openocd errors. when gdb target exits,
the debug_ext.py aims to cleanup all threads and processes, but fails
with traceback if openocd-watch thread not available, which could happen
if openocd started separately.
Can still be enabled by passing --cmake-warn-uninitialized on the command line
Prevents CMake warnings printed by default if IDF_PATH is underneath the CMake
project directory.
The reason for this is that CMake --warn-uninitialized only enables checks
inside the project directory (ie top-level CMakeLists.txt directory and
subdirectories), it doesn't enable for files included from other directories.
(The only way to enable warnings in other directories is to pass
--check-system-dirs and this looks like it's only useful for CMake's own
developers as it prints a lot of warnings from inside CMake otherwise - see
https://gitlab.kitware.com/cmake/cmake/-/issues/19645 )
Plan to follow up with a later commit to clean up most of the warnings (which
aren't problems for CMake execution), but we'll also disable this option by
default to avoid this unexpected triggering of IDF warnings.
Support for execution of asynchronous target, such as openocd, which
by default runs in the background, but if it's the only target idf.py
outputs the openocd in the console waiting for termination by user.
Supports also blocking commands gdb and gdbtui to start a debugging
session in an active console.
Supports running gdbgui running a UI debugging session in a browser
window, using the active console for other commands, such as openocd
or monitor.
Supports combining the debug targets in one action list, such as
idf.py openocd gdbgui monitor
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.
This solves the issue that target is changed to the default one after
idf.py fullclean.
Also allow setting the default target using sdkconfig.defaults, e.g.
CONFIG_IDF_TARGET="esp32s2"
Closes IDF-1040
Python 2 expect the environ variables are all of type 'str', but
sometimes wrong 'unicode' type is given.
Here we force all variables that are not str to become str.