Commit Graph

20825 Commits

Author SHA1 Message Date
Darian Leung
ebd058c8c9 usb: Update USB Host Library
This commit updates the USB Host Library as follows:

- usb_helpers.h
    - Removed dependency on USB Host Library API
    - Added function to print string descriptors
- usbh
    - Fixed bug where an interface/endpoint could be claimed/allocated multiple times
    - Removed redundant device ref_count change
- Added unit test for USB Host Library API usage
2022-02-18 15:51:05 +08:00
Darian Leung
50bbdbc1de usb: Hub Driver and USBH recover port automatically after disconnection
This commit updates the Hub Driver and USBH as follows:
- Updated communication mechanism between Hub Driver and USBH
    - USBH notifies the Hub Driver via Hub request callback (usbh_hub_req_cb_t)
    - Hub Driver notifies the USBH via usbh_hub_pass_event()
- Hub Driver now defers all event handling to hub_process.
- Hub Driver and USBH will now automatically recover the port after a disconnected
    device has been closed.
- Fixed incorrect assert in usbh_dev_close()
2022-02-18 15:51:05 +08:00
Darian Leung
ea6de613bf usb: Hub Driver Update and Refactor
Hub Driver is refactored as follows:

This commit update and refactors the Hub Driver as follows:

- Refactored enumeration state machine and stage functions
    - Enumeration stage is now incremented
    - Combined transfer stages of enumeration into common functions
- Comments updated
- Fixed usbh_hal_disable_debounce_lock() that would cause root_port_handle_events()
    to fail the HCD_PORT_CMD_RESET call because the previous port connection interrupt
    was not cleared.

The following features were added to the Hub Driver

- Enumeration config descriptor is now fetched in two separate stages
    - Header is fetched first to determine the wTotalLength of the descriptor
    - Fetching the full descriptor will request exactly wTotalLength bytes
    - This works around some non-compliant devices that will babble/return zero
        when requesting a length > wTotalLength
    - Closes https://github.com/espressif/esp-idf/issues/7799
- Enumeration now stores string descriptors
    - The Manufacturer, Product, and Serial Number string descriptors are
        now read and stored during enumeration
    - String descriptors are now part of usb_device_info_t
- Added unit test to test enumeration
2022-02-18 15:51:05 +08:00
Darian Leung
7f09fe1b23 usb: USB Host stack uses USB PHY driver
This commit updates the USB Host stack to use the USB PHY driver. The
USB PHY and the OTG Controller should now both be setup/deleted using
usb_new_phy() and usb_del_phy() respectively.

- The hcd_install() now expects the USB PHY and OTG Contorller to be
    already setup before it is called
- usb_host_install() now has an option to skip calling usb_del_phy() if
    the user wants to setup their own USB PHY (e.g., in the case of using
    and external PHY).
- CDC-ACM and MSC examples/test updated to use internal PHY

Closes https://github.com/espressif/esp-idf/issues/8061
2022-02-18 15:51:05 +08:00
Darian Leung
b3b8ed79c8 usb: HCD multiple fixes
This commit fixes the following bugs in the HCD

- HCD control pipes fill incorrect transfer size

_buffer_fill_ctrl() would fill the transfer descriptors length with
wLength instead of transfer->num_bytes. Therefore, the remaining length
would be incorrect when a control transfer requests more bytes than are
available.

- Fix USB_TRANSFER_FLAG_ZERO_PACK behavior

The previous behavior of USB_TRANSFER_FLAG_ZERO_PACK was incorrect, and did not
support interrupt pipes. A zero length packet can now be added to Bulk/Interrupt
OUT transfers where the length is a multiple of the endpoint's MPS.

- Fixed HCD port suspend and resume test case

Halting a control pipe mid control transfer can lead some test devices to get stuck
2022-02-18 15:51:05 +08:00
Darian Leung
8888179439 usb: Tidy up usbh
- Remove enum_todo_flags from usbh
- USBH move config_desc to constant fields
2022-02-18 15:51:05 +08:00
Zim Kalinowski
000d3823bb Merge branch 'cumulative_backport_into_v4.4' into 'release/v4.4'
Cumulative backport MR (v4.4)

See merge request espressif/esp-idf!17194
2022-02-18 07:16:52 +00:00
Marius Vikhammer
cdfd59cc0e docs: update copyright date for docs automatically 2022-02-18 12:59:12 +08:00
Zim Kalinowski
a8c073c1cc fixed trailing whitespace 2022-02-18 12:58:53 +08:00
Zim Kalinowski
dc4783945a freertos: Move Espressif's specific esp_reent_init into collective ifdef 2022-02-18 12:58:53 +08:00
Omar Chebib
7caacf20c1 Documentation: added ESP32S3 interrupt allocation doc 2022-02-18 12:36:05 +08:00
KonstantinKondrashov
90c63f7250 esp_system: ipc_isr does not use its own initialization task, it is done from ipc_task()
It helps to reduce the memory usage at startup.

