Commit Graph

36 Commits

Author SHA1 Message Date
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
Radim Karniš
4ccdc51b07 ci(espefuse_test): Comply with esptool v4.8 2024-08-22 16:12:16 +02:00
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
Jan Beran
832c3f265a fix: Generate secure keys in project dir instead of build dir 2024-06-28 12:36:49 +02:00
Jan Beran
b286105d5f feat: Add unit tests for new wrapper commands 2024-06-24 10:56:10 +02:00
Frantisek Hrbata
fbe8bf89ee fix: properly resolve component dependencies
There is currently a bug in the __build_resolve_and_add_req function in
tools/cmake/build.cmake where the check for registered component
requirements is incorrectly applied to the component itself rather than
its dependencies. This issue likely originated from a typo, using
component_target instead of _component_target. To prevent further
confusion, _component_target has been renamed to _req_target.

Fixing this revealed multiple incorrect dependencies for the Linux
target, which have now been resolved by explicitly specifying the
dependencies for the Linux target.

Closes https://github.com/espressif/esp-idf/issues/13447

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-30 22:01:55 +08:00
Marek Fiala
a97e355e74 feat(tools): Run Tools related host tests on Win 2024-02-02 14:58:04 +01:00
Frantisek Hrbata
a773072734 fix: harden input parsing in component_requirements hint module
Currently we silently ignore when the original component is not found
in a hope we can provide at least some meaningful hint. As it turned
out it's not true. Instead of providing misleading hint, just return
error. This adds several checks for situations, which should not happen,
but when they do it should be easier to identify the root cause of the
problem.

For example when hint module received malformed output with extra new
lines, e.g. caused by a bug in RunTool, it wrongly reported the original
component as source component.

This should also fix the tests on Windows.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-01-23 18:22:08 +01:00
Ivan Grokhotkov
71153c7dbb
feat(tools): add 'idf.py qemu' extension
This extension allows running programs in QEMU similar to running
them on a real chip:

- 'idf.py qemu' — builds and runs the program in QEMU. User gets
  a QEMU instance launched, and can work with it as a normal QEMU
  instance.
- 'idf.py qemu monitor' — same, but QEMU is launched in the
  background, and idf_monitor runs in the foreground, showing QEMU
  output. Compared to only running 'idf.py qemu' this enables, for
  example, automatic backtrace decoding.
- 'idf.py qemu gdb' — launches QEMU in the background and opens an
  interactive GDB prompt, connecting it to QEMU.
- 'idf.py qemu --gdb monitor' and 'idf.py gdb' in another shell:
  launches QEMU in the background, keeps it suspended until GDB is
  connected, and opens idf_monitor. GDB can be used in another shell
  to debug the application.
2023-12-03 07:45:19 +01:00
Roland Dobai
bc1d74bb88 fix(ci): Remove unittest-xml-reporting dependency from host tests 2023-11-30 14:03:41 +01:00
Roland Dobai
51b104deac Merge branch 'feat/all_components' into 'master'
feat(tools): display hints for projects with trimmed down list of components

Closes IDF-8005 and IDF-8316

