345 Commits

Author SHA1 Message Date
Roland Dobai
16ba8b7e4a Merge branch 'feature/add_utf_8_decoding' into 'master'
feat(tools): Enforced utf-8 encoding with Python open() functions

Closes IDF-10654

See merge request espressif/esp-idf!32303
2024-12-30 16:07:29 +08:00
Frantisek Hrbata
949f6cb9f7 feat(tools): add idf.py diag reporting tool
The initial implementation of a diagnostic tool that collects valuable
information about esp-idf and failed build to assist in investigating
reported issues.

The gathered information includes environmental variables, details about
the python virtual environment, installed tools, platform information,
project_description.json, sdkconfig, build logs, map file, linker
scripts, and others.

usage:

1) create the default report

   # allow diag to create the report directory name
   $ idf.py diag
   # explicitly specify the report directory
   $ idf.py diag --output <report directory>

2) examine the contents of the generated <report directory> for
   sensitive information and add additional content to the
   <report directory>

3) create report archive zip file that can be shared or attached to
   the reported issue

   $ idf.py diag --zip <report directory>

The tool collects information as described in what are known as recipe
files. A recipe file is a YAML file, similar to an Ansible playbook or a
GitHub action, but much more simplified. Each recipe outlines how to
gather a set of related information. For instance, the manager.yml
recipe gathers data related to the component manager. Each recipe
includes metadata such as its description, tags, and steps. Tags are
used to determine which recipes to use; by default, all built-in recipes
located in tools/idf_py_actions/diag/recipes are used. Steps consist of
a list of commands to be executed. Currently, there are four commands:
file, exec, env, and glob. For more detailed information about recipes,
their format, and commands, please refer to
tools/idf_py_actions/diag/recipes/README.md.

Recipe example for component manager:

description: IDF Component Manager information
tags: [manager, base, project]
output: manager
steps:
  - name: 'IDF Component Manager'
    cmds:
      - exec:
        cmd: 'python -m idf_component_manager version'
        output: manager.ver
      - file:
        path: '${PROJECT_DIR}/dependencies.lock'
      - glob:
        # Gather all idf_component.yml files from the project directory and
        # save them in directories relative to the project directory within
        # the idf_component directory.
        pattern: 'idf_component.yml'
        recursive: true
        relative: true
        path: '${PROJECT_DIR}'
        output: 'idf_component/'

Create report for manager

1) all recipes with manager tag

   $ idf.py diag --tag manager

2) use only the manager recipe explicitly; built-in recipes can be
   referenced simply by their name, but all recipes can be referenced
   by their path

   $ idf.py diag --recipe manager
   or
   $ idf.py diag --recipe <full path>

To display available recipes, use

   $ idf.py diag --list

and to verify recipes, use

   $ idf.py diag --check

Both --list and --check honers the --tag and --recipe options.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-12-27 12:08:59 +01:00
Frantisek Hrbata
642855c952 feat(tools): add command arguments in the logs produced by RunTool
Currrently, all logs generated by RunTool are stored in files named
idf_py_(stdout|stderr)_output_$$, making it difficult to identify which
log corresponds to which command. To simplify this for idf-diag, include
the command arguments at the beginning of the log. This will allow
idf-diag to use regex to differentiate logs for build, monitor, flash,
and other commands and targets.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-12-27 12:02:23 +01:00
Marek Fiala
2c814ef2fa feat(tools): Enforce utf-8 encoding with open() function 2024-12-27 17:12:21 +08:00
Roland Dobai
5603258961 Merge branch 'fix/missing_header_hint' into 'master'
fix(hints): improve suggestion for missing header file

Closes IDF-11895

See merge request espressif/esp-idf!35728
2024-12-20 19:39:54 +08:00
Roland Dobai
757d74abae Merge branch 'fix/failing_create_readonly_test_on_win' into 'master'
fix(tools): fixed failing Win CI (tests read_only, cli)

Closes IDF-11782

See merge request espressif/esp-idf!35549
2024-12-19 21:41:50 +08:00
David Čermák
7e2464720e Merge branch 'feat/lwip_extern_decl_sockutls' into 'master'
feat(lwip): Declare additional POSIX API if available

Closes IDFGH-14028 and IDFGH-12794