Closes https://github.com/espressif/esp-idf/issues/8111
2022-02-18 12:36:05 +08:00
Michael (XIAO Xufeng)
21b80a969f soc: updated soc_caps about rtc_io and the format 2022-02-18 11:44:43 +08:00
Michael (XIAO Xufeng)
fd20ac807c sleep: fixed ext1 cannot wakeup via RTCIO >= 18 issue
Closes https://github.com/espressif/esp-idf/issues/8231
2022-02-18 11:44:20 +08:00
Jakob Hasse
c904b4807b bugfix (nvs): Fixed issues found by Coverity
*  Fixed potential memory leak
*  Fixed wrong strncpy usage
*  Fixed potential out of bounds access
2022-02-17 22:22:26 +08:00
Marius Vikhammer
f3639dafc8 freertos: add pm_trace header include 2022-02-17 22:22:26 +08:00
Chip Weinberger
9cc4c2f34d SPIRAM: 'Abort on allocation failure' should not trigger when there is available SPI ram
(cherry picked from commit 8dcdb2f363fd3fa00bd77e4bd75e7c73d6c7d0fb)
2022-02-17 22:22:26 +08:00
Jiang Jiang Jian
5ff09f0a06 Merge branch 'bugfix/modbus_allow_address_gaps_in_master_data_dict_v44' into 'release/v4.4'
freemodbus: allow address gaps in master data dictionary (support of UID field in MBAP) (backport v4.4)

See merge request espressif/esp-idf!16896
2022-02-17 08:38:57 +00:00
Alex Lisitsyn
d2399f6d8c freemodbus: allow address gaps in master data dictionary (support of UID field in MBAP) (backport v4.4) 2022-02-17 08:38:56 +00:00
Jiang Jiang Jian
b2ef617a34 Merge branch 'bugfix/fix_ble_adv_underrun_error_v4.4' into 'release/v4.4'
components/bt: Fix ble adv_underrun issue(backport v4.4)

See merge request espressif/esp-idf!17164
2022-02-17 08:30:38 +00:00
Jiang Jiang Jian
38cca53445 Merge branch 'bugfix/assoc_comeback_fail_issue_v4.4' into 'release/v4.4'
Fix assoc comeback causing invalid state & FTM cleanup (Backport v4.4)

See merge request espressif/esp-idf!17170
2022-02-17 04:42:52 +00:00
Jiang Jiang Jian
98c5c7bac8 Merge branch 'bugfix/enterprise_certs_weak_md_v4.4' into 'release/v4.4'
esp_wifi: Fixed issue of weak md for certificates in wifi_enterprise example.(v4.4)

See merge request espressif/esp-idf!16979
2022-02-17 04:40:12 +00:00
Jiang Jiang Jian
b39d0dbf2c Merge branch 'bugfix/usb_default_print_wifi_v4.4' into 'release/v4.4'
esp_phy: enable usb under default(without choosing USB_SERIAL_JTAG) (backport v4.4)

See merge request espressif/esp-idf!17075
2022-02-17 04:15:54 +00:00
Jiang Jiang Jian
f9927119b8 Merge branch 'bugfix/efuse_timesettings_for_esp32s3_v4.4' into 'release/v4.4'
efuse: Fixes eFuse timesettings issue on esp32S3 (v4.4)

See merge request espressif/esp-idf!17177
2022-02-17 04:00:14 +00:00
Jiang Jiang Jian
174bd31bc0 Merge branch 'bugfix/usb_no_rom_log_v4.4' into 'release/v4.4'
USB_SERIAL_JTAG: Fix the issue that there is no rom log when restarting(backport v4.4)

See merge request espressif/esp-idf!17073
2022-02-17 03:59:36 +00:00
Marius Vikhammer
6664e6cf43 ds: update gen_digital_signature_tests.py to handle different max key sizes
Max key size is now decided by target parameter, and related parameters are
no longer hard coded.

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


(cherry picked from commit 4a3f50faa0)
2022-02-17 11:24:54 +08:00
morris
35d5a30d47 Merge branch 'feature/adc_calibration_version_2_on_c3_v4.4' into 'release/v4.4'
adc: upgrade adc calibration algorithm to version 2 on c3 (v4.4)

See merge request espressif/esp-idf!17049
2022-02-17 03:04:35 +00:00
morris
11440c8757 Merge branch 'bugfix/gpio_intr_on_core1_s3_v4.4' into 'release/v4.4'
gpio: Fix the bug that gpio interrupt cannot be triggered on app cpu on ESP32S3 (backport v4.4)

See merge request espressif/esp-idf!16595
2022-02-17 01:47:46 +00:00
David Čermák
ae6f171370 Merge branch 'bugfix/mdns_null_deref_fuzzer_v4.4_' into 'release/v4.4'
mdns: Fix potential null deref reported by fuzzer test(v4.4)

See merge request espressif/esp-idf!17147
2022-02-17 01:21:00 +00:00
David Čermák
bf7266312c Merge branch 'bugfix/esp_eth_start_tx_buff_v4.4_followup' into 'release/v4.4'
Fixed ESP32 EMAC driver `insufficient TX buffer size` (v4.4 followup)

