Commit Graph

4720 Commits

Author SHA1 Message Date
wanlei
66ca403bc6 spi_slave: support spi slave hd append mode on chips other than s2 2023-03-21 11:30:17 +08:00
Roland Dobai
c1ce05e244 Merge branch 'feature/test_check_python_dependencies' into 'master'
ci: add dep check_python_dependencies.pyt test

Closes IDF-4961

See merge request espressif/esp-idf!22790
2023-03-20 16:21:56 +08:00
Jakob Hasse
7dbe9687f9 Merge branch 'bugfix/esp_shared_stack_watchpoint_setting' into 'master'
bugfix(esp_system): made watchpoint setting configuration-dependent

Closes IDFGH-9003

See merge request espressif/esp-idf!21738
2023-03-20 10:19:05 +08:00
Frantisek Hrbata
53a8742680 ci: add dep check_python_dependencies.pyt test
Two new tests are added.

1) test_check_python_dependencies
The test prepares artificial constraints file containing packages from
requirements.core.txt, which are also reported in pip-freeze output
for virtual env. The constraints file requires package versions higher
than currently installed in venv, so check_python_dependencies
should fail for all of them.

2) test_check_required_packages_only
Test for espressif/esp-idf/-/merge_requests/17917. After installing
core requirements, install additional foopackage, which is embedded.
Add version requirement for foopackage, which cannot be satisfied,
to constraints file. Since foopackage is not a direct requirement,
check-python-dependencies should not fail.