See merge request espressif/esp-idf!35683
2024-12-19 18:14:17 +08:00
David Cermak
d66b6e2749 feat(hints): Add hints on using external sock utilities 2024-12-17 11:18:46 +01:00
Frantisek Hrbata
0c2843a071 fix(hints): improve suggestion for missing header file
Currently, we are only suggesting that the header file is likely not
part of the component's INCLUDE_DIRS. However, the header file may be
missing also because of the configuration settings. For instance, the
component might be disabled in sdkconfig, or the feature that supplies
the header might not be enabled. Enhance the hint message to address
this scenario as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-12-17 10:56:26 +01:00
Marek Fiala
0b78083595 fix(tools): fixed test_create_project_with_idf_readonly on Win 2024-12-16 14:55:15 +01:00
Tomas Rezucha
bf86ab3926 feat(dfu): Enable DFU on ESP32-P4 2024-12-11 09:23:32 +01:00
Roland Dobai
bfe065003d Merge branch 'fix/monitor_no_elf' into 'master'
fix(tools): fix running monitor without elf file

Closes IDF-11821

See merge request espressif/esp-idf!35479
2024-12-09 21:40:53 +08:00
Alexey Lapshin
e0bb3a25e4 fix(tools): fix idf.py gdb execution in case app was not built 2024-12-06 19:15:56 +07:00
Peter Dragun
54d3c090be fix(tools): fix running monitor without elf file 2024-12-06 09:48:48 +01:00
Frantisek Hrbata
496e9cdff8 fix(hints): handle multiple missing headers in the output
The object files are compiled simultaneously, which can result in
several error messages about missing headers. The current regex used to
find missing headers in the compiler's output employs a greedy search,
potentially capturing multiple error messages from different compilation
units. This can cause bug reports where the original component cannot be
identified. Strengthen the regex to ensure it only processes the first
reported error.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-20 18:41:55 +08:00
Alexey Lapshin
2a6e08431b Merge branch 'feature/move-gdb-options-to_project_description_json' into 'master'
feat(debugging): move gdbinit generation to CMake

Closes IDF-11489

See merge request espressif/esp-idf!34779
2024-11-20 14:30:40 +08:00
Alexey Lapshin
48a49c8154 feat(debugging): move gdbinit generation to CMake
This feature is useful for 3rd-party software to run GDB with predefined
options that described in project_description.json file

allow to pass custom options to "idf.py gdb":

  --gdb-commands: command line arguments for gdb. (without changes)
  -ex: pass command to gdb.
  -x: pass gdbinit file to gdb. Alias for old --gdbinit command
2024-11-19 16:41:38 +07:00
Peter Dragun
6495a8318d Merge branch 'monitor_multi_elf' into 'master'
feat(monitor): Add support for decoding output based on multiple ELF files

Closes IDF-11026

See merge request espressif/esp-idf!34858
2024-11-19 17:18:35 +08:00
Tomas Rezucha
66596b7f59 feat(hints/usb): Add a hint about too small control transfer size 2024-11-18 21:03:30 +08:00
Peter Dragun
28dcb9a889 feat(monitor): Add support for decoding output based on multiple ELF files 2024-11-18 12:35:45 +01:00
gaoxu
64bbb53b8f feat(esp32h21): introduce target esp32h21(stage 1) 2024-11-12 15:42:27 +08:00
Aditya Patwardhan
6930dff98d Merge branch 'feature/add_option_to_provide_flash_file_for_qemu' into 'master'
feat(tools): Added option to specify flash image in "idf.py qemu"

See merge request espressif/esp-idf!34031
2024-10-24 02:22:43 +08:00
Roland Dobai
4460d9fb1b fix(tools): Print message about GDBGUI being not supported with Python 3.13 2024-10-22 14:22:18 +02:00
Aditya Patwardhan
a58a07ecfe feat(tools): Added option to specify flash image in "idf.py qemu" 2024-10-21 18:48:02 +08:00
Marius Vikhammer
8e511ffb4e fix(hints): added missing seperator between hints 2024-10-17 17:04:55 +08:00
Marius Vikhammer
bb8fa9300f Merge branch 'change/rename_va_narg' into 'master'
fix(system): rename __VA_NARG__ macro

Closes IDF-11367

See merge request espressif/esp-idf!34068
2024-10-17 08:57:44 +08:00
Marius Vikhammer
64e0fc7a5a fix(system): rename __VA_NARG__ macro
__VA_NARG__ is copied from a forum post and is a pretty common implementation
with a high chance of causing naming collision

Added ESP_ namespace to avoid this.
2024-10-15 09:41:00 +08:00
Roland Dobai
0a354e09ef Tools: Add new ROM binary release including for ESP32-C5 2024-10-14 14:32:35 +08:00
Martin Vychodil
f659405ee0 Merge branch 'feat/monitor_auto_color' into 'master'
feat(tools): Add auto color to monitor and disable colors from chip logs

Closes IDF-362 and DOC-9110

