Commit Graph

300 Commits

Author SHA1 Message Date
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
Peter Dragun
2662a5125c fix(tools/idf_monitor): exit with error if monitor is run with --no-reset and without --port
Closes https://github.com/espressif/esp-idf/issues/14040
2024-06-24 13:47:40 +02:00
Jan Beran
b286105d5f feat: Add unit tests for new wrapper commands 2024-06-24 10:56:10 +02:00
Marc Finet
9456c157ff feat(build): Add config to disable warn be considered as errors
The -Werror=all activates error for all warnings in -Wall, however, it
does not activate error for other default warnings, such as:
- int-conversion (pointer from integer w/o a cast)
- incompatible-pointer-types
- discarded-qualifiers

Which are IMO even more important that -Wall.

This commit fixes that by activating error for all warnings (i.e. from
-Wall and default ones) and removing those from -Wextra, as the culprit
commit seemed to address.

Fixes: 60f29236f6 "Build system: Raise warning level" (2016-11-16)

In order to avoid long analysis during esp-idf upgrade, provide a way to
restore the previous -Werror=all behavior that consider only warnings
from -Wall (and not default ones).

Also add a hint to use the Kconfig option on compilation error, but warn
that fixing the code is the preferred way.

Merges https://github.com/espressif/esp-idf/pull/11239

Suggested-By: Ivan Grokhotkov <ivan@espressif.com>
2024-06-20 14:43:26 +08:00
Ivan Grokhotkov
f95caa751b Merge branch 'feature/update-qemu-to-esp_develop_9.0.0_20240606' into 'master'
feat(tools): update qemu version to esp_develop_9.0.0_20240606

See merge request espressif/esp-idf!31375
2024-06-14 20:41:52 +08:00
Ivan Grokhotkov
6ddf31bbdc
feat(tools): enable idf.py qemu integration for ESP32-S3 2024-06-12 10:50:13 +02:00
Jakub Kocka
23ba79d5c7 fix(tools): Avoid crashing when Git is used to acquire IDF version
Closes https://github.com/espressif/esp-idf/issues/13345
2024-06-11 08:13:25 +02:00
Jan Beran
950428c2f4 feat(tools): Add often used espefuse subcommands to idf.py 2024-06-07 16:23:17 +02:00
Roland Dobai
7b7f73ba2a Merge branch 'feat/add_espsecure_subcommands' into 'master'
feat: Add espsecure subcommands into idf.py

See merge request espressif/esp-idf!29424
2024-05-31 18:29:55 +08: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
Frantisek Hrbata
6f41dee0cd feat: add diff option support to idf.py size commands
This adds a possibility to specify --diff option to idf.py size,
size-components and size-files commands. This can be map file directly,
project directory or build directory.

Usage example:
idf.py size-components --diff ../hello_world2/build/hello_world.map
idf.py size-components --diff ../hello_world2/build
idf.py size-components --diff ../hello_world2

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-24 15:19:37 +08:00
Roland Dobai
06b4b97326 fix(tools): Use GDGBUI arguments based on its version
Closes https://github.com/espressif/esp-idf/issues/13665
2024-05-23 07:33:11 +02:00
Jan Beran
981062d54f feat(tools): add often used espsecure subcommands to idf.py 2024-05-20 15:13:35 +02:00
Alexey Lapshin
2b36636f6f fix(system): print warning if stray section is found while linking 2024-05-17 13:37:42 +04:00
Erhan Kurubas
810adf2dcc change(gdbinit): set remote timeout for the gdb connection 2024-05-06 22:06:18 +02:00
Roland Dobai
af302c0bee Merge branch 'feat/add_merged_bin_cmd' into 'master'
feat(tools): Add idf.py merge-bin command and cmake target

See merge request espressif/esp-idf!29996
2024-04-22 17:55:36 +08:00
Jan Beran
0dec6fe65d feat(tools): Add idf.py merge-bin command and cmake target 2024-04-16 12:49:18 +02:00
Erhan Kurubas
72f463afc6 Merge branch 'doc_update_esp32p4_jtag' into 'master'
Update esp32p4 jtag debugging guide

Closes IDF-7758