This also fixes existing TestCustomPythonPathInstall test, which sets
IDF_PYTHON_ENV_PATH, but does not restore it. Unittest seems to be
running tests in order based on class/test name. Meaning this test runs
before TestPythonInstall and all tests in TestPythonInstall are using
the latest tmpdir from TestCustomPythonPathInstall as IDF_PYTHON_ENV_PATH.
IOW TestPythonInstall is actually testing custom python env path, same as
TestCustomPythonPathInstall. This fixes it by restoring the
IDF_PYTHON_ENV_PATH. Note that since the actual IDF_PYTHON_ENV_PATH
was different(tmpdir) from PYTHON_DIR, the default PYTHON_DIR was never used,
so the tests were running with old python env(no
shutil.rmtree(PYTHON_DIR).

Since TestCustomPythonPathInstall is inheriting from TestPythonInstall
it also runs test_opt_argument and test_no_constraints for the second
time. This seems unnecessary, so this patch also skips these two tests
in TestCustomPythonPathInstall.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-17 15:22:33 +01:00
Jiang Jiang Jian
2658fb7623 Merge branch 'feature/add_memprot_support_for_esp32h2' into 'master'
esp32h2: enable memory protection scheme using PMA and PMP

Closes IDF-6452 and IDF-6332

See merge request espressif/esp-idf!22699
2023-03-17 15:19:52 +08:00
Wan Lei
3b62bf59c4 Merge branch 'bugfix/fix_deep_sleep_crash_when_psram_high_freq' into 'master'
mspi: turn down freq to fix crash when sleep

Closes IDF-6881

See merge request espressif/esp-idf!22491
2023-03-16 14:11:21 +08:00
wanlei
a48d1a85c1 mspi: add test_app measuring time cost of mspi APIs
and merge mspi unit test into this
2023-03-16 11:11:43 +08:00
Roland Dobai
4bf12081e2 Merge branch 'bugfix/non_default_sdkconfig' into 'master'
tools: fix usage of sdkconfig with custom path or name

Closes IDF-1369

See merge request espressif/esp-idf!22520
2023-03-15 20:53:38 +08:00
Mahavir Jain
b29ed0ba0b
test_apps: enable memprot tests for ESP32-H2 target 2023-03-15 13:16:26 +05:30
Armando
929b7717ff system: fixed ram app cannot use mmu correctly issue 2023-03-15 10:59:20 +08:00
Jakob Hasse
0769298b3b Merge branch 'contrib/github_pr_8987' into 'master'
pthread: avoid heap alloc in pthread_cond_timedwait if possible (GitHub PR)

Closes IDFGH-7409

See merge request espressif/esp-idf!22702
2023-03-13 19:34:21 +08:00
Jakob Hasse
03bc6488de bugfix(esp_system): made watchpoint setting configuration-dependent
esp_execute_shared_stack_function always restored the stack watchpoint
regardless of CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK. This would lead
to an abondoned but active watchpoint on a former stack once the task
calling esp_execute_shared_stack_function is deleted, if
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is inactive.
This has been fixed now.

Closes https://github.com/espressif/esp-idf/issues/10414
2023-03-13 14:24:15 +08:00
Jiang Jiang Jian
d5f53fb415 Merge branch 'feature/nan_datapath' into 'master'
NAN Datapath support and console example

Closes WIFI-1223

See merge request espressif/esp-idf!13593
2023-03-11 04:50:10 +08:00
MacDue
75066bde5a ci: remove components/pthread/pthread_cond_var.c from ignore list 2023-03-10 15:52:27 +08:00
Nachiket Kukade
4c76af3f68 esp_wifi: Add support for NAN Discovery and Datapath
Update wifi lib with below -
1. Create NAN Discovery SM for beaconing & cluster formation
2. Create NAN interface for Tx/Rx of beacons & action frames
3. Add commands & events for NAN Services Publish/Subscribe/Followup
4. Add NAN Datapath definitions, Events, Peer structures
5. Support for forming and parsing of Datapath related attributes
6. Modules for NDP Req, Resp, Confirm, Term, Peer management
7. NAN Interface related additions in Datapath, Data Tx Q's

In addition include below changes -
1. Add netif and driver support for NAN Interface
2. Add simple examples for Publisher-Subscriber usecases
3. Add an advanced console example that supports commands
   for NAN Discovery, Services & Datapath
4. Add wifi_apps for providing better NAN API's and Peer management

Co-authored-by: Shyamal Khachane <shyamal.khachane@espressif.com>
2023-03-10 11:18:23 +05:30
Mahavir Jain
00f30bb199 Merge branch 'esp32c6/fix_pmp_config' into 'master'
esp32c6: Fix incorrect PMP configuration

Closes IDF-6927

See merge request espressif/esp-idf!22435
2023-03-10 12:21:30 +08:00
jingli
b6580ea4ac example: refactor deep sleep example to make codes more structured 2023-03-09 15:23:56 +08:00
Sachin Parekh
ed0a1f7b52 esp32c6: Fix incorrect PMP configuration
- Enable pytest memprot tests for C6
2023-03-09 11:37:29 +05:30
Frantisek Hrbata
a558ad506e tools: fix custom sdkconfig renaming in set-target
Currently the set-target has sdkconfig file name hardcoded to the
default one and doesn't honor custom config paths or names.
IMHO the only place where we can really now the config file name
is in cmake. But also the config should be really renamed only if
the set-target action is running.

This moves the config file renaming into cmake and it's performed only
when _IDF_PY_SET_TARGET_ACTION env. var. is set to 'ON'. This should
hopefully guarantee that it's really renamed only while set-target is
running.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:45:55 +01:00
Frantisek Hrbata
1ca9e63e79 tools: add target consistency checks to cmake
Extend target checks in cmake, in case it's run directly and not via
idf.py or if idf.py misses something. This may happen
for example if cmake variables are set in project's CMakeLists.txt.

Some clean-ups are included along with the new checks and tests.

1. __target_check() function is removed. IIUC it should never fail,
   because the selected target is explicitly passed as environmental
   variable to kconfgen. Meaning the IDF_TARGET from environment variable may
   not be actually used in kconfgen if IDF_TARGET is already set it cmake cache.
   Note that the IDF_TARGET environment variable used for kconfgen is not
   based on the actual IDF_TARGET environment variable set for idf.py, but
   rather on the value set in __target_init() with

	set(IDF_TARGET ${env_idf_target} CACHE STRING "IDF Build Target")

   My understanding is that the original check was introduced to handle
   situation, where IDF_TARGET was already set in cmake's cache and
   the IDF_TARGET from environment variable was different. Since
   the kconfgen would use the original environment variable(not
   explicitly passed as it is now) the IDF_TARGET in cmake and in
   sdkconfig could differ. IOW I think the original check was introduced
   to cope with the following cmake behaviour

	set(VARIABLE "value1" CACHE STRING "test variable")
	set(VARIABLE "value2" CACHE STRING "test variable")
	message("Variable value: ${VARIABLE}")
	output: Variable value: value1

2. I scratched by head how it is possible that the following code
   in __target_check()

   	if(NOT ${IDF_TARGET} STREQUAL ${env_idf_target})

   could fail if IDF_TARGET is not set. For example in clean project

	IDF_TARGET=esp32 idf.py reconfigure

   Here env_idf_target==esp32 and IDF_TARGET is not set, so I would
   expect that cmake will fail with error message that the cache
   and env target do not match. The thing is that the variable
   evaluation is done before the if command, so it actually
   sees this

   	if(NOT  STREQUAL esp32)

   which is false and the error is not printed. It can be seen
   with 'cmake --trace-expand' command. I don't know if this
   was used on purpose or it worked just as a coincidence, but
   I find it very confusing, so I added explicit check if the
   IDF_TARGET is defined before the actual check. Same for
   CMAKE_TOOLCHAIN_FILE.

3. Error messages are not formated(line-wrapped) by cmake's markup
   so it's easier to check the output in tests.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:45:47 +01:00
Frantisek Hrbata
8e912faad1 tools: add target consistency checks for target specified with -D option
Extend existing target consistency checks for the two following cases.
1. Target does not match currently used toolchain
   $ IDF_TARGET=esp32s2 idf.py reconfigure
   $ idf.py -DIDF_TARGET=esp32c3 build

2. Target is ambiguous, because it's specified also as env. var.
   IDF_TARGET=esp32s3 idf.py set-target esp32c2

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:43:42 +01:00
Frantisek Hrbata
0d859f2786 tools: move target guessing into cmake
The _guess_or_check_idf_target() function has sdkconfig and sdkconfig.defaults
file names hardcoded. Since config file names may be specified with SDKCONFIG
or SDKCONFIG_DEFAULTS cmake vars, directly in CMakeLists.txt or passed in with
the -D cmake option, they are not respected.

Problem is when SDKCONFIG or SDKCONFIG_DEFAULTS is set in
CMakeLists.txt. While idf can detect cmake vars passed through it
to cmake via the -D option, detecting SDKCONFIG and SDKCONFIG_DEFAULTS
vars settings in CMakeLists.txt would require to parse it. This seems
like error prone approach. Also if the vars defined by the -D option
are passed directly to cmake, not via idf, they will not be visible to idf.

It seems reasonable to move the logic into cmake, where we know the correct
SDKCONFIG and SDKCONFIG_DEFAULTS values. So the IDF_TARGET detection/guessing
is moved into targets.cmake, where the IDF_TARGET is actually set. The target
is guessed based on the following precendence.

1) $ENV{IDF_TARGET}
2) IDF_TARGET
3) SDKCONFIG
4) sdkconfig
5) SDKCONFIG_DEFAULTS if non-empty or
   $ENV{SDKCONFIG_DEFAULTS} if non-empty or
   sdkconfig.defaults