See merge request espressif/esp-idf!26297
2023-10-16 17:40:12 +08:00
Darian Leung
2b357071f1 refactor(freertos/task_snapshot): Deprecate task_snapshot.h
This commit deprecates the `#include "freertos/task_snapshot.h" include path:

- Adds compatibility header with compile time warning
- Removes hints related to `task_snapshot.h`
- Adds entry to migration guide
2023-10-07 18:55:47 +08:00
Frantisek Hrbata
64d82b54bc feat(hints): use all_component_info from project_description.json
Currently the component_requirements hint module does not work
as expected if the component list for a project is trimmed down.
With the new "all_component_info" dictionary info in project_description.json,
the module can produce hints even if cmake's COMPONENTS variable is
set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-10-02 16:24:41 +02:00
Frantisek Hrbata
00d77e7a75 fix(hints): properly identify source component
If there is a component(child) within a component(parent), like for test_apps, the parent
component may be wrongly identified as source component for the failed include. This may
lead to a false bug report if the parent component has component, which provides the missing
header, in requirements.

Fix this by looking for the longest matching source component directory.

Suggested-by: Ivan Grokhotkov <ivan@espressif.com>
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-09-27 12:50:25 +02:00
Frantisek Hrbata
c5503b3537 ci(tools): fix test_hints.py to run on windows
1. The original test, before hint modules support was added, used
tempfile.NamedTemporaryFile in a way which is not supported on windows.
It was having the file open, which the hints tried to read it, leading
the EPERM exception. The docs[1] says this is not supported.
<quote>
Whether the name can be used to open the file a second time, while the
named temporary file is still open, varies across platforms (it can be
so used on Unix; it cannot on Windows)
</quote>

2. The hint module component_requirements test used the idf.py directly,
which is idf.py.exe on windows.Now it's starting idf.py through python.
We could probably used shell=True, but this approach is used in other
tests too.

Anyway the test are now passing on windows.

[1] https://docs.python.org/3/library/tempfile.html

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-05 20:13:28 +02:00
Frantisek Hrbata
801bf0053d ci(tools): add tests for component_requirements.py hints module
Following tests were added.

1. Test for missing header directory in component's INCLUDE_DIRS
2. Test for missing dependency in component's PRIV_REQUIRES
3. Test for missing dependency in component's REQUIRES
4. Test for dependency in PRIV_REQUIRES which should be in REQUIRES

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-05 20:13:28 +02:00
Marek Fiala
076779f419 feat(tools): idf.py adding arguments from file via @filename.txt
- moved test inputs to one directory
- removed `-` from test arguments

Closes https://github.com/espressif/esp-idf/pull/11821
Closes https://github.com/espressif/esp-idf/issues/11783
2023-07-25 10:29:09 +02:00
Nebojsa Cvetkovic
4c1f574c3d feat(idf.py): Allow adding arguments from file via @filename.txt 2023-07-21 06:42:23 +01:00
Marius Vikhammer
b1b25ad7df hints: add a more complete description for component not found errors 2022-12-06 10:54:44 +08:00
Alexey Lapshin
29655fe22a tools: fixed elf symbols load if gdbinit specified
ROM and bootloader symbols add to use in GDB (via 'idf.py gdb')
2022-09-21 22:39:03 +04:00
simon.chupin
92ef2a4c83 Tools: Add unit tests for idf.py hints 2022-09-01 17:09:46 +02:00
Marek Fiala
9c0969b512 Tools: Export selected target actions
Added option --json to action help, for export selected target actions
2022-07-19 20:02:55 +02:00
Sergei Silnov
360183dd8d Tools: Make idf.py tests independent on extra extensions 2022-05-27 10:45:27 +02:00
simon.chupin
1c5e596633 idf.py: Change copyright in tools dir 2022-05-24 14:01:50 +02:00
Fu Hanxi
0146f258d7 style: format python files with isort and double-quote-string-fixer 2021-01-26 10:49:01 +08:00
martin.gano
304cff9f75 Redirect warning to stderr and unset temporary shell procedure 2020-11-11 15:12:58 +01:00
Renz Christian Bagaporo
a5d49d4db5 tools: fix double builds with idf.py 2020-03-02 07:18:22 +05:00
Sergei Silnov
506c46fddc idf.py: add exit_with_error for deprecation 2019-12-02 10:41:23 +01:00
Sergei Silnov
262ed0e72b idf.py: Fix regression ignorance of --verbose flag 2019-11-25 11:47:55 +01:00
Sergei Silnov
2dbad4fe7b idf.py: add support for subcommands hidden from help 2019-11-08 17:54:10 +01:00
Sergei Silnov
5e6aae3e04 Fix typo and naming format for extensions 2019-10-30 10:34:17 +01:00
Sergei Silnov
1c798393e2 Add idf.py extensions and move core actions to separate files 2019-10-30 10:34:17 +01:00
Sergei Silnov
1faa69a01b idf.py: Fix execution order for dependent tasks
Closes https://github.com/espressif/esp-idf/issues/3948

Add tests for idf.py
Move param check from cmake to idf_py test
Refactor task processing for idf.py
Add code comments
Fix an issue when options for dependent tasks are ignored
Add check for dupes in command list
2019-09-16 22:48:57 +08:00
Sergei Silnov
58418c790a idf.py: Add support for deprecation of command/options 2019-08-20 16:10:25 +02:00