Commit Graph

5480 Commits

Author SHA1 Message Date
harshal.patil
2acb037138 fix(examples): Example CA certs must contain the Key Usage parameter
- Example CA certificates that are used for self-signed client certificates
need to include the Key Usage parameter.
- Python3.13 changed the default context of the SSL context that is
generated using ssl.create_default_context() by enabling the VERIFY_X509_STRICT
flag by default
2025-04-03 10:53:26 +05:30
Roland Dobai
c7b6135800 Merge branch 'fix/remove-unused-from-gdbinit_cmake_v5.2' into 'release/v5.2'
fix(tools): remove unused variables in gdbinit.cmake (v5.2)

See merge request espressif/esp-idf!38047
2025-04-02 15:15:05 +08:00
Frantisek Hrbata
8e40868d84 fix(tools): handle packages with dots in their names during dependency checks
The `setuptools` package starting with `v70.1.0`[1] contains built-in
`bdist_wheel` command. Before this version `setuptools` relied on the
`bdist_wheel` command implementation from the `wheel` package. Starting with
`setuptools` `v75.8.1` the `PEP 491`[3] restrictions on the distribution name
of a wheel package are enforced[4], replacting also `.` with `_`.  Note that
`PEP 491` actually allows `.` in the distribution name, but for some reason the
latest packaging docs[10][11] does not, stating that `.` should be replaced
with `_`. This was discussion here[12].

Also the `wheel` package starting with `v0.45.0`[5] is using the `bdist_wheel`
command from `setuptools`.  This means that any package which has `.` in its
distribution name, like `ruamel.yaml.clib`, can have different wheel name,
depending on which version of the `bdist_wheel` command was used.

The `bdist_wheel` command from setuptools prior `v75.8.1` or `wheel` prior
`v0.45.0` will keep the dots in distribution name preserved.  For exaple the
`ruamel.yaml.clib` package will have distribution name
`ruamel.yaml.clib-0.2.12.dist-info. Newer versions will replace the dots with
`_` according to [10][11], creating distribution like
`ruamel_yaml_clib-0.2.12.dist-info`.

From packaging point of view `ruamel.yaml.clib-0.2.12.dist-info` and
`ruamel_yaml_clib-0.2.12.dist-info` are the same packages, but this is not
reflected in `importlib.metadata` prior python 3.10[9], which does not perform
name normalization prior the distribution search. This causes the `version`
from `importlib.metadata` to fail on python prior the 3.10 version if the
package with dots in distribution name was generated with normalized paths with
newer `setuptools`. Note that the distribution name normalization was
backported to some later 3.9 python version.

Let's demonstrate this behavior on a simple package with the
`my.minimal.package` name.

```
my_minimal_package/
├── pkg
│   └── __init__.py
└── setup.py

from setuptools import setup, find_packages

