Commit Graph

263 Commits

Author SHA1 Message Date
Roland Dobai
7ab6811a39 Merge branch 'fix/runtool_crcrlf_v5.2' into 'release/v5.2'
fix: save RunTool command output with correct line endings (v5.2)

See merge request espressif/esp-idf!28677
2024-02-18 15:34:14 +08:00
Roland Dobai
2193e441c2 Merge branch 'fix/harden_hints_parsing_v5.2' into 'release/v5.2'
fix: harden input parsing in component_requirements hint module (v5.2)

See merge request espressif/esp-idf!28708
2024-02-18 15:34:04 +08:00
Frantisek Hrbata
2b2a838518 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-25 13:37:17 +01:00
Frantisek Hrbata
306ea38038 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-24 11:07:21 +01:00
Roland Dobai
33a62c86d3 fix(gdbgui): Fix support of gdbgui on Unix with Python 3.11
Closes https://github.com/espressif/esp-idf/issues/12764
2024-01-05 18:51:50 +01:00
Jiang Jiang Jian
23e7663119 Merge branch 'bugfix/coredump_detect_v5.2' into 'release/v5.2'
tools: idf.py: fix detection of raw core dump file (v5.2)

See merge request espressif/esp-idf!27840
2023-12-26 10:38:43 +08:00
GuyBrush
8b68b39198 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-12-13 09:26:40 +00:00
Peter Dragun
9effe1aba6 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-11 11:17:54 +01:00
Peter Dragun
ffd3a58ff9 fix(tools/coredump): do not detect port when core file is used
Closes https://github.com/espressif/esp-idf/issues/12673
2023-12-05 09:52:19 +01:00
Erhan Kurubas
94c27b976d fix(coredump-info): set default gdb timeout as 3 seconds 2023-11-13 15:34:24 +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
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
Peter Dragun
95b764970e Merge branch 'feat/uf2-to-esptool' into 'master'
feat(tools): move uf2 file generation to esptool

Closes IDF-7434

See merge request espressif/esp-idf!25655
2023-10-12 16:03:16 +08:00
Alexey Lapshin
2585e53d54 Merge branch 'feature/update-toolchain-to-esp-13.1.0_new_newlib' into 'master'
Update toolchain to esp-13.2.0_20230919

Closes GCC-250, GCC-322, GCC-324, GCC-327, GCC-330, and IDF-8287

See merge request espressif/esp-idf!25073
2023-10-10 08:18:33 +08:00
Peter Dragun
9acf412a07 feat(tools): move uf2 generation to esptool 2023-10-09 15:38:30 +02:00
Darian
a10121491f Merge branch 'change/freertos_make_task_snapshot_private' into 'master'
refactor(freertos/task_snapshot): Make task snapshot private

Closes IDF-8182

See merge request espressif/esp-idf!26115
2023-10-09 16:32:18 +08:00
Alexey Lapshin
98199d50d6 change(tools): update gcc toolchain version to 13.2.0
Add Kconfig option to supress new gcc warnings
Update docs with migration guide
2023-10-09 12:13:00 +04: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
Guillaume Souchere
cb9868e82d feat(heap): Add runtime hint on tlsf assert trigger
Catch all tlsf assertion failure and display a hint for out of bound writing since
all assertion failure are triggered when the tlsf metadata structure has been corrupted.
2023-10-05 11:57:37 +02: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
Peter Dragun
0a8a5c0e7a fix(tools): fix autocomplete for --port option
Closes https://github.com/espressif/esp-idf/issues/7970
2023-09-06 14:32:48 +02:00
Michal Jenikovsky
e9bb33624b idf.py: gdb action incorrectly generated EOL gdbinit scripts
GDB on Windows incorrectly reads EOL in the script files causing 'gdb'
action to fail.

(gdb) source .../build/gdbinit/py_extensions
(gdb) source .../build\gdbinit\symbols
add symbol table from file "...\build\bootloader\bootloader.elf"
.../build\gdbinit\symbols:6: Error in sourced command file:
Undefined command: "".  Try "help".

