Commit Graph

20290 Commits

Author SHA1 Message Date
Darian Leung
0a948594cb usb: Fix USBH handling of disconnections
This commit fixes how the USBH handling of a sudden device disconnection,
more specifically handling of device gone.
- Previously the USBH would only halt, flush, and dequeue the device's
default EP, then send a device gone event to the Host Library layer.
- Now the USBH will also halt and flush all non-default EPs, allowing
all of the URBs to be dequeud.
- Some internal object members are now protected by a mutex instead of
a spinlock.

Closes https://github.com/espressif/esp-idf/issues/7505
2021-11-11 16:26:09 +08:00
Darian Leung
de6bf09f40 usb: Fix how the HCD handles sudden disconnection
This commit fixes how the USB Host HCD handles sudden disconnections.

Bugs:
- HW channels remain active when the port suddenly disconnects, and
previously the channel would be disabled by setting the disabled bit,
then waiting for a disabled interrupt. However, ISOC channels do not
generate the disabled interrupt when the port is invalid, thus leading
to tasks getting indefinitely blocked in hcd_pipe_command().

Fix:
On a sudden disconnection, forcibly treat all channels as halted even
if their HCCHAR.ChEna bit is still set. We do a soft reset after a port
error anyways, so the channels will eventually be reset.

Closes https://github.com/espressif/esp-idf/issues/7505
2021-11-11 16:25:01 +08:00
Darian Leung
a1082dfa59 usb: Fix LL 8/16 bit register field access
This commit addes the 8/16 bit register field access workarounds to
the DWC_OTG peripheral. This workaround was applied to all other
peripherals in commit 874a720286.
2021-11-11 16:24:08 +08:00
Darian Leung
466c42c3c1 freertos: Fix SMP round robin scheduling
The previous SMP freertos round robin would skip over tasks when
time slicing. This commit implements a Best Effort Round Robin
where selected tasks are put to the back of the list, thus
makes the time slicing more fair.

- Documentation has been updated accordingly.
- Tidy up vTaskSwitchContext() to match v10.4.3 more
- Increased esp_ipc task stack size to avoid overflow

Closes https://github.com/espressif/esp-idf/issues/7256
2021-11-11 16:16:11 +08:00
songruojing
762ca128b4 gpio: Fix the bug that esp32 gpio interrupt cannot be triggered on core 1
Introduced in 874a720286

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

(cherry picked from commit 7ec38fcc42)
2021-11-11 12:43:09 +08:00
Jiang Jiang Jian
f6db71539e Merge branch 'bugfix/esp32_light_sleep_crash_4.4' into 'release/v4.4'
Fix crash caused by bluetooth high level interrupt (v4.4)

See merge request espressif/esp-idf!15872
2021-11-11 03:38:49 +00:00
baohongde
0c0d0f9b35 components/bt: Fix the issue caused by the power off the bt power domain 2021-11-11 11:33:15 +08:00
Li Shuai
a2790756b0 fix the wifi scan fail issue caused by the power off the wifi power domain 2021-11-11 11:33:04 +08:00
Armando (Dou Yiwen)
bd9d8c314e Merge branch 'bugfix/fix_120m_sdr_flash_config_on_non_s3_bug_v4.4' into 'release/v4.4'
spi_flash: make 120m config only visible on s3 sdr mode (v4.4)

See merge request espressif/esp-idf!15868
2021-11-11 02:47:47 +00:00
Ondrej Kosta
018bc054a5 Merge branch 'bugfix/LAN8720_reset_assertion_v4.4' into 'release/v4.4'
Increased LAN8720 ETH-PHY reset assertion time (v4.4)

See merge request espressif/esp-idf!15825
2021-11-10 20:39:58 +00:00
Darian
d722a37aa6 Merge branch 'refactor/freertos_deprecate_critical_nested_macros_v4.4' into 'release/v4.4'
freertos: Deprecate critical nested macros (v4.4)

See merge request espressif/esp-idf!15613
2021-11-10 16:16:53 +00:00
Anton Maklakov
c62f7fd6ee Merge branch 'bugfix/tools_fix_win_gdb_dlls_v4.4' into 'release/v4.4'
tools: Fix missed DLLs in GDB for Windows (v4.4)

See merge request espressif/esp-idf!15894
2021-11-10 13:55:34 +00:00
Xie Wen Xiang
10afcc9f63 Merge branch 'bugfix/fix_ble_prefered_ext_conn_parameter_detection_v4.4' into 'release/v4.4'
component/bt: check the ble ext conn parameter(backport v4.4)

See merge request espressif/esp-idf!15768
2021-11-10 13:01:22 +00:00
Darian Leung
7e725751e4 freertos: Remove critical nested macros
This commit removes the following critical nested macros as follows:

- portENTER_CRITICAL_NESTED()
- portEXIT_CRITICAL_NESTED()

They are replaced with portSET_INTERRUPT_MASK_FROM_ISR() and
portCLEAR_INTERRUPT_MASK_FROM_ISR() which are the proper FreeRTOS interfaces.