setup(
    name='my.minimal.package',
    version='0.1.0',
    packages=find_packages(),
    install_requires=[],
    entry_points={},
)
```

With python 3.9.0 search for `my.minimal.package` fails because
of the missing name normalization.
```
docker run --rm -it --platform linux/x86_64 python:3.9.0 bash
python -m venv venv
. venv/bin/activate
pip install setuptools==v75.8.1
python setup.py bdist_wheel
pip install dist/my_minimal_package-0.1.0-py3-none-any.whl
python
Python 3.9.0 (default, Nov 18 2020, 13:28:38)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib.metadata import version as get_version
>>> get_version('my.minimal.package')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 551, in version
    return distribution(distribution_name).version
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: my.minimal.package
>>> get_version('my_minimal_package')
'0.1.0'
```

With python 3.10.0 search for both `my.minimal.package` and
`my_minimal_package` succeeds.
```
docker run --rm -it --platform linux/x86_64 python:3.10.0 bash
python
Python 3.10.0 (default, Dec  3 2021, 00:21:30) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib.metadata import version as get_version
>>> get_version('my.minimal.package')
'0.1.0'
>>> get_version('my_minimal_package')
'0.1.0'
```

In our `tools/check_python_dependencies.py` we cannot relay on the default
distribution finder, used in the `version` function from `importlib.metadata`,
to do name normalization on older python versions.  To cope with this,
implement a fallback version search. If `version` fails with
`PackageNotFoundError`, do the name normalization according to [10][11] and try
again.

Note: There is also a `wheel`[6][7] `v0.43.0` package embeded in `setuptools`
along with the new implementation[8].  This one seems to be used if the
external `wheel` package is not available but imported. TBH this is all kinda
messy and I may have overlooked something.

* [1] https://setuptools.pypa.io/en/stable/history.html#v70-1-0
* [2] https://setuptools.pypa.io/en/stable/history.html#v75-8-1
* [3] https://peps.python.org/pep-0491/#escaping-and-unicode
* [4] https://github.com/pypa/setuptools/pull/4766/files
* [5] https://wheel.readthedocs.io/en/stable/news.html
* [6] https://github.com/pypa/setuptools/blob/main/setuptools/_vendor/wheel/__init__.py
* [7] https://github.com/pypa/setuptools/issues/1386
* [8] https://github.com/pypa/setuptools/blob/main/setuptools/command/bdist_wheel.py
* [9] c6ca368867
* [10] https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization
* [11] https://packaging.python.org/en/latest/specifications/binary-distribution-format/
       #escaping-and-unicode
* [12] https://github.com/pypa/setuptools/issues/3777

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-03-27 08:05:20 +01:00
Alexey Lapshin
23a6786a5f fix(tools): remove unused variables in gdbinit.cmake
Closes https://github.com/espressif/esp-idf/issues/15035
2025-03-26 19:58:36 +07:00
Aditya Patwardhan
04438b1148 Merge branch 'bugfix/provisioning_sec2_aes_iv_usage_v5.2' into 'release/v5.2'
fix(provisioning): fix incorrect AES-GCM IV usage in security2 scheme (v5.2)

See merge request espressif/esp-idf!37616
2025-03-26 12:09:51 +08:00
morris
f25eec679f Merge branch 'bugfix/gpio_dump_io_config_v5.2' into 'release/v5.2'
fix(gpio): fix pu, pd, drv value incorrect from gpio_dump_io_configuration on esp32 (v5.2)

See merge request espressif/esp-idf!37910
2025-03-24 10:22:12 +08:00
Roland Dobai
92a165ddc1 Merge branch 'fix/extractall_deprecation_v5.2' into 'release/v5.2'
fix(idf_tools): Patch extractall() deprecation warning (v5.2)

See merge request espressif/esp-idf!37885
2025-03-21 02:02:02 +08:00
Song Ruo Jing
a21e88c561 fix(gpio): fix 8/16-bit gpio, rtc/lp_io register access 2025-03-20 16:04:36 +08:00
Radim Karniš
636f51b68d fix(idf_tools): Validate input features 2025-03-19 21:45:08 +01:00
Radim Karniš
0c3e15351b fix(idf_tools): Patch extractall() deprecation warning 2025-03-19 13:53:07 +01:00
Marius Vikhammer
a0ba8c9e1d Merge branch 'bug/xtensa_cpu1_sys_lockup_v5.2' into 'release/v5.2'
fix(panic_handler): Updated panic handler to use RTC WDT (v5.2)

See merge request espressif/esp-idf!37121
2025-03-12 09:58:59 +08:00
Mahavir Jain
17c8e14e28 fix(esp_local_ctrl): update for changes in protocomm security2 scheme 2025-03-10 10:01:52 +05:30
Mahavir Jain
c18de74f77 fix(provisioning): fix incorrect AES-GCM IV usage in security2 scheme
Using same IV in AES-GCM across multiple invocation of
encryption/decryption operations can pose a security risk. It can help
to reveal co-relation between different plaintexts.

This commit introduces a change to use part of IV as a monotonic
counter, which must be incremented after every AES-GCM invocation
on both the client and the device side.

Concept of patch version for a security scheme has been introduced here
which can help to differentiate a protocol behavior for the provisioning
entity. The security patch version will be available in the JSON
response for `proto-ver` endpoint request with the field
`sec_patch_ver`.

Please refer to documentation for more details on the changes required
on the provisioning entity side (e.g., PhoneApps).
2025-03-10 10:01:44 +05:30
Sudeep Mohanty
ed720503fb fix(panic_handler): Updated panic handler to use RTC WDT
This commit updates the following:
- Updates the panic handler to use only the RTC WDT to reset the system.
- Refactors some of the panic handler code.
- Updates Bluetooth files where in they now feed the WDTs instead of
  reconfiguring them.
- Removes some unnecessary configuration of WDTs from various files.
- Added a unit test to verify that the system does not lock up when the
  panic handler is stuck.
- Updates the memprot unit tests to work with the refactored panic
  handler.

Closes https://github.com/espressif/esp-idf/issues/15166
Closes https://github.com/espressif/esp-idf/issues/15018
Closes https://github.com/espressif/esp-idf/issues/10110
2025-03-06 09:06:53 +01:00
Erhan Kurubas
4109316502 feat(tools): update openocd version to v0.12.0-esp32-20250226 2025-03-05 15:46:10 +01:00
Jiang Jiang Jian
33a97b8ea1 Merge branch 'fix/esp-event-profiling_v5.2' into 'release/v5.2'
fix(esp_event): Fix event loop profiling in handler_execute function (backport v5.2)

See merge request espressif/esp-idf!36691
2025-03-04 11:01:02 +08:00
Jiang Jiang Jian
511423cd2e Merge branch 'bugfix/storage_generic_pytests_v5.2' into 'release/v5.2'
fix(ci): Removed storage related entries in known generate test child pipeline warnings (v5.2)

See merge request espressif/esp-idf!36686
2025-03-04 11:00:24 +08:00
Alexey Gerenkov
12901ff20b Merge branch 'fix/coredump_test_uart_data_missing_v5.2' into 'release/v5.2'
Fix missing coredump uart data in tests (v5.2)

See merge request espressif/esp-idf!36713
2025-03-04 00:12:14 +08:00
akshat
6312c5eebe bugfix(wifi): Fix header file errors and remove esp_supplicant from check_public_headers_exceptions.txt 2025-03-02 17:07:46 +08:00
Euripedes Rocha
6e1423736e fix(mqtt): Regenerate certificates for testing
- Previous fix ommited one of the client certificates by mistaque.
- This regenerates all certificates to clean that up.
2025-03-02 16:51:21 +08:00
morris
e6f49c0480 Merge branch 'feat/spi_std_timing_and_bit_trans_v5.2' into 'release/v5.2'
feat(driver_spi): support adjust master rx to standard timing (v5.2)

See merge request espressif/esp-idf!36401
2025-02-28 18:40:13 +08:00
Roland Dobai
75a735fdc7 Merge branch 'fix/ci_upload_gdbinit_files_v5.2' into 'release/v5.2'
fix(ci): upload generated gdbinit files

See merge request espressif/esp-idf!37374
2025-02-28 17:36:52 +08:00
Marius Vikhammer
b8e6e5389d Merge branch 'bugfix/remove_wdt_both_cpus_test_v5.2' into 'release/v5.2'
test(panic): remove WDT both CPU test (v5.2)

See merge request espressif/esp-idf!36622
2025-02-28 17:30:53 +08:00
Roland Dobai
5e577dcd5a Merge branch 'fix/ldgen_interm_no_secs_v5.2' into 'release/v5.2'
fix(ldgen): don't emit intermediate placements without sections (v5.2)

See merge request espressif/esp-idf!36969
2025-02-28 16:08:50 +08:00
Mahavir Jain
e2dd6f8a6f Merge branch 'bugfix/memprot_s2_intr_peri1_v5.2' into 'release/v5.2'
fix(security): ESP32S2 memory protection check for Peri1 RTCSLOW interrupt (v5.2)

See merge request espressif/esp-idf!37119
2025-02-28 15:52:29 +08:00
Alexey Lapshin
90120f30e1 fix(ci): upload generated gdbinit files 2025-02-28 10:27:31 +07:00
Xiao Xufeng
9b74d1aca5 change(version): Update version to 5.2.5 2025-02-26 18:01:09 +08:00
Martin Vychodil
671dc31a32 fix(security): Fixed ESP32S2 memory protection check for Peri1 RTCSLOW interrupt
- fixes the issue found in https://github.com/espressif/esp-idf/issues/15359
- extends debug printouts in the related tests
2025-02-19 19:26:21 +01:00
Xiao Xufeng
af4a98ba99 change(version): Update version to 5.2.4 2025-02-19 23:17:56 +08:00
Frantisek Hrbata
9a1eef2ccc fix(ldgen): don't emit intermediate placements without sections
When a symbol needs to be placed to a different target than the one
designated for the object file, the object file is expanded, which
includes the following steps:

1. Creating a new placement for the symbol's input section with the
   specified target.
2. Excluding the object placement from the orignal target.
3. Creating a new intermediate placement for the object for the original
   target, where its input sections are expanded, excluding the input
   section for the symbol.

Let's illustrate the object expansion process with the following example:

[sections:rodata]
entries:
    .rodata+
    .sdata2+
    .srodata+

[scheme:default]
entries:
    text -> flash_text
    rodata -> flash_rodata

[scheme:noflash]
entries:
    text -> iram0_text
    rodata -> dram0_data

[mapping:soc_pm]
archive: libsoc.a
entries:
    gpio_periph: GPIO_HOLD_MASK (noflash)

gpio_periph section headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000034 000000 00  AX  0   0  2
  [ 2] .data             PROGBITS        00000000 000034 000000 00  WA  0   0  1
  [ 3] .bss              NOBITS          00000000 000034 000000 00  WA  0   0  1
  [ 4] .rodata.GPIO_HOLD_MASK PROGBITS        00000000 000034 000058 00   A  0   0  4
  [ 5] .rodata.GPIO_PIN_MUX_REG PROGBITS        00000000 00008c 000058 00   A  0   0  4
  [ 6] .debug_info       PROGBITS        00000000 0000e4 0000d8 00      0   0  1
  [ 7] .rela.debug_info  RELA            00000000 0009d4 000108 0c   I 16   6  4
  [ 8] .debug_abbrev     PROGBITS        00000000 0001bc 000070 00      0   0  1
  [ 9] .debug_aranges    PROGBITS        00000000 00022c 000018 00      0   0  1
  [10] .rela.debug_aranges RELA            00000000 000adc 00000c 0c   I 16   9  4
  [11] .debug_line       PROGBITS        00000000 000244 0001ab 00      0   0  1
  [12] .debug_str        PROGBITS        00000000 0003ef 00022d 01  MS  0   0  1
  [13] .comment          PROGBITS        00000000 00061c 000030 01  MS  0   0  1
  [14] .note.GNU-stack   PROGBITS        00000000 00064c 000000 00      0   0  1
  [15] .riscv.attributes RISCV_ATTRIBUTES 00000000 00064c 000044 00      0   0  1
  [16] .symtab           SYMTAB          00000000 000690 000260 10     17  36  4
  [17] .strtab           STRTAB          00000000 0008f0 0000e1 00      0   0  1
  [18] .shstrtab         STRTAB          00000000 000ae8 0000d1 00      0   0  1

1. Creating a new placement
.dram0.data :
{
    *libsoc.a:gpio_periph.*(.rodata.GPIO_HOLD_MASK .sdata2.GPIO_HOLD_MASK .srodata.GPIO_HOLD_MASK)
}

2. Excluding the object placement
.flash.rodata :
{
    *(EXCLUDE_FILE(*libsoc.a:gpio_periph.*) .rodata.* ...)
}

3. Creating a new intermediate placement
.flash.rodata :
{
    *libsoc.a:gpio_periph.*(.rodata.GPIO_PIN_MUX_REG)
}

Now, let's do the same, but also move GPIO_PIN_MUX_REG to noflash with an updated mapping.

[mapping:soc_pm]
archive: libsoc.a
entries:
    gpio_periph: GPIO_HOLD_MASK (noflash)
    gpio_periph: GPIO_PIN_MUX_REG (noflash)

1. Creating a new placement
.dram0.data :
{
    *libsoc.a:gpio_periph.*(.rodata.GPIO_HOLD_MASK .sdata2.GPIO_HOLD_MASK .srodata.GPIO_HOLD_MASK)
    *libsoc.a:gpio_periph.*(.rodata.GPIO_PIN_MUX_REG .sdata2.GPIO_PIN_MUX_REG
                            .srodata.GPIO_PIN_MUX_REG)
}

2. Excluding the object placement
.flash.rodata :
{
    *(EXCLUDE_FILE(*libsoc.a:gpio_periph.*) .rodata.* ...)
}

3. Creating a new intermediate placement
.flash.rodata :
{
    *libsoc.a:gpio_periph.*
}

The *libsoc.a:gpio_periph.* entity in step 3 no longer has input
sections, as there are no remaining .rodata input sections in the object
file. The linker behavior for this mapping is to include all object
input sections that have not yet been placed as described in
https://sourceware.org/binutils/docs/ld.html#Input-Section-Basics
"If you use a file name without a list of sections, then all sections in
the input file will be included in the output section. This is not
commonly done, but it may by useful on occasion."

The map file for such mapping now contains following input sections

 .flash.rodata   0x3c0a0120    0x19b34
     *libsoc.a:gpio_periph.*()
     .debug_info    0x3c0b95bf       0xd8 esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .debug_abbrev  0x3c0b9697       0x70 esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .debug_aranges
                    0x3c0b9707       0x18 esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .debug_line    0x3c0b971f      0x1ab esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .debug_str     0x3c0b98ca      0x21a esp-idf/soc/libsoc.a(gpio_periph.c.obj)
                                    0x22d (size before relaxing)
     .comment       0x3c0b9ae4       0x30 esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .note.GNU-stack
                    0x3c0b9ae4        0x0 esp-idf/soc/libsoc.a(gpio_periph.c.obj)
     .riscv.attributes
                    0x3c0b9ae4       0x44 esp-idf/soc/libsoc.a(gpio_periph.c.obj)

This is incorrect, and such intermediate placement should not be
generated. This type of placement can be recognized because it is not
explicitly defined in the mapping and lacks input sections. We can
identify this in the significant function and prevent issuing commands
for such placement.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-02-14 12:18:23 +01:00
Erhan Kurubas
6465aef894 ci(coredump): collect all expected uart data first, then process lazily 2025-02-03 15:18:19 +01:00
Guillaume Souchere
d1a02e1854 fix(esp_event): Fix event loop profiling in handler_execute function
handler_execute function is looking to match the handler only in the
list of loop events but does not look in the base event handler list
nor the id event handler list. So unless the event handler is
registered to be triggered for all event bases and all event ids of
an event loop, its profiling fields (invoked and time) are not updated
when it is called.

This commit updates the search for the matching handler to also look
in base event list and ID event list.

Closes https://github.com/espressif/esp-idf/issues/15041
2025-01-30 10:51:38 +01:00
radek.tandler
0c69545f30 fix(ci): Removed storage related ignore warnings 2025-01-30 09:42:26 +01:00
Marius Vikhammer
d9c471d054 test(panic): remove WDT both CPU test
Test never worked on S3/P4 and was flakey on ESP32. Hard to design a reliable test
case that triggers both WDT at the exact same time.
2025-01-24 13:29:45 +01:00
wanckl
65a616197f feat(driver_spi): support using SPI_DEVICE_STD_TIMING to adjust master rx in standard timing 2025-01-22 11:11:47 +08:00
Roland Dobai
2f62363cc6 Merge branch 'feature/add_utf_8_decoding_v5.2' into 'release/v5.2'
feat(tools): Enforced utf-8 encoding with Python open() functions (v5.2)

See merge request espressif/esp-idf!36127
2025-01-05 21:26:37 +08:00
Marek Fiala
3cca3da1d5 feat(tools): Enforce utf-8 encoding with open() function 2025-01-02 16:12:47 +01:00
Marius Vikhammer
94d9ab88bb fix(interrupt): fixed wrongly reserved interrupt for wifi on H2 2025-01-02 16:49:11 +08:00
Jiang Jiang Jian
dbe1e41c6f Merge branch 'ci/add_build_test_eco_versions_v5.2' into 'release/v5.2'
ci: add build test for eco versions (v5.2)

See merge request espressif/esp-idf!35820
2025-01-02 15:24:47 +08:00
Frantisek Hrbata
a4de7c8ac4 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-29 18:56:58 +01:00
Chen Yudong
1a95f45d3b ci: add build test for eco versions 2024-12-19 21:02:57 +08:00
Roland Dobai
d7fe977e0f fix(idf_tools.py): Upgrade pip and setuptools separately
This way the setuptools version dependency resolution will be done by
the upgraded pip.
2024-12-18 12:57:32 +01:00
Roland Dobai
af6aa414b2 Merge branch 'change/bump_up_kconfcheck_version' into 'release/v5.2'
ci(pre-commit): bump kconfig checker pre-commit version to 1.5.0

See merge request espressif/esp-idf!35402
2024-12-18 01:31:27 +08:00
Alexey Gerenkov
e82f6d2ce6 Merge branch 'fix/test_idf_gdb_v5.2' into 'release/v5.2'
test(system): mark gdb test runners properly (v5.2)

See merge request espressif/esp-idf!35588
2024-12-17 21:44:44 +08:00
Jan Beran
cc902394ef ci(pre-commit): bump kconfig checker pre-commit version to 1.5.0 2024-12-17 14:33:28 +01:00
Island
aabe255f89 Merge branch 'bugfix/fix_hid_crash_v5.2' into 'release/v5.2'
fix(ble): Fix crash issue during logging (v5.2)

See merge request espressif/esp-idf!35509
2024-12-12 09:06:11 +08:00
Erhan Kurubas
f4e6591a89 change(cmake): use board configuration file for ftdi interface 2024-12-11 18:47:43 +01:00
Erhan Kurubas
d1d42a9b48 test(system): mark gdb test runners properly 2024-12-11 18:47:43 +01:00
Sarvesh Bodakhe
c3d4270d79 fix(esp_wifi): Add some bugfixes and cleanup in softAP
1. Fix wrong reason code in 'WIFI_EVENT_AP_STADISCONNECTED' event
2. cleanup in softAP for disconnecting connected station
3. Update examples to display reason while processing WIFI_EVENT_AP_STADISCONNECTED event
2024-12-10 20:22:51 +08:00
zhanghaipeng
88ae97e8be feat(bt): Add support for converting BT HCI logs to btsnoop format 2024-12-09 17:54:20 +08:00