6) esp32

All config files referred in $ENV{SDKCONFIG_DEFAULTS} and SDKCONFIG_DEFAULTS
are searched, compared to the current behaviour. First target found in the
above chain is used.

The original _guess_or_check_idf_target() is renamed to _check_idf_target() and
used for the target consistency checks only.

The get_sdkconfig_filename() helper is now used to get the sdkconfig file
for consistency checks. It looks in SDKCONFIG specified with the -D
option and project_description.json.

With this change config full paths are reported in messages, so it's clear
e.g. from which config the target was guessed from or which config has
consistency problem. test_non_default_target.py was adjusted to this
change and also new test for testing the IDF_TARGET guessing was added.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:37:58 +01:00
Frantisek Hrbata
a8a4d7c66d tools: add get_sdkconfig_filename() helper
Get project's current sdkconfig file name. It looks in SDKCONFIG cmake var
defined by the -D option and project_description.json. If not found return
default sdkconfig.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:37:58 +01:00
Frantisek Hrbata
e89f980193 tools: add _parse_cmdl_cmakecache() helper
This parses cmakes cache vars defined on command line with -D options
into dictionary. It allows to simplify the check for new cache entries
and also can be re-used for other checks.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-08 16:37:58 +01:00
jiangguangming
87f2eb9e2a esp_rom: put rom cache related functions to cache.h 2023-03-07 14:51:24 +08:00
Li Shuai
1a10eabe41 Power Management: refactor the configuration of each module in sleep mode 2023-03-04 00:17:40 +08:00
Roland Dobai
140e6bea72 Merge branch 'contrib/github_pr_10772' into 'master'
tools: Docker: install build-essential apt package (GitHub PR)

Closes IDFGH-9402

See merge request espressif/esp-idf!22463
2023-03-02 22:26:51 +08:00
Marius Vikhammer
7a0b9f65c9 esp-system: migrate test app cases to pytest 2023-03-01 03:21:39 +00:00
Peter Dragun
16d033a919 tools: Docker: add build-essentials needed for linux targets
Closes https://github.com/espressif/esp-idf/pull/10772
2023-02-28 11:27:25 +01:00
Jiang Jiang Jian
146a5c4de4 Merge branch 'feature/sae_softAP' into 'master'
esp_wifi: WPA3-SAE support for softAP

Closes IDFGH-4771

