Commit Graph

4713 Commits

Author SHA1 Message Date
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
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
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
Omar Chebib
d55060d184 Merge branch 'staging/rename_twdt_config_examples' into 'master'
TWDT: Use the new TWDT Kconfig options in the examples and tests

See merge request espressif/esp-idf!20363
2023-02-20 10:42:23 +08:00
Marius Vikhammer
ec57895db9 coredump: allow coredump at panic even if gdbstub is used.
Closes https://github.com/espressif/esp-idf/issues/10017
2023-02-17 15:15:36 +08:00
Laukik Hase
f0132be83e Merge branch 'feature/memprot_test_app' into 'master'
esp_system: Add test_app for `memprot` peripheral

Closes IDF-6819

See merge request espressif/esp-idf!21829
2023-02-17 13:59:44 +08:00
Omar Chebib
5e5343d429 TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-02-17 11:22:25 +08:00
Martin Vychodil
c58a84f893 Merge branch 'feature/fatfs_format_api' into 'master'
fatfs: added APIs to format a FAT filesystem

Closes IDF-6046

See merge request espressif/esp-idf!21845
2023-02-16 19:59:31 +08:00
Laukik Hase
6e0e7e34ea
test_app: Extend panic app to include memprot-related tests
- Add support for esp32s2, esp32c3 and esp32c2 for the `memprot`-related tests
- Preliminary support for esp32s3 has also been added,
  the test app will be enabled for esp32s3 later when
  the memprot-related issues are fixed.
- Override panic handler to dump the violation intr status
  - Dump the `memprot` violation registers before calling the
    real panic handler
  - Handle `Illegal Instruction` exception in case of memprot permission violation
    * In esp32c3 with `memprot` enabled, if we try to execute arbitrary code
      from RTC_FAST_MEM we get an `Illegal Instruction` exception from the panic
      handler rather than a `Memory Protection Fault`.
    * This is because the Illegal Instruction interrupt occurs earlier than the
      memory protection interrupt due to a higher interrupt latency.
2023-02-16 17:13:56 +05:30
Laukik Hase
fa27795048
test_app: Split panic test app into separate source files
- Added minor improvements to  `panic` test app
  * Replaced existing API to disable flash cache which did not disabled cache always
    (`esp_flash_default_chip->os_func->start(esp_flash_default_chip->os_func_data)`)
    with `spi_flash_enable_interrupts_caches_and_other_cpu`
  * Included some required headers explicitly (`esp_memory_utils.h` and `esp_heap_caps.h`)
2023-02-16 15:26:47 +05:30