Created a portmacro_deprecated.h for each port to contain deprecated API
that were originally from portmacro.h
2021-11-10 18:34:32 +08:00
Zim Kalinowski
6438af2ef9 Merge branch 'bugfix/simplify_codeowners_v4.4' into 'release/v4.4'
gitlab: simplify approvals for backports (v4.4)

See merge request espressif/esp-idf!15865
2021-11-10 10:24:38 +00:00
Armando
4a8d4b584a docs: add adc calibration docs on c3 and s3 2021-11-10 18:12:54 +08:00
Anton Maklakov
3b0de88cad tools: Fix missed DLLs in GDB for Windows 2021-11-10 17:07:46 +07:00
Sudeep Mohanty
9e46667545 ringbuf: Fix bug where comparision between a signed and unsigned operand resulted in incorrect free size for no-split/allow-split buffers
This commit fixes a bug in no-split and allow-split ring buffers free buffer size calculation.
When the free size available in the buffers less than the size of one item header,
the function prvGetCurMaxSizeNoSplit/AllowSplit() incorrectly returned the maxItemSize instead of 0.
This is due to the comparision between a negative and a positive value
where both operands are treated as unsigned during the comparision operation,
thereby treating the negative operand as a large integer.

Also added new unit tests to test buffer-full and almost-full conditions
where this scenario is likely to be hit.

Closes https://github.com/espressif/esp-idf/issues/7344
Closes https://github.com/espressif/esp-idf/pull/7371
2021-11-10 14:42:40 +05:30
Tian Sen Wen
2c24beca04 esp_eth: optimize dm9051 Tx throughput 2021-11-10 17:08:21 +08:00
Jiang Jiang Jian
44d13c648b Merge branch 'bugfix/fix_ota_crash_backport_v4.4' into 'release/v4.4'
spi_flash: fix app crash when OTA because the OTA task's stack is in rtc fast memory(backport v4.4)

See merge request espressif/esp-idf!15852
2021-11-10 08:35:34 +00:00
xiongweichao
44b9e6e055 Fix crash caused by bluetooth high level interrupt 2021-11-10 16:14:52 +08:00
Mahavir Jain
214d2eeba7 Merge branch 'bugfix/manual_secure_boot_v2_multiple_digest_issue_v4.4' into 'release/v4.4'
secure_boot_v2: fix issue in pre-flashed digest (manual) workflow (v4.4)

See merge request espressif/esp-idf!15780
2021-11-10 04:22:55 +00:00
Armando
d5218e84e2 spi_flash: make 120m config only visible on s3 sdr mode 2021-11-10 12:04:49 +08:00
Martin Vychodil
43471b047b Merge branch 'feature/fatfs_disk_status_implementation_v4.4' into 'release/v4.4'
fatfs: Implementation of disk_status for SD/MMC card (v4.4)

See merge request espressif/esp-idf!15847
2021-11-09 18:45:42 +00:00
Ivan Grokhotkov
1ed627d022 gitlab: simplify approvals for backports (v4.4) 2021-11-09 18:39:26 +01:00
Roland Dobai
8a60e69c24 Merge branch 'bugfix/create_dir_idf_env_v4.4' into 'release/v4.4'
tools: Create the ".espressif" directory on the first run on clean system (v4.4)

See merge request espressif/esp-idf!15855
2021-11-09 13:40:56 +00:00
Jan Procházka
683da6b46d fatfs: Implementation of disk_status nad disk_initialize for SD/MMC card
FATFS provides a disk status and disk initialize callback which were not
implemented. Implementation has very low impact on SD/MMC speed and
fixes issues, when trying to open file when SD card was removed from
slot and not deinited.

If disk_status returns STA_NOINIT, it will always continue with
disk_initialize. If that returns 0, it will continue like everything is
working normally. So there has to be the same check as in disk_status.
Return of disk_initialize is always checked like this for STA_NOINIT or
STA_PROTECT so if command fails, we return the STA_NOINIT.

stat = disk_initialize(pdrv);
if (stat & STA_NOINIT) return FR_NOT_READY;
if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;

Closes IDF-4125
2021-11-09 20:17:03 +08:00
Mahavir Jain
d9429ca7bc Merge branch 'add_agressive_revoke_v4.4' into 'release/v4.4'
secure_boot: Added Kconfig option for aggressive key revoke (v4.4)

See merge request espressif/esp-idf!15850
2021-11-09 11:15:07 +00:00
Roland Dobai
2cdf90f810 tools: Create the ".espressif" directory on the first run on clean system
Closes https://github.com/espressif/esp-idf/issues/7848
2021-11-09 12:02:50 +01:00
Sachin Parekh
2f39639c20 secure_boot: Do not allow key revocation in bootloader 2021-11-09 15:19:47 +05:30
Sachin Parekh
7fe2a4815d secure_boot: Added Kconfig option for aggressive key revoke
Applicable to S2, C3, and S3
2021-11-09 15:19:47 +05:30
jingli
07b1b45ad6 fix: app crash when OTA because the OTA task's stack is in rtc fast memory 2021-11-09 17:10:20 +08:00
Wang Meng Yang
5e4d166323 Merge branch 'bugfix/fix_crash_when_shutdown_bt_v4.4' into 'release/v4.4'
component/bt: fix crash when shutdown bt(backport v4.4)