See merge request espressif/esp-idf!33623
2024-10-11 01:04:26 +08:00
Alexey Lapshin
9d32a31657 feat(tools): add binary size exceeded hint 2024-10-07 19:00:04 +07:00
Peter Dragun
2c458f3af1 feat(tools): Add auto color to monitor and disable colors from chip logs
ANSI color codes are handled on the host side instead of the chip side. This
will result in shorter log messages transmitted over serial.
2024-10-01 11:46:20 +02:00
Radim Karniš
4a04a9e95c feat(idf_py): Allow tracing interactions during flashing with --trace 2024-09-26 11:27:04 +02:00
Konstantin Kondrashov
dcd433e62c Merge branch 'bugfix/werror_hint' into 'master'
fix(tools): Fix a regular expression in hints.yml for Werror=

See merge request espressif/esp-idf!33625
2024-09-19 01:30:27 +08:00
Konstantin Kondrashov
d1a00f5808 fix(tools): Fix a regular expression in hints.yml for Werror= 2024-09-18 16:33:47 +03:00
Alexey Gerenkov
5c43055e3e Merge branch 'esp32c61_jtag_doc_update' into 'master'
docs(jtag): update esp32c61 jtag debugging guide

Closes IDF-10168

See merge request espressif/esp-idf!33546
2024-09-18 19:36:23 +08:00
Erhan Kurubas
6ade64eb05 docs(jtag): update esp32c61 jtag debugging guide 2024-09-18 10:44:41 +03:00
Marek Fiala
6ec1e9107f feat(tools): Move sample_project from examples to tools
Extended example readme.md by further development options.
2024-09-16 09:12:50 +02:00
Alexey Lapshin
c605620073 Merge branch 'fix/keep-got-sections-for-riscv' into 'master'
feat(esp_system): drop .got* sections and add hint

See merge request espressif/esp-idf!32969
2024-09-06 19:21:06 +08:00
Roland Dobai
17fed13a27 Merge branch 'distutils' into 'master'
fix(tools): remove distutils to support python 3.12

Closes IDFGH-13510

See merge request espressif/esp-idf!33260
2024-09-06 14:23:04 +08:00
Alexey Lapshin
73987108cd feat(esp_system): drop .got* sections and add hint
Closes https://github.com/espressif/esp-idf/issues/14296
2024-09-05 15:47:01 +07:00
Guilhem Saurel
727c6a82ea fix(tools): python3.12 support
remove distutils use
2024-09-04 18:00:56 +02:00
laokaiyao
462698f2de change(i2s): add warning for inaccurate sample rate 2024-08-29 19:03:19 +08:00
harshal.patil
e5f22521da
docs(secure_boot_v2): Mention idf.py and openssl commands to generate and verify signatures
- Adds support for verify_signature command in idf.py

Closes https://github.com/espressif/esptool/issues/942
2024-08-27 15:44:05 +05:30
Ivan Grokhotkov
0773caf283 Merge branch 'feature/idf_py_efuse_qemu' into 'master'
feat(idf.py): support efuse-related commands in QEMU

Closes QEMU-193

See merge request espressif/esp-idf!29809
2024-08-21 16:13:54 +08:00
Ivan Grokhotkov
7b228ce8ab
feat(idf.py): allow running idf.py efuse-* commands with QEMU 2024-08-15 16:57:08 +02:00
Ivan Grokhotkov
c521fcb6fd
fix(cmake): report correct error on unknown component name
Previously the error message was

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:296 (__component_get_property):
  __component_get_property Function invoked with incorrect arguments for
  function named: __component_get_property
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:341 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:638 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Now it will be:

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:298 (message):
  Failed to resolve component 'whatever' required by component 'main'.
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:345 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:642 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Also improved the hint to show the component name in quotes.
2024-08-12 17:54:44 +02:00
Marius Vikhammer
837f2cd48a fix(tools): fixed spelling mistakes in idf.py hints 2024-08-05 15:44:48 +08:00
Radim Karniš
ed9b2d1fd6 change(port_detection): Filter out BT and WLAN debug serial ports on MacOS
Closes https://github.com/espressif/esp-idf/issues/14058
2024-07-04 20:40:10 +08:00
Jan Beran
832c3f265a fix: Generate secure keys in project dir instead of build dir 2024-06-28 12:36:49 +02:00
Roland Dobai
53d3f2f594 Merge branch 'feat/wrapper_tests' into 'master'
feat: Add unit tests for new wrapper commands

Closes IDF-10224

See merge request espressif/esp-idf!31525
2024-06-26 16:06:01 +08:00