See merge request espressif/esp-idf!26527
2024-04-13 02:10:21 +08:00
Erhan Kurubas
9e80e127ac doc(jtag): update esp32p4 jtag debugging guide 2024-04-04 21:37:56 +03:00
Frantisek Hrbata
75c765ff42 fix: exit gracefully when process started via asyncio is terminated
Currently when process is started through asyncio Runner and it is termited
e.g. with SIGINT(ctrl+c) a traceback is printed instead of gracefully
exit.

Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7fe980970900>
Traceback (most recent call last):
  File "/usr/lib64/python3.12/asyncio/base_subprocess.py", line 129, in __del__
    self.close()
  File "/usr/lib64/python3.12/asyncio/base_subprocess.py", line 107, in close
    proto.pipe.close()
  File "/usr/lib64/python3.12/asyncio/unix_events.py", line 568, in close
    self._close(None)
  File "/usr/lib64/python3.12/asyncio/unix_events.py", line 592, in _close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 793, in call_soon
    self._check_closed()
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 540, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

This is caused because asyncio Runner context in asyncio.run is closing the event
loop and if exception is unhandled in coroutine(run_command) the transport is not
closed before the even loop is closed and we get RuntimeError: Event loop is closed
in the transport __del__ function because it's trying to use the closed
even loop.

Let's catch asyncio.CancelledError in case the process we are trying to
read from is terminated, print message, let the asyncio finish and exit
gracefully.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-04-04 09:58:01 +02:00
Ivan Grokhotkov
c0ff293bf8
feat(idf.py): add ESP32-P4 ROM info 2024-03-25 14:39:36 +01:00
Ivan Grokhotkov
d9fb9a5500
feat(tools): add ESP32-P4 to the supported targets list 2024-03-25 14:24:55 +01:00
Alexey Lapshin
174e9f582b feat(tools): update toolchain version to esp-13.2.0_20240305 2024-03-15 12:35:09 +04:00
wanlei
ee02b71f1c feat(esp32c61): introduce target esp32c61 2024-03-01 21:12:25 +08:00
Roland Dobai
9a9c8caaaf Merge branch 'fix/harden_hints_parsing' into 'master'
fix: harden input parsing in component_requirements hint module

Closes IDF-9082

See merge request espressif/esp-idf!28661
2024-01-25 20:26:35 +08: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
Frantisek Hrbata
cf161304bb fix: save RunTool command output with correct line endings
Currently RunTool reads command's output with asyncio read, which
returns bytes. This is decoded into python's string and the output already
contains OS specific line endings, which on Windows is CRLF. Problem is
that the command output is saved by using python's text stream/file,
which replaces LF, native python's line ending, with OS specific line ending.
On Windows, and in this particular case, the CRLF from the command output is
translated into CRCRLF and saved in the commands output file. When this
file is read in again, e.g. for hint modules, the CRCRLF is replaced
with LFLF. Again the file is open as text file. Meaning a new emply line
is added.

Fix this by opening the output file with "newline=''", which prevents
this translation. We already have the OS specific line ending in the
command's output.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-01-23 10:03:40 +01:00
Roland Dobai
c6acde833b fix(gdbgui): Fix support of gdbgui on Unix with Python 3.11
Closes https://github.com/espressif/esp-idf/issues/12764
2024-01-05 11:23:02 +01:00
Ivan Grokhotkov
d9983c0039
feat(qemu): add a CLI option for graphics output 2023-12-18 11:47:15 +01:00
dyarkovoy
1cc04d062c fix(tools): Fixed Python path case sensitive error on Windows
Closes https://github.com/espressif/esp-idf/issues/12779
Closes https://github.com/espressif/esp-idf/pull/12780
2023-12-15 08:01:29 +00:00
Mahavir Jain
1b822573b6 Merge branch 'feat/make_verify_signature_block_function_public' into 'master'
feat(bootloader_support): Make `esp_secure_boot_verify_sbv2_signature_block()` function public

Closes IDFGH-11599

See merge request espressif/esp-idf!27742
2023-12-13 11:43:33 +08:00
harshal.patil
fe293dfd83
feat(bootloader_support): Make esp_secure_boot_verify_sbv2_signature_block() function public
Closes https://github.com/espressif/esp-idf/issues/12717
2023-12-11 18:50:55 +05:30
Peter Dragun
5085763984 fix(tools): idf.py: fix detection of raw core dump file
When idf.py coredump-debug is launched with '--core' argument, it
tries to determine the file format (raw, elf, b64). To detect the
'raw' core dump the code checked if the version word matched one of
the known values.
However, the version word also contains the chip ID in the high
half-word, so the check failed for anything other than the ESP32.
The detection of core file format has been moved to esp-coredump
package in version 1.9.0, including the fix for chip ID.