See merge request espressif/esp-idf!15708
2021-11-09 08:06:24 +00:00
Wang Meng Yang
5c6a8711ad Merge branch 'bugfix/hfp_demo_audio_not_sine_v4.4' into 'release/v4.4'
fix hfp_ag demo audio not sine_v4.4

See merge request espressif/esp-idf!15749
2021-11-09 03:02:15 +00:00
Ivan Grokhotkov
864605785b Merge branch 'feature/rw_lock_cond_var_4.4' into 'release/v4.4'
pthread: reader-writer locks implementation (backport 4.4)

See merge request espressif/esp-idf!15830
2021-11-08 13:31:16 +00:00
morris
832865629c Merge branch 'feature/github-7661_v4.4' into 'release/v4.4'
mck pin not defined in i2s examples (v4.4)

See merge request espressif/esp-idf!15836
2021-11-08 13:23:59 +00:00
Arnaud-Oechslin
7195af2d7d i2s: add mck pin definition in the example
If the mck pin is not set to GPIO 0,1,3 or -1 the whole pin configuration fails. This fix corrects that.

Merges https://github.com/espressif/esp-idf/pull/7661
2021-11-08 17:33:18 +08:00
Kevin (Lao Kaiyao)
1433f5337f Merge branch 'bugfix/i2s_ws_polarity_in_tdm_v4.4' into 'release/v4.4'
i2s: fix ws signal polarity in tdm mode (v4.4)

See merge request espressif/esp-idf!15820
2021-11-08 09:30:14 +00:00
Wei Tian Hua
397e148049 Merge branch 'doc/make_classic_bt_API_ref_only_for_esp32_4.4' into 'release/v4.4'
Doc/make classic bt api ref only for esp32 [backport v4.4]

See merge request espressif/esp-idf!15727
2021-11-08 09:14:24 +00:00
Jakob Hasse
bbe2a1bf34 Merge branch 'feature/add_flash_psram_config_guide_v4.4' into 'release/v4.4'
doc: add flash and psram configuration guide on esp32s3 (4.4)

See merge request espressif/esp-idf!15811
2021-11-08 08:32:36 +00:00
KonstantinKondrashov
4d0e72dc5f efuse example: Fix pre-load SB test for S2, C3 (erase revoke bits) 2021-11-08 12:48:12 +08:00
Mahavir Jain
4ac351247d secure_boot_v2: fix issue in pre-flashed digest (manual) workflow
This commit fixes issue where empty (unprogrammed) digest slot out of
multiple supported (e.g. 3 for ESP32-C3) could cause issue in
workflow enablement process.

Notes:

1. This issue was applicable for chips supporting "secure-boot-v2"
scheme with multiple digests slots
2. This issue was affecting only manual workflow, where digest of
public was pre-flashed in efuse
3. Change in "flash_encrypt.c" is only for additional safety purpose
2021-11-08 12:48:12 +08:00
Armando
cc8214c59d doc: add flash and psram configuration doc in programming guide 2021-11-08 04:32:18 +00:00
morris
56aa8b6cb3 Merge branch 'bugfix/KSZ8851SNL_enable_multicast_v4.4' into 'release/v4.4'
esp_eth: KSZ8851SNL, enable Rx multicast in MAC filter (v4.4)

See merge request espressif/esp-idf!15823
2021-11-08 03:44:15 +00:00
xiewenxiang
7a6a61feef component/bt: fix crash when shutdown bt(backport v4.4) 2021-11-08 10:55:12 +08:00
Jakob Hasse
b117bcd2a0 feat (pthread): reader-writer locks implementation
* Added implementation based on cond. variables
* Added unit tests

Closes https://github.com/espressif/esp-idf/issues/7411
2021-11-08 10:21:37 +08:00
Roland Dobai
cd97e95a12 Merge branch 'bugfix/archive_details_always_run_like_diff_v4.4' into 'release/v4.4'
tools: fix bug with idf_size argument archive_details (v4.4)

See merge request espressif/esp-idf!15774
2021-11-05 15:38:38 +00:00
Ondrej Kosta
43b62a5b62 Copyright message fix for 'Increased LAN8720 ETH-PHY reset assertion time' 2021-11-05 11:39:04 +01:00
Frank Sautter
5f9ae3510a Increased LAN8720 ETH-PHY reset assertion time (IDFGH-6018)
Increase reset assertion time from 100µs (as specified minimum in the datasheet) to 150µs.
Some specimen of the LAN8720 need the reset signal asserted longer than 100µs to initialise properly. Otherwise they are in a zombie state where they are establishing and loosing an Ethernet link once in a seconds interval.
2021-11-05 11:35:35 +01:00
Ondrej Kosta
484d5c8491 esp_eth: KSZ8851SNL, enable Rx multicast in MAC filter
Closes https://github.com/espressif/esp-idf/issues/7750
2021-11-05 11:23:14 +01:00