Forcing line separator to '\n' resolved the issue

Signed-off-by: Michal Jenikovsky <jendo@jmsystems.sk>
2023-08-11 12:37:29 +02:00
Ivan Grokhotkov
6878ddaa4a feat(tools): idf.py: implement hints for component reqs
Implementation of hint module for component dependency. It can provide
hint about missing header directory in component's INCLUDE_DIRS or
about missing component dependency in REQUIRES or PRIV_REQUIRES.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-05 20:13:28 +02:00
Ivan Grokhotkov
54d4662107 feat(tools): idf_monitor: support for loadable hint provider modules
Currently hints are supported based on hints.yml only, which may be
limiting for some use cases. This introduces a generic plugin approach,
which allows to implement hint module that doesn't require entry in hints.yml.
Such module has the full command output available and it is not limited to
a single regex in hints.yml.

Note that regex in hint.yml expects the output concatenated into a single line,
but hint modules are getting the output unchanged.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-05 20:13:28 +02:00
Frantisek Hrbata
ed35c3a94a feat(tools): add global build context
Introduces get_build_context() helper, which allows to get build context, e.g.
project description, at places where this info is not available. The
build context is set within ensure_build_directory.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-05 20:13:28 +02:00
Ivan Grokhotkov
cfa1896780 Merge branch 'contrib/github_pr_11535' into 'master'
Replace deprecated flushregs alias with full gdb command (GitHub PR)

Closes IDFGH-10272

See merge request espressif/esp-idf!24752
2023-07-28 22:40:22 +08:00
Aleksei Apaseev
6532076ad6 coredump: added the chip_rev field into the coredump header 2023-07-26 10:53:28 +08:00
Aleksei Apaseev
ba51b09cb2 coredump: added the chip_rev field into the coredump header 2023-07-26 10:53:28 +08:00
Roland Dobai
f4a1567474 Merge branch 'bugfix/debug_ext_ctrl_c' into 'master'
tools: fix waiting on gdb process when interrupted with CTRL+C

Closes IDFGH-10638

See merge request espressif/esp-idf!24836
2023-07-20 23:05:53 +08:00
Ivan Grokhotkov
0ebe2cecfa
feat(system): add an error log and a hint on failed interrupt alloc
When interrupt allocation fails, esp_intr_alloc will now print a
message telling that no free interrupt was found. This message is
then checked in hints.yml, to give a link to the troubleshooting
guide.
2023-07-19 16:47:41 +02:00
Ryan Yin
354e2c4673 feat: fix: create-project & create_component with proper file permission 2023-07-17 19:32:30 +08:00
Frantisek Hrbata
ff1ce54869 fix(debug_ext): CTRL+C handling while waiting on gdb process
idf.py spawns gdb process within a thread and uses Thread.join() to wait
for the gdb process to finish. As CTRL+C(SIGINT) is used by gdb to interrupt the
running program, we catch the SIGINT while waiting on the gdb to finish,
and try Thread.join() again.

With cpython's commit

	commit a22be4943c119fecf5433d999227ff78fc2e5741
	Author: Victor Stinner <vstinner@python.org>
	Date:   Mon Sep 27 14:20:31 2021 +0200

	    bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)

this logic doesn't work anymore, because cpython internally marks the
thread as stopped when join() is interrupted with an exception. IMHO
this is broken in cpython and there is a bug report about this
https://github.com/python/cpython/issues/90882. Problem is that
waiting on a thread to finish is based on acquiring a lock. Meaning
join() is waiting on _tstate_lock. If this wait is interrupted, the
above referenced commit adds a logic that checks if the lock is help,
meaning the thread is done and marks the thread as stopped. But there is
no way to tell if the lock was acquired by us running join() or if it's
held by someone else e.g. still by the thread bootstrap code. Meaning
the thread is still running.