See merge request espressif/esp-idf!15690
2023-02-28 12:25:05 +08:00
Shreyas Sheth
2b8e40e760 esp_wifi: WPA3-SAE support for softAP 2023-02-28 12:25:05 +08:00
Song Ruo Jing
1a66459b44 usb_serial_jtag: Improve the code for the issue of usb cdc device unable to work during sleep
1. Remove RTC_CLOCK_BBPLL_POWER_ON_WITH_USB Kconfig option
   During sleep, BBPLL clock always gets disabled
   esp_restart does not disable BBPLL clock, so that first stage bootloader log can be printed
2. Add a new Kconfig option PM_NO_AUTO_LS_ON_USJ_CONNECTED
   When this option is selected, IDF will constantly monitor USB CDC port connection status.
   As long as it gets connected to a HOST, automatic light-sleep will not happen.

Closes https://github.com/espressif/esp-idf/issues/8507
2023-02-27 12:10:49 +08:00
liuning
7817c23623 esp_coex: correct Kconfig name 2023-02-26 06:58:18 +00:00
liuning
38316b38b5 esp_wifi: move coex part from esp_wifi to esp_coex 2023-02-26 06:58:18 +00:00
Fu Hanxi
481e221e69 Merge branch 'ci/set_manifest_root_path' into 'master'
ci: use IDF_PATH as the manifest root path

Closes RDT-272

See merge request espressif/esp-idf!22426
2023-02-23 14:02:08 +08:00
Armando (Dou Yiwen)
aeaf119338 Merge branch 'refactor/resolve_mmu_soc_dependency_to_sdkconfig_h' into 'master'
g0: resolve MMU_PAGE_SIZE not defined in g0 build issue

Closes IDF-5219

See merge request espressif/esp-idf!22447
2023-02-23 12:05:13 +08:00
Alexey Lapshin
0da15a7a19 build: add option COMPILER_DISABLE_GCC12_WARNINGS 2023-02-22 05:33:03 +00:00
Alexey Lapshin
2ef6215621 tools: change esp32h2 march to rv32imac_zicsr_zifencei 2023-02-22 05:33:03 +00:00
Alexey Lapshin
61a7342acd tools: add riscv zicsr/zifencei because they were separated from i
https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4
2023-02-22 05:33:03 +00:00
Alexey Lapshin
c5ae3c67f1 Revert "tools: bypass atomic instruction variant for esp32c6 temporarily"
This reverts commit 08f05420c0.
2023-02-22 05:33:03 +00:00
Alexey Lapshin
5389ac4e04 tools: cmake: ignore linker RWX segment warnings 2023-02-22 05:33:03 +00:00
Alexey Lapshin
d867b11022 tools: update toolchain version to 'esp-12.2.0_20230208'
Closes https://github.com/espressif/esp-idf/issues/5308
2023-02-22 05:33:03 +00:00
Alexey Lapshin
4e411d9e3b tools: add triplet i686-linux-gnu for distributions 2023-02-22 05:33:03 +00:00
Armando
c56eb8646b g0: resolve MMU_PAGE_SIZE not defined in g0 build issue 2023-02-22 12:37:40 +08:00
Fu Hanxi
38c292c7bf ci: fix: pexpect.buffer can't be kept between processes 2023-02-21 16:09:19 +08:00
Fu Hanxi
b661d64811 Merge branch 'bugfix/fix_case_tester_wait_case_running_too_short' into 'master'
case_tester: use process instead of thread

See merge request espressif/esp-idf!21847
2023-02-20 20:24:01 +08:00
Marius Vikhammer
89190fab02 Merge branch 'bugfix/allow_coredump_gdb_simu' into 'master'
coredump: allow coredump at panic even if gdbstub is used.

Closes IDFGH-8567

See merge request espressif/esp-idf!22103
2023-02-20 16:07:57 +08:00
Marius Vikhammer
eb40fc913a Merge branch 'bugfix/linux_target_driver_mock' into 'master'
linux-target: fixed driver mock being broken due to changes in driver folder structure

Closes IDFGH-9375

See merge request espressif/esp-idf!22375
2023-02-20 15:38:38 +08:00
Fu Hanxi
a0c025cc47 ci: use IDF_PATH as the manifest root path
this would remove the restriction that tools/ci/ci_build_apps.py could
only be run in IDF_PATH.
2023-02-20 14:55:04 +08:00
Fu Hanxi
b04e5d070a case_tester: use multi-processing instead of threads
Pros:
- Using thread would face GIL issue and turns out very slow when running
with poor hardware.

Cons:
- Does not support windows anymore. For testing purpose, it's fine.
2023-02-20 11:18:14 +08:00