Reported in https://github.com/espressif/esp-idf/issues/10852
2023-12-07 13:48:04 +01:00
Roland Dobai
8e619642c9 Merge branch 'feat/esp_idf_size_ng_integration' into 'master'
feat(tools): esp_idf_size.ng integration

Closes IDF-8771

See merge request espressif/esp-idf!27448
2023-12-05 20:36:07 +08: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
4797d744fa Merge branch 'fix/coredump_port' into 'master'
fix(tools/coredump): do not detect port when core file is used

Closes IDFGH-11552

See merge request espressif/esp-idf!27441
2023-11-30 18:40:23 +08:00
Frantisek Hrbata
18334588bc feat(tools): esp_idf_size.ng integration
This integrates esp_idf_size.ng, refactored esp-idf-size version, into
esp-idf and enables it by default. The esp_idf_size.ng may be enabled
by using the --ng option, but also via ESP_IDF_SIZE_NG env. variable,
which is used in this integration.

New -l/--legacy option is added, which enforces usage of the old version.
This option can be also set via "ESP_IDF_SIZE_LEGACY" env. variable.
This should allow to easily switch back to old version if there is any
problem.

The new version is used by default for all formats, except for the "json".

Examples:
$ idf.py size                           # uses refactored version
$ idf.py size --legacy                  # uses legacy version
$ idf.py size --l                       # uses legacy version
$ idf.py size --format json             # uses legacy version
$ idf.py size --format json2            # uses refactored version
$ export ESP_IDF_SIZE_LEGACY="1"        # use legacy version only from now on

ESP_IDF_SIZE_FORCE_TERMINAL, which forces terminal control codes(colors), is also set
when running from idf.py, so the colors are propagated even if stdout
for esp_idf_size.ng is not attached to tty.

The same changes are applied also to the idf_size.py wrapper.

There is an import check if esp_idf_size.ng is available. If not,
we switch into the legacy mode. This should cover situation when the
esp-idf has support for refactored version, but it's not installed.
This should also allow users to bind to a legacy version(<1.0.0) and the
idf.py size and idf_size.py should still work. This also allow us to
restring the version in constraints file if we need to switch back to
legacy version globally.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-11-30 09:26:51 +01:00
Alexey Lapshin
3ac31855b2 Merge branch 'contrib/github_pr_12683' into 'master'
fix(tools): fix path delimiter in gdbinit for Windows

Closes IDFGH-11562

See merge request espressif/esp-idf!27485
2023-11-30 04:57:07 +08:00
GuyBrush
090bb85a12 fix(tools): fix path delimiter in gdbinit for Windows
Merges https://github.com/espressif/esp-idf/pull/12683

Signed-off-by: Alexey Lapshin <alexey.lapshin@espressif.com>
2023-11-29 13:54:48 +04:00
Peter Dragun
59179ce54d fix(tools/coredump): do not detect port when core file is used
Closes https://github.com/espressif/esp-idf/issues/12673
2023-11-28 10:20:08 +01:00
wanglei
076aefce74 feat(esp32c5): add esp32c5 target in kconfig and tools 2023-11-28 16:14:17 +08:00
Jakub Kocka
579ecbddb8 feat(hints): Added hint for LIBUSB_ERROR_NOT_FOUND 2023-11-02 15:33:00 +01:00
Erhan Kurubas
659748748f fix(coredump-info): set default gdb timeout as 3 seconds 2023-11-01 19:41:56 +01:00
sonika.rathi
bb329accd7 fix(sd_card): update hints.yml to provide SD troubleshooting hints 2023-10-25 11:19:08 +02:00
Marius Vikhammer
d36b72ef23 fix(idf.py): fixed save-defconfig failing due to wrong argument name 2023-10-21 12:23:07 +08:00
Peter Dragun
bdcae08458 feat(tools/kconfig): add menu labels for min config
Closes https://github.com/espressif/esp-idf/issues/10358
2023-10-18 15:01:46 +02:00