I may be missing something, but I don't see any reason why to spawn gdb
process within a thread. This change removes the thread and spawns gdb
directly. Instead waiting on a thread, we wait on the process to finish,
replacing join() with wait() and avoiding this problem.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-07-17 08:00:23 +02:00
Daniel Mangum
647e7a2a71
fix: Replace deprecated flushregs alias with full gdb command
Usage of `flushregs` in gdb will result in the following warning:

```
Warning: 'flushregs', an alias for the command 'maintenance flush register-cache', is deprecated.
Use 'maintenance flush register-cache'.
```

This patch updates to use the recommend command.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
Merges https://github.com/espressif/esp-idf/pull/11535
2023-07-13 09:26:47 +02:00
Marek Fiala
206c46325a fix(tools): Tool curses import check
Verify that curses tool can be successfully imported on unix systems

When detected:
- installing esp-idf -> reinstall python environment
- using idf.py menuconfig -> raise error with hint message

Closes https://github.com/espressif/esp-idf/issues/11643
2023-07-12 13:23:06 +00:00
Wu Zheng Hui
4c713227ae Merge branch 'bugfix/fix_idf_monitor_parsing_pc_with_wrong_rom_elf' into 'master'
bugfix: fix idf passing wrong chip revision to idf_monitor

See merge request espressif/esp-idf!24609
2023-07-11 17:14:10 +08:00
Roland Dobai
15c4b93893 Merge branch 'asyncio_error' into 'master'
[Tools] hints: add guide to fix error with unsupported asyncio

Closes IDFGH-10485

See merge request espressif/esp-idf!24528
2023-07-11 17:05:11 +08:00
Peter Dragun
58c467f3aa fix(tools/coredump-info): pass non-default partition table offset to esp-coredump
Closes https://github.com/espressif/esp-idf/issues/11564
2023-07-10 10:42:06 +02:00
wuzhenghui
78c959b13e fix: fix idf passing wrong chip revision to idf_monitor 2023-07-05 17:30:12 +08:00
Peter Dragun
341390f928 fix(tools/hints): add guide to fix error with unsupported asyncio
Closes https://github.com/espressif/esp-idf/issues/11732
2023-07-03 10:26:26 +02:00
Armando (Dou Yiwen)
17d6768e65 Merge branch 'feature/add_target_esp32p4' into 'master'
esp32p4: introduce the target

See merge request espressif/esp-idf!24155
2023-06-14 10:16:44 +08:00
Armando
101e6a18eb esp32p4: introduce the target
Add esp32p4 target to tools and Kconfig
Create directories and files that are essential for `idf.py --preview set-target esp32p4`
2023-06-13 15:16:11 +08:00
Alexey Lapshin
07c7fe929b tools: process progression for flash action output 2023-06-12 13:56:59 +04:00
Alexey Lapshin
59206e39a0 tools: fix control characters print if hints enabled
Closes https://github.com/espressif/esp-idf/issues/11351
2023-05-22 20:18:02 +08:00
Frantisek Hrbata
a5d3c2d443 tools: fix hints processing in interactive mode
Currently hints are processed only once the process is finished and
exits with non-error exit code. In interactive mode, e.g. for monitor,
we want to process ouput lines for hints right away.

This adds a simple buffer, which keeps the last line and once EOL is
reached, it is processed for hints.

Since the original hints processing was file based, a new helper
function was added to allow processing hints in string.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-05-09 14:35:04 +02:00
laokaiyao
bf2a7b2df6 esp32h4: removed esp32h4 related codes 2023-04-23 12:03:07 +00:00
Roland Dobai
1bf382a3e1 Merge branch 'monitor_win_color' into 'master'
bug(idf_monitor, hints): fix monitor colors on windows with hints

Closes IDF-5863

See merge request espressif/esp-idf!22070
2023-04-21 20:15:38 +08:00
Peter Dragun
faa82b060c feat(esptool): allow to set force for write_flash 2023-04-17 12:53:01 +02:00