See merge request espressif/esp-idf!16666
2022-02-16 18:33:12 +00:00
David Čermák
299b6538e4 Merge branch 'bugfix/protocols_test_on_eth_v4.4' into 'release/v4.4'
ci/mqtt: Move protocol tests to eth runners(v4.4)

See merge request espressif/esp-idf!17010
2022-02-16 18:31:54 +00:00
David Čermák
538401aa06 Merge branch 'contrib/github_pr_8337_v4.4' into 'release/v4.4'
Set success when closing socket (GitHub PR) (v4.4)

See merge request espressif/esp-idf!17097
2022-02-16 18:31:30 +00:00
KonstantinKondrashov
d011404607 esptool: Fixes esp32h2 target name 2022-02-17 00:14:45 +08:00
Nachiket Kukade
908874c642 esp_wifi: Update wifi lib
1. Fix assoc comeback causing invalid state
2. Better cleanup in some FTM failure cases
2022-02-16 15:51:50 +05:30
KonstantinKondrashov
5c7b597594 efuse: Fixes eFuse timesettings issue on esp32S3 2022-02-16 15:15:27 +08:00
songruojing
60b0d30d9c ci: increase target-test.yml UT_T1_1 job to support newly added LEDC fade ut tests
(cherry picked from commit f5cbe89487)
2022-02-16 15:02:46 +08:00
songruojing
83edf2dbcf ledc: Fix FADE_NO_WAIT mode concurrency problem.
Add test cases for fade concurrency issue and fade timing check.

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

(cherry picked from commit be2ab09832)
2022-02-16 15:02:45 +08:00
songruojing
574f2c6a17 ledc: bugfix - Simplify the procedure to perform a one-time duty update
Avoid adding one extra fade cycle when performing a one-time duty update.
Add some notes to ledc_get_duty and ledc_update_duty APIs, so that users
are aware of when the new duty will be effective.

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

(cherry picked from commit e175086226)
2022-02-16 15:02:45 +08:00
Armando
175132a874 adc: upgrade adc calibration algorithm to version 2 on c3 2022-02-16 14:58:42 +08:00
Ivan Grokhotkov
492afe4d4a esp_adc_cal: move esp_adc_cal_get_voltage into common source file 2022-02-16 14:58:42 +08:00
Ivan Grokhotkov
be542db463 esp_adc_cal: simplify CMakeLists.txt 2022-02-16 14:58:42 +08:00
songruojing
9991b1b021 ci: increase target-test.yml UT_T1_1 job to support newly added ut test 2022-02-16 14:52:39 +08:00
songruojing
41e452e7d8 gpio: Fix the bug that gpio interrupt cannot be triggered on app cpu on ESP32S3
Closes https://github.com/espressif/esp-idf/issues/7885

(cherry picked from commit 91f1159f9c)
2022-02-16 14:50:51 +08:00
songruojing
b722e6f6ec gpio: Bugfix - Move esp_intr_free() out of the critical section in gpio_uninstall_isr_service()
Closes https://github.com/espressif/esp-idf/issues/5571

Fix the bug that if the API was called from one core to free the interrupt source on the other core, it would trigger interrupt watchdog.

(cherry picked from commit 0e8286c57b)
2022-02-16 14:50:51 +08:00
Zim Kalinowski
81861d03c0 Merge branch 'bugfix/fix_i2c_crash_v4.4' into 'release/v4.4'
I2C: Fix I2C Master operation with repeated start condition (backport v4.4)

See merge request espressif/esp-idf!17118
2022-02-16 06:30:44 +00:00
David Cermak
c0e105cc41 mdns: Fix potential null deref reported by fuzzer test 2022-02-16 06:23:57 +00:00
Zim Kalinowski
33f7009bef Merge branch 'bugfix/i2c_spiram_bug_v4.4' into 'release/v4.4'
i2c: fix buffer check when SPIRAM used as a heap (backport v4.4)

See merge request espressif/esp-idf!17098
2022-02-16 05:16:32 +00:00
Jiang Jiang Jian
d483bd9518 Merge branch 'feature/support_eap_fast_release_v4.4' into 'release/v4.4'
Add support for EAP-FAST authentication (backport v4.4)

See merge request espressif/esp-idf!16279
2022-02-16 03:28:15 +00:00
Jiang Jiang Jian
11ec6ed917 Merge branch 'bugfix/eap_client_crash_v4.4' into 'release/v4.4'
wpa_supplicant: Fix memory corruption (v4.4)

See merge request espressif/esp-idf!17128
2022-02-16 03:27:47 +00:00
Jiang Jiang Jian
e3a5a85e2f Merge branch 'feature/gcov_esp32c3_v4.4' into 'release/v4.4'
debug_stubs and gcov: Refactor and add support for RISCV (v4.4)

See merge request espressif/esp-idf!17068
2022-02-16 03:26:49 +00:00