Compare commits

...

1804 Commits

Author SHA1 Message Date
6407ecb3f8 versions: Update version to 4.4.3 2022-11-08 16:22:14 +01:00
755ce1077d Merge branch 'bugfix/backup_dma_stall_when_sw_rst_v4.4' into 'release/v4.4'
backport v4.4: force clear reset signal to fix the backup dma operation failure...

See merge request espressif/esp-idf!20634
2022-10-20 17:06:58 +08:00
ee882708f8 Merge branch 'bugfix/fix_ignore_rx_sub_ampdu_int_issue_v4.4' into 'release/v4.4'
esp_wifi: fix ignore rx sub ampdu interrupt issue(Backport v4.4)

See merge request espressif/esp-idf!20604
2022-10-18 15:52:55 +08:00
3047225a9f Merge branch 'bugfix/fix_c3_dig_dibas_limit_bug_to_v4.4' into 'release/v4.4'
C3: Fix system not stable bug when dbias storing in efuse is bigger than 27 (v4.4)

See merge request espressif/esp-idf!20498
2022-10-17 17:58:38 +08:00
dbf1241ae2 backup dma: force clear reset signal to fix the backup dma operation failure caused by RTC_SW_CPU_RST 2022-10-17 11:07:51 +08:00
2fc0bb7b2a Merge branch 'bugfix/close_stack_callback_during_ble_stop_v4.4' into 'release/v4.4'
Nimble: Added check to deregister stack callback with controller during stack deinit(v4.4)

See merge request espressif/esp-idf!20450
2022-10-14 17:52:07 +08:00
4391e369d2 esp_wifi: fix ignore rx sub ampdu interrupt issue 2022-10-14 14:29:38 +08:00
488c79a003 Merge branch 'bugfix/fix_connect_fail_when_enable_SPIRAM_v4.4' into 'release/v4.4'
esp_wifi: fix connect fail when enable SPIRAM and ESPNOW send (backport v4.4)

See merge request espressif/esp-idf!20445
2022-10-13 14:20:11 +08:00
ab3238ec0e esp_wifi: fix connect fail when enable SPIRAM 2022-10-10 17:30:24 +08:00
cje
c34e900969 fix C3 system not stable bug when dbias storing in efuse is bigger than 27 2022-10-08 11:55:26 +08:00
e7db4ff5ec Nimble: Added check to deregister stack callback with controller during
stack deinit
2022-10-06 09:44:45 +05:30
9269a536ac Merge branch 'bugfix/fix_deinit_return_ok_when_wifi_no_longer_initialized_issue_v4.4' into 'release/v4.4'
esp_wifi: fix fail to scan after recv disassoc/deauth for esp32s2(Backport v4.4)

See merge request espressif/esp-idf!20410
2022-09-29 19:20:48 +08:00
e85c5822a2 Merge branch 'bugfix/add_so_linger_to_httpd_config_v4.4' into 'release/v4.4'
esp_http_server: Add struct linger in httpd_config_t (v4.4)

See merge request espressif/esp-idf!20359
2022-09-29 16:04:06 +08:00
d7bad4ac1d Merge branch 'bugfix/esptool_secure_boot_signing_key_path_v4.4' into 'release/v4.4'
esptool: (re)populate the secure boot signing key path (v4.4)

See merge request espressif/esp-idf!20423
2022-09-29 15:15:32 +08:00
b62b197cd3 esptool: (re)populate the secure boot signing key path
For project with reduced component list, secure boot signing key
path was not getting correctly. This change sets the secure boot
signing key path explicitly based on the relevant config option.

Closes https://github.com/espressif/esp-idf/issues/9578
Close IDFGH-8075
2022-09-29 10:09:32 +05:30
3911a1b8e7 Merge branch 'feature/support_7.2.8_soc/pvt_dig_v4.4' into 'release/v4.4'
ESP32S3:support auto adjust LDO voltage based on pvt-dig(backport 4.4)

See merge request espressif/esp-idf!20249
2022-09-29 11:07:55 +08:00
zlq
b44530f188 1.add ldo parameters in efuse table; 2.set ldo based on pvt-efuse; 3.ldo voltage is changed based on cpu freq 2022-09-29 03:16:49 +08:00
7f2d6e96b4 esp_wifi: fix deinit return wrong value
1. Deinit does not return ESP_ERR_WIFI_NOT_INIT if the wifi driver is no longer initialized.
2. Fix get wrong channel value use esp_wifi_get_config.
3. Fix bug of missing unlock when wifi stop.
4. Fix annotation error of api esp_wifi_connect.
2022-09-28 18:09:56 +08:00
2c8f83ec72 esp_wifi: fix fail to scan after recv disassoc/deauth for esp32s2
esp_wifi: sync peripheral device reg base
2022-09-28 18:09:03 +08:00
268718b7b4 Merge branch 'bugfix/fix_uart_fake_tx_done_v4.4' into 'release/v4.4'
uart: Fix unwanted processing of TX_DONE interrupt immediately after calling uart_wait_tx_done() (backport v4.4)

See merge request espressif/esp-idf!20314
2022-09-28 16:45:03 +08:00
cc841ae9c0 Merge branch 'bugfix/fast_scan_profile_issue_v4.4' into 'release/v4.4'
Fix repeated scans causing bss overwrite in connect process (Backport v4.4)

See merge request espressif/esp-idf!19858
2022-09-28 16:35:39 +08:00
e53ea6c776 Merge branch 'bugfix/acl_buf_ocf_and_conn_fail_v4.4' into 'release/v4.4'
bugfix/fixed the exhaustion of ACL buffer and duplicated connection requests (v4.4)

See merge request espressif/esp-idf!20384
2022-09-28 16:31:38 +08:00
12ee73b16a Merge branch 'bugfix/fix_ble_disconnect_due_to_channel_map_instant_passed_v4.4' into 'release/v4.4'
Fixed BLE disconnection issue when channel map update failed due to bad channels(backport v4.4)

See merge request espressif/esp-idf!20376
2022-09-28 16:24:58 +08:00
5eadda3a35 Merge branch 'feature/optimize_rgb_lcd_draw_bitmap_v4.4' into 'release/v4.4'
rgb_lcd: optimise rgb_panel_draw_bitmap (v4.4)

See merge request espressif/esp-idf!20361
2022-09-28 14:55:50 +08:00
5e2c14b40b Merge branch 'bugfix/wifi_prov_device_name_v4.4' into 'release/v4.4'
wifi_provisioning : Increased 1 byte of BLE advertising device name to store '\0' (v4.4)

See merge request espressif/esp-idf!20374
2022-09-28 13:42:24 +08:00
b992d3b4f8 Merge branch 'doc/usj_sw_reset_alive_bbpll_doc_v4.4' into 'release/v4.4'
usb_serial_jtag: fixed the docs that we can use usj in sleep modes (v4.4)

See merge request espressif/esp-idf!20288
2022-09-28 11:49:47 +08:00
339eca61ad fixed the exhaustion of ACL buffer
fixed the duplication of connection request from the same device
2022-09-28 10:12:29 +08:00
403bff2a2b fix err using rpa for confirmation calculation 2022-09-27 19:32:26 +08:00
b063151c4b fix on data len change cmd malfunction 2022-09-27 19:32:11 +08:00
zwj
358a03e844 Fixed extend adv tx power range error 2022-09-27 19:30:06 +08:00
zwj
cac46cb107 update BLE lib for ESP32C3 and ESP32S3
Fixed BLE disconnection issue when channel map update failed due to bad channels
2022-09-27 19:24:58 +08:00
b86e91ac55 Merge branch 'fix/ci_macos_idf_env_json_v4.4' into 'release/v4.4'
CI: Clean-up idf-env.json which might not compatible with newer versions (v4.4)

See merge request espressif/esp-idf!20367
2022-09-27 19:00:57 +08:00
113b558006 Merge branch 'refactor/editorconfig_remove_freertos_tabs_4.4' into 'release/v4.4'
editorconfig: Removed FreeRTOS tab rule (backport 4.4)

See merge request espressif/esp-idf!20369
2022-09-27 18:54:58 +08:00
a78a36e7b9 wifi_provisioning : Increased 1 byte of BLE advertising device name to store '\0', at the end, to ensure we adhere to the max name length as per spec. 2022-09-27 16:09:11 +05:30
2dd6a166b9 Merge branch 'feat/essl_extra_component_v4.4' into 'release/v4.4'
sdio/example: fixed the essl return value issue (v4.4)

See merge request espressif/esp-idf!20345
2022-09-27 18:33:06 +08:00
4445da6232 refactor(editorconfig): Removed FreeRTOS tab rule
FreeRTOS used tabs before, but changed to spaces now.
This hasn't been reflected in the editorconfig file
and is fixed now.
2022-09-27 11:49:29 +02:00
4e5a8942a1 CI: Clean-up idf-env.json which might not compatible with newer versions 2022-09-27 16:21:14 +07:00
6f87740bbe Merge branch 'bugfix/fixed_gap_in_i2s_adc_dac_output' into 'release/v4.4'
i2s_example: fixed i2s_adc_dac output gap (v4.4)

See merge request espressif/esp-idf!20320
2022-09-27 15:49:17 +08:00
c8ce38e60c Merge branch 'bugfix/missing_idfSelectedId' into 'release/v4.4'
Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId'

See merge request espressif/esp-idf!20327
2022-09-27 15:22:36 +08:00
741d35d528 rgb_lcd: added yuv converter LL driver 2022-09-27 13:42:56 +08:00
e66a72b452 rgb_lcd: workaround pclk polarity bug by setting mo>=2 2022-09-27 13:22:18 +08:00
72a25862a1 rgb_lcd: support PLL240MHz clock source 2022-09-27 13:20:51 +08:00
efed5ee33f esp_http_server: Add linger in httpd_config_t
Closes: https://github.com/espressif/esp-idf/issues/9514
2022-09-27 10:10:16 +05:30
30ab6a9246 rgb_lcd: optimise rgb_panel_draw_bitmap
by using memcpy instead of coping in a nested for loop
2022-09-27 10:36:41 +08:00
3a6831b1b4 rgb_lcd: support fractional clock divisor 2022-09-27 10:27:36 +08:00
cc74a9bf39 Merge branch 'bugfix/fix_socket_leak_v4.4' into 'release/v4.4'
esp-tls: socket will be set to -1 and will not be closed (backport v4.4)

See merge request espressif/esp-idf!20351
2022-09-26 22:28:51 +08:00
eb5f70b6fb esp_wifi: Update wifi libs
Fix scan causing bss overwrite in connect process
2022-09-26 18:52:57 +05:30
5514cee480 sdio/example: fixed the essl return type issue 2022-09-26 19:40:37 +08:00
640f1c844b Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId'
Closes https://github.com/espressif/esp-idf/issues/9837
2022-09-26 13:36:16 +02:00
c1429bbeeb esp-tls: socket will be set to -1 and will not be closed 2022-09-26 19:23:32 +08:00
ae263f1bc8 Merge branch 'feature/sink_support_mono_v4.4' into 'release/v4.4'
bt: Fixed sink not being able to output mono audio because it can only decode dual channel audio data(v4.4)

See merge request espressif/esp-idf!20077
2022-09-26 17:47:31 +08:00
d1113747e7 Merge branch 'bugfix/fix_set_country_code_before_wifi_start_issue_v4.4' into 'release/v4.4'
Bugfix/fix set country code before wifi start issue v4.4(Backport v4.4)

See merge request espressif/esp-idf!20095
2022-09-23 17:49:55 +08:00
3427867e70 i2s_example: fixed i2s_adc_dac output gap
Closes: https://github.com/espressif/esp-idf/issues/9389
2022-09-23 17:31:20 +08:00
5a969b91a8 uart: Fix unwanted processing of TX_DONE interrupt immediately after calling uart_wait_tx_done()
In previous transmission(s), the TX_DONE interrupt raw bit may be raised, but never been cleared.
TX_DONE interrrupt status bit should be cleared before enabling it to check the new transmission.

Introduced in 4e09d147b11ed8a094b5858642c9f60d658ef656
2022-09-23 16:10:53 +08:00
60d6ad326e Merge branch 'bugfix/spi2_add_device_cs_more_than_3_v4.4' into 'release/v4.4'
spi_master:fix error when use `spi_bus_add_device` more than 3 device(v4.4)

See merge request espressif/esp-idf!20126
2022-09-23 11:20:17 +08:00
e833fb0c30 Merge branch 'bugfix/tinyusb_corrected_typo_naming_of_acm_v4.4' into 'release/v4.4'
tinyusb: fix typo naming of ACM (backport v4.4)

See merge request espressif/esp-idf!20299
2022-09-23 09:30:45 +08:00
7d4b99984d Merge branch 'bugfix/twai_isr_iram_v4.4' into 'release/v4.4'
hal: fix CONFIG_TWAI_ISR_IN_IRAM for C3, hide TWAI menu for C2 (v4.4)

See merge request espressif/esp-idf!20092
2022-09-23 02:25:26 +08:00
9aa7c83e19 Merge branch 'bugfix/mqtt_enqueue' into 'release/v4.4'
[mqtt] Fix esp_mqtt_client_enqueue for len=0 (v4.4)

See merge request espressif/esp-idf!20230
2022-09-22 21:49:46 +08:00
8d53799e2e Merge branch 'feature/update_esptool_v3' into 'release/v4.4'
feat(esptool): Update to v3.3.2 in IDF v4.4

See merge request espressif/esp-idf!20257
2022-09-22 21:37:12 +08:00
36d973a5e5 tinyusb: fix typo naming of ACM 2022-09-22 20:33:31 +08:00
f40364e2f3 feat(esptool): Update to v3.3.2 2022-09-22 10:26:09 +02:00
06a52bf770 usb_serial_jtag: fixed the docs that we can use usj in sleep modes
Related to: https://github.com/espressif/esp-idf/issues/8507, https://github.com/espressif/esp-idf/issues/8884
2022-09-22 15:37:32 +08:00
c407e69246 Merge branch 'refactor/add_description_to_touch_pad_set_meas_time_v4.4' into 'release/v4.4'
touch_sensor: add description to distinguish the API on different target (v4.4)

See merge request espressif/esp-idf!20242
2022-09-22 14:51:41 +08:00
3ea96f0e22 Merge branch 'bugfix/relay_friend_cred_message_v4.4' into 'release/v4.4'
ble_mesh: stack: Fix friend relay lpn message when relay disable(v4.4)

See merge request espressif/esp-idf!20204
2022-09-22 14:17:25 +08:00
ac0ef933ff Merge branch 'ci/optimize_ats_ci_flow_v4.4' into 'release/v4.4'
CI: optimize ATS ci flow (v4.4)

See merge request espressif/esp-idf!20175
2022-09-22 14:11:56 +08:00
3247fa9374 Merge branch 'bugfix/fix_spi_bus_lock_concurrency_issue_v4.4' into 'release/v4.4'
spi_bus_lock: fix a concurrency issue (v4.4)

See merge request espressif/esp-idf!20138
2022-09-22 13:33:31 +08:00
5c57f9c884 touch_sensor: add description to distinguish the API on different target
Closes https://github.com/espressif/esp-idf/issues/9067
2022-09-22 10:31:08 +08:00
08fa67fe92 Merge branch 'bugfix/i2s_receive_data_lost_v4.4' into 'release/v4.4'
i2s: fix message queue overflow condition (v4.4)

See merge request espressif/esp-idf!20209
2022-09-21 22:01:12 +08:00
2f23432c00 [mqtt] Fix esp_mqtt_client_enqueue for len=0
Detailed description of the changes:
* [Backport] mqtt_client: fix esp_mqtt_client_enqueue for len=0
  - See merge request espressif/esp-mqtt!144
  - mqtt_client: fix esp_mqtt_client_enqueue for len=0
    (espressif/esp-mqtt@e918742)

Closes https://github.com/espressif/esp-idf/issues/9719
2022-09-21 13:42:32 +02:00
1b70a08cc9 Merge branch 'bugfix/fix_xtal32k_error_detect_backport_v4.4' into 'release/v4.4'
esp_hw_support/clk_cali: fix xtal32k error detect(backport v4.4)

See merge request espressif/esp-idf!20276
2022-09-21 19:11:14 +08:00
17214c2db6 hal: fix CONFIG_TWAI_ISR_IN_IRAM not taking effect for C3/H2 2022-09-21 08:35:54 +00:00
c6fd8752b0 Merge branch 'examples/tls_removed_deprecated_version_v4.4' into 'release/v4.4'
test_apps: removed verification of TLS v1.1 (v4.4)

See merge request espressif/esp-idf!19290
2022-09-21 16:35:40 +08:00
9a61a07fd8 esp_hw_support/clk_cali: remove redundant check for cali value 2022-09-21 15:13:22 +08:00
13984c0a79 esp_hw_support/clk_cali: fix xtal32k error detect 2022-09-21 15:11:04 +08:00
7d4d75c507 Merge branch 'doc/support_micro_def' into 'release/v4.4'
Support of Micro definition in header file

See merge request espressif/esp-idf!20071
2022-09-21 13:53:53 +08:00
d805d2ad5a Merge branch 'bugfix/clobbering_freertos_base_priority_v4.4' into 'release/v4.4'
spi_flash: fix issue linked with raising of task priority while priority is already raised (v4.4)

See merge request espressif/esp-idf!20026
2022-09-21 13:11:35 +08:00
0f630acf43 Merge branch 'bugfix/spi_hd_quad_issue_4.4' into 'release/v4.4'
SPI : fix wrong dummy cycle on quad mode and put get-command function in spi_ll.h(backport v4.4)

See merge request espressif/esp-idf!19816
2022-09-21 12:06:40 +08:00
af62cfc8a2 Merge branch 'bugfix/fix_ledc_timer_update_usage_v4.4' into 'release/v4.4'
ledc: Fix the usage of ledc_ls_timer_update and ledc_timer_rst (backport v4.4)

See merge request espressif/esp-idf!20241
2022-09-21 11:40:27 +08:00
bf9b44f7fc ble_mesh: stack: Fix friend relay lpn message when relay disable. 2022-09-21 03:39:56 +00:00
4b8915d7af Merge branch 'bugfix/lpn_not_recv_message_to_all_node_4.4' into 'release/v4.4'
ble_mesh: stack: Add option for lpn auto sub all-nodes(v4.4)

See merge request espressif/esp-idf!20264
2022-09-21 11:31:55 +08:00
7cedbfabdf Merge branch 'bugfix/gpio_usb_pin_pupd_v4.4' into 'release/v4.4'
gpio: fix USB D+ pin cannot disable pullup (backport v4.4)

See merge request espressif/esp-idf!20251
2022-09-21 11:28:36 +08:00
b9bd4df2d6 Merge branch 'support/readme_esp32s3_bluedroid_examples_v4.4' into 'release/v4.4'
Added ESP32-S3 in README Bluedroid examples (v4.4)

See merge request espressif/esp-idf!20224
2022-09-21 10:39:44 +08:00
e4df3e2ad7 ble_mesh: stack: Add option for lpn auto sub all-nodes. 2022-09-20 20:30:08 +08:00
3531585522 Merge branch 'feature/update-GCC-Toolchain-to-esp-2021r2-patch5-8.4.0' into 'release/v4.4'
tools: update GCC-Toolchain version to 'esp-2021r2-patch5-8.4.0' for IDF-v4.4

See merge request espressif/esp-idf!20186
2022-09-20 20:25:02 +08:00
4bee8a84e2 gpio: fix USB D+ pin cannot disable pullup
Internally, disable usb serial jtag DP pin's pullup when calling gpio_ll_pullup_dis and rtcio_ll_pullup_disable
At usb serial jtag setup/install, re-enable DP pin's pullup

Closes https://github.com/espressif/esp-idf/issues/9495
2022-09-20 15:23:01 +08:00
bb6f2ca740 Support of Micro defination in header file 2022-09-20 11:07:06 +05:30
9c830297b9 freertos: Adds new APIs to set/get and restore base priority
Closes https://github.com/espressif/esp-idf/issues/7580
2022-09-20 05:00:13 +00:00
c070c58ef3 Merge branch 'ci/app_type_elf_reduce_ram_v4.4' into 'release/v4.4'
CI: reduce memory footprint for "Loadable ELF build" (v4.4)

See merge request espressif/esp-idf!20227
2022-09-20 12:57:53 +08:00
9bd20fc2ca ledc: Fix the usage of ledc_ls_timer_update and ledc_timer_rst
ledc_ls_timer_update is required only when CLK_DIV and DUTY_RES bits are changed.
Calling ledc_timer_rst while re-configure PWM frequency through ledc_set_freq can cause glitch in the signal
2022-09-20 11:52:57 +08:00
4f971a0cf5 CI: reduce memory footprint for "Loadable ELF build"
Build test was failing due to IRAM overflow, building with the recommended
options for reducing memory footprint should give us some breathing room.
2022-09-19 17:22:30 +08:00
1d9f539f22 Merge branch 'bugfix/light_sleep_deadlock_v4.4' into 'release/v4.4'
esp_hw_support: Fix light sleep deadlock (v4.4)

See merge request espressif/esp-idf!19516
2022-09-19 16:33:19 +08:00
cd5ffbf44b docs: update wifi country code docs. 2022-09-19 15:22:57 +08:00
2a72036337 esp_wifi: add small UT for country code 2022-09-19 15:22:57 +08:00
2dff79510d esp_wifi: fix disconnect after set country issue 2022-09-19 15:20:29 +08:00
8ae535cdc5 Added ESP32-S3 in README Bluedroid examples (v4.4) 2022-09-19 12:47:49 +05:30
b0a5b100ea test_apps: Removed verification of TLS v1.1 2022-09-19 09:13:42 +04:00
2da3035b52 doc: add application notes for i2s 2022-09-19 12:03:08 +08:00
2f929685fc Merge branch 'bugfix/fix_send_eapol_key_request_frame_when_wpa_group_handshake_issue_v4.4' into 'release/v4.4'
wpa_supplicant: try install gtk before send 2 of 2(Backport v4.4)

See merge request espressif/esp-idf!20201
2022-09-19 10:58:59 +08:00
190502bfec i2s: fix the wrong condition of event queue 2022-09-19 10:18:34 +08:00
7ce7c22140 tools: update GCC-Toolchain version to 'esp-2021r2-patch5-8.4.0'
Fix running GDB on macos-arm64
2022-09-18 18:27:54 +07:00
5b24356ab5 wpa_supplicant: try install gtk before send 2 of 2 2022-09-17 19:02:53 +08:00
25c968ec65 Merge branch 'bugfix/exclude_component_dirs_pacman_v4.4' into 'release/v4.4'
build: fix excluded components being passed to component manager (v4.4)

See merge request espressif/esp-idf!19623
2022-09-16 22:10:05 +08:00
5af9949289 Merge branch 'fix/idf_tools_download' into 'release/v4.4'
tools: fix idf_tools.py download command without --platform option

See merge request espressif/esp-idf!20170
2022-09-16 18:51:39 +08:00
baa28b54a2 esp_hw_support: Fix esp_light_sleep_start() deadlock
esp_light_sleep_start() will stall the other CPU via esp_ipc_isr_stall_other_cpu(). After stalling the other CPU,
will call esp_clk_... API which themselves take locks. If the other stalled CPU is holding those locks, this will
result in a deadlock.

This commit adds a workaround calling esp_clk_private_lock() to take the lock before stalling the other CPU.
2022-09-16 17:02:38 +08:00
9ea9192efb esp_hw_support: esp_clk should use spinlock instead of mutex
esp_clk used to be protected using _lock_t (i.e., a FreeRTOS Mutex). However, esp_clk API is current called from
from critical sections, thus mutex should not be used (as they can be blocking).

This commit updates esp_clk to use spinlocks for critical sections instead.

Note: Added a small fix to exclude esp_clk.c from bootloader builds in the
      legacy build system (this is already the case in CMake).
2022-09-16 17:02:38 +08:00
e80057035a Merge branch 'bugfix/adapt_new_btc_v4.4' into 'release/v4.4'
ble_mesh: stack: Corrected parameter size when the btc_transfer_context is used (v4.4)

See merge request espressif/esp-idf!20166
2022-09-16 10:53:55 +08:00
d6522044d3 Merge branch 'bugfix/change_log_level_for_print_v4.4' into 'release/v4.4'
Nimble : updated debug level for a print to avoid unwanted console log. (v4.4)

See merge request espressif/esp-idf!20111
2022-09-16 10:52:31 +08:00
ecf84354b2 Merge branch 'feature/ulp_binutils_multi_target_v4.4' into 'release/v4.4'
ulp: support the new multi-target ULP-FSM binutils (v4.4)

See merge request espressif/esp-idf!20147
2022-09-16 10:01:00 +08:00
a8e81f88f1 tools: update esp32ulp-elf to v2.35_20220830
Closes https://github.com/espressif/esp-idf/issues/6432
Closes https://github.com/espressif/binutils-esp32ulp/issues/23
2022-09-15 23:41:56 +04:00
4b46e85b0a Merge branch 'bugfix/transport_foundation_intialization_v4.4' into 'release/v4.4'
tcp_transport: Fix initialition of transport (v4.4)

See merge request espressif/esp-idf!20047
2022-09-16 00:13:48 +08:00
4ef57caf77 CI: optimize ATS ci flow 2022-09-15 22:59:13 +08:00
d4b4964088 Merge branch 'bugfix/gdbstub_test_fix_v4.4' into 'release/v4.4'
system: fix gdbstub panic tests after the truncated backtrace is fixed

See merge request espressif/esp-idf!20149
2022-09-15 19:06:10 +08:00
d2b1ea9ac1 Nimble : updated debug level for a print to avoid unwanted console log. 2022-09-15 15:24:53 +05:30
87921558fd ble_mesh: stack: added the judgment that the parameter is NULL but the parameter len is not zero to avoid btc_transfer_context failed 2022-09-15 09:14:39 +00:00
65da9400e8 tools: fix idf_tools.py download command without --platform option 2022-09-15 12:55:41 +04:00
69da6a3c23 system: fix gdbstub panic tests after the truncated backtrace is fixed
GDB has been updated in 0007754 to fix the abort backtrace issue.
This commit updates the test case to match the new (correct) behavior.
2022-09-15 10:36:46 +02:00
481d00be93 Merge branch 'bugfix/fix_memory_corruption_in_recon_code_v4.4' into 'release/v4.4'
Nimble: Fixed memory corruption introduced in reconnection attempt code (v4.4)

See merge request espressif/esp-idf!19745
2022-09-14 16:34:22 +08:00
440f9e138c Merge branch 'bugfix/enable_ans_svc_by_default_v4.4' into 'release/v4.4'
Nimble: Enable ANS service by default in nimble peripheral example (v4.4)

See merge request espressif/esp-idf!20022
2022-09-14 16:17:20 +08:00
163a4b6b02 SPI_BUS_LOCK: fix a concurrency issue
define: lock_bits = (lock->status & LOCK_MASK) >> LOCK_SHIFT;  This `lock_bits` is the Bit 29-20 of the lock->status

1. spi_hdl_1:
   acquire_end_core():
   uint32_t status = lock_status_clear(lock, dev_handle->mask & LOCK_MASK);
   Becuase this is the first `spi_hdl_1`, so after this , lock_bits == 0`b0. status == 0

2. spi_hdl_2:
   acquire_core:
   uint32_t status = lock_status_fetch_set(lock, dev_handle->mask & LOCK_MASK);
   Then here status is 0`b0, but lock_bits == 0`b10. Because this is the `spi_hdl_2`

3. spi_hdl_2:
   `acquire_core` return true, because status == 0. `spi_bus_lock_acquire_start(spi_hdl_2)` then won't block.

4. spi_hdl_2:
   spi_device_polling_end(spi_hdl_2).

5. spi_hdl_1:
   acquire_end_core:
   status is 0, so it cleas the lock->acquiring_dev

6. spi_hdl_2:
   spi_device_polling_end:
   assert(handle == get_acquiring_dev(host)); Fail

Closes https://github.com/espressif/esp-idf/issues/8179
2022-09-14 12:11:29 +08:00
27470afb7c spi_master:fix error when use spi_bus_add_device more than 3 device
update gpio_sig at `spics_out` array in each spi_periph.c of chips later than s2
then `spi_bus_add_device` can correctly distribute gpio_signals for cs_signal

Closes https://github.com/espressif/esp-idf/issues/8876
2022-09-14 11:20:47 +08:00
0b7532c097 Merge branch 'bugfix/idf_tools_update_bundled_cert_v4.4' into 'release/v4.4'
tools: update bundled root certificate in idf_tools.py (v4.4)

See merge request espressif/esp-idf!20114
2022-09-13 21:34:31 +08:00
6c3267e8a9 Merge branch 'feature/s2_s3_support_ext_mem_stack_v4.4' into 'release/v4.4'
soc: support placing task stacks in external memory for S2 and S3 (v4.4)

See merge request espressif/esp-idf!20001
2022-09-13 21:24:02 +08:00
a29f770c7a Merge branch 'feature/mem-corruption-check-when-comprehensif-poisoning-v4.4' into 'release/v4.4'
heap: Provide memory corruption check when poisoning is active (V4.4)

See merge request espressif/esp-idf!19778
2022-09-13 20:41:48 +08:00
5224045d17 Merge branch 'doc/nvs_max_num_namespaces_4.4' into 'release/v4.4'
doc (nvs): added note about maximum possible namespaces (backport 4.4)

See merge request espressif/esp-idf!19980
2022-09-13 17:33:19 +08:00
1be5e5eae5 ci: fix incorrect paths in the build system test
The working directory when the test runs is not $IDF_PATH, it is
the directory of the template project.
2022-09-13 10:23:07 +02:00
0e8c7284ce build: fix excluded components being passed to component manager
`__COMPONENT_TARGETS` is evaluated very early when components and
component directories are added to the build, which means that all
components (including the ones which are in EXCLUDE_COMPONENTS) have
a build system target defined. The component manager was given the
list of all known components (derived from the list of targets), not
the list of components after EXCLUDE_COMPONENTS were processed.
Because of that, EXCLUDE_COMPONENTS didn't effectively exclude the
component from the consideration of the component manager.
2022-09-13 10:05:59 +02:00
3b03bee2a4 Merge branch 'test/add_adc_wifi_test_thresh_on_v4.4' into 'release/v4.4'
test: added adc wifi test thresh for esp32, s2, c3, s3 on v4.4

See merge request espressif/esp-idf!20116
2022-09-13 14:50:00 +08:00
2488281d17 test: added adc wifi test thresh for esp32, s2, c3, s3 on v4.4
Due to unit test, we can't specify runners, for adc related tests.
Whereas adc tests are easily influenced by board hw condition, e.g.
pullup/down value.
This commit increases the thresh to 200mV.
2022-09-13 11:56:37 +08:00
95b4553026 Merge branch 'docs/update_ulp_shift_ops_description_v4.4' into 'release/v4.4'
docs: Updated description of ULP FSM shift operations (v4.4)

See merge request espressif/esp-idf!20101
2022-09-13 09:20:40 +08:00
3301606cdf tools: update bundled root certificate in idf_tools.py
dl.espressif.com is now using the same root certificate as github.com.
This commit replaces the previously-used ISRG X1 root certificate
with the DigiCert Root CA certificate.
As a result, even if the certificates are not installed (as it happens
on macOS with python.org installers, if the user forgets to run
'Install Certificates.command'), the download is successful.

Related to https://github.com/espressif/esp-idf/issues/4081
2022-09-12 18:09:24 +02:00
c5a2315f5a Merge branch 'feature/update-gcc-toolchain-to-esp-2021r2-patch4-8.4.0' into 'release/v4.4'
tools: update GCC-toolchain version to esp-2021r2-patch4 for IDF-v4.4

See merge request espressif/esp-idf!20051
2022-09-12 21:52:01 +08:00
00077545bf tools: Update GCC toolchain to esp-2021r2-patch4 version. Includes GCC 8.4.0, Newlib 3.3.0
Closes https://github.com/espressif/esp-idf/issues/7857
Closes https://github.com/espressif/esp-idf/issues/6004
Closes https://github.com/espressif/esp-idf/issues/6124
Closes https://github.com/espressif/esp-idf/issues/9396
2022-09-12 19:28:37 +07:00
da0cfb806a system: add missing header
Because we got rid of the including core-isa.h in newlib's config.h (8a3197a2a9a42dd99605cf8cc1e0f2d3c976c58c)
2022-09-12 19:26:42 +07:00
faa368a612 [tcp_transport] Fix initialition of transport
- Foundation was initialized only for SSL.
- Removed base from list.
- Changed SSL and TCP initialition.
- Clean of state data structures.
2022-09-12 11:49:25 +02:00
320f17550a docs: Updated description of ULP FSM shift operations
This commit updates the documentation for ULP FSM LSH and RSH
operations.

Closes https://github.com/espressif/esp-idf/issues/8831
2022-09-12 10:33:20 +02:00
12369a5faf Merge branch 'bugfix/reserve_dma_ram_in_segments_v4.4' into 'release/v4.4'
psram: reserve dma pool in the step of heap max block (v4.4)

See merge request espressif/esp-idf!18858
2022-09-11 02:49:39 +08:00
f9a630b967 Merge branch 'bugfix/calib_i2c_clk_v4.4' into 'release/v4.4'
I2C: Make I2C clock frequency accurate(backport v4.4)

See merge request espressif/esp-idf!19069
2022-09-11 02:44:26 +08:00
224871784b Merge branch 'bugfix/fix_ble_get_cur_pkt_num_crash_sometimes_when_bluetooth_is_disconnecting_v4.4' into 'release/v4.4'
Fixed calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting (backport v4.4)

See merge request espressif/esp-idf!20042
2022-09-09 21:05:52 +08:00
8e6af17ee5 Merge branch 'bugfix/fix_some_ble_bugs_on_esp32c3_and_esp32s3_v4.4' into 'release/v4.4'
Fixed some BLE controller bugs on ESP32-C3 and ESP32-S3 (backport v4.4)

See merge request espressif/esp-idf!19988
2022-09-09 19:39:57 +08:00
ef5a87ea20 Merge branch 'bugfix/mdns_add_service_fail_if_nohostname' into 'release/v4.4'
mdns: Fix add_service() to report error if no-hostname

See merge request espressif/esp-idf!19679
2022-09-09 18:38:31 +08:00
742c7f9672 Merge branch 'fix/DOC_3566_v4.4' into 'release/v4.4'
Updating doc for the issue doc_3566 (v4.4)

See merge request espressif/esp-idf!20061
2022-09-09 17:43:57 +08:00
4c4799ac49 bt:Fixed sink not being able to output mono audio because it can only decode dual channel audio data 2022-09-09 17:31:04 +08:00
a44071ab14 updating doc for the issue doc_3566 2022-09-09 10:40:44 +05:30
28d7eb44b9 Merge branch 'feature/update_tool_version_with_checksum_file_v4.4' into 'release/v4.4'
tools: Add tool's versions update with checksum file (v4.4)

See merge request espressif/esp-idf!19956
2022-09-09 00:34:07 +08:00
964fcc7062 Merge branch 'bugfix/test_ethernet_throughput_basic_v4.4' into 'release/v4.4'
Bugfix/test ethernet throughput basic (v4.4)

See merge request espressif/esp-idf!19563
2022-09-08 20:50:41 +08:00
6ece53adaa Merge branch 'bugfix/iperf_py_script_upt_v4.4' into 'release/v4.4'
ci iperf: fixed condition for waiting to iperf server is up in DUT (v4.4)

See merge request espressif/esp-idf!19815
2022-09-08 19:56:21 +08:00
c0c1485dc4 Add QA test Functions 2022-09-08 17:55:54 +08:00
zwj
4bf2eb3f48 fix calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting 2022-09-08 17:54:43 +08:00
67ff43c2c7 Merge branch 'bugfix/wrong_bpp_for_rgb666_v4.4' into 'release/v4.4'
lcd: fix wrong bpp size of rgb666 format (v4.4)

See merge request espressif/esp-idf!20032
2022-09-08 17:34:40 +08:00
de1e58118d Merge branch 'bugfix/fix_init_memory_leak_issue_v4.4' into 'release/v4.4'
esp_wifi: done beacon monitor timer when call pm deattach.(Backport v4.4)

See merge request espressif/esp-idf!19937
2022-09-08 17:02:33 +08:00
151b957238 lcd: fix wrong bpp size of rgb666 format
Closes https://github.com/espressif/esp-idf/issues/9729
2022-09-08 13:22:16 +08:00
722282e30b tools: add standard triplets for macos 2022-09-08 11:17:02 +07:00
1edf376060 Tools: fix architecture armhf/armel detection 2022-09-08 11:17:02 +07:00
7d010d36c8 tools: Add tool's versions update with checksum file
'idf_tools.py add-version' has new options:
--override            Override tool versions with new data
--checksum-file       URL or path to local file with checksum/size for artifacts

Usage e.g.:
CHECKSUM_URL=https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/crosstool-NG-esp-2021r2-checksum.sha256
idf_tools.py add-version --tool xtensa-esp32-elf --version esp-2021r2 --override --checksum-file $CHECKSUM_URL

Positional argument 'files' moved to optional argument '--artifact-file'

Add tests for add-version logic
2022-09-08 11:17:02 +07:00
ec78f2546f Tools: idf_tools.py prints URL before starting the download
This helps users with poor Internet connection to be able to cancel the
download and download it in another way.

Closes https://github.com/espressif/esp-idf/issues/8625
2022-09-08 11:17:02 +07:00
a3ab8da720 tools: just extract download() method 2022-09-08 10:34:17 +07:00
89c55f954a Merge branch 'fix/test_app_ide_integration_v4.4' into 'release/v4.4'
Tools: Increase the delay before producing exception in the Monitor IDE test app (v4.4)

See merge request espressif/esp-idf!20013
2022-09-07 22:22:35 +08:00
fcfef95fa7 Nimble: Enable ANS service by default in nimble examples 2022-09-07 17:22:37 +05:30
ce1e8350b4 SPI: Fixed Quad SPI wrong dummy cycle issue on ESP32C3/ESP32S3 and put get-command/dummy-bits functions in spi_ll.h 2022-09-07 18:55:38 +08:00
194d3c665d Tools: Increase the delay before producing exception in the Monitor IDE test app 2022-09-07 12:04:39 +02:00
zwj
c1e54ac0fa Update ESP32-C3 and ESP32-S3 BLE lib
- Fixed the performance issue of BLE sync scan in coexistence scenario when PLL track is enabledFixed the usage of PLL track related baseband IRQs
 - Fixed connect failed due to error sync found signal
 - Fixed BLE disconnect failed due to terminate_ind have sent but no ACK is received
 - Added ADV mode error check in ADV rx isr handler function
 - Fixed BLE RAL_UNDERRUN and TX_CRYPT_ERR assert
 - Disable scan continue
 - Fixed scan forever if scan continue is disable
2022-09-07 12:33:33 +08:00
6e6c8135d5 Merge branch 'bugfix/remove_bt_dft_init_semicolon_v4.4' into 'release/v4.4'
bt: Remove trailing semicolon from bt dft initializer(v4.4)

See merge request espressif/esp-idf!19914
2022-09-07 12:00:32 +08:00
2c8d6a4954 Merge branch 'bugfix/deadlock_after_call_esp_bluedroid_disable_v4.4' into 'release/v4.4'
bt:Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable()(v4.4)

See merge request espressif/esp-idf!19951
2022-09-07 11:55:15 +08:00
16459d0d42 soc: support placing task stacks in external memory for S2 and S3 2022-09-07 11:46:56 +08:00
6c4400132e Merge branch 'update_expat_R_2_4_8' into 'release/v4.4'
expat: Update expat library to R_2_4_8 release

See merge request espressif/esp-idf!19962
2022-09-06 22:50:06 +08:00
e3c1fde6c4 Merge branch 'bugfix/driver_rs485_fix_test_sync_issues_v44' into 'release/v4.4'
driver: uart rs485 fix test sync issues and fail threshold (backport v4.4)

See merge request espressif/esp-idf!19610
2022-09-06 17:23:46 +08:00
7d8636ce0a driver: uart rs485 fix test sync issues and fail threshold (backport v4.4) 2022-09-06 17:23:46 +08:00
bb0a13944f expat: Update expat library to R_2_4_8 release
Detailed changelog: https://github.com/libexpat/libexpat/blob/R_2_4_8/expat/Changes
2022-09-06 14:00:01 +05:30
1d51f93473 Docs: Update CN trans for nvs_flash.rst 2022-09-06 10:17:58 +02:00
87ff108235 doc (nvs): added note about maximum possible namespaces 2022-09-06 10:17:58 +02:00
78d7844b01 system: fix SET_STACK macro crashing in windowoverflow8 exception
If a windowoverflow8 happened after changing the SP, the exception handler would look for
the extra save area by looking at the previous frame's SP. This SP would be a garbage value
and could cause the windowoverflow exception to write to invalid memory ares.
2022-09-06 15:54:57 +08:00
6d7877fcb8 Merge branch 'bugfix/remove_redef_s3_cpu_macro' into 'release/v4.4'
soc: delete obsolete soc/cpu.h for S3 (v4.4)

See merge request espressif/esp-idf!19900
2022-09-05 16:26:33 +08:00
a825bfdebb Merge branch 'docs/reorder_mem_alloc_content_v4.4' into 'release/v4.4'
docs: reorder content in mem_alloc section (v4.4)

See merge request espressif/esp-idf!19949
2022-09-05 16:04:30 +08:00
55039da3e5 Merge branch 'bugfix/bootloader_assert_v4.4' into 'release/v4.4'
bootloader: dont print assert msg if CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is set (v4.4)

See merge request espressif/esp-idf!19943
2022-09-05 15:47:15 +08:00
d0c19a0e74 Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable()
Closes https://github.com/espressif/esp-idf/issues/9672
2022-09-05 14:23:16 +08:00
22b13112b6 docs: reorder content in mem_alloc section
We should avoid hiding sections between long lists of API documentation.
2022-09-05 13:46:08 +08:00
2b706909e1 Merge branch 'bugfix/s3_gpio48_hold_v4.4' into 'release/v4.4'
gpio: Fix ESP32S3 GPIO48 does not support hold function bug (backport v4.4)

See merge request espressif/esp-idf!19933
2022-09-05 13:32:07 +08:00
518af54ded bootloader: dont print assert msg if CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is set
Closes https://github.com/espressif/esp-idf/pull/7518
2022-09-05 12:31:31 +08:00
9c7046375f gpio: Fix ESP32S3 GPIO48 does not support hold function bug
GPIO_HOLD_MASK array was missing the last item
2022-09-05 03:47:43 +00:00
db00e4a8c2 esp_wifi: done beacon monitor timer when call pm deattach.
1. done beacon monitor timer when call pm deattach.
2. fix pairwise cipher tkip pmf compability issue.
2022-09-03 21:10:46 +08:00
ed5aea2955 Merge branch 'bugfix/fix_calling_cb_func_before_perform_v4.4' into 'release/v4.4'
esp_https_ota: fix bug where `http_client_init_cb` is called after esp_http_client_perform() (v4.4)

See merge request espressif/esp-idf!19931
2022-09-03 01:07:51 +08:00
42756f7eff esp_https_ota: fix bug where http_client_init_cb is called after esp_http_client_perform() instead of before.
Closes https://github.com/espressif/esp-idf/issues/9581
2022-09-02 16:15:50 +05:30
f6a7962a06 Merge branch 'bugfix/temp_sensor_value' into 'release/v4.4'
temperature_sensor: Fix issue that value is not accurate on ESP32-S3(v4.4)

See merge request espressif/esp-idf!19922
2022-09-02 17:56:49 +08:00
f2ac141ebf temperature_sensor: Fix issue that value is not accurate on ESP32-S3 2022-09-02 16:03:39 +08:00
d0ba3fd63e Merge branch 'bugfix/propogate_isr_allocation_failure_v4.4' into 'release/v4.4'
Fix MCPWM multiplication overflow (v4.4)

See merge request espressif/esp-idf!19891
2022-09-02 10:00:00 +08:00
c16eb81c5f Merge branch 'bugfix/miniz_header_doc_v4.4' into 'release/v4.4'
esp-rom: fixed error in miniz header documention for tdefl_init (v4.4)

See merge request espressif/esp-idf!19910
2022-09-02 09:54:24 +08:00
66dfcd72d2 Merge branch 'docs/malloc_header_v4.4' into 'release/v4.4'
heap: remove misleading info about malloc being equivalent to heap_caps_malloc(p, MALLOC_CAP_8BIT) (v4.4)

See merge request espressif/esp-idf!19896
2022-09-02 09:12:07 +08:00
a1e6041777 Remove trailing semicolon from bt dft initializer
Similar to espressif#6554
2022-09-01 20:33:36 +08:00
92d018f4f1 esp-rom: fixed error in miniz header documention for tdefl_init
Closes https://github.com/espressif/esp-idf/issues/8435
2022-09-01 18:14:24 +08:00
f8bea48cad soc: delete obsolete soc/cpu.h for S3
This file has been moved to esp_hw_support/, but it seems like we forgot to
delete the old one in soc/ for ESP32S3.
2022-09-01 15:09:16 +08:00
b6248014b9 heap: remove misleading info about malloc being equivalent to heap_caps_malloc(p, MALLOC_CAP_8BIT)
The actual memory allocated for malloc() depends on a lot of factors, see heap_caps_malloc_default()

Closes https://github.com/espressif/esp-idf/issues/7659
2022-09-01 14:33:03 +08:00
ca831bbd63 mcpwm: fix multiplication overflow in converting us to compare ticks
Closes https://github.com/espressif/esp-idf/issues/9648
2022-09-01 05:11:23 +00:00
645d5641dd timer: propagate isr register failure
Closes https://github.com/espressif/esp-idf/issues/9651
2022-09-01 05:11:23 +00:00
836f9875b1 Merge branch 'bugfix/ble_disconnect_enable_light_sleep_and_bb_pd_v4.4' into 'release/v4.4'
bt: Fixed bluetooth disconnection issue when light sleep and baseband power down are enabled (v4.4)

See merge request espressif/esp-idf!19803
2022-09-01 11:33:22 +08:00
b059440b83 Merge branch 'docs/update_jtag_select_efuse_desc_4.4' into 'release/v4.4'
Docs: update the JTAG select eFuse description in configure-other-jtag.rst (backport v4.4)

See merge request espressif/esp-idf!19801
2022-08-30 11:06:57 +08:00
7cb9629590 Docs: update the JTAG select eFuse description in configure-other-jtag.rst (backport v4.4) 2022-08-30 11:06:57 +08:00
a3da33c813 Merge branch 'contrib/github_pr_9563_v4.4' into 'release/v4.4'
Add git-lfs to docker container (GitHub PR) (v4.4)

See merge request espressif/esp-idf!19653
2022-08-29 22:48:36 +08:00
22b222b762 I2C: Make I2C clock frequency accurate 2022-08-29 09:07:30 +00:00
1fdfe449e3 Merge branch 'bugfix/fix_rtc_gpio_hold_v4.4' into 'release/v4.4'
gpio: Fix missing set hold bit in rtc gpio register (v4.4)

See merge request espressif/esp-idf!19821
2022-08-29 13:53:57 +08:00
bff89fd71b added missing call to set hold register bit
This commit fixes gpio_hold_en(pin) function for ESP32, where after wakeup from deep sleep, the pin gets reset to default state and stop holding the pin level.
2022-08-29 10:18:09 +08:00
526cd8c219 ci iperf: fixed condition for waiting to iperf server is up in DUT 2022-08-26 15:58:00 +02:00
5852e93eba Fix bluetooth disconnection issue when light sleep and baseband power down are enabled 2022-08-26 16:03:57 +08:00
55a2b55bdb heap: Add test to check that the corruption of free memory is detected
This commit extends the heap test set by adding a test to check corruption
detection in free memory block.

For each byte of the free block memory, the test changes the value of the byte,
call multi_heap_check(), make sure that the function returns 'corruption detected'
only when comprehensive poisoning is set, restore the good value of the byte, calls
multi_heap_check() again and make sure that it returns 'OK'.
2022-08-26 07:51:29 +02:00
6536e51a32 heap: Provide tlsf_check_hook() mechanism to check for memory corruption
Add a call to tlsf_check_hook() in tlsf_check() that calls
multi_heap_internal_check_block_poisoning() and check the memory
of every free blocks when heap poisoning is active.
2022-08-26 07:51:22 +02:00
e6fda46a02 Merge branch 's3_sysview_irq_names_v4.4' into 'release/v4.4'
Fix ESP32-S3 interrupt names used by SystemView (v4.4)

See merge request espressif/esp-idf!19676
2022-08-25 18:53:04 +08:00
2e26fbf56c Add git-lfs to docker container 2022-08-25 08:34:59 +00:00
41839b69bd Merge branch 'bugfix/fix_ble_sch_arb_assert_v4.4' into 'release/v4.4'
Fixed BLE sch_arb assert on ESP32-C3 and ESP32-S3(backport v4.4)

See merge request espressif/esp-idf!19733
2022-08-25 13:44:20 +08:00
696760668a Nimble: Fixed memory corruption introduced in reconnection attempt code 2022-08-25 04:54:02 +00:00
134170a6fc Merge branch 'contrib/github_pr_9529_mr_v4.4' into 'release/v4.4'
bt:No need to use local copy of btc_msg_t in btc_transfer_context, create it on heap and pass to osi_thread_post()(v4.4)

See merge request espressif/esp-idf!19692
2022-08-25 10:44:43 +08:00
5927bc2227 Merge branch 'bugfix/freertos_eventgroup_test_flakiness_v4.4' into 'release/v4.4'
freertos: Fix flakey event group unit tests (v4.4)

See merge request espressif/esp-idf!19528
2022-08-24 19:08:55 +08:00
5b1bedec2a Merge branch 'bugfix/remove_remaining_rom_time_t_dependencies_v4.4' into 'release/v4.4'
Newlib: Add workaround for ROM Newlib stdio functions using 32-bit time_t callpath (v4.4)

See merge request espressif/esp-idf!19684
2022-08-24 17:07:46 +08:00
72313054ad Merge branch 'bugfix/nvs_part_ptr_wrong_init_4.4' into 'release/v4.4'
bugfix (nvs_flash): Fix nvs_flash_init_partition_ptr (backport v4.4)

See merge request espressif/esp-idf!18672
2022-08-24 17:06:53 +08:00
954299a063 Merge branch 'bugfix/wps_connection_issue_v4.4' into 'release/v4.4'
wpa_supplicant: Fix WPS connection issue after WPS done (v4.4)

See merge request espressif/esp-idf!19720
2022-08-24 14:07:27 +08:00
ac043bfc91 Merge branch 'bugfix/gpio_wakeup_docs_v4.4' into 'release/v4.4'
docs: fix documentation wrongly stating ESP_SLEEP_WAKEUP_GPIO is light sleep only (v4.4)

See merge request espressif/esp-idf!19740
2022-08-24 13:25:55 +08:00
228737d978 docs: fix documentation wrongly stating ESP_SLEEP_WAKEUP_GPIO is light sleep only
ESP_SLEEP_WAKEUP_GPIO is also a valid deep sleep wakeup cause on targets
with SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP

Closes https://github.com/espressif/esp-idf/issues/9567
2022-08-24 10:50:59 +08:00
e87caa8d75 Merge branch 'bugfix/ble_mesh_console_support_nimble_host_for_v4.4' into 'release/v4.4'
ble_mesh:ble mesh console support nimble(v4.4)

See merge request espressif/esp-idf!19604
2022-08-24 10:27:13 +08:00
300a4a16a5 Merge branch 'bugfix/add_signature_in_image_len_v4.4' into 'release/v4.4'
bootloader_support: consider signature sector in image length validation (v4.4)

See merge request espressif/esp-idf!19484
2022-08-23 20:19:52 +08:00
zwj
ad510c5099 Update BLE lib for ESP32-C3 and ESP32-S3
- update ble tx power level mapping
- Fixed ble sch_arb assert
2022-08-23 19:49:50 +08:00
zwj
fc4ffd144a fix extend adv set remove failed 2022-08-23 19:49:40 +08:00
bfc927e258 Merge branch 'fix/fix_esp_rsa_sign_alt_modifying_input_params_v4.4' into 'release/v4.4'
esp_rsa_sign_alt: Fix esp_init_ds_data_ctx API to not modify user defined data... (v4.4)

See merge request espressif/esp-idf!19714
2022-08-23 19:05:22 +08:00
606ada809a esp_rsa_sign_alt: Fix esp_init_ds_data_ctx API to not modify user defined data when it is given directory from flash 2022-08-23 13:27:03 +05:30
4d9c4fd7e1 wpa_supplicant: Fix WPS connection issue after WPS done
esp_wifi_disconnect is needed to clear the wifi state and enable
station to connect to new SSID. Add changes to call it after
WPS is done.
2022-08-23 13:09:32 +05:30
23d5a582cb Merge branch 'bugfix/fix_rtc_clock_freq_value_macro_v4.4' into 'release/v4.4'
rtc_clk: Fix wrong RC_FAST and RC_SLOW clock frequency values on ESP32C3 and ESP32S3

See merge request espressif/esp-idf!19665
2022-08-22 15:54:32 +08:00
810667fc1e update code to use osi_free() 2022-08-22 15:40:48 +08:00
879466e0cb local copy of btc_msg_t
No need to use local copy of btc_msg_t in btc_transfer_context, create it on heap and pass to osi_thread_post().
2022-08-22 15:40:42 +08:00
a45fcce631 newlib: Add workaround for printf functions using 32-bit time_t on first call
sizeof(time_t) was previously switched from 4 to 8, ROM functions that use
time_t or dependent types (such as "struct stat") are no longer called due as
they still treat sizeof(time_t) as 4 (see commit
24c20d18).

However, there is a ROM callpath that was left out. If putchar is the first
stdio print related call, the call path will result in cantwrite() ->
__swsetup_r() -> __smakebuf_r() -> __swhatbuf_r() using the ROM "struct stat"
(where sizeof(time_t)==4).

Instead of removing all printf related ROM newlib functions (which will result
in increased binary size), this commit adds a workaround to setup the stdio
files before any print related calls occur.

This results in cantwrite() always returning false, thus the callpath described
above never being reached.

Closes https://github.com/espressif/esp-idf/issues/9269
2022-08-22 11:56:51 +08:00
2bce0a19f6 Merge branch 'bugfix/fix_esp32_psram_cs_hold_time_issue_when_under_80m_v4.4' into 'release/v4.4'
esp_psram: fix esp32 psram cs hold time issue when under 40m (v4.4)

See merge request espressif/esp-idf!19648
2022-08-21 15:10:57 +08:00
f3ddf105a4 Merge branch 'bugfix/fix_disassembler_interpreting_padding_v4.4' into 'release/v4.4'
(Xtensa) Build: add .xt.prop and .xt.lit to the compiled ELF file (backport v4.4)

See merge request espressif/esp-idf!19609
2022-08-20 03:49:58 +08:00
bd0ec74c2e mdns: Fix add_service() to report error if no-hostname 2022-08-19 18:41:38 +02:00
350dd3798e bugfix (nvs_flash): Fix nvs_flash_init_partition_ptr
Added unit test case.

Closes https://github.com/espressif/esp-idf/pull/8755

Signed-off-by: Jakob Hasse <jakob.hasse@espressif.com>
2022-08-19 16:13:10 +02:00
0b0ca31386 Merge branch 'contrib/github_pr_9497_v4.4' into 'release/v4.4'
Move xSemaphoreGive out of configASSERT (GitHub PR) (v4.4)

See merge request espressif/esp-idf!19536
2022-08-19 21:06:43 +08:00
eebbc181e8 Merge branch 'staging/add_idf_as_lib_to_ci_v4.4' into 'release/v4.4'
CI: idf_as_lib is now run on all suported targets (backport v4.4)

See merge request espressif/esp-idf!19618
2022-08-19 21:05:49 +08:00
4bb3ebd6e5 Merge branch 'bugfix/update-doc-freertos-task-header_v4.4' into 'release/v4.4'
freertos: Update the documentation of the ulBitsToClearOnEntry parameter (v4.4)

See merge request espressif/esp-idf!19661
2022-08-19 21:04:47 +08:00
0784fd086a esp32s3: fix interrupt names used by SystemView 2022-08-19 14:42:45 +02:00
5245c53d7a replace CAN with TWAI in the esp_isr_names table 2022-08-19 14:39:37 +02:00
4851e0b9ca Merge branch 'bugfix/hfp_examples_not_work_with_default_sdkconfig_v4.4' into 'release/v4.4'
bugfix/set default number of sco connection to 1 (v4.4)

See merge request espressif/esp-idf!19587
2022-08-19 20:32:56 +08:00
c6aa0928ab freertos: Update the docuementation of the ulBitsToClearOnEntry parameter in xTaskGenericNotifyWait() function.
Closes https://github.com/espressif/esp-idf/issues/7207

The description of how the xTaskGenericNotifyWait parameter is handled in the
xTaskGenericNotifyWait() function was inaccurate.

In this commit, the description was updated to match the implementation of xTaskGenericNotifyWait().
2022-08-19 08:04:12 +02:00
b2f4fc022a rtc_clk: Fix wrong RC_FAST and RC_SLOW clock frequency values on ESP32C3 and ESP32S3 2022-08-19 12:21:11 +08:00
d08be42a53 esp_psram: fixed 40mhz cs signal glitch issue 2022-08-18 20:33:12 +08:00
91e6b5de70 Merge branch 'feature/sae_sta_h2e_v4.4' into 'release/v4.4'
esp_wifi: WPA3 SAE H2E support for station (backport v4.4)

See merge request espressif/esp-idf!18634
2022-08-18 17:56:31 +08:00
b5d2ee7ed4 CI: idf_as_lib is now run on all suported targets 2022-08-18 12:07:19 +08:00
756b46ca96 esp_wifi: WPA3 SAE H2E support for station
Mandate sta threshold wpa3 for ssid after receiving transition disable
bit from AP
2022-08-18 02:55:51 +05:30
3154abc66e (Xtensa) Build: add .xt.prop and .xt.lit to the compiled ELF file
Adding prop and lit sections to the ELF will let the debugger and the disassembler
have more info about data bytes present in the middle of the Xtensa
instructions, usually used for padding.
2022-08-17 14:58:36 +08:00
d2eb652738 ble_mesh:ble mesh console support nimble 2022-08-17 14:34:04 +08:00
d88544fd05 Fixed the failure of 'connect audio' operation in HFP examples with default SDK configuration
Due to the lack of synchronized connections, the hf_client can not create audio_connection to
hf_ag. Set default number of synchronized connection to 1.

Closes https://github.com/espressif/esp-idf/issues/9537
2022-08-17 10:14:50 +08:00
4c550fd79f Merge branch 'fix/install.ps1.v4.4' into 'release/v4.4'
Tools: Remove undefined variable from install.ps1 (v4.4)

See merge request espressif/esp-idf!19583
2022-08-16 22:19:41 +08:00
a1f0381797 Tools: Remove undefined variable from install.ps1
Closes https://github.com/espressif/esp-idf/issues/9556
2022-08-16 12:14:43 +02:00
06ca9b6427 Merge branch 'bugfix/incorrect_base_addr_for_rtcio_on_esp32s3_v4.4' into 'release/v4.4'
rtci2c: Corrected the register base addr reference for RTC I2C on esp32s3 (v4.4)

See merge request espressif/esp-idf!19559
2022-08-16 10:51:06 +08:00
d9dda477b0 eth_iperf_test: improved regex to properly evaluate IP address 2022-08-15 16:07:33 +02:00
6dcb5bd1d3 rtci2c: Corrected the register base addr reference for RTC I2C on esp32s3
This commit corrects the register base address reference for RTC I2C on
esp32s3.
2022-08-15 14:50:14 +02:00
047d75eee5 rename xHoldSemaphore to result 2022-08-12 17:54:34 +08:00
d96121221d Move xSemaphoreGive out of configASSERT
xSemaphoreGive won't be executed in configASSERT and semaphore will stay locked if NDEBUG (idf v5) or CONFIG_FREERTOS_ASSERT_DISABLE (idf v3, v4) are defined.
2022-08-12 17:54:29 +08:00
b867b52770 freertos: Fix flakey event group unit tests
The event group unit tests would previously use a single call bit (the
"BIT_CALL" macro) to unblock all the test tasks. However, if one or more tasks
were delayed in calling xEventGroupWaitBits(), the other tasks would clear the
test bits, leading to the test deadlocking.

This commit updates the bits used so that each task gets their own CALL and
RESPONSE bits.
2022-08-12 16:54:59 +08:00
9d97b7ba50 Merge branch 'bugfix/bt_invalid_workqueue_num_v4.4' into 'release/v4.4'
Bluetooth:fixed the invalid workqueue number for BTU thread in Bluedroid(backport v4.4)

See merge request espressif/esp-idf!19510
2022-08-12 14:02:20 +08:00
34fbb676c7 Merge branch 'feature/optimize_chips_memory_allocation_backport_v4.4' into 'release/v4.4'
system: Optimize chips bootloader and heap memory allocation(backport v4.4)

See merge request espressif/esp-idf!19472
2022-08-12 11:19:06 +08:00
805b6af65d Merge branch 'bugfix/wifi_bt_use_same_clock_source_v4.4' into 'release/v4.4'
Fix Wi-Fi does not know that Bluetooth has modified the lpclk source(v4.4)

See merge request espressif/esp-idf!19408
2022-08-12 11:05:43 +08:00
59fed9597d Merge branch 'bugfix/remove_repeated_kconfig_for_h2' into 'release/v4.4'
esp32h2/kconfig: remove repeated kconfig

See merge request espressif/esp-idf!19507
2022-08-11 20:16:22 +08:00
48be2350a8 Merge branch 'bugfix/mesh_bqb_test_issues_v4.4' into 'release/v4.4'
ble_mesh: stack: Fix mesh v1.0 BQB test issues(v4.4)

See merge request espressif/esp-idf!19502
2022-08-11 20:10:05 +08:00
002581806a Merge branch 'ci/fix_nightly_run_build_jobs_v4.4' into 'release/v4.4'
ci: build all when has env var NIGHTLY_RUN (v4.4)

See merge request espressif/esp-idf!18947
2022-08-11 16:55:41 +08:00
9aa32bc499 components/bt: fixed the invalid workqueue number for BTU thread in Bluedroid
There should be only one workqueue for BTU task. The queue length for the second workqueue of BTU can be uninitialized and caused memory overflow and corruption.

Closes https://github.com/espressif/esp-idf/issues/9507
2022-08-11 16:17:17 +08:00
6368633102 esp32h2/kconfig: remove repeated kconfig 2022-08-11 15:05:12 +08:00
a426f4727d ble_mesh: stack: Fix kr from non-primary subnet shouldn't ignore
For case MESH/NODE/KR/BV-02-C
2022-08-11 14:14:02 +08:00
3413b3d469 ble_mesh: stack: Add a check if the appkey is bound to the model.
For case MESH/NODE/CFG/MP/BI-03-C
2022-08-11 14:13:56 +08:00
89bc1bc7e3 ble_mesh: stack: the count_log field should be set to 0 when HBS is sent.
For MESH/NODE/CFG/HBS/BV-02-C
2022-08-11 14:13:49 +08:00
246ed6232f ble_mesh: stack: The Heartbeat Publication Period Log value can set to 0x11, range: [0, 0x11] 2022-08-11 14:13:42 +08:00
104ce885cb ble_mesh: stack: The value of expect_ack_for will be rewrited after send_pub_key().
For case MESH/PVNR/PROV/BV-04-C
2022-08-11 14:13:35 +08:00
28e4ceb7e1 ble_mesh: stack: Fix ignore connectable PB-ADV PDU containing a Link Open message.
For case MESH/NODE/PBADV/BI-04-C
2022-08-11 14:13:27 +08:00
f12c79c3ca ble_mesh: stack: Fix PB-GATT not check invalid link flag
For case MESH/NODE/PROV/BI-03-C
2022-08-11 14:11:32 +08:00
d31337c095 ble_mesh: stack: Fix invalid provisioning pdu type check
For case MESH/NODE/PROV/BI-15-C
2022-08-11 14:11:16 +08:00
4bf8f462a2 Merge branch 'opt/bluedroid_adv_report_datapath_v4.4' into 'release/v4.4'
Bluetooth/Bluedroid: optimize BLE adv report datapath and adv report flow control mechanism(backport v4.4)

See merge request espressif/esp-idf!19381
2022-08-11 11:20:42 +08:00
32e7672926 Merge branch 'contrib/github_pr_9498_backport4_4' into 'release/v4.4'
Bluetooth/Bluedroid: fix member typo(backport v4.4)

See merge request espressif/esp-idf!19458
2022-08-11 10:54:45 +08:00
6c2afe05cf Merge branch 'bugfix/disable_rom_lgo_v4.4' into 'release/v4.4'
system: moved placement of disable rom log efuse in startup flow (v4.4)

See merge request espressif/esp-idf!19482
2022-08-11 09:18:50 +08:00
80d6e39edc Merge branch 'staging/fix_heap_fail_callback_v4.4' into 'release/v4.4'
Heap: heap_caps_*_prefer functions now properly call alloc_failed callback (backport v4.4)

See merge request espressif/esp-idf!19481
2022-08-11 06:28:03 +08:00
3a54a55a80 Merge branch 'feature/oocd_ver_upgrade_v4.4' into 'release/v4.4'
tools: Updates OpenOCD version to 'v0.11.0-esp32-20220706' (v4.4)

See merge request espressif/esp-idf!19490
2022-08-10 21:28:32 +08:00
46868ddbb5 tools: Updates OpenOCD version to 'v0.11.0-esp32-20220706' 2022-08-10 13:00:06 +03:00
4fb74a808b Merge branch 'bugfix/friend_and_lpn_issues_v4.4' into 'release/v4.4'
ble_mesh: stack: Fix friend and lpn issues(v4.4)

See merge request espressif/esp-idf!19475
2022-08-10 13:50:52 +08:00
58d93a89af bootloader_support: consider signature sector in image length validation
For secure boot enabled cases, bootloader and firmware images have signature
appended and size is variable based on scheme being used. This appended data
must be considered while verifying image length against allocated partition
size to avoid any possibilities of going beyond reserved size.

Closes IDF-5617
2022-08-10 10:38:15 +05:30
a421e30cf2 system: moved placement of disable rom log efuse in startup flow
Functions used for burning this efuse would log, but at this point
esp_log is not initialized. Moved to a later point in the startup process.

Closes https://github.com/espressif/esp-idf/issues/9457
2022-08-10 12:17:51 +08:00
6906c34319 heap: add a unit test for malloc(0) and slightly optimize heap_caps_malloc_prefer 2022-08-10 11:41:01 +08:00
b43e777e0a fix malloc(0) and heap_caps_alloc_failed()
Don't call heap_caps_alloc_failed() for malloc(0) and calloc(0), because it is not an error.
Improve handling of malloc(0) and calloc(0).

Merges https://github.com/espressif/esp-idf/pull/9517
2022-08-10 11:40:53 +08:00
05575cc246 Heap: heap_caps_*_prefer functions now properly call alloc_failed callback
heap_caps_*_prefer functions will now only call heaps_caps_alloc_failed
callback if all attempts to allocation memory fail (and not after each attempt
anymore).

* Closes https://github.com/espressif/esp-idf/issues/9086
2022-08-10 11:40:32 +08:00
56a89b920d Merge branch 'bugfix/i2s_slot_sequence_v4.4' into 'release/v4.4'
i2s: fixed pdm rx sample rate doubled issue

See merge request espressif/esp-idf!19415
2022-08-10 11:10:37 +08:00
719f43d286 ci: build all when has env var NIGHTLY_RUN 2022-08-10 00:24:18 +00:00
ed418eaf06 Merge branch 'fix/python_flake_warnings_4.4' into 'release/v4.4'
Tools: Fix Python style warnings

See merge request espressif/esp-idf!19471
2022-08-10 02:57:22 +08:00
2eb28028ed ble_mesh: stack: Fix add continuously secure update into friend queue.
For MESH/NODE/FRND/FN/BV-20-C
2022-08-09 21:48:37 +08:00
d21a87f60c ble_mesh: stack: Fix friend relay lpn message when relay feature is disable
For MESH/NODE/FRND/FN/BV-23-C
2022-08-09 21:48:22 +08:00
1fb1d6ecde bugfix: malloc retention buffer with MALLOC_CAP_RETENTION caps 2022-08-09 20:56:59 +08:00
e3979eb14b bugfix: DCache data memory is dma accessible but not retention dma accessible 2022-08-09 20:56:51 +08:00
decb47bb5d use enum and designated initializers in soc_memory_type define 2022-08-09 20:54:01 +08:00
103b952525 ci: fix ci 2022-08-09 20:34:25 +08:00
9b7bed2243 Clean IRAM and DRAM address space conversion macros 2022-08-09 20:33:26 +08:00
f935c17a95 Tools: Fix Python style warnings 2022-08-09 14:30:52 +02:00
41bbc39669 stack/dram is also IRAM0 accessible 2022-08-09 20:28:29 +08:00
45a79bc135 update bootloader.ld rom_boot ram usage info 2022-08-09 20:28:04 +08:00
62ac5364e0 Use the entire sharedbuffer space as the heap of the D/IRAM attribute 2022-08-09 20:27:38 +08:00
d8432af3ab update bootloader memory allocation 2022-08-09 20:02:46 +08:00
53a5d51aea i2s: fix PDM TX stereo mode for c3 and s3 2022-08-09 18:28:09 +08:00
76cdab5f42 i2s: fixed pdm rx sample rate doubled issue
Closes: https://github.com/espressif/esp-idf/issues/8660
2022-08-09 18:28:09 +08:00
482a37612d i2s: fix 16bit slot sequence on esp32 2022-08-09 18:28:09 +08:00
fdf7029078 Fixed union member access typo
Closes https://github.com/espressif/esp-idf/pull/9498
2022-08-09 15:25:44 +08:00
4c6d2e0da7 bt member typo
Terminate sec_event.cfm_req.bd_name string, not sec_event.pin_req.bd_name
2022-08-09 15:25:24 +08:00
f8729d905e Merge branch 'feature/ulp_riscv_adc_v4.4' into 'release/v4.4'
ulp-riscv: add support for using ADC as well as an example show-casing it. (v4.4)

See merge request espressif/esp-idf!19058
2022-08-09 15:00:50 +08:00
22b847fc5f Merge branch 'bugfix/memory_region_define_rtc_fast_v4.4' into 'release/v4.4'
backport v4.4: substract rtc_iram_seg memory region size from ESP_BOOTLOADER_RESERVE_RTC

See merge request espressif/esp-idf!19423
2022-08-09 14:38:40 +08:00
a968442603 Merge branch 'bugfix/ringbuf_iram_fix_v4.4' into 'release/v4.4'
esp_ringbuf: placement in flash is no longer controlled by... (v4.4)

See merge request espressif/esp-idf!19165
2022-08-09 11:01:52 +08:00
b65ec8c7c9 Merge branch 'bugfix/several_i2C_issues' into 'release/v4.4'
I2C: Fix I2C task wait too long on an event (backport 4.4)

See merge request espressif/esp-idf!18768
2022-08-09 10:29:32 +08:00
f8f93d936e ulp-riscv: add support for using ADC as well as an example show-casing it. 2022-08-09 09:21:15 +08:00
00215f3414 Merge branch 'bugfix/restore_missing_ble_mesh_videos_v4.4' into 'release/v4.4'
ble_mesh: doc: Restore missing ble mesh videos(v4.4)

See merge request espressif/esp-idf!19403
2022-08-08 17:12:01 +08:00
a940064748 esp_ringbuf: placement in flash is no longer controlled by CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH
esp-ringbuf funtion placement is now controlled by its own configs:
CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH and CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH

Closes https://github.com/espressif/esp-idf/issues/9198
2022-08-08 07:15:00 +00:00
cb411a81a2 I2C: Fix a bug making the I2C task wait too long on an event
The I2C ISR will now notify the task waiting on an event. Thus, the task can stop waiting on the event queue as soon as possible.
2022-08-08 06:10:31 +00:00
12db32642c substract rtc_iram_seg memory region size from ESP_BOOTLOADER_RESERVE_RTC 2022-08-08 11:27:10 +08:00
11ac122c53 1. Wi-Fi: update tsf tick interval when lpclk is modified
2. Move register_lpclk_callback to coexistence
2022-08-05 12:57:47 +08:00
58811bec45 ble_mesh: doc: Restore missing ble mesh videos 2022-08-05 11:51:57 +08:00
970420a923 Power Management: fix the issue of sleeping time error beacause external 32kHz xtal does not exist 2022-08-05 11:30:36 +08:00
8f0c559c03 make bluetooth and wifi use the same low power clock 2022-08-05 11:22:22 +08:00
cf9309c8a2 ESP32S3:bluetooth support use main XTAL in light sleep mode 2022-08-05 11:21:59 +08:00
9332413407 ESP32C3:bluetooth support use main XTAL in light sleep mode 2022-08-05 11:21:58 +08:00
9fe854c4ca Merge branch 'bugfix/vendor_model_send_message_no_memory_forv4.4' into 'release/v4.4'
ble_mesh:example: free the memory of malloc (v4.4)

See merge request espressif/esp-idf!19185
2022-08-04 14:47:22 +08:00
d16797b447 Merge branch 'bugfix/further_fix_for_mspi_current_leakage_backport_v4.4' into 'release/v4.4'
system/sleep: further fix spi flash/ram current leakage(backport v4.4)

See merge request espressif/esp-idf!19212
2022-08-04 14:46:56 +08:00
d4507a380e Merge branch 'bugfix/corrected_typo_in_example_peripherals_usb_v4.4' into 'release/v4.4'
example: peripherals/usb: fix typo naming of local variables (backport v4.4)

See merge request espressif/esp-idf!19100
2022-08-04 14:46:44 +08:00
68dd89971e Merge branch 'bugfix/backtrace_formatting_add_missing_space_v4.4' into 'release/v4.4'
Reverts Backtrace: format to what it used to be (v4.4)

See merge request espressif/esp-idf!19123
2022-08-04 14:46:31 +08:00
46f5c59cc2 Merge branch 'bugfix/set_ipv6_dns_error_v4.4' into 'release/v4.4'
lw ip: Fixed that ipv6 dns cannot work (v4.4)

See merge request espressif/esp-idf!19062
2022-08-04 14:45:58 +08:00
905b3b1718 Merge branch 'bugfix/btdm_fix_some_bluedroid_issues_v4.4' into 'release/v4.4'
Fix some bluedroid issues(backport v4.4)

See merge request espressif/esp-idf!19130
2022-08-04 14:45:44 +08:00
0544069689 Merge branch 'bugfix/put_sempher_and_queue_used_in_isr_into_DRAM_v4.4' into 'release/v4.4'
Make sure semphr/queue used in interrupt is in DRAM

See merge request espressif/esp-idf!18988
2022-08-04 14:44:56 +08:00
d3eeebf8f8 Merge branch 'bugfix/fix_bluedroid_host_memory_overflow_v4.4' into 'release/v4.4'
Fixed bluedroid host memory overflow for v4.4

See merge request espressif/esp-idf!19060
2022-08-04 14:44:40 +08:00
869abf8a3f Merge branch 'bugfix/freertos_event_group_unblock_race_condition_v4.4' into 'release/v4.4'
FreeRTOS: Fix event group task list race condition (v4.4)

See merge request espressif/esp-idf!19103
2022-08-04 14:43:45 +08:00
9f9021a221 Merge branch 'bugfix/multiple_adc_bugfix_v4.4' into 'release/v4.4'
adc: fix multiple bugs (v4.4)

See merge request espressif/esp-idf!19142
2022-08-04 14:42:53 +08:00
bfb88338bb Merge branch 'bugfix/memory_debug_not_work_v4.4' into 'release/v4.4'
bugfix/fix the dependency error of macro for memory debug (v4.4)

See merge request espressif/esp-idf!19237
2022-08-04 14:42:12 +08:00
79a8ad665a Merge branch 'bugfix/memory_copy_bugs_in_bluedroid_4.4' into 'release/v4.4'
components_bt/bluedroid: Fix Memory Copy Build Err [backport v4.4]

See merge request espressif/esp-idf!19311
2022-08-04 14:41:58 +08:00
66a1de0843 Merge branch 'bugfix/fix_legacy_pair_not_send_link_key_host_v4.4' into 'release/v4.4'
component_bt: fix legacy pair controller does not send the link key to the host (v4.4)

See merge request espressif/esp-idf!19320
2022-08-04 14:41:45 +08:00
aa81e5bbbe Merge branch 'bugfix/fix_bt_sphinx_warnings_4.4' into 'release/v4.4'
components_bt: fix unstandard typedefs [backport v4.4]

See merge request espressif/esp-idf!19338
2022-08-04 14:41:28 +08:00
6770180781 Merge branch 'bugfix/fix_write_to_null_pointer_if_malloc_failed_issue_v4.4' into 'release/v4.4'
Bugfix/fix write to null pointer if malloc failed issue(Backport v4.4)

See merge request espressif/esp-idf!19352
2022-08-04 14:41:17 +08:00
40a8214314 Merge branch 'feature/esp_lcd_spi_rx_v4.4' into 'release/v4.4'
Add support SPI rx into LCD component (backport v4.4)

See merge request espressif/esp-idf!19122
2022-08-04 14:41:03 +08:00
824a5547b7 Merge branch 'feature/wifi_beacon_loss_optimize_v4.4' into 'release/v4.4'
backport v4.4: beacon loss and noise check timer optimize for wifi power save

See merge request espressif/esp-idf!19172
2022-08-04 14:23:14 +08:00
e4c5e5a701 sleep: beacon loss and noise check timer optimize for wifi power save 2022-08-04 12:11:39 +08:00
c0d04787ca Merge branch 'feature/rainmaker_BT_configurable_v4.4' into 'release/v4.4'
Wifi_prov_mgr: Made BT configurable after provisioning is completed (v4.4)

See merge request espressif/esp-idf!19263
2022-08-04 11:49:36 +08:00
6854841267 Merge branch 'contrib/github_pr_9446_v4.4' into 'release/v4.4'
Add missing comma (GitHub PR) (v4.4)

See merge request espressif/esp-idf!19307
2022-08-04 11:47:02 +08:00
b2770bd18e Merge branch 'tools/mfg_fix_blank_lines_csv_v4.4' into 'release/v4.4'
tools: Introduce support for blank lines in config and value files for mfg utility (v4.4)

See merge request espressif/esp-idf!19253
2022-08-03 22:49:14 +08:00
575d28e56c Merge branch 'contrib/github_pr_9408_v4.4' into 'release/v4.4'
nvs_partition_gen: Allow up to 4000 byte strings with NVS V2 (GitHub PR) (v4.4)

See merge request espressif/esp-idf!19306
2022-08-03 22:49:02 +08:00
8ed69bd03a Merge branch 'bugfix/s3_dfu_tool_v4.4' into 'release/v4.4'
dfu: add esp32s3 to supported DFU targets for idf.py (v4.4)

See merge request espressif/esp-idf!19166
2022-08-03 22:48:44 +08:00
e5a96aaca6 component/bt: use OSI utility "osi_event" for HCI downstream data processing 2022-08-03 21:55:08 +08:00
c6c4a23098 component/bt: consider to handle HCI LE Direct Advertising Report 2022-08-03 21:55:07 +08:00
6c0c837378 component/bt: allocate and use one static buffer for HCI adv flow control command 2022-08-03 21:55:06 +08:00
aaf1d3909d component/bt: use fixed_pkt_queue instead of fixed_queue for hci commands
some fixes after modifications:
  1. removed the use of waiting_command_t
  2. fix assert for HCI write_eir command
  3. fixed the crash upon handling command status event when trying to free to the HCI command buffer
  4. fixed the issue in transmitting HCI vendor specific commands
  5. fixed the lost command complete callbacks for HCI commands LE_RAND and LE_ENCRYPT
2022-08-03 21:55:05 +08:00
c3f5b85032 component/bt: add a timer to monitor the adv flow control credits downwards procedure 2022-08-03 21:55:04 +08:00
b735c46ba7 component/bt: fix adv report flow control logic, give ADV report credits every 10 packets 2022-08-03 21:55:03 +08:00
2ef0627c2c component/bt: add simple ADV flow control mechanism -- drop the packets when the adv report queues are considered full 2022-08-03 21:55:02 +08:00
dcf173c95a component/bt: use the OSI utility "osi_event" to handle adv report in btc_layer 2022-08-03 21:55:01 +08:00
c9ebba2ddf component/bt: use the OSI utility "pkt_queue" to store ADV report packet in btu layer
# Conflicts:
#	components/bt/host/bluedroid/hci/hci_hal_h4.c
2022-08-03 21:54:52 +08:00
71c072cc8c component/bt: use the OSI utility "osi_event" for hci_hal_h4 upstream data packets handling 2022-08-03 21:50:38 +08:00
88af2c548f component/bt: use the OSI utility "osi_event" to handle A2DP source data Tx processing 2022-08-03 21:50:37 +08:00
ceb4096287 component/bt: use the OSI utility "osi_event" to handle A2DP sink data Rx processing 2022-08-03 21:50:36 +08:00
93d4306aff component/bt: add new OSI utility "fixed_pkt_queue", which has same functionality with "fixed_queue" 2022-08-03 21:50:35 +08:00
96cbdee383 component/bt: add new OSI utility "pkt_queue" which acts as a mutex-protected linked list, to be used as data queue between tasks 2022-08-03 21:50:34 +08:00
6edcab3885 component/bt: add new OSI utility "osi_event" to support the scenario that event need only to be handle once. 2022-08-03 21:50:33 +08:00
1e06076c3c component/bt: make OSI thread workqueue length configurable through API
reduce the length of workqueue1 for BTC and HCI task

# Conflicts:
#	components/bt/common/osi/thread.c
2022-08-03 21:50:32 +08:00
d635d8f361 component/bt: modify the implementation of osi_thread using freeRTOS queue 2022-08-03 21:50:31 +08:00
ce1fde4b3b Merge branch 'update/version_4_4_2' into 'release/v4.4'
Update version to 4.4.2

See merge request espressif/esp-idf!19346
2022-08-03 20:45:40 +08:00
2c59eb0bca fix possible memory leak if report level not set 2022-08-02 20:42:44 +08:00
007381cf82 fix write to null pointer if malloc failed 2022-08-02 20:42:38 +08:00
1b16ef6cfc versions: Update version to 4.4.2 2022-08-02 14:06:15 +02:00
72fd3bc1e6 component_bt: Fix build doc errors of bt
1. bluedroid: use standard function pointer define.
   2. blufi: Change ESP_BD_ADDR_LEN into ESP_BLUFI_BD_ADDR_LEN
   3. doc/sphinx_known_warnings: Remove fixed parts.
2022-08-02 13:39:36 +08:00
c4491c352d fix legacy pair controller does not send the link key to the host
Closes https://github.com/espressif/esp-idf/issues/5850
2022-08-01 19:07:16 +08:00
5b648b8452 components_bt/bluedroid: Fix Memory&String Copy Build Err
1. When setting compilier into -O2 optimization, build for classic bt demo will get wrong
   2. Fix a memcpy bug that maybe get memory truncated

Closes https://github.com/espressif/esp-idf/issues/9398
2022-08-01 14:27:56 +08:00
dc626195f0 Add missing comma
Add missing comma when CONFIG_ESP32S3_DATA_CACHE_16KB is enabled
2022-08-01 09:17:40 +05:30
b765963c7c nvs_partition_gen: Allow up to 4000 byte strings with NVS V2
As documented, the limit for NVS format v2 is 4000 bytes for a string.
2022-08-01 09:12:39 +05:30
6d85d53cee Merge branch 'bugfix/qatest_spp_crash_v4.4' into 'release/v4.4'
bugfix/qatest spp crash (v4.4)

See merge request espressif/esp-idf!19238
2022-07-28 16:06:56 +08:00
e26a02d783 Merge branch 'bugfix/temp_fix_clk8m_and_cpu_cannot_pd_at_the_same_time_backport_v4.4' into 'release/v4.4'
esp_hw_support/sleep: fix cannot pd cpu and rc fast at the same time during light sleep(backport v4.4)

See merge request espressif/esp-idf!19266
2022-07-28 16:06:16 +08:00
236bd27134 further fix spi flash/ram current leakage
Currently, we pull up cs io for spi flash/ram to reduce current leakage during
light sleep. But some kind of spi flash/ram chip need all io pull up. Otherwise,
current leakage will still exist.
2022-07-28 13:11:55 +08:00
0d83001bd4 docs: fix docs of power down flash 2022-07-28 13:10:55 +08:00
5f2855882b kconfig: fix kconfig help of power down flash 2022-07-28 13:10:55 +08:00
6b6fa902ed ble_mesh:the memory requested by malloc has not benn released 2022-07-28 11:35:22 +08:00
23d934429c esp_hw_support/sleep: fix cannot pd cpu and rc fast at the same time during light sleep
Since cpu retention dma use rc fast as clk source, so rc_fast_digi
will be enabled when we config to pd cpu. And cpu retention does not
need rc fast keep on during light sleep. So, if we use rc_fast_digi
to determine whether rc fast can be powered down, then cpu and and
rc fast cannot pd at the same time.
2022-07-28 11:24:40 +08:00
92abac1fd8 psram: fixed heap pool reservation for DMA/internal usage fail issue
As heap block may be allocated into multiple non-continuous chunks, to
reserve enough memory for dma/internal usage, we do the malloc in the
step of max available block.
2022-07-28 10:12:17 +08:00
a066de7fec 1. add protect for bt_util_buf_env buffers when multi-access
2. ignore assert_err in em_bt_clkoff1_setf
2022-07-27 18:01:12 +08:00
eb490dc18e Merge branch 'feature/rainmaker_BT_configurable' into 'release/v4.4'
Doc: Made bluetooth configurable after wifi provisioning is completed

See merge request espressif/esp-idf!19263
2022-07-27 12:24:50 +05:30
b654c14d0e tools: Introduce support for blank lines in config and value files for mfg utility
Some users have requested this feature.

In order to avoid complete refactoring or introducing more code complexity, a design choice to create temporary files without blank lines is made.

Additionally, an extension check is added and there are multiple smaller code style and structure improvements.

Closes https://github.com/espressif/esp-idf/issues/8421
2022-07-26 23:17:33 +02:00
14903a46d1 Merge branch 'bugfix/optimize_beacon_timeout_issue_4.4' into 'release/v4.4'
esp_wifi:bugfix optimize beacon timeout issue(4.4)

See merge request espressif/esp-idf!19157
2022-07-25 15:48:57 +08:00
aadd18514c components/coex: Make sure sempher and queue used in isr is in DRAM
Closes https://github.com/espressif/esp-idf/issues/9032
Closes https://github.com/espressif/esp-idf/issues/8928
Closes https://github.com/espressif/esp-idf/issues/9129
2022-07-25 11:10:28 +08:00
c5db1591cf components/bt: Make sure sempher and queue used in isr is in DRAM 2022-07-25 11:08:13 +08:00
47b6a8c85a Merge branch 'bugfix/phy_init_failed_when_wifi_deinit_4.4' into 'release/v4.4'
esp_wifi:bugfix for phy init failed when wifi deinit(4.4)

See merge request espressif/esp-idf!19137
2022-07-25 10:52:28 +08:00
9892ce6a53 fix the dependency error of macro for memory debug 2022-07-22 16:17:14 +08:00
145c3cd000 Merge branch 'bugfix/wps_disable_disconnect_v4.4' into 'release/v4.4'
WiFi: Do not disconnect in WPS disable API incase WPS is done/scanning (v4.4)

See merge request espressif/esp-idf!19148
2022-07-22 15:13:54 +08:00
fbbcf5c5bc dfu: add esp32s3 to supported DFU targets for idf.py 2022-07-21 15:58:44 +08:00
d072873d5e esp_lcd: Add RX into SPI lcd panel. 2022-07-21 09:18:28 +02:00
91dc99a3ce esp_wifi:bugfix optimize beacon timeout issue 2022-07-21 10:57:20 +08:00
f42fd4236c WiFi: Do not disconnect in WPS disable incase WPS is done/scanning
Closes https://github.com/espressif/esp-idf/issues/9341
2022-07-20 18:17:45 +05:30
cb62457f6d adc: fix esp32 continuous mode sampling freq issue 2022-07-20 16:43:38 +08:00
ad8862fa19 adc: fix esp32s2 continuous mode converted bytes issue
When working in continuous mode, hardware will continuously trigger
ADC to do conversions. On esp32s2, 2 bytes will be generated per
conversion. Prior to this commit, driver assumes 4 bytes per conversion
(on s2). This commit fixed this issue.
2022-07-20 16:43:38 +08:00
1a17610895 bugfix for phy init failed when wifi deinit 2022-07-20 15:14:34 +08:00
ce465c0574 adc: fix esp32s3 continuous mode output bits issue
Prior to this change, esp32s3 ADC continuous mode output resolution is 13 bits.
This commit correct the `adc_digi_output_data_t` on esp32s3. Correct
output bits should be 12 bits. Corresponding definition in `soc_caps.h`
is also updated.
2022-07-20 15:01:57 +08:00
ffebc3d93f component/bt: Modify the bluetooth device name length limits 2022-07-20 09:22:47 +08:00
a840c77d4e component/bt: set ext adv param failed when stop ext adv 2022-07-20 09:09:17 +08:00
5728fe325e Reverts Backtrace: format to what it used to be
Was:  Backtrace: N:M N:M N:M ...
Now:  Backtrace:N:MN:M N:M ...

The problem with the new format is that it is hard to parse and
breaks the parser that is used by PlatformIO.  The old format
is much more reasonable.  I do not see how the pattern in IDFDUT.py
can work with the new format, due to the missing space after the :
2022-07-19 11:55:32 +02:00
28954a635d esp_lcd: Fix code style.
(cherry picked from commit 18f46959e4c83d6dd01db53d26388d5d3b4e3d99)
2022-07-19 09:40:01 +02:00
197f916383 fixed misaligned data transfer for ssd1306
(cherry picked from commit 46a2bf8ac9)
(cherry picked from commit b95304829af55174c0c8ac1b9c561e0319896d5b)
2022-07-19 09:39:50 +02:00
b1574fef2d freertos: Fix flakey event group unit test
The "FreeRTOS Event Groups" main task will only wait a single tick for the created
tasks to set their response bits. This short delay may not be sufficent if the tick
frequency is high.

This commit updates the test so that

- the main task waits indefinitely for all the response bits to be set.
- created tasks are cleand up by the main task
2022-07-19 12:03:04 +08:00
d465316f0b freertos: Fix event group task list race condition
FreeRTOS synchronization primitives (e.g., queues, eventgroups) use various event lists (i.e., task lists) to track what
tasks are blocked on a current primitive. Usually these event lists are accessed via one of the event lists functions
(such as vTask[PlaceOn|RemoveFrom]UnorderedEventList()), which in turn ensure that the global task list spinlock
(xTaskQueueMutex) is taken when accessing these lists.

However, some functions in event_groups.c manually traverse their event lists. Thus if a tick interrupt occurs on
another core during traversal and that tick interrupt unblocks a task on the event list being traversed, the event list
will be corrupted.

This commit modifies the following event_groups.c functions so that they take the global task list lock before
traversing their event list.

- xEventGroupSetBits()
- vEventGroupDelete()
2022-07-19 12:03:04 +08:00
02afbaccdd example: peripherals/usb: fix typo naming of local variables 2022-07-19 10:30:44 +08:00
f0a3ccc732 Merge branch 'ci/support_nightly_build_keyword_in_ttfw_v4.4' into 'release/v4.4'
ci: support keyword `nightly_run` in ttfw_idf decorator (v4.4)

See merge request espressif/esp-idf!18946
2022-07-18 21:20:28 +08:00
4bb12517f5 lwip: Fixed that ipv6 dns cannot work 2022-07-15 16:18:01 +08:00
85da506ec0 Fixed bluedroid host memory overflow 2022-07-15 14:47:28 +08:00
ee2029c38a Merge branch 'update_v4.4/mbedtls_v2.28.1' into 'release/v4.4'
mbedtls: Update to release v2.28.1 (v4.4)

See merge request espressif/esp-idf!19041
2022-07-14 22:51:26 +08:00
f69e6b3714 Merge branch 'bugfix/rgb_panel_set_gap_v4.4' into 'release/v4.4'
rgb_lcd: fix error in rgb_panel_set_gap

See merge request espressif/esp-idf!19051
2022-07-14 20:35:05 +08:00
c9119cbcef Merge branch 'docs/update_wifi_beacon_timeout_doc_v4.4' into 'release/v4.4'
docs: update wifi beacon timeout docs (v4.4)

See merge request espressif/esp-idf!19044
2022-07-14 18:10:12 +08:00
dee1bd1a24 rgb_lcd: fix error in rgb_panel_set_gap
Closes https://github.com/espressif/esp-idf/issues/9279
2022-07-14 16:52:55 +08:00
4b79600876 docs: add WIFI_EVENT_STA_BEACON_TIMEOUT event docs. 2022-07-14 15:38:33 +08:00
91a315f7c0 docs: update wifi beacon timeout docs 2022-07-14 15:38:33 +08:00
f7c20f3718 mbedtls: Update to release v2.28.1
- Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.1
2022-07-14 10:01:39 +05:30
d446c4a18f Merge branch 'bugfix/fix_beacon_timeout_timer_assert_issue_v4.4' into 'release/v4.4'
esp_wifi: fix sta reset beacon timeout timer issue(Backport v4.4)

See merge request espressif/esp-idf!19035
2022-07-14 11:25:14 +08:00
8dbe7582a9 Merge branch 'bugfix/print_ready_after_init_transaction_forv4.4' into 'release/v4.4'
ble_mesh:example:change the location of print ready(V4.4)

See merge request espressif/esp-idf!19028
2022-07-14 11:24:48 +08:00
c074da530b Merge branch 'feature/temp_sensor_v4.4' into 'release/v4.4'
temperature sensor: Add support on ESP32-S3 (backport v4.4)

See merge request espressif/esp-idf!18718
2022-07-14 10:51:43 +08:00
5744a18555 Merge branch 'docs/update_linker_script_generation_v4.4' into 'release/v4.4'
docs:update linker script generation (v4.4)

See merge request espressif/esp-idf!19039
2022-07-14 10:50:09 +08:00
5b816c8551 docs:update linker script generation 2022-07-14 10:27:49 +08:00
e33df4d5b5 Merge branch 'bugfix/flash_encryption_8l_psram_v4.4' into 'release/v4.4'
flash_encryption: Fix issue that flash encryption cannot work when 8-line psram enabled(backport v4.4)

See merge request espressif/esp-idf!19023
2022-07-13 23:33:06 +08:00
9f0532bdf3 esp_wifi: fix sta reset beacon timeout timer issue 2022-07-13 20:37:38 +08:00
c2fe9327f2 ble_mesh:change the location of print ready 2022-07-13 17:58:39 +08:00
daceb3516d temperature sensor: Add support on ESP32-S3,
Closes https://github.com/espressif/esp-idf/issues/8086
2022-07-13 17:22:59 +08:00
8538153616 flash_encryption: Fix issue that flash encryption cannot work when 8-line psram enabled,
Closes https://github.com/espressif/esp-idf/issues/9244,
                  Closes https://github.com/espressif/esp-idf/issues/9287
2022-07-13 17:20:38 +08:00
322a2240f1 Merge branch 'bugfix/eapol_drop_issue_v4.4' into 'release/v4.4'
esp_wifi: clear old keys before going for new connection(backport v4.4)

See merge request espressif/esp-idf!18996
2022-07-13 15:40:11 +08:00
b68fd2b88f Merge branch 'bugfix/fix_memory_leak_in_hidh_v4.4' into 'release/v4.4'
Fix memory leak in bt_hidh.c[backport 4.4]

See merge request espressif/esp-idf!19007
2022-07-13 14:03:32 +08:00
dfb75aa230 Merge branch 'feature/uart_get_free_tx_buffer_size_v4.4' into 'release/v4.4'
uart: Add a new API to get the free space size of tx buffer (backport v4.4)

See merge request espressif/esp-idf!18977
2022-07-13 10:56:44 +08:00
bd7269411a Merge branch 'bugfix/wifi_sta_and_ble_disconnect_BCI-303_v4.4' into 'release/v4.4'
component_bt: Fix wifi is initialized before bluetooth initialization, bluetooth can't stay connected(v4.4)

See merge request espressif/esp-idf!18999
2022-07-13 00:13:03 +08:00
327624b04c Merge branch 'bugfix/correct_blecmd_for_rf_path_v4.4' into 'release/v4.4'
Bluedroid: Fixed compilation error due to incorrect macro name (v4.4)

See merge request espressif/esp-idf!18994
2022-07-12 20:32:02 +08:00
692ba818fe Merge branch 'bugfix/fix_esp32_ke_mem_c_assert_v4.4' into 'release/v4.4'
fix esp32 BLE ke_mem.c assert for v4.4

See merge request espressif/esp-idf!19000
2022-07-12 20:30:32 +08:00
4e6f8b362d Merge branch 'bugfix/ble_50_sync_periodic_adv_lost_data_v4.4' into 'release/v4.4'
components/bt: Fix ble sync periodic adv report will lost data(backport release/v4.4)

See merge request espressif/esp-idf!18958
2022-07-12 17:30:04 +08:00
9f5b700c9a Merge branch 'bugfix/fix_esp32c3_s3_adv_report_duplicate_check_v4.4' into 'release/v4.4'
Fix esp32c3/s3 adv report duplicate check for v4.4

See merge request espressif/esp-idf!18962
2022-07-12 17:29:35 +08:00
c2f9a0ad87 fix memory leak in esp_bt_hidh_dev_report_write and esp_bt_hidh_dev_set_report in bt_hidh.c
Closes https://github.com/espressif/esp-idf/issues/9323
2022-07-12 15:57:23 +08:00
zwj
f39df9a9c0 fix esp32 BLE ke_mem.c assert 2022-07-12 14:40:21 +08:00
c85f71aee3 Fix wifi is initialized before bluetooth initialization, bluetooth can't stay connected 2022-07-12 14:35:32 +08:00
522e0a6b06 esp_wifi: clear old keys before going for new connection 2022-07-12 10:43:34 +05:30
b5522f5709 Bluedroid: Fixed compilation error due to incorrect macro name 2022-07-12 09:42:27 +05:30
68225b63de Merge branch 'docs/404_tips_backport_v4.4' into 'release/v4.4'
docs: update 404.rst (backport v4.4)

See merge request espressif/esp-idf!18975
2022-07-12 11:57:10 +08:00
724cbd4167 Merge branch 'bugfix/fix_spi_slave_example_sender_ccount_issue' into 'release/v4.4'
spi: fix spi slave example sender ccount issue (v4.4)

See merge request espressif/esp-idf!18423
2022-07-12 11:49:28 +08:00
cd13a62952 Merge branch 'bufix/Backport_some_wifi_lwip_bugs_for_4.4_0711' into 'release/v4.4'
Backport some wifi&lwip bugs for 4.4 0711

See merge request espressif/esp-idf!18984
2022-07-12 11:36:25 +08:00
2476d5d837 Merge branch 'fix/usb_cdc_reconnection' into 'release/v4.4'
tinyusb: Fix lost packet after reconnection

See merge request espressif/esp-idf!18952
2022-07-12 10:32:31 +08:00
b3e8d0f7bf Merge branch 'bugfix/tinyusb_prs_v4.4' into 'release/v4.4'
Fix tinyusb_driver_install (dangling pointer) and ESP32S3 USB external PHY pinout (backport v4.4)

See merge request espressif/esp-idf!18978
2022-07-12 10:31:14 +08:00
4b4289ebba tinyusb: Fix lost packet after reconnection 2022-07-11 17:06:33 +02:00
c3f077397a esp_wifi: reset beacon timeout timer when keep alive null works or hw drop beacon 2022-07-11 21:29:34 +08:00
f8a4504bc5 Icmp: get tos parameter in icmp reply
bugfix for add ttl for ping socket
2022-07-11 20:24:18 +08:00
101762718a add option to route LWIP logs through ESP_LOG interface
Signed-off-by: xueyunfei <xueyunfei@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/8785
Closes https://github.com/espressif/esp-idf/issues/8361
2022-07-11 19:26:41 +08:00
3e7aefd9fe udp example:Optimization udp example with recv_msg 2022-07-11 19:16:30 +08:00
4a3875c4c7 wifi:bugfix for wrong configuration of static txbuf
wifi:bugfix fix qos null update ba ssn
2022-07-11 19:16:11 +08:00
88361bddf2 USB external PHY pinout set as in Reference Manual Figure 29-3.
(cherry picked from commit 9ceff23c6d)
2022-07-11 17:26:45 +08:00
41f78c1347 Fix tinyusb_driver_install (dangling pointer)
(cherry picked from commit db90b512a1)
2022-07-11 17:20:57 +08:00
f4d33d2739 uart: Add a new API to get the free space size of tx buffer
Closes https://github.com/espressif/esp-idf/issues/8932

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

(cherry picked from commit 9d73475e44)
2022-07-11 17:04:11 +08:00
3838e3da4a components/bt: Fix ble sync periodic adv report lost data issue 2022-07-11 16:50:30 +08:00
b9a1020fcf Merge branch 'bugfix/reset_ble_hw_on_inititalization_v4.4' into 'release/v4.4'
[Bluetooth] Reset Bluetooth hardware during controller inititalization on ESP32-C3/ESP32-S3(release/v4.4)

See merge request espressif/esp-idf!18964
2022-07-11 16:28:53 +08:00
65becd2edf Merge branch 'bugfix/fix_osi_men_dbg_xxx_not_defined_when_enable_mem_dbg_v4.4' into 'release/v4.4'
bugfix/fix the issue of functions not defined when enable memory debug (v4.4)

See merge request espressif/esp-idf!18815
2022-07-11 16:28:27 +08:00
def63b6ec7 docs: update 404.rst 2022-07-11 16:18:34 +08:00
eb15c547f2 fix licence copyright for header file syscon_reg.h on ESP32C3 and ESP32S3 2022-07-11 11:09:06 +08:00
4d5aa82cea component/bt: reset Bluetooth hardware during controller inititalization on ESP32-C3/ESP32-S3
1. Rename MACROs SYSTEM_WIFI_RST_EN register bit fields to be more recognizable
2. reset Bluetooth baseband and MAC bits to fix the issue of task watchdog triggered during controller initialization due to invalid hardware state
2022-07-11 11:06:11 +08:00
1595e008f0 fix esp32c3/s3 adv report duplicate check 2022-07-11 10:53:53 +08:00
db8ef465a4 Merge branch 'ci/only_run_deploy_cases_on_master_backport4.4' into 'release/v4.4'
CI: Only deploy test cases on master (backport 4.4)

See merge request espressif/esp-idf!18955
2022-07-10 15:42:51 +08:00
3ab8c3fff4 Merge branch 'doc/ble_deinit_v4.4' into 'release/v4.4'
doc(bt): Add description for de-initialize bt controller(backport release/v4.4)

See merge request espressif/esp-idf!18928
2022-07-10 15:37:50 +08:00
e26594d8f4 Merge branch 'bugfix/fix_wrong_params_in_hidd_v4.4' into 'release/v4.4'
Fix wrong parameter of get_report_by_id_and_type in bt_hidd.c[backport 4.4]

See merge request espressif/esp-idf!18930
2022-07-10 15:36:28 +08:00
4a2a974257 Merge branch 'bugfix/main_task_on_cpu1_startup_failure_v4.4' into 'release/v4.4'
freertos: Fix issue with bootup failure in ESP_MAIN_TASK_AFFINITY_CPU1 config (v4.4)

See merge request espressif/esp-idf!18935
2022-07-10 15:36:05 +08:00
52dda7f100 Merge branch 'docs/update_wifi_csi_sub_carrier_index_doc_v4.4' into 'release/v4.4'
docs:update wifi sci subcarrier index docs (v4.4)

See merge request espressif/esp-idf!18941
2022-07-10 15:35:49 +08:00
e519e437fe Merge branch 'docs/add_chiptype_link_gpio_v4.4' into 'release/v4.4'
docs: Add chip target and link to gpio.h (v4.4)

See merge request espressif/esp-idf!18948
2022-07-10 15:35:31 +08:00
f54d484502 CI: Only deploy test cases on master (backport 4.4) 2022-07-08 23:38:37 +08:00
bc4338625c docs:add chiptype and link to gpio.h 2022-07-08 16:29:11 +08:00
1b0fe85245 ci: support keyword nightly_run in ttfw_idf decorator 2022-07-08 15:37:23 +08:00
f9d96d28bf docs: modify some Chinese expressions related to CSI 2022-07-08 14:42:12 +08:00
ef9eaae48c docs:update wifi sci subcarrier index docs 2022-07-08 14:34:46 +08:00
603be06120 Merge branch 'fix/tls-size-esp32c2_esp32c3_esp32h2_v4.4' into 'release/v4.4'
esp_system: Fix esp32c2/esp32c3/esp32h2 TLS size

See merge request espressif/esp-idf!18810
2022-07-08 11:14:34 +08:00
5ebc86354a freertos: Fix issue with bootup failure in ESP_MAIN_TASK_AFFINITY_CPU1 config
Idle tick hook that indicates completion of scheduler init must be launched
on other core than the one where main task runs. Earlier it was assumed that
main task shall always run on PRO cpu but that behavior can be changed with
ESP_MAIN_TASK_AFFINITY_CPU1 and hence this fix.

Closes https://github.com/espressif/esp-idf/issues/9247
Closes IDFGH-7705
2022-07-08 08:36:19 +05:30
875915a822 fix the issue of functions not defined when enable memory debug 2022-07-08 11:03:07 +08:00
fe1fb25078 doc(bt): Add description for de-initialize bt controller 2022-07-08 11:02:01 +08:00
7b305f9f56 fix wrong params of get_report_by_id_and_type in bt_hidd.c 2022-07-08 10:11:17 +08:00
f84d5de899 Merge branch 'docs/improve_docs_for_flash_power_down_backport_v4.4' into 'release/v4.4'
docs: improve docs about flash power-down(backport v4.4)

See merge request espressif/esp-idf!18910
2022-07-07 14:01:39 +08:00
3e2aa8e97b improve docs about flash power-down 2022-07-07 11:30:51 +08:00
afc6f7f932 Merge branch 'docs/update_wifi_api_doc_v4.4' into 'release/v4.4'
DOC: update wifi api docs ( backport v4.4)

See merge request espressif/esp-idf!18076
2022-07-07 10:57:36 +08:00
f68d61d5f4 Merge branch 'bugfix/lower_a2dp_appT_prio_v4.4' into 'release/v4.4'
bugfix/lower the priority of application task of a2dp demo (v4.4)

See merge request espressif/esp-idf!18819
2022-07-07 10:56:20 +08:00
6e63caa4fa Merge branch 'bugfix/resolve_redefinition_in_spp_and_hid_v4.4' into 'release/v4.4'
bugfix/resolve redefinition in btc_spp.h and btc_hd.h/btc_hh.h (v4.4)

See merge request espressif/esp-idf!18824
2022-07-07 10:56:04 +08:00
ed7d2d3f0d Merge branch 'bugfix/fix_ble_ke_mem_c_assert_on_c3_s3_v4.4' into 'release/v4.4'
Fixed BLE ke_mem.c assert for v4.4

See merge request espressif/esp-idf!18878
2022-07-07 10:55:49 +08:00
eaf6f3c2cd Merge branch 'bugfix/fix_bluedroid_host_memory_overflow_v4.4' into 'release/v4.4'
Fixed bluedroid host memory overflow for v4.4

See merge request espressif/esp-idf!18903
2022-07-07 10:54:08 +08:00
363b8b2973 Fixed bluedroid host memory overflow 2022-07-06 21:21:30 +08:00
d949df8dcb Merge branch 'bugfix/ext_adv_param_check_v4.4' into 'release/v4.4'
Bluedroid: fix channel map of ext adv params check for v4.4

See merge request espressif/esp-idf!18890
2022-07-06 17:21:27 +08:00
bdaeab5de7 Merge branch 'bugfix/xtensa_sol_frame_saves_extra_registers_v4.4' into 'release/v4.4'
freertos: Xtensa solicited stack frame should save threadptr register (v4.4)

See merge request espressif/esp-idf!18853
2022-07-06 17:19:32 +08:00
8546527213 Merge branch 'bugfix/restore_edr_en_and_protect_for_vhci_env_v4.4' into 'release/v4.4'
bugfix/restore edr_en and add protect for vhci_env (v4.4)

See merge request espressif/esp-idf!18811
2022-07-06 17:15:54 +08:00
a3f72a9310 Merge branch 'feature/esp_docs_1.0.0_v4.4' into 'release/v4.4'
docs: update esp-docs to 1.0.0  (v4.4)

See merge request espressif/esp-idf!18210
2022-07-06 17:14:03 +08:00
9113f72078 Bluedroid: fix channel map of ext adv params check 2022-07-05 19:44:12 +08:00
zwj
3e6cc4892b fix BLE ke_mem.c assert 2022-07-05 16:12:57 +08:00
90e58c3721 docs: fix all doxygen warnings
Doxygen warnings would previously not result in a failed pipeline.
Fixed this as well as all current warnings.
2022-07-05 11:14:40 +08:00
690f802b1c Merge branch 'bugfix/not_use_malloc_in_bluedroid_v4.4' into 'release/v4.4'
component/bt: use osi_malloc instead of malloc in bluedroid

See merge request espressif/esp-idf!18843
2022-07-04 20:05:46 +08:00
977a040301 Merge branch 'bugfix/fix_sink_wrong_sniff_params_v4.4' into 'release/v4.4'
Fix A2DP Sink Wrong Sniff Parameters which Caused by HID Porting[backport 4.4]

See merge request espressif/esp-idf!18801
2022-07-04 19:57:53 +08:00
c26d2ad132 freertos: Xtensa FreeRTOS saves threadptr in solicited stack frame
The Xtensa FreeRTOS port does not save the threadptr register when
doing a voluntary yield. This can result in a crash when multiple
tasks used the threadptr register and call "taskYIELD()".

This commit adds the threadptr register to the solicited stack frame.
2022-07-04 18:27:57 +08:00
65ed4b5339 component/bt: use osi_malloc instead of malloc in bluedroid 2022-07-04 16:10:25 +08:00
e07d16d6a3 docs: update linkcheck configs
linkcheck CI job can now pass, no longer necessary to ignore the results from it.
2022-07-04 11:05:49 +08:00
27cd55dca1 docs: fix broken links 2022-07-04 11:05:49 +08:00
2ad49d47eb docs: fix indention in dac code snippet 2022-07-04 11:05:49 +08:00
116eda0bd2 CI: update esp-idf-doc-env docker image version 2022-07-04 11:05:49 +08:00
389cef7739 docs: update esp-docs 1.0.0
Update esp-docs to 1.0.0 and fix new warnings introduced from update
2022-07-04 11:05:49 +08:00
f3917d1706 restore edr_en which wrongly cleared by rsw
add critical protection for vhci_env_p->vhci_intr_st
ignore max_page when handle remote features
2022-07-01 19:28:36 +08:00
59b50180a0 resolve redefinition in btc_spp.h and btc_hd.h/btc_hh.h
Closes https://github.com/espressif/esp-idf/issues/9199
2022-07-01 19:21:37 +08:00
09289fe451 esp_system: Fix esp32c2/esp32c3/esp32h2 TLS size
The change fixes thread-local-storage size by removing .srodata section
from it. It initially was included in TLS section by mistake.
The issue was found when stack size increased after building applications
with GCC-11.1 compiler. Stack size became bigger because some new data
appeared in .srodata. See more details here:
adce62f53d
2022-07-01 15:19:21 +04:00
9de7886528 lower the priority of application task of a2dp demo 2022-07-01 19:08:47 +08:00
53c186af26 esp_wifi: backport some wifi fix
1.Update wifi doc for espnow/LR/fix rate/disable 11b/multiple antennas
2.Optimization example of wifi station
3.Optimize the null pointer judgment of eb
4.Bugfix for close sniffer mode when wifi stop
5.Fix deep sleep can't reconnect to ap when pmf enable.
6.Fix some ap will ignore auth when rx deauth for a while.
7.Fixed espnow recv unencrypted packets issue
8.Fix not update phy according to country code.
9.Update regdomain max channel according to country info from nvs and or AP.
10.Channel 14 is allowed only 11b mode.
11.Remove csa when switch channel from/to 14 channel.
12.Update phy mode nvs when softap channel from 14 to other.
13.Fix the bug that check whether channel parameter is valid.
2022-07-01 17:39:53 +08:00
d9a278827c optimize the null pointer judgment of eb 2022-07-01 17:39:53 +08:00
be5b89d217 wifi example:optimization example of wifi station 2022-07-01 17:39:53 +08:00
ea13b4ed8b Apply 1 suggestion(s) to 1 file(s) 2022-07-01 17:39:53 +08:00
2db401a737 Apply 1 suggestion(s) to 1 file(s) 2022-07-01 17:39:53 +08:00
db85519413 Apply 2 suggestions by Marius Vikhammer 2022-07-01 17:39:53 +08:00
795c4a4b2a docs: update wifi multiple antennas docs 2022-07-01 17:39:53 +08:00
15845ff47b DOC:Correct IP_EVENT_STA_LOST_IP name
Fix the name of the IP_EVENT_STA_LOST_IP event (was IP_STA_LOST_IP)

Signed-off-by: xueyunfei <xueyunfei@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/8347
2022-07-01 17:39:53 +08:00
31035183da esp_wifi: update esp_wifi_internal_set_fix_rate usage 2022-07-01 17:39:53 +08:00
29432233f8 esp_wifi: update noise floor unit 2022-07-01 17:39:53 +08:00
05770a1f52 Doc:update wifi api docs
* Add documents related to espnow config rate

* Optimization set dns server api description
2022-07-01 17:39:53 +08:00
e04b4d9b81 modify API-reference using Sphinx directives 2022-07-01 17:39:53 +08:00
254ec47ae4 update wifi api docs 2022-07-01 17:39:53 +08:00
c9140caf8c Merge branch 'bugfix/no_proxy_beacon_send_after_deinit_v4.4' into 'release/v4.4'
ble_mesh: stack: Bugfix for proxy beacon send after reinit mesh(v4.4)

See merge request espressif/esp-idf!18791
2022-07-01 17:17:39 +08:00
9616ef8ee8 Merge branch 'bugfix/wifi_condition_linker_mapping_v4.4' into 'release/v4.4'
esp_wifi: Fix linking of WiFi functions dependent on PM_ENABLE (v4.4)

See merge request espressif/esp-idf!18796
2022-07-01 17:17:21 +08:00
4f598d2ec3 fix sink wrong sniff params which caused by HID porting 2022-07-01 14:49:54 +08:00
597ff180d8 Merge branch 'bugfix/fix_stale_pmf_config_v4.4' into 'release/v4.4'
Fix stale PMF config in NVS issue (Backport v4.4)

See merge request espressif/esp-idf!18662
2022-07-01 13:54:42 +08:00
41b9e66082 wifi: Fix linking of WiFi functions dependent on PM_ENABLE
The following functions are only defined when CONFIG_PM_ENABLE is defined:

- wifi_apb80m_request()
- wifi_apb80m_release()

This commit makes their linker script mapping statements also dependent on CONFIG_PM_ENABLE
thus fixing some linker errors when CONFIG_PM_ENABLE is disabled.
2022-07-01 12:29:35 +08:00
23e482feeb ble_mesh: stack: Bugfix for proxy beacon send after reinit mesh 2022-07-01 11:42:07 +08:00
69951819a0 Merge branch 'bugfix/s3_increase_static_alloc_size_v4.4' into 'release/v4.4'
bootloader, esp_system: increase static allocation space for esp32s3 (v4.4)

See merge request espressif/esp-idf!18685
2022-07-01 10:54:25 +08:00
b9e018aa53 Merge branch 'bugfix/ledc_auto_clk_refactor_v4.4' into 'release/v4.4'
LEDC: improved support for ESP32-C3 and refactored divisor calculation (v4.4)

See merge request espressif/esp-idf!17101
2022-07-01 10:52:00 +08:00
cb012683ff Merge branch 'bugfix/spiffs_readdir_errno_v4.4_2' into 'release/v4.4'
spiffs: update submodule to fix SPIFFS_readdir errno issue (v4.4)

See merge request espressif/esp-idf!18637
2022-07-01 10:51:45 +08:00
1bd2e3f9df Merge branch 'feature/s3_ulp_support_v4.4' into 'release/v4.4'
ulp: Added ULP support for  esp32s3 (v4.4)

See merge request espressif/esp-idf!18621
2022-07-01 10:51:18 +08:00
d28dc7f49b Merge branch 'bugfix/idf_as_lib_cmakelists' into 'release/v4.4'
Build: fix idf_as_lib example and toolchain CMake files (v4.4)

See merge request espressif/esp-idf!18589
2022-07-01 10:44:30 +08:00
cd2f38a7bb Merge branch 'feature/efuse_rst_is_treated_as_poweron_rst_v4.4' into 'release/v4.4'
reset_reasons: EFUSE_RST is treated as POWERON_RST + checks errors of eFuse BLOCK0 (v4.4)

See merge request espressif/esp-idf!17871
2022-07-01 10:43:40 +08:00
e8c7364fa3 Merge branch 'bugfix/mbedtls_free_keypair_v4.4' into 'release/v4.4'
Nimble: Fixed memory leak while generating keypair using embedtls v4.4

See merge request espressif/esp-idf!18775
2022-07-01 10:43:19 +08:00
f768b809bb Merge branch 'bugfix/fix_deinit_init_connect_fail_issue_v4.4' into 'release/v4.4'
esp_wifi: clear phy calibrated flag when phy pd memory deinit(Backport v4.4)

See merge request espressif/esp-idf!18777
2022-07-01 10:42:57 +08:00
52c78344c1 esp_wifi: clear phy calibrated flag when phy pd memory deinit 2022-06-30 17:12:05 +08:00
5c33bb8ae2 Merge branch 'bugfix/fix_blufi_example_softap_current_connection_equal_zero_issue_v4.4' into 'release/v4.4'
bluetooth: fix two blufi example bugs(Backport v4.4)

See merge request espressif/esp-idf!18772
2022-06-30 17:01:47 +08:00
279638a39b esp_wifi: Update wifi lib
Fix issue where set_config API uses stale NVS config if PMF disable
API was used before
2022-06-30 14:28:32 +05:30
d5ed8f9db6 Merge branch 'feat/revert_touch_s3_v4.4' into 'release/v4.4'
touch: Added support for using touch in sleep modes back on ESP32-S3 (v4.4)

See merge request espressif/esp-idf!18691
2022-06-30 16:55:23 +08:00
0a8fc491c7 Merge branch 'bugfix/a2dp_source_not_stop_discovery_correctly_v4.4' into 'release/v4.4'
bugfix/avoid wrongly restart discovery in a2dp_source (v4.4)

See merge request espressif/esp-idf!18710
2022-06-30 16:54:52 +08:00
7804d1c4db Merge branch 'bugfix/esp32s2_startup_garbled_output_v4.4' into 'release/v4.4'
esp_system: fix garbled UART output on startup on esp32s2 (v4.4)

See merge request espressif/esp-idf!18750
2022-06-30 16:52:11 +08:00
ec6155dff1 Nimble: Fixed memory leak while generating keypair using embedtls 2022-06-30 14:21:54 +05:30
e4e49783db Merge branch 'bugfix/enable_gcmp_gmac_192bit_v4.4' into 'release/v4.4'
esp_example: Enable GCMP, GMAC for 192 bit config example by default(backport v4.4)

See merge request espressif/esp-idf!18681
2022-06-30 16:51:46 +08:00
f015bcdaed Merge branch 'bugfix/a_small_fix_for_multi_heap_backport_v4.4' into 'release/v4.4'
Heap: fix param passed to assert_valid_block, should be block not ptr(backport v4.4)

See merge request espressif/esp-idf!18673
2022-06-30 16:51:28 +08:00
d1ae2b8ffd Merge branch 'bugfix/app_trace_iram_v4.4' into 'release/v4.4'
apptrace: move all apptrace related functions to IRAM (v4.4)

See merge request espressif/esp-idf!18728
2022-06-30 16:50:55 +08:00
7c28a05c69 Merge branch 'bugfix/configure_link_encryption_for_charac_v4.4' into 'release/v4.4'
WifiProv: Add configuration support for forcing link encryption (v4.4)

See merge request espressif/esp-idf!18660
2022-06-30 16:49:26 +08:00
55773f878d Merge branch 'bugfix/mbedtls_custom_cert_ut_v4.4' into 'release/v4.4'
ci: Fix `custom certificate bundle` UT failure for S3 (v4.4)

See merge request espressif/esp-idf!18658
2022-06-30 16:48:45 +08:00
46cff3cd1c Merge branch 'feature/add_filter_seq_auth_config_v4.4' into 'release/v4.4'
ble_mesh: stack: Add filter old seq_auth packet menuconfig(v4.4)

See merge request espressif/esp-idf!18649
2022-06-30 16:48:01 +08:00
54e01833be Merge branch 'bugfix/fix_wss_server_example_v4.4' into 'release/v4.4'
fix(example): Fix wss_server_example not close socket (backport v4.4)

See merge request espressif/esp-idf!18602
2022-06-30 16:47:24 +08:00
d76d3580c6 Merge branch 'wifi_prov_mgr/wpa3_psk_v4.4' into 'release/v4.4'
wifi_prov: Added support for WPA3_PSK and WPA2_WPA3_PSK APs (v4.4)

See merge request espressif/esp-idf!18601
2022-06-30 16:46:53 +08:00
93d8cf3eb6 Merge branch 'bugfix/sync_host_nocp_cmd_v4.4' into 'release/v4.4'
Nimble: Sync sending Host Number of Completed Packets command

See merge request espressif/esp-idf!18607
2022-06-30 16:39:58 +08:00
1b17711caa Merge branch 'bugfix/dirent-definition_v4.4' into 'release/v4.4'
newlib: dirent d_ino type fix (v4.4)

See merge request espressif/esp-idf!18611
2022-06-30 16:39:39 +08:00
d27d10ae16 Merge branch 'tools/update_cmake_v4.4' into 'release/v4.4'
tools: Update CMake (v4.4)

See merge request espressif/esp-idf!18606
2022-06-30 16:37:48 +08:00
b784b1c239 Merge branch 'feature/update_hfp_ag_version_v4.4' into 'release/v4.4'
component_bt: update hfp_ag version to 1.7.2(v4.4)

See merge request espressif/esp-idf!18603
2022-06-30 16:37:14 +08:00
e8ea685214 Merge branch 'bugfix/sap_mode_change_crash_issue_v4.4' into 'release/v4.4'
Fixes for SAP mode change and PMF issues (Backport v4.4)

See merge request espressif/esp-idf!18590
2022-06-30 16:33:58 +08:00
8827fc28a0 bluetooth: fix two blufi example bugs
1. Softap mode do not assign ip
2. SotAp current connection always show 0
2022-06-30 15:06:53 +08:00
74e9376022 esp_system: fix garbled UART output on startup on esp32s2
Closes https://github.com/espressif/esp-idf/issues/9168
2022-06-29 12:33:05 +02:00
3c358dd074 ulp: only enable relevant wakeup sources for ULP
Do not enable co-processor trap wakeup source when running ULP FSM, as this
could cause spurious wake-ups.
2022-06-29 11:57:05 +08:00
a0e3d488da ulp: Added support for ULP FSM on esp32s3 and fixed bugs for esp32s2
This commit enables ULP FSM support for esp32s3 and updates ULP FSM code
flow for other chips.
It adds C Macro support for the ULP FSM instruction set on esp32s2 and
esp32s3.
The unit tests are also updated to test ULP FSM on ep32s2 and esp32s3.
2022-06-29 11:57:02 +08:00
74d745a80b docs: update cn trans for upl docs 2022-06-29 11:56:59 +08:00
dafcb9a883 apptrace: move all apptrace related functions to IRAM
Closes: https://github.com/espressif/esp-idf/issues/9131
2022-06-29 10:17:48 +08:00
66e52c60f5 avoid wrongly restart discovery 2022-06-28 13:03:44 +08:00
886c2d742d docs: Updated ULP documentation
This commit updates documentation for ULP.
2022-06-28 12:09:33 +08:00
477844806e re-enable riscv ulp gpio support and examples 2022-06-27 17:17:06 +08:00
d424b93192 Revert "touch: add protection for touch sleep case"
This reverts commit 974ac3b4b8.
2022-06-27 14:33:09 +08:00
c3c802d9b8 Revert "touch_sensor: forbid from using touch sensor with sleep on ESP32-S3"
This reverts commit a84faa3cef.
2022-06-27 14:33:09 +08:00
6e6b9ec5a6 bootloader, esp_system: increase static allocation space for esp32s3
The previously used splits between memory allocated for ROM code,
2nd stage bootloader and the app were somewhat safe and conservative.
This resulted in some space being unavailable for static allocation
in the app.

This commit increases the space available for static allocation to the
maximum possible amount.

1. Some of the ROM code static allocation is only used in UART/USB/SPI
   download modes. This region ("shared buffers") has been placed at
   the lower end of ROM memory area, to be reusable in flash boot
   mode. The 2nd stage bootloader linker script is modified to "pack"
   all sections exactly up to the end but with roughly 8K margin between
   startup stacks.
2. Instead of calculating the sections placement and hardcoding the
   addresses in the LD script again, rewrite it to calculate the
   start address of each memory region automatically based on the
   logic above.
3. Adjust the app memory layout (SRAM_IRAM_END) accordingly,
   increasing the space available for static allocation.

Overall these changes increase the space available for static
allocation by about 78kB.

The downside of these changes is that the 2nd stage bootloader .data
segment is now directly adjacent to the startup stack on the PRO CPU.
Previously, there was effectively about 78kB of extra stack space for
the PRO CPU, before the stack would run into the data segment.
2022-06-27 09:22:01 +05:30
5a58ab0d4a esp_example: Enable GCMP, GMAC for 192 bit config 2022-06-24 17:37:06 +05:30
41a0757bcc fix param passed to assert_valid_block, should be block not ptr 2022-06-23 21:43:53 +08:00
7a01fe7a71 WifiProv: Extended support for configuring if link encryption is needed
when attempting to read / write characteristic to bluedroid stack
2022-06-23 17:44:38 +05:30
9e2369cb79 ci: Enable custom certificate bundle test for ESP32-S3
- Increase leakage limit for `test performance RSA key operations`
  UT by 64 bytes
2022-06-23 16:32:26 +05:30
e114850dda mbedtls: Acquire lock before enabling MPI (RSA) hardware
- For ESP32-S3
2022-06-23 16:32:26 +05:30
b82782f109 ble_mesh: stack: Add filter old seq_auth packet menuconfig 2022-06-23 16:17:20 +08:00
1736fdf256 spiffs: update submodule to fix SPIFFS_readdir errno issue
See https://github.com/pellepl/spiffs/pull/288 for the description of the issue.
Reported in https://github.com/esp-rs/rust/issues/117#issuecomment-1142159661
2022-06-22 17:52:17 +02:00
c563d799fe efuse: Checks errors of 4x coding scheme for BLOCK0 if so then abort 2022-06-22 17:16:26 +08:00
dcc706280d reset_reasons: EFUSE_RST is treated as POWERON_RST
ESP32 does not have the EFUSE_RST, the rest chips has this reset reason.
2022-06-22 16:39:02 +08:00
afe3bfe19f SPI:fix spi slave example sender ccount issue
On riscv core, core cycle counter counts the clock cycles only when core is active (not sleeping).
In spi_slave/sender example, it uses ccount (core cycle counter) to do a simple debounce.
Therefore, when using spi_slave/sender and spi_slave/receiver, program will be stuck.
This commit fix this issue by using esp_timer
2022-06-22 15:06:29 +08:00
b72f987c5c ulp: Added ULP RISC-V support for esp32s3
This commit adds support for ULP RISC-V for esp32s3.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2022-06-22 13:33:14 +08:00
e6964819b4 newlib: dirent d_ino type fix
As per the posix spec, `d_ino` should be defined as `ino_t`. See the
reference:
http://pubs.opengroup.org/onlinepubs/7908799/xsh/dirent.h.html.
2022-06-21 14:40:13 +01:00
9ddf575e42 Nimble: Sync sending Host Number of Completed Packets command 2022-06-21 16:40:59 +05:30
ddfc699abf tools: Update CMake
This updates CMake to the latest version (3.23).
There are no deprecations and feature removals that affect us going from the previous version:

https://cmake.org/cmake/help/latest/release/3.21.html#deprecated-and-removed-features

https://cmake.org/cmake/help/latest/release/3.22.html#deprecated-and-removed-features

https://cmake.org/cmake/help/latest/release/3.23.html#deprecated-and-removed-features

Closes https://github.com/espressif/esp-idf/issues/8821
2022-06-21 11:26:09 +02:00
5020faf559 update hfp_ag version to 1.7.2 2022-06-21 14:41:19 +08:00
3169baa76d fix(example): Fix wss_server_example not close socket 2022-06-21 14:23:46 +08:00
279ab23244 wifi_prov: Added support for WPA3_PSK and WPA2_WPA3_PSK APs 2022-06-21 11:17:09 +05:30
d5664cd7e5 Build: Xtensa assembly files are now assembled with -mlongcalls option 2022-06-21 11:20:07 +08:00
d629502586 Build: fix idf_as_lib example not building 2022-06-21 11:17:39 +08:00
8e7ee9ff26 Build: CMake compiler flags will be set, regardless of the cache status
Defining CMake variables from the command-line or from another CMake project,
such as `-DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS=`, caused a link failure as ESP
CMake was unable to set its proper compilation flags.
Additional CMake compiler flags can now be provided by another project.

* Closes https://github.com/espressif/esp-idf/issues/7507
2022-06-21 11:07:50 +08:00
6c5fb29c2c Merge branch 'bugfix/light_sleep_when_rtc_is_used_for_gettimeofday_v4.4' into 'release/v4.4'
esp_hw_support: Fix time spent in light sleep when RTC is used for gettimeofday (v4.4)

See merge request espressif/esp-idf!18413
2022-06-21 01:27:33 +08:00
3356aa38ed Merge branch 'feat/add_track_startup_time_to_startup_time_example_v4.4' into 'release/v4.4'
feat: Added tracking startup_time example startup times (v4.4)

See merge request espressif/esp-idf!18441
2022-06-21 01:16:58 +08:00
746df6107c Merge branch 'bugfix/bond_not_saved_for_pairing_again' into 'release/v4.4'
Bugfix/bond not saved properly after re-pairing

See merge request espressif/esp-idf!18235
2022-06-21 00:21:13 +08:00
8a2c9cf47f feat: Added tracking startup_time example startup times 2022-06-20 16:20:00 +00:00
b0a15716ee esp_hw_support: Fix time spent in light sleep when RTC is used for gettimeofday
The esp_timer was not advanced correctly.
2022-06-20 16:17:00 +00:00
586d9a2ef1 esp_wifi: Update wifi libs
Update wifi libs with below fixes -
1. Fix issues caused during SoftAP mode change
2. Error handling and cleanup related to STA PMF
2022-06-20 10:09:45 +00:00
582f9548d6 Merge branch 'nvs/remove_asserts_v4.4' into 'release/v4.4'
change: NVS assertions as runtime errorcodes (v4.4)

See merge request espressif/esp-idf!18460
2022-06-20 16:50:36 +08:00
b085cd2821 Merge branch 'refactor/improve_flash_power_down_logic_backport_v4.4' into 'release/v4.4'
system/sleep: improve flash power down logic(backport v4.4)

See merge request espressif/esp-idf!18587
2022-06-20 15:36:46 +08:00
d273837a51 Merge branch 'feature/modbus_update_for_other_targets_v44' into 'release/v4.4'
modbus: update to support other targets (Backport v4.4)

See merge request espressif/esp-idf!17385
2022-06-20 15:34:06 +08:00
76bde2df72 modbus: update to support other targets (Backport v4.4) 2022-06-20 15:34:06 +08:00
4cc873dfd9 improve flash power down logic 2022-06-20 11:32:20 +08:00
076c6764d9 Merge branch 'bugfix/update_gpio_intr_enable_note_v4.4' into 'release/v4.4'
Update the note of the gpio_intr_enable function(v4.4)

See merge request espressif/esp-idf!18541
2022-06-20 01:24:50 +08:00
a77509a140 Merge branch 'feature/btdm_add_link_role_param_for_gatt_disconnection_event_v4.4' into 'release/v4.4'
component/bt: add link role param for gatt disconnection event(backport v4.4)

See merge request espressif/esp-idf!15948
2022-06-20 00:42:33 +08:00
439c808555 Merge branch 'bugfix/avdtp_genreal_reject_format_error_v4.4' into 'release/v4.4'
component_bt: Fix AVDTP general reject format error(v4.4)

See merge request espressif/esp-idf!18556
2022-06-20 00:09:01 +08:00
57dcaf6ee7 Merge branch 'bugfix/adds_iram_attr_for_efuse_apis_v4.4' into 'release/v4.4'
bootloader_efuse: Adds IRAM_ATTR for efuse API (v4.4)

See merge request espressif/esp-idf!18561
2022-06-20 00:08:43 +08:00
4d0fe48431 Merge branch 'bugfix/enterprise_certs_ca_expired_v4.4' into 'release/v4.4'
esp_wifi: Fix issue of ca certificate expired

See merge request espressif/esp-idf!18519
2022-06-20 00:01:20 +08:00
b7d5e8160f Merge branch 'bugfix/fix_some_memory_leak_in_phy_v4.4' into 'release/v4.4'
Bugfix/fix some memory leak in phy v4.4

See merge request espressif/esp-idf!18551
2022-06-19 23:50:54 +08:00
1133b0ef10 Merge branch 'bugfix/touch_wait_circle_after_wakeup_from_sleep_on_s3_v4.4' into 'release/v4.4'
touch: fix the touch sensor wait cycle on s3 (v4.4)

See merge request espressif/esp-idf!17424
2022-06-19 22:49:08 +08:00
646b52f26e Merge branch 'bugfix/uart_isr_followup' into 'release/v4.4'
UART: Fix custom ISR registration function

See merge request espressif/esp-idf!17359
2022-06-19 22:48:17 +08:00
3176c707da component/bt: add link role param for gatt disconnection event(backport v4.4) 2022-06-19 14:41:55 +00:00
469e2e540b Merge branch 'feature/adds_check_32k_xtal_stopped_v4.4' into 'release/v4.4'
esp_hw_support: Adds a msg when 32k xtal was stopped (v4.4)

See merge request espressif/esp-idf!18411
2022-06-19 22:41:20 +08:00
93bf6be8bd Merge branch 'bugfix/ipc_blocking_v4.4' into 'release/v4.4'
esp_ipc: Fix a case when ipc_task() can wake up blocking task early (v4.4)

See merge request espressif/esp-idf!18415
2022-06-19 22:39:54 +08:00
44976afe6f Merge branch 'bugfix/fatfs_mtime_dst_v4.4' into 'release/v4.4'
fatfs: fix incorrect mtime returned for files created during DST (v4.4)

See merge request espressif/esp-idf!18458
2022-06-19 22:36:25 +08:00
ac4d9888e0 add: Kconfig assert or errorcode option
add: private include header
add: macro encapsulation for assertion or error check
add: ESP_FAIL return code documentation in public headers
change: replaced all assertions by NVS_ASSERT_OR_RETURN macro
change: few internal function return values from void to esp_err_t
change: ESP_ERR_NVS_VALUE_TOO_LONG macro comment
2022-06-19 14:35:42 +00:00
08c30b1c32 esp_wifi: Fix issue of ca certificate expired 2022-06-19 14:35:23 +00:00
dc0650503b Update the note of the gpio_intr_enable function 2022-06-19 14:33:13 +00:00
09b8af7398 fix the bug that some memory leaked in phy after wifi/ble deinit 2022-06-19 14:33:00 +00:00
af493beb76 deinit BB MAC back memory when they are not used 2022-06-19 14:33:00 +00:00
8164030575 Fix AVDTP general reject format error. 2022-06-19 14:32:43 +00:00
c9bec434aa bootloader_efuse: Adds IRAM_ATTR for efuse API
Fixes startup of app for case:
bootloader with 40Mhz and app with 80Mhz (ESPTOOLPY_FLASHFREQ)

Closes https://github.com/espressif/esp-idf/issues/9156
2022-06-19 14:32:15 +00:00
f68ef7f325 Merge branch 'tools/csv_handling_overhaul_v4.4' into 'release/v4.4'
tools: Overhaul csv handling for mfg_gen and nvs_partition_gen (v4.4)

See merge request espressif/esp-idf!18567
2022-06-18 01:23:45 +08:00
367dff055d tools: overhaul csv handling for mfg_gen and nvs_partition_gen
This fixes the issue where multiline strings and strings with delimiters inside the nvs input csv file were incorrectly parsed, and adds back the ability to add comment lines anywhere in the CSV file.

The issue stems from the move away from the python built in csv module to manual parsing, which was made after moving away from using the csv module to parse mfg data.

This reverts back to using the csv module for parsing and writing csv data in both mfg_gen and nvs_partition_gen, fixes the original issue in mfg_gen and improves code quality which makes the code more readable and maintainable.

Closes https://github.com/espressif/esp-idf/issues/7175
2022-06-17 13:50:09 +00:00
8062994960 Merge branch 'prov/update_protobuf_files' into 'release/v4.4'
provisioning: Updated proto auto-generated files for custom_config example

See merge request espressif/esp-idf!18569
2022-06-17 21:45:57 +08:00
b3c2a8c467 provisioning: Updated proto auto-generated files for custom_config example 2022-06-17 15:08:20 +05:30
0391a7e9d0 Merge branch 'bugfix/fix_ws_ping_receive_v4.4' into 'release/v4.4'
fix(websocket): Support handler deal with PING and CLOSE frame (backport v4.4)

See merge request espressif/esp-idf!18529
2022-06-17 14:11:39 +08:00
d02995240d Merge branch 'fix/gitlab_404_local_mirror_v4.4' into 'release/v4.4'
Handle gitlab 404 error (v4.4)

See merge request espressif/esp-idf!16958
2022-06-16 15:59:59 +08:00
1bd2145d6b ci: Add PING test for ci 2022-06-16 05:39:19 +00:00
7db0dcf72b fix(websocket): Support handler deal with PING and CLOSE frame 2022-06-16 05:39:19 +00:00
a0b227cf85 Handle gitlab 404 error
ci: do not retry on 404 when LOCAL_GITLAB_HTTPS_HOST not set
2022-06-16 05:38:46 +00:00
70c1ea2092 Merge branch 'bugfix/spiffs_flake8_check_v4.4' into 'release/v4.4'
ci: exclude spiffs submodule from flake8 checks (v4.4)

See merge request espressif/esp-idf!18535
2022-06-16 13:37:17 +08:00
1638cf47e4 ci: exclude spiffs submodule from flake8 checks 2022-06-16 07:23:24 +02:00
71c176d587 Merge branch 'bugfix/freertos_stack_tcb_alloc_order_v4.4' into 'release/v4.4'
freertos: fix allocation order for stack and TCB per portSTACK_GROWTH (v4.4)

See merge request espressif/esp-idf!18455
2022-06-15 10:55:51 +08:00
b38ba40d4b Merge branch 'bugfix/psram_startup_crash_v4.4' into 'release/v4.4'
psram: Fix startup crash when `CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0` (v4.4)

See merge request espressif/esp-idf!18500
2022-06-15 10:54:53 +08:00
1081d9ef7f Merge branch 'bugfix/spi_bus_flag_check_v4.4' into 'release/v4.4'
driver(spi): fix flag check in bus initialization (v4.4)

See merge request espressif/esp-idf!18463
2022-06-15 10:54:25 +08:00
c1ee8ceda8 Merge branch 'bugfix/esp_crt_bundle_build_issue_v4.4' into 'release/v4.4'
esp_crt_bundle: Fix build problems if MBEDTLS_CERTIFICATE_BUNDLE is disabled (v4.4)

See merge request espressif/esp-idf!18464
2022-06-15 10:53:46 +08:00
9fbdb65ac3 Merge branch 'docs/update_pairing_popup_troubleshoot_v4.4' into 'release/v4.4'
docs: Added a subsection for FAQ regarding paring pop up during provisioning (v4.4)

See merge request espressif/esp-idf!18497
2022-06-15 10:53:20 +08:00
65c85e34b1 Merge branch 'bugfix/cpu_cycle_count_not_iram_v4.4' into 'release/v4.4'
HAL: place cpu_ll_get_cycle_count in IRAM (v4.4)

See merge request espressif/esp-idf!18293
2022-06-15 10:52:48 +08:00
aa95c6545b Merge branch 'fix/usb/buffer_sizes_backport_v4.4' into 'release/v4.4'
usb: TinyUSB buffer sizes (backport v4.4)

See merge request espressif/esp-idf!18502
2022-06-15 10:51:27 +08:00
4aada814cc Merge branch 'feature/remove_back_compatible_with_s3beta_rom_v4.4' into 'release/v4.4'
spi_flash: remove back-compatible with caller function of S3Beta ROM(backport v4.4)

See merge request espressif/esp-idf!18504
2022-06-15 10:50:53 +08:00
08643e5184 Merge branch 'bugfix/rmt_register_file' into 'release/v4.4'
rmt: fix error in rmt register file (v4.4)

See merge request espressif/esp-idf!18511
2022-06-15 10:50:34 +08:00
4908c4e27d Merge branch 'bugfix/eap_method_selection_release_v4.4' into 'release/v4.4'
esp_wifi: Fix the negotiation of method with eap server.

See merge request espressif/esp-idf!18507
2022-06-15 10:50:03 +08:00
18c02b7a24 Merge branch 'bugfix/wlan_fixes_backports' into 'release/v4.4'
esp_wifi: Backport some WLAN fixes(v4.4)

See merge request espressif/esp-idf!18495
2022-06-15 10:48:51 +08:00
1ba0bf31b6 rmt: fix error in rmt register file
Closes https://github.com/espressif/esp-idf/issues/9100
2022-06-14 22:10:00 +08:00
7706cc8daf spi_flash: remove back-compatible with caller function of S3Beta ROM 2022-06-14 19:30:59 +08:00
3806e36807 usb: Fixed RX buffer min size 2022-06-14 12:49:42 +02:00
2b001daa78 Merge branch 'docs/i2c_thread_safety_backport_v4.4' into 'release/v4.4'
docs: Fix I2C thread-safety (backport v4.4)

See merge request espressif/esp-idf!18186
2022-06-14 18:45:07 +08:00
7543b94b38 esp_wifi: Fix the negotiation of method with eap server. 2022-06-14 15:10:14 +05:30
d7b5381fd2 esp_wifi: Remove group cipher check for PMF connection 2022-06-14 14:49:51 +05:30
9fb3ad9946 wpa_supplicant: Unicast key renew in TKIP mic failure
Currently we always request group key renew for during
TKIP mic failure. Add support for unicast/multicast
key renew as per packet.
2022-06-14 14:49:51 +05:30
f05d741c03 esp_wifi: Add APIs to check BTM and RRM support of connected AP 2022-06-14 14:49:51 +05:30
972aa9a9a9 esp_wifi: Changes to not use pmkid caching when SSID is changed 2022-06-14 14:49:51 +05:30
e4df46011c wpa_supplicant: Fix issues reported by coverity 2022-06-14 14:49:51 +05:30
a40641e3b1 Merge branch 'bugfix/wifi_backport_v4.4_0613' into 'release/v4.4'
esp_wifi: backport some wifi fix(v4.4)

See merge request espressif/esp-idf!18486
2022-06-14 17:12:26 +08:00
ed439cc7f3 freertos: Indicate completed initialization for APP CPU with idle task hook
Co-authored-by: Mahavir Jain <mahavir@espressif.com>
2022-06-14 14:19:01 +05:30
288929eb3a Merge branch 'bugfix/fix_ble_ext_adv_parameter_detection_v4.4' into 'release/v4.4'
component/bt: check the ble ext adv parameters (backport release/v4.4)

See merge request espressif/esp-idf!18489
2022-06-14 16:35:25 +08:00
8ad4039cc4 docs: Added a subsection for FAQ regarding paring pop up during provisioning 2022-06-14 11:26:16 +05:30
49baddf113 component/bt: check the ble ext adv parameters 2022-06-14 11:30:13 +08:00
6bbdcbef1e Merge branch 'bugfix/pm_enabled_bt_build_fail_v4.4' into 'release/v4.4'
Bluetooth build fail when power management is enabled(v4.4)

See merge request espressif/esp-idf!18375
2022-06-14 11:22:40 +08:00
6297fa4039 Merge branch 'feature/vfs_spiffs_(f)truncate_support_v4.4' into 'release/v4.4'
spiffs: Add vfs (f)truncate api support (v4.4)

See merge request espressif/esp-idf!17968
2022-06-14 11:22:08 +08:00
e88621532e esp_wifi: backport some wifi fix
1. add ht40 support for espnow & 80211_tx
2. fix smartconfig v2 bssid is zero issue
3. Optimize phy calibration time for C3 and S3
2022-06-14 10:57:47 +08:00
3e93a8c15f test_apps: add build only test for !MBEDTLS_CERTIFICATE_BUNDLE 2022-06-12 09:31:37 +05:30
a597cc80aa examples: add dependency on cert bundle configuration
Refactor examples to build with MBEDTLS_CERTIFICATE_BUNDLE disabled. Only examples
that can work with certificate bundle disabled have been modified here.
2022-06-12 09:30:31 +05:30
660b876465 esp_crt_bundle: Fix build problems if MBEDTLS_CERTIFICATE_BUNDLE is disabled
Exclude source and include file from build list if certificate bundle feature
is disabled.

Closes https://github.com/espressif/esp-idf/issues/8714
Closes IDFGH-7106
2022-06-12 09:29:12 +05:30
cb0275cb8f Merge branch 'bugfix/esp_http_client_test_v4.4' into 'release/v4.4'
esp_http_client example: Fix CI failures (v4.4)

See merge request espressif/esp-idf!18466
2022-06-12 03:52:54 +08:00
384ea8123b https_request_example:
Use local python server to test client session tickets
Update example test to test the client session tickets
Check for minimum heap info in the example test.
2022-06-11 12:19:08 +05:30
68ee89eac9 esp_http_client_test.py: Remove check for HTTP manual redirect
Manual redirect example is not backported on release/v4.4
2022-06-11 12:12:29 +05:30
f41a8df4cc Merge branch 'feature/esp-tls_optimize_memory_v4.4' into 'release/v4.4'
esp-tls: add api to free client session(backport v4.4)

See merge request espressif/esp-idf!18410
2022-06-10 20:22:00 +08:00
e75f4e5a1a Merge branch 'bugfix/mqtt_read_neg_and_ping_v4.4' into 'release/v4.4'
mqtt: Fix incorrect reads on error (v4.4)

See merge request espressif/esp-idf!18177
2022-06-10 18:25:06 +08:00
7691b44ee5 ci/mqtt: Fix weekend test publish-connect on target
* Fix thread safe issue in paho-mqtt library
* Move the weekend test to ethernet runner
2022-06-10 09:12:50 +02:00
61b5285cff mqtt: Fix incorrect reads on error (idf_v4.x)
* Update submodule: git log --oneline 985078affa8a2d2b56b87c8e6455252850f895c6..27eb4726067465c5c67d4ecdca5ddccd26f02580

Detailed description of the changes:
* MQTT: Fix signature matching for integer values (Backport to idf_v4.x)
  - See merge request espressif/esp-mqtt!133
  - Closes https://github.com/espressif/esp-idf/issues/8482
  - MQTT: Fix signature matching for integer values (espressif/esp-mqtt@f162002)
* ci: Deploy idf_v4.x branch to GitHub (espressif/esp-mqtt@ee5ecad)
2022-06-10 09:12:27 +02:00
8878b75a27 driver(spi): fix flag check in bus initialization
The current flag check in the SPI bus initialization is wrong and
causes exceptions when using certain SPI hosts in quad transfert mode.
2022-06-10 10:55:21 +08:00
507e273e1d fatfs: fix incorrect mtime returned for files created during DST
mktime function uses tm_isdst member as an indicator whether the time
stamp is expected to be in daylight saving time (1) or not (0).
FAT filesystem uses local time as mtime, so no information about DST
is available from the filesystem.

According to mktime documentation, tm_isdst can be set to -1, in which
case the C library will try to determine if DST was or wasn't in
effect at that time, and will set UTC time accordingly.

Note that the conversion from UTC to local time and then back to UTC
(time_t -> localtime_r -> FAT timestamp -> mktime -> time_t) does not
always recover the same UTC time. In particular, the local time in the
hour before DST comes into effect can be interpreted as "before DST"
or "after DST", which would correspond to different UTC values. In
this case which option the C library chooses is undefined.

Closes https://github.com/espressif/esp-idf/issues/9039
Originally reported in https://github.com/espressif/arduino-esp32/issues/6786
2022-06-09 22:02:46 +02:00
5b6d9d87a3 freertos: add return value to API vTaskGetSnapshot
`vTaskGetSnapshot` is being used in coredump module to collect diagnostic information.
It is possible that input arguments are invalid and `assert` in this situation is not
correct.

This commit modifies API signature to return pdTRUE in case of success, and pdFALSE
otherwise. Caller can verify return value and then take appropriate decision.
2022-06-09 21:13:23 +05:30
4a59036ab1 freertos: fix allocation order for stack and TCB per portSTACK_GROWTH
This is as per FreeRTOS recommendation and allows to protect task TCB
in case task stack has overflowed.
2022-06-09 20:49:27 +05:30
871af8c5a5 esp_hw_support: Adds a msg when 32k xtal was stopped 2022-06-09 22:45:31 +08:00
62b46a0e92 Merge branch 'bugfix/s3_psram_spinlock_v4.4' into 'release/v4.4'
spinlock: fixed spinlocks not working on S3 if placed in PSRAM (v4.4)

See merge request espressif/esp-idf!18439
2022-06-09 17:18:18 +08:00
3a5e9d5ce1 Merge branch 'feature/add_mld6_flag_for_eth_v4.4' into 'release/v4.4'
feat(netif): Add NETIF_FLAG_MLD6 flag for eth netif (backport v4.4)

See merge request espressif/esp-idf!18266
2022-06-09 10:59:21 +08:00
c3d76d6496 Merge branch 'ci/force_based_on_commit_v4.4' into 'release/v4.4'
ci: support one pipeline must based on commmits (v4.4)

See merge request espressif/esp-idf!17920
2022-06-09 10:58:29 +08:00
be8129dc2d Merge branch 'bugfix/doc_static_Files_v4.4' into 'release/v4.4'
docs: fix missing static file path (v4.4)

See merge request espressif/esp-idf!17329
2022-06-09 10:56:28 +08:00
efdca9431c Merge branch 'bugfix/c3_efuse_fail_bits_v4.4' into 'release/v4.4'
soc: Fix efuse fail bits (v4.4)

See merge request espressif/esp-idf!18417
2022-06-09 10:53:31 +08:00
7905f0d3f8 Merge branch 'feature/adds_efuses_to_table_v4.4' into 'release/v4.4'
efuse: Adds ERR_RST_ENABLE efuse for C3 (v4.4)

See merge request espressif/esp-idf!18419
2022-06-09 10:53:16 +08:00
957505136b spinlock: fixed spinlocks not working on S3 if placed in PSRAM
The compare and set instruction (S32C1I) cannot be used when
lock is not in internal memory.

Closes https://github.com/espressif/esp-idf/issues/9120
2022-06-09 10:39:19 +08:00
75491fe216 spiffs: Add vfs (f)truncate api support
Unit test cases added to verify truncate.

Closes https://github.com/espressif/esp-idf/issues/2234
2022-06-08 12:52:25 +00:00
f1318fe7cb Merge branch 'bugfix/mbedtls_dynamic_memory_crash_on_rsa_ciphers_v4.4' into 'release/v4.4'
mbedtls: fix ssl server crash when enable mbedtls dynamic buffer(backport v4.4)

See merge request espressif/esp-idf!18426
2022-06-08 19:46:43 +08:00
270fadaee2 Merge branch 'bugfix/uninitialized-element_v4.4' into 'release/v4.4'
component_bt:initialize all elements of esp_bt_controller_config_t(v4.4)

See merge request espressif/esp-idf!18404
2022-06-08 15:24:39 +08:00
edcc76ec2e https_server: add mbedtls dynamic buffer function test 2022-06-08 15:09:38 +08:00
4896d0c8f3 mbedtls: fix ssl server crash when enable mbedtls dynamic buffer
Not free keycert until MBEDTLS_SSL_CLIENT_KEY_EXCHANGE for rsa key exchange methods, because keycert will be used to parse client key exchange.
2022-06-08 14:27:41 +08:00
f86be6141b Merge branch 'bugfix/i2c_timeout_issue_v4.4' into 'release/v4.4'
I2C: patch for solving watchdog timeout issue(backport v4.4)

See merge request espressif/esp-idf!18130
2022-06-08 14:12:37 +08:00
f20d229390 Merge branch 'refactor/flash_qio_overidable_v4.4' into 'release/v4.4'
spi_flash: refact that flash qio can be overidable(backport v4.4)

See merge request espressif/esp-idf!18036
2022-06-08 12:37:55 +08:00
e41a7d64b5 Merge branch 'bugfix/do_not_allow_unauthenticated_encrypted_key_data_release_v4.4' into 'release/v4.4'
esp_wifi: Ignore unauthenticated encrypted EAPOL-Key data and fix

See merge request espressif/esp-idf!18314
2022-06-08 10:51:57 +08:00
9b07593ce5 Merge branch 'bugfix/esp_http_client_example_v4.4' into 'release/v4.4'
esp_http_client example: Add cert for redirect to HTTPS example (v4.4)

See merge request espressif/esp-idf!18402
2022-06-08 02:28:48 +08:00
1979c68e82 efuse: Adds ERR_RST_ENABLE efuse for C3 and S3
Closes https://github.com/espressif/esp-idf/issues/8357
2022-06-07 22:06:45 +08:00
02fe424e48 soc: Fix description of efuse fail bits 2022-06-07 21:42:33 +08:00
e5d55fe1b1 esp_ipc: Fix a case when ipc_task() can wake up blocking task early
Closes https://github.com/espressif/esp-idf/issues/8559
2022-06-07 21:20:08 +08:00
f47023f8c2 Merge branch 'update/protobuf_v4.4' into 'release/v4.4'
protobuf: Updated to v1.4.0  (v4.4)

See merge request espressif/esp-idf!18406
2022-06-07 20:37:47 +08:00
1191d9c8e6 example: https_request update free client session api 2022-06-07 19:37:10 +08:00
4be609a471 esp-tls: add api to free client session
Free session with mbedtls api to avoid mem-leak
2022-06-07 19:22:36 +08:00
a7664ecb27 Merge branch 'fix/menuconfig_option_esp_cryptoauthlib_v4.4' into 'release/v4.4'
esp_tls_mbedtls.c: Fix esp-idf integration of esp-cryptoauthlib (v4.4)

See merge request espressif/esp-idf!18400
2022-06-07 18:56:00 +08:00
fbf35a4874 esp_local_ctrl: Regenerated proto-c and python with protobuf compiler v3.21.0
$protoc --version
libprotoc 3.21.0

$ protoc-c --version
protobuf-c 1.4.0
2022-06-07 15:59:41 +05:30
0ca9ad5249 wifi_provisioning: Regenerated proto-c and python with protobuf compiler v3.21.0 2022-06-07 15:59:40 +05:30
509a423f83 protocomm: Regenerated proto-c and python with protobuf compiler v3.21.0 2022-06-07 15:59:40 +05:30
9549f0026f protobuf: Fix v4.21.0 (python) compatibility issue
- Added auto-generated protobuf files (proto-c and python to pre-commit hook ignore lists
2022-06-07 15:59:40 +05:30
0b05f1708d protobuf-c: Update submodule to v1.4.0 2022-06-07 15:59:39 +05:30
d02db62bc3 Merge branch 'test/rtc_8m_d256_v4.4' into 'release/v4.4'
rtc: fixed 8MD256 can't be used as RTC slow src on ESP32 (v4.4)

See merge request espressif/esp-idf!18105
2022-06-07 18:21:12 +08:00
f2048b2d15 initialize all elements of esp_bt_controller_config_t
Closes https://github.com/espressif/esp-idf/pull/9073
2022-06-07 17:30:48 +08:00
b291be8a5d esp_http_client example: Add cert for redirect to HTTPS example
esp_http_client_test.py: Add checks for missing example logs
2022-06-07 14:53:25 +05:30
b306517641 esp_tls_mbedtls.c: Fix esp-idf integration of esp-cryptoauthlib
menuconfig option
2022-06-07 14:45:40 +05:30
e595ae88d4 HAL: place cpu_ll_get_cycle_count in IRAM
Closes https://github.com/espressif/esp-idf/issues/9008
2022-06-07 06:30:46 +00:00
57082d14a5 Merge branch 'feature/semihosting_call_number_change_v4.4' into 'release/v4.4'
Semihosting V2 (v4.4)

See merge request espressif/esp-idf!18332
2022-06-06 20:31:19 +08:00
5accbaebab Merge branch 'bugfix/i2c_port_check_v4.4' into 'release/v4.4'
I2C: Fix I2C ports check in each function of the API implementation

See merge request espressif/esp-idf!18257
2022-06-06 14:56:36 +08:00
5addf329d8 Merge branch 'bugfix/i2c_incorrect_speed_v4.4' into 'release/v4.4'
I2C: Fix SCL period timings on ESP targets (backport v4.4)

See merge request espressif/esp-idf!18271
2022-06-06 12:32:32 +08:00
2ee9fc6aff Bluetooth build fail when power management is enabled
Closes https://github.com/espressif/esp-idf/issues/9081
2022-06-06 11:42:45 +08:00
93d27565ac test_rtc: add test_app to test power consumption 2022-06-06 00:51:38 +08:00
c61db5e9c9 soc_caps: add SOC_PM_SUPPORT_RTC_PERIPH_PD
Partially pick 6336f8191e
2022-06-06 00:17:39 +08:00
deea85b848 pm: add test for RTC using 8MD256 as clock source 2022-06-06 00:16:03 +08:00
2a1002b4a4 modify voltage param to fit all mode of S3 2022-06-05 02:33:51 +08:00
a2e1b6756e esp32s3: fixed dangerous power parameters in sleep modes 2022-06-05 02:33:51 +08:00
f46bd50884 pm: putting dbias and pd_cur code into same function 2022-06-05 02:33:51 +08:00
254870c3c4 rtc: fixed 8MD256 can't be used as RTC slow src on ESP32
Sync configuration from other chips

Closes: https://github.com/espressif/esp-idf/issues/8007, https://github.com/espressif/esp-idf/pull/8089
2022-06-05 02:33:50 +08:00
5e6cffbb14 Merge branch 'bugfix/backport_certificate_bundle_fixes_v4.4' into 'release/v4.4'
Certificate bundle fixes (v4.4)

See merge request espressif/esp-idf!18352
2022-06-03 16:27:47 +08:00
f1abc863a2 Merge branch 'bugfix/console_fixes_4.4' into 'release/v4.4'
console: various fixes and example improvements (backport v4.4)

See merge request espressif/esp-idf!18161
2022-06-03 03:54:30 +08:00
c55db5e688 semihosting: drop absolute path support 2022-06-02 11:14:18 +02:00
2d91698324 Update esp_crt_bundle certificates 2022-06-02 11:03:24 +05:30
279ec3eb35 i2c: fix 'comparision is always true' warning 2022-06-02 13:28:21 +08:00
487df7cb61 Merge branch 'bugfix/add_bda_to_read_rmt_name_param_v4.4' into 'release/v4.4'
Bugfix/add bda to read rmt name param v4.4

See merge request espressif/esp-idf!18280
2022-06-02 11:46:07 +08:00
f51d746a9a Merge branch 'feature/docker_build_gh_actions_v4.4' into 'release/v4.4'
ci: move Docker image builds to Github, plus other improvements (v4.4)

See merge request espressif/esp-idf!18287
2022-06-02 11:45:29 +08:00
cd21a31416 vfs: usb_serial_jtag: consider O_NONBLOCK flag when reading via driver
Closes https://github.com/espressif/esp-idf/issues/8839
2022-06-01 16:32:28 +02:00
129cdcc08c console: linenoiseProbe: check if response is valid
Previously linenoiseProbe would accept any 4 byte response, even one
that isn't expected. This adds a check that the first byte of the
response is ESC.
Suggested in https://github.com/espressif/esp-idf/issues/8839.
2022-06-01 16:32:28 +02:00
78480e215a examples: console: add a readme with an overview of examples 2022-06-01 16:32:28 +02:00
6f57018c9d examples: support USB_CDC and USB_SERIAL_JTAG in basic console example
Related to https://github.com/espressif/esp-idf/issues/8738
Related to https://github.com/espressif/esp-idf/issues/8879

Doesn’t implement USB_CDC (over USB_OTG peripheral) for ESP32-S3 yet;
this only works on ESP32-S2 for now. On ESP32-S3 it is now possible to
use USB_SERIAL_JTAG console.
2022-06-01 16:32:28 +02:00
80f7b45672 examples: console: move duplicated cmd_wifi files into a new component 2022-06-01 16:32:28 +02:00
cb4a197a98 examples: move console_usb example to console directory 2022-06-01 16:30:14 +02:00
fa4256c885 ci: build and push Docker images in Github actions, add arm64 platform
Replaces the previously used Docker Hub autobuild infrastructure.
This allows for more flexible configuration of the build process,
at the expense of some extra maintenance of CI workflow files
required.
2022-06-01 16:23:50 +02:00
dc4fcdd2e1 docs: document build arguments of the Docker image 2022-06-01 16:23:50 +02:00
8eec6cb868 tools/docker: add IDF_CLONE_SHALLOW and IDF_INSTALL_TARGETS arguments
These two arguments can be used to reduce the size of the Docker
image:

- Setting IDF_CLONE_SHALLOW enables shallow cloning.
- Setting IDF_INSTALL_TARGETS to the comma separated list of targets
  results in toolchains being installed only for these targets.
2022-06-01 16:23:50 +02:00
c0df348156 semihosting: version 2 2022-06-01 14:49:03 +02:00
c0dcebc41c Merge branch 'feat/esp32s3_support_gpio_deepsleep_wakeup_v4.4' into 'release/v4.4'
example/deep_sleep: add example of EXT0 and using internal pullups (v4.4)

See merge request espressif/esp-idf!18119
2022-06-01 19:56:17 +08:00
a1d5a9b971 esp_crt_bundle: Add bounds checking for the "esp_crt_bundle_set" API.
Closes https://github.com/espressif/esp-idf/issues/8397
2022-06-01 15:09:50 +05:30
ec0f7850a0 mbedtls: move locally managed root certificates to separate file
Purpose:
This will allow for easily automating periodic updates to
"cacrt_all.pem" file.

Note:
For now newly created "cacrt_local.pem" contains single "DST Root CA X3"
which we are keeping to manage compatibility with endpoints like
"howsmyssl.com". Please note this Root CA is expired and is not part of
Mozilla’s NSS root certificate store.
2022-06-01 15:07:31 +05:30
43d3cb37a0 esp_crt_bundle: Fix build error
- When `esp_crt_bundle.h` is included before any config,
  a build error (`esp_err_t` not defined) is observed

Closes https://github.com/espressif/esp-idf/issues/8606
2022-06-01 15:06:59 +05:30
f1fbbf3171 Merge branch 'bugfix/fixed-unsatisfiable-condition_v4.4' into 'release/v4.4'
Fixed comparison with ESP_MONITOR_DECODE (v4.4)

See merge request espressif/esp-idf!18334
2022-06-01 16:12:40 +08:00
221bf746d0 Fixed comparsion of integer and string that evaluated always to False
Closes https://github.com/espressif/esp-idf/issues/9052
Closes IDFGH-7482
2022-05-31 14:07:18 +02:00
ae0e3e2e2a Merge branch 'feature/add_spiffs_check_v4.4_2' into 'release/v4.4'
spiffs: Add esp_spiffs_check() function (v4.4)

See merge request espressif/esp-idf!18189
2022-05-31 10:28:03 +08:00
d5151ac1f7 Bugfix/bond not saved properly after re-pairing 2022-05-30 22:39:58 +05:30
afde319749 Merge branch 'bugfix/fix_lwip_kconfig_v4.4' into 'release/v4.4'
fix(Kconfig): Fix lw-ip Kconfig display garbled characters (backport v4.4)

See merge request espressif/esp-idf!18320
2022-05-30 17:53:55 +08:00
ad176653a0 fix(Kconfig): Fix lw-ip Kconfig display garbled characters 2022-05-30 16:21:09 +08:00
26ad146077 esp_wifi: Ignore unauthenticated encrypted EAPOL-Key data and fix
handling of key RSC.

Closes https://github.com/espressif/esp-idf/issues/8401
2022-05-30 12:15:44 +05:30
fc30369909 Merge branch 'bugfix/update_efuse_name_v4.4' into 'release/v4.4'
efuse: update efuse name (backport v4.4)

See merge request espressif/esp-idf!18195
2022-05-30 11:15:16 +08:00
2e4784611d efuse: update efuse name (backport v4.4) 2022-05-30 11:15:16 +08:00
0340c2f2bc Merge branch 'bugfix/keep_rtc8m_in_lightsleep_v4.4' into 'release/v4.4'
pm: fixed RTC8M domain power down issue when used as RTC source (v4.4)

See merge request espressif/esp-idf!18075
2022-05-30 09:54:39 +08:00
22cf1d0d58 assign value to uninitialized bt_addr field 2022-05-29 18:08:56 -07:00
35fd2cee7c add address field to read_rmt_name_param 2022-05-29 18:08:41 -07:00
72dcce1ec2 Merge branch 'bugfix/return_idf_component_manager_build_property_v4.4' into 'release/v4.4'
build & config: Add IDF_COMPONENT_MANAGER build property (v4.4)

See merge request espressif/esp-idf!18286
2022-05-28 13:59:17 +08:00
12dfcdd1d9 spiffs: Add esp_spiffs_check() function
esp_spiffs_check() exposes SPIFFS_check() functionality to the user
2022-05-27 21:14:33 +00:00
fbb0e684e9 Merge branch 'bugfix/mkdfu_flash_parameters_v4.4' into 'release/v4.4'
mkdfu.py: Support setting flash parameters (backport v4.4)

See merge request espressif/esp-idf!18291
2022-05-28 03:26:29 +08:00
f40b88e866 mkdfu.py: Support setting flash parameters 2022-05-27 16:24:13 +02:00
d15b02fdb2 Merge branch 'bugfix/disable_extensions_idfpy_tests_v4.4' into 'release/v4.4'
Tools: Make idf.py tests independent on extra extensions (v4.4)

See merge request espressif/esp-idf!18277
2022-05-27 18:57:43 +08:00
c3969b789e build & config: Add IDF_COMPONENT_MANAGER build property 2022-05-27 12:57:00 +02:00
395087ff44 Tools: Make idf.py tests independent on extra extensions 2022-05-27 11:14:08 +02:00
6260f53c14 Merge branch 'feature/modbus_master_fix_check_uart_set_pin_v44' into 'release/v4.4'
example/modbus_master: fix the assert for uart_set_pin (backport v4.4)

See merge request espressif/esp-idf!17624
2022-05-27 11:51:48 +08:00
8ac3d392a2 I2C: Fix SCL period timings on ESP targets
The output frequency is now more accurate as the SCL period timings have been fixed.
This fix applies for ESP32, ESP32S3, ESP32C3 and ESP32H2
2022-05-27 11:17:40 +08:00
692c1a6bea Merge branch 'feature/idf_py_clang_tidy_check_v4.4' into 'release/v4.4'
feat(idf.py): add `idf.py clang-check` and `idf.py clang-html-report` (v4.4)

See merge request espressif/esp-idf!18229
2022-05-26 16:40:10 +08:00
8215bd6670 feat(netif): Add NETIF_FLAG_MLD6 flag for eth netif 2022-05-26 16:07:50 +08:00
308f84972c I2C: Fix I2C ports check in each function of the API implementation
* Closes https://github.com/espressif/esp-idf/issues/9009
2022-05-26 12:44:46 +08:00
992b4ffb1e Merge branch 'bugfix/systimer_counter_value_bit_field_v4.4' into 'release/v4.4'
HAL: Fix systimer counter value bit field (v4.4)

See merge request espressif/esp-idf!18254
2022-05-26 10:16:39 +08:00
906bb0e4a3 hal: Fix systimer counter value bit field
This commit fixes the systimer_counter_value_t by adding a resreved field so that the
type fills 64-bits.

Without the reserved field, when compiling with -O0 optimization, the unoccupied high
bits would not be initalized by the compiler, leading to systimer_hal_get_counter_value()
returning a garbage value.
2022-05-26 01:47:33 +08:00
7e20435a54 Merge branch 'bugfix/fix_cannot_lslp_again_after_ulp_wakeup_backport_v4.4' into 'release/v4.4'
sleep: fix cannot lightsleep again after a wakeup from ULP(backport v4.4)

See merge request espressif/esp-idf!18180
2022-05-25 16:52:36 +08:00
ff4875bc9b Merge branch 'bugfix/setup_defines_for_correct_mutex_usage' into 'release/v4.4'
coap_config_posix.h: Set up defines for correct mutex usage

See merge request espressif/esp-idf!18232
2022-05-25 13:55:44 +08:00
3e7f721d33 Merge branch 'bugfix/i2s_write_timeout_when_setting_clock_v4.4' into 'release/v4.4'
i2s: fixed write timeout while setting the clock (v4.4)

See merge request espressif/esp-idf!18220
2022-05-25 13:34:28 +08:00
1a6c817c27 Merge branch 'bugfix/s3_spi_pre_v4.4' into 'release/v4.4'
hal: Fix max value for clkdiv_pre in ESP32-S3 SPI master clock config (v4.4)

See merge request espressif/esp-idf!18237
2022-05-25 11:29:34 +08:00
0ebd381c16 Merge branch 'contrib/github_pr_9001_v4.4' into 'release/v4.4'
usbh_print_intf_desc prints wrong value for tbInterfaceClass (IDFGH-9000)

See merge request espressif/esp-idf!18236
2022-05-25 01:56:33 +08:00
cca9f93067 usbh_print_intf_desc prints wrong value for tbInterfaceClass (IDFGH-9000) 2022-05-24 14:28:54 +02:00
7a9daa3cd3 hal: Fix max value for clkdiv_pre in ESP32-S3 SPI master clock config
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-24 08:51:16 -03:00
993267d745 coap_config_posix.h: Set up defines for correct mutex usage
if COAP_CONSTRAINED_STACK is defined (is for esp-idf), the mutexes set up
to protect the critical sections were not working as expected and were just
dummy entries.

Use the pthread_ version of the mutex instead by defining HAVE_PTHREAD_H
and HAVE_PTHREAD_MUTEX_LOCK.
2022-05-24 14:43:02 +05:30
f16e21aa9d docs(idf.py): add IDF Clang Tidy chapter 2022-05-24 16:08:40 +08:00
5c19581bfe feat(idf.py): add idf.py clang-check and idf.py clang-html-report 2022-05-24 16:08:40 +08:00
9b0f7b657b i2s: fixed write timeout while setting the clock (v4.4) 2022-05-24 10:14:44 +08:00
064148212b Merge branch 'bugfix/read_eof_no_vfs_4.4' into 'release/v4.4'
newlib: fix return value of no-VFS _read_r if nothing received (v4.4)

See merge request espressif/esp-idf!18160
2022-05-23 17:53:47 +08:00
9d2238d6e4 Merge branch 'bugfix/mbedtls_dynamic_buffer_crash_on_ssl_server_v4.4' into 'release/v4.4'
fix(mbedtls): fix ssl server memory leak when enable mbedtls dynamic buffer function(backport v4.4)

See merge request espressif/esp-idf!18166
2022-05-23 11:20:30 +08:00
fc8ef9d1c2 Merge branch 'bugfix/mdsn_fuzzer_extend_v4.4' into 'release/v4.4'
mdns: ~~Extend fuzzing and~~ Fix various petty issues (v4.4)

See merge request espressif/esp-idf!18056
2022-05-20 16:58:13 +08:00
11cf565834 docs: Fix I2C thread-safety 2022-05-20 08:34:04 +02:00
db98a4b2ef Merge branch 'bugfix/vfs_sock_select_race_v4.4' into 'release/v4.4'
vfs: Fix potential select() race if both sock and other-fd trigger (v4.4)

See merge request espressif/esp-idf!18175
2022-05-20 12:55:09 +08:00
bef5b2ac6e remove wrong function rtc_cntl_ll_ulp_wakeup_enable for esp32s2 and esp32s3 2022-05-19 23:27:32 +08:00
25c49588f9 esp_hw_‎support/sleep: ‎fix cannot lightsleep again after a wakeup from ULP
Since ulp wakeup signal are connected to ulp int raw(except esp32), we
need to clear ulp int raw before sleep when ulp wakeup enabled. Otherwise,
if the ulp int raw is already set, chip will not sleep properly.

Closes https://github.com/espressif/esp-idf/issues/6229
2022-05-19 23:13:42 +08:00
f974099b42 vfs: Fix potential select() race if both sock and other-fd trigger
This fixes a potential race condition in select() if both a socket-fd
and non-socket fd trigger simultaneously to unblock this select.
In case of both fds, we use lwip's local thread semaphore, so we only
have to try return it (if it was taken/triggered more than once) when
we exit select().

Closes https://github.com/espressif/esp-idf/issues/8896
2022-05-19 16:57:39 +02:00
ae6c52e9f9 Merge branch 'bugfix/fix_memory_miss_bug_v4.4' into 'release/v4.4'
esp32c3/esp32s3: Fix cpu crash bug when wakeup from lightsleep for memory data miss (backport v4.4)

See merge request espressif/esp-idf!17826
2022-05-19 13:47:20 +08:00
5d95cd58b2 Merge branch 'bugfix/fix_wifi_pm_state_v4.4' into 'release/v4.4'
esp_wifi: fix no null data after WiFi waking up. (backport v4.4)

See merge request espressif/esp-idf!18142
2022-05-19 10:51:59 +08:00
416d01db7a Merge branch 'bugfix/wifi_provisioning_arduino_v4.4' into 'release/v4.4'
provisioning: replace <lwip/inet.h> by <lwip/ip4_addr.h> in wifi_provisioning/wifi_config.h (v4.4)

See merge request espressif/esp-idf!18162
2022-05-19 10:45:38 +08:00
263e1cec64 Merge branch 'bugfix/tools_clang_atomic_alignment_v4.4' into 'release/v4.4'
cmake: add "-Wno-atomic-alignment" flag to cmake script (v4.4)

See merge request espressif/esp-idf!18163
2022-05-19 10:44:46 +08:00
9ce3973f19 Merge branch 'bugfix/errno_overlap_v4.4' into 'release/v4.4'
newlib: fix ESHUTDOWN and ENOTSOCK having the same numerical value (v4.4)

See merge request espressif/esp-idf!18164
2022-05-19 10:44:12 +08:00
81c195fed2 fix(mbedtls): fix ssl server memory leak when enable mbedtls dynamic buffer function 2022-05-19 10:41:40 +08:00
c5deb7a971 Merge branch 'bugfix/disable_bt_pll_track_v4.4' into 'release/v4.4'
Bluetooth: disable PLL track function for ESP32-C3/ESP32-S3 as it introduced coexistence issues(bacport v4.4)

See merge request espressif/esp-idf!18139
2022-05-19 10:41:27 +08:00
74dd39d8b0 Merge branch 'bugfix/Fix_ios_ble_adv_rsp_v4.4' into 'release/v4.4'
Fix iOS advertisement response and simplify (v4.4)

See merge request espressif/esp-idf!18038
2022-05-19 10:40:57 +08:00
7a72f8e852 Merge branch 'bugfix/driver_uart_fix_tx_bytes_rts_assert_failure_v44' into 'release/v4.4'
driver: fixes context switch while sending cause rts reset before send (backport v4.4)

See merge request espressif/esp-idf!17929
2022-05-19 10:40:34 +08:00
6bf650c159 driver: fixes context switch while sending cause rts reset before send (backport v4.4) 2022-05-19 10:40:34 +08:00
0bbdd67231 Merge branch 'bugfix/fix_s3_bbpll_calibrate_fail_bug_v4.4' into 'release/v4.4'
ESP32S3: fix bbpll calibrate fail bug in high temperature  (backport v4.4)

See merge request espressif/esp-idf!17896
2022-05-19 10:39:52 +08:00
6382b51bfb Merge branch 'feature/check_block_after_burn_v4.4' into 'release/v4.4'
efuse: Validates data after burning and re-burnes it if necessary (v4.4)

See merge request espressif/esp-idf!17702
2022-05-19 10:39:17 +08:00
80c516e6ad Merge branch 'bugfix/vfs_fat_(p)write_on_diskfull_v4.4' into 'release/v4.4'
vfs: bugfix vfs_fat_write/pwrite upon disk-full (v4.4)

See merge request espressif/esp-idf!17649
2022-05-19 10:39:01 +08:00
8fe41e2e41 Merge branch 'fix/backport/usb_host/cdc_build' into 'release/v4.4'
usb_host: Don't build CDC host driver for unsupported targets (backport v4.4)

See merge request espressif/esp-idf!17526
2022-05-19 10:38:50 +08:00
b02cf33bfa newlib: fix ESHUTDOWN and ENOTSOCK having the same numerical value 2022-05-18 19:52:15 +02:00
50356cb073 cmake: add "-Wno-atomic-alignment" flag to clang scripts
Clang outputs performance warnings by default for atomic operations with
access size more then 4 bytes. So add "-Wno-atomic-alignment add" flag to
ESP-IDF cmake script.
2022-05-18 19:50:04 +02:00
9359c61fea provisioning: Fix include for Arduino INADDR_NONE 2022-05-18 19:44:05 +02:00
134b5153e3 newlib: fix return value of no-VFS _read_r if nothing received
'read' function should return 0 when encountering an end of file. When
newlib calls read and sees EOF returned, it assumes that this
condition is permanent and never calls 'read' for this file again
(unless the read pointer is moved using fseek).
The correct behavior in case no characters were received over UART is
to return -1. In this case newlib will retry reading from file on next
call to fread, fgetc or another function which calls __srefill_r.
2022-05-18 19:33:10 +02:00
d222adbeeb solve memory error bug when in lightsleep mode 2022-05-18 17:43:13 +08:00
d6f51a5cab esp_wifi: fix no null data after WiFi waking up (backport v4.4). 2022-05-17 23:12:33 +08:00
5c24b7f75f components/bt: disable Bluetooth PLL track function for ESP32-C3/ESP32-S3 as it introduced coexistence issues 2022-05-17 20:54:51 +08:00
fe1cf490b9 Merge branch 'feature/enable_component_manager_by_default_for_pure_cmake_v4.4' into 'release/v4.4'
tools: Enable the component manager by default in CMake (v4.4)

See merge request espressif/esp-idf!18121
2022-05-17 18:42:19 +08:00
04f7c342f0 I2C: patch for solving watchdog timeout issue 2022-05-17 16:36:40 +08:00
bfce7241c4 example/deep_sleep: add example of EXT0 and using internal pullups 2022-05-17 10:45:31 +08:00
66f60095c2 tools: Enable the component manager by default in CMake 2022-05-16 17:10:07 +02:00
81391f57f6 Merge branch 'feature/disable_protection_v4.4' into 'release/v4.4'
bootloader: Create option for toggling memory region protection (v4.4)

See merge request espressif/esp-idf!18117
2022-05-16 22:09:44 +08:00
4efab0d0ff soc/esp32s3: merge gpio caps into soc_caps.h 2022-05-16 22:01:11 +08:00
477d11e9c1 bootloader: Create option for enabling memory region protection
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-16 09:39:51 -03:00
4995e24199 Merge branch 'feature/optimize_wifi_provisioning_memory_v4.4' into 'release/v4.4'
feat(wifi_provisioning): Optimize memory for wifi scan ap number (backport v4.4)

See merge request espressif/esp-idf!18113
2022-05-16 15:20:44 +08:00
a706a482c6 feat(wifi_provisioning): Optimize memory for wifi scan ap number 2022-05-16 14:07:19 +08:00
e119d6cb06 pm: add powerdown for int_8m on ESP32-H2
Also move the xtal fpu logic to sleep_modes.c
2022-05-16 00:59:36 +08:00
3806b240cf Merge branch 'bugfix/interrupted_thread_gdb_bt_v4.4' into 'release/v4.4'
riscv: Fixes GDB backtrace of interrupted threads (v4.4)

See merge request espressif/esp-idf!17716
2022-05-13 21:59:18 +08:00
caa5444c93 RISC-V: Fix vectors.S assembly file indentation and macro usage
The file is now more consistent as the macros have been fixed, more comments
have been added and the indentation is now using spaces only.
2022-05-13 12:54:21 +03:00
9017ff235b riscv: Use semihosting to set breakpoint and watchpoint when running under debugger 2022-05-13 12:54:21 +03:00
46a98fb8d1 riscv: Adds support for returning from exception handler 2022-05-13 12:52:06 +03:00
300d67411a riscv: Fixes GDB backtrace end function to point to prvTaskExitError 2022-05-13 12:52:06 +03:00
44bfddd784 riscv: Fixes GDB backtrace of interrupted threads
Save missed SP value on stack
2022-05-13 12:52:06 +03:00
80ea94dd36 Merge branch 'bufix/esp32c3_s3_build_err_v4.4' into 'release/v4.4'
component_bt: Fix ESP32C3/S3 build error after enable light sleep(v4.4)

See merge request espressif/esp-idf!17995
2022-05-13 15:39:38 +08:00
832c199c25 Merge branch 'bugfix/fix_heap_free_memory_v4.4' into 'release/v4.4'
Heap: fix free bytes calculation for TLSF heap (backport v4.4)

See merge request espressif/esp-idf!17688
2022-05-12 16:20:32 +08:00
17b9cc6b4a pm: fixed RTC8M domain power issues
introduced in e44ead5356

1. The int8M power domain config by default is PD. While LEDC is using
RTC8M as clock source, this power domain will be kept on.

But when 8MD256 is used as RTC clock source, the power domain should
also be kept on.

On ESP32, there was protection for it, but broken by commit
e44ead5356. Currently the power domain
will be forced on when LEDC is using RTC8M as clock source &&
!int8m_pd_en (user enable ESP_PDP_DOMAIN_RTC8M in lightsleep). Otherwise
the power domain will be powered off, regardless of RTC clock source.

In other words, int8M domain will be forced off (even when 8MD256
used as RTC clock source) if LEDC not using RTC8M as clock source, user
doesn't enable ESP_PDP_DOMAIN_RTC8M, or in deep sleep.

On later chips, there's no such protection, so 8MD256 could't be used as
RTC clock source in sleep modes.

This commit adds protection of 8MD256 clock to other chips. Fixes the
incorrect protection logic overriding on ESP32. Now the power domain
will be determiend by the logic below (order by priority):

    1. When RTC clock source uses 8MD256, power up
    2. When LEDC uses RTC8M clock source, power up
    3. In deepsleep, power down
    4. Otherwise determined by user config of ESP_PDP_DOMAIN_RTC8M,
       power down by default. (This is preferred to have highest
       priority, but it's kept as is because of current code structure.)

2. Before, after the macro `RTC_SLEEP_CONFIG_DEFAULT` decides dbias, the
protection above may force the int8m PU. This may cause the inconsistent
of dbias and the int8m PU status.

This commit lifts the logic of pd int8m/xtal fpu logic to upper layer
(sleep_modes.c).

Related: https://github.com/espressif/esp-idf/issues/8007, https://github.com/espressif/esp-idf/pull/8089

temp
2022-05-12 15:57:09 +08:00
18fb3d60b8 Apply 1 suggestion(s) to 1 file(s) 2022-05-12 07:49:28 +00:00
06aeeff54e efuse: fix 2022-05-12 07:49:28 +00:00
8c063a326e efuse: Fix 3/4 coding scheme UTs 2022-05-12 07:49:28 +00:00
ce148dd7b8 efuse: Improve messages during burn operation 2022-05-12 07:49:28 +00:00
24af86071d efuse: Burn func can return an error
esp_efuse_utility_burn_chip()
2022-05-12 07:49:28 +00:00
114608142a efuse: Validates data after burning and re-burnes it if necessary
It checks the content of the written data and encoding errors.
2022-05-12 07:49:28 +00:00
009e66e625 Merge branch 'feature/esp_lcd_read_i2c_v4.4' into 'release/v4.4'
Feature/esp lcd read i2c (backport v4.4)

See merge request espressif/esp-idf!18066
2022-05-11 22:33:41 +08:00
9f2d407105 Merge branch 'bugfix/i2c_too_short_panics_v4.4' into 'release/v4.4'
I2C: Read transactions, without a STOP, won't panic anymore (backport v4.4)

See merge request espressif/esp-idf!17954
2022-05-11 14:04:46 +08:00
571afca7dc Merge branch 'bugfix/rmt_undetermined_idle_level' into 'release/v4.4'
rmt: fix undetermined idle level (v4.4)

See merge request espressif/esp-idf!18035
2022-05-11 12:25:21 +08:00
0bd2c55413 mdns: Fix potential read behind parsed packet 2022-05-10 16:45:43 +02:00
d6ad597b0f mdns: Fix memleak when adding delegated host 2022-05-10 16:45:43 +02:00
c8874b0d85 mdns: Fix null-service issue when parsing packets
Closes https://github.com/espressif/esp-idf/issues/8307
2022-05-10 16:45:43 +02:00
c9b0be6ef7 esp_lcd: Add support for rx_param on I2C transport.
(cherry picked from commit 4a2766d906)
2022-05-10 15:03:53 +02:00
c9d5c14451 Fix iOS advertisement response and simplify 2022-05-09 10:09:06 +05:30
ea4b3fdfe5 spi_flash: refact that flash qio can be overidable 2022-05-09 11:08:53 +08:00
f33720a263 rmt_legacy: fix undetermined idle level
Closes https://github.com/espressif/esp-idf/issues/8864
2022-05-08 07:20:30 +00:00
4222e93351 Merge branch 'flash/opi_12345G_support_v4.4' into 'release/v4.4'
opi_flash: Add new 16MB opi flash (MX25UW12345G) support.(backport v4.4)

See merge request espressif/esp-idf!17782
2022-05-08 12:23:18 +08:00
b021055190 Merge branch 'bugfix/i2s_only_right_mode_v4.4' into 'release/v4.4'
i2s: fix only right case and mono stereo switch issue (v4.4)

See merge request espressif/esp-idf!18022
2022-05-07 22:46:45 +08:00
cdaa440d98 i2s: fix only right case v4.4 2022-05-07 13:43:01 +00:00
baa2748f23 Merge branch 'docs/fix_command_in_partition-tables_4.4' into 'release/v4.4'
docs: Fix a command in partition-tables.rst (backport v4.4)

See merge request espressif/esp-idf!18029
2022-05-07 16:57:14 +08:00
91315de70c docs: fix a command in partition-tables 2022-05-07 15:15:22 +08:00
39c63420ba Fix ESP32C3/S3 build error after enable light sleep 2022-05-07 06:19:33 +00:00
123288c1c6 Merge branch 'bugfix/default_ssid_not_set_v4.4' into 'release/v4.4'
esp_wifi: Fix for default ap ssid not set.(v4.4)

See merge request espressif/esp-idf!18005
2022-05-07 12:36:41 +08:00
d72ba54138 Merge branch 'bugfix/fix_websocket_server_v4.4' into 'release/v4.4'
fix(server): Fix websocket server not support handle multiple connections when client send CLOSE frame (backport v4.4)

See merge request espressif/esp-idf!18018
2022-05-07 10:17:59 +08:00
97caa51152 Merge branch 'bugfix/spi_slave_intr_iram_v4.4' into 'release/v4.4'
driver: spi_slave: make sure CS helpers are in IRAM if the ISR is (v4.4)

See merge request espressif/esp-idf!17831
2022-05-06 22:23:13 +08:00
e759fa4697 fix(server): Fix websocket server not support handle multiple connections when client send CLOSE frame 2022-05-06 17:55:14 +08:00
2cd59a1a77 Merge branch 'docs/update_usb_pins_and_add_a_note_to_uart_v4.4' into 'release/v4.4'
doc: update usb pins and provide a note in api-reference/uart (v4.4)

See merge request espressif/esp-idf!17986
2022-05-05 18:31:14 +08:00
88f79ca9ca esp_wifi: Fix for default ap ssid not set.
Closes https://github.com/espressif/esp-idf/issues/8744
2022-05-05 14:04:49 +05:30
e12b3c5644 Merge branch 'fix/idf_tools_fstrings_v4.4' into 'release/v4.4'
Tools: Don't use f-string in idf_tools.py

See merge request espressif/esp-idf!17990
2022-05-04 22:30:49 +08:00
7b33262d26 Tools: Don't use f-string in idf_tools.py
ESP-IDF v4.4 supports Python 3.6 or newer. F-strings are available there
but idf_tools.py can fail if run with older Pythons because the Python
version check is done later.

Closes https://github.com/espressif/esp-idf/issues/8890
2022-05-04 12:01:49 +02:00
a6a245f75f Merge branch 'feature/ftruncate_vfs_fatfs_support_v4.4' into 'release/v4.4'
fatfs: Implement ftruncate function in VFS and FAT VFS (v4.4)

See merge request espressif/esp-idf!17864
2022-05-04 08:14:46 +08:00
70c336963b doc: update usb pins and provide a note in api-reference/uart
Closes https://github.com/espressif/esp-idf/issues/8811

Signed-off-by: Ivan Grokhotkov <ivan@espressif.com>
2022-05-03 23:41:02 +02:00
a615fccd01 Merge branch 'bugfix/spiffs_check_part_alignment_v4.4' into 'release/v4.4'
spiffs: add init checks for partition alignment and data types (v4.4)

See merge request espressif/esp-idf!17835
2022-05-03 17:01:50 +08:00
b6f4629e11 Merge branch 'bugfix/_rtc_slow_length_incorrectly_optimized_backport_v4.4' into 'release/v4.4'
sleep_power_domain: fix _rtc_slow_length being incorrectly optimized by compiler(backport v4.4)

See merge request espressif/esp-idf!17974
2022-05-03 15:04:09 +08:00
653cddf091 Merge branch 'bugfix/fix_rtc_mem_load_err_backport_v4.4' into 'release/v4.4'
rtc_regulator: fix rtc mem load err(backport v4.4)

See merge request espressif/esp-idf!17977
2022-05-03 15:03:41 +08:00
ebb9cc3670 fatfs: Add ftruncate api support for VFS and FAT-VFS
Unit test cases added to verify ftruncate within fatfs tests.

Closes https://github.com/espressif/esp-idf/issues/8279
2022-05-02 04:37:56 +00:00
a2f141807f fix rtc mem load err(since the voltage of rtc regulator is too low) 2022-05-01 23:29:12 +08:00
74399f5b44 fix _rtc_slow_length being incorrectly optimized by compiler 2022-05-01 23:14:18 +08:00
8efd164e7f Merge branch 'bugfix/fix_esp32c3_brownout_bug_after_deepsleep_v4.4' into 'release/v4.4'
rtc: fix c3 brownout bug after deepsleep (backport v4.4)

See merge request espressif/esp-idf!17957
2022-05-01 17:29:33 +08:00
8c8f700c1d Merge branch 'update/mqtt_refs_v4.4' into 'release/v4.4'
mqtt: Fix sending log data; dup flag after queue (v4.4)

See merge request espressif/esp-idf!17402
2022-04-28 22:45:59 +08:00
fe83802d65 fix c3 brownout bug after deepsleep 2022-04-28 18:23:28 +08:00
dcc77b0bed Merge branch 'bugfix/idle_task_skipped_light_sleep_backport_v4.4' into 'release/v4.4'
pm_impl: fix neither enter light sleep nor enter waiti state in idle task(backport v4.4)

See merge request espressif/esp-idf!17837
2022-04-28 16:12:23 +08:00
198dfc92dd mqtt: Fix sending log data; dup flag after queue
* Fix sending mqtt message longer than Tx buffer size
* Fix enqueue API to send data with correct dup flag
* Update submodule: git log --oneline b86d42c130ac64a916ce6cf299d99f9756692394..985078affa8a2d2b56b87c8e6455252850f895c6

Detailed description of the changes:
* Isolate IDF env for v4.4 and v5.0(master)
  - See merge request espressif/esp-mqtt!111
  - ci: Isolate IDF env for v4.4 and v5.0(master) (espressif/esp-mqtt@4c5a65c)
* Client: Remove usage of legacy FreeRTOS types
  - See merge request espressif/esp-mqtt!120
  - ci: Fix build issues with IDF-4.4 against master (espressif/esp-mqtt@c28a56d)
  - See commit https://github.com/espressif/esp-mqtt/commit/6ef98d6
* mqtt_client: Fix mqtt send long data error
  - See merge request espressif/esp-mqtt!117
  - Closes https://github.com/espressif/esp-mqtt/issues/214
  - See commit https://github.com/espressif/esp-mqtt/commit/372b323
* Client: Fix use esp_mqtt_client_enqueue API to send data, data dup flag will be set 1
  - See merge request espressif/esp-mqtt!116
  - See commit https://github.com/espressif/esp-mqtt/commit/df8dc92
2022-04-28 07:55:25 +00:00
6398e19245 Merge branch 'feature/update_openocd_version_v4.4' into 'release/v4.4'
Update OpenOCD version (v4.4)

See merge request espressif/esp-idf!17934
2022-04-28 14:58:59 +08:00
0da60f7b83 I2C: Read transactions, without a STOP, won't panic anymore
* Closes https://github.com/espressif/esp-idf/issues/8548
2022-04-28 14:05:22 +08:00
751c546a68 Heap: fix typos in test and component 2022-04-28 05:59:31 +00:00
bf8fd5f42c Heap: fix free bytes calculation for TLSF heap
* Closes https://github.com/espressif/esp-idf/issues/8270
2022-04-28 05:59:31 +00:00
4178cdaa4f Merge branch 'bugfix/wrong_gpio_is_deep_sleep_wakeup_valid_gpio_v4.4' into 'release/v4.4'
gpio: fix wrong GPIO_IS_DEEP_SLEEP_WAKEUP_VALID_GPIO macro (backport v4.4)

See merge request espressif/esp-idf!17807
2022-04-28 11:19:20 +08:00
4fedbdd264 Merge branch 'bugfix/spp_crash_after_call_spp_deinit_v4.4' into 'release/v4.4'
Component_bt/Fix spp crash after call esp_spp_deinit(v4.4)

See merge request espressif/esp-idf!17930
2022-04-28 01:26:06 +08:00
eff2402b5b Merge branch 'docs/remove_bt_doc_fillers_v4.4' into 'release/v4.4'
docs: remove filler template content from BT docs (v4.4)

See merge request espressif/esp-idf!17947
2022-04-27 20:35:06 +08:00
9ae38aa873 Merge branch 'bugfix/fix_disable_bt_log_ci_fail_v4.4' into 'release/v4.4'
component_bt: Fix CI failure when disable bluetooth debug log(v4.4)

See merge request espressif/esp-idf!17899
2022-04-27 18:20:41 +08:00
ef7ce17dbd Merge branch 'bugfix/fix_build_warring_v4.4' into 'release/v4.4'
esp_phy: fix build warning(v4.4)

See merge request espressif/esp-idf!17840
2022-04-27 18:19:27 +08:00
fc30e896c0 docs: remove filler template content from BT docs 2022-04-27 17:51:27 +08:00
fd45998249 Merge branch 'contrib/github_pr_8779_v4.4' into 'release/v4.4'
esp_wifi: fix clearing default wifi netif procedure(v4.4)

See merge request espressif/esp-idf!17938
2022-04-27 17:17:47 +08:00
e72017bb23 tools: print system platform 2022-04-27 08:58:32 +02:00
6ae22d9f3b tools: add distro links for macos-arm64 2022-04-27 08:56:33 +02:00
46c5be3197 tools: OpenOCD version updated to v0.11.0-esp32-20220411 2022-04-27 08:55:36 +02:00
6232753804 Fix spp initialization failure without free mutex 2022-04-27 14:19:59 +08:00
eb8a4d3423 Fix spp crash after calling esp_spp_deinit 2022-04-27 14:19:50 +08:00
97c9fa7aca ci: support one pipeline must based on commmits 2022-04-27 11:05:08 +08:00
e0d6398a99 esp_wifi: fix clearing default wifi netif procedure
Prior to this change "esp_wifi_clear_default_wifi_driver_and_handlers"
will not remove netif pointer from table when both AP and STA interfaces were
created and destroying default wifi interfaces is done in unfortunate
order. As a result there is dangling pointer left and it may cause crash in
later code (i.e. when esp_wifi_stop() is called).
2022-04-26 22:50:40 -04:00
c41208550a Merge branch 'bugfix/oversized_SegN_as_valid_v4.4' into 'release/v4.4'
ble_mesh: stack: Bugfix for oversized SegN as valid(v4.4)

See merge request espressif/esp-idf!17772
2022-04-26 20:11:35 +08:00
75e50e97f8 Merge branch 'bugfix/scan_mixed_keymgmt_issue_v4.4' into 'release/v4.4'
Combined fix for scan issue and PMF disable API (Backport v4.4)

See merge request espressif/esp-idf!17743
2022-04-26 19:24:12 +08:00
e57697aef2 esp_phy: fix tx power limit for esp32s2/s3/c3 2022-04-26 03:36:47 -04:00
e97720131d esp_phy: fix build warning 2022-04-26 03:36:47 -04:00
36823b45cc Merge branch 'bugfix/rrm_dpp_task_delete_v4.4' into 'release/v4.4'
wpa_supplicant: backport WLAN fixes (release v4.4)

See merge request espressif/esp-idf!17655
2022-04-26 12:38:04 +08:00
1ce01c6f76 Fix CI failure when disable bluetooth debug log 2022-04-26 11:28:01 +08:00
a86cad6afe fix s3 bbpll calibrate fail bug in high temperature 2022-04-25 18:21:10 +08:00
7a34692e6f ble_mesh: stack: Bugfix for oversized SegN as valid 2022-04-25 11:49:50 +08:00
69a3bdacb0 Merge branch 'bugfix/adc2_cal_assert_arbiter_failed_v4.4' into 'release/v4.4'
adc_cal: fixed the assertion failure or returning wrong error code when ADC2 failed the arbitration (v4.4)

See merge request espressif/esp-idf!17586
2022-04-25 10:14:12 +08:00
3419823c46 Merge branch 'bugfix/add_spinlock_for_dma_channel' into 'release/v4.4'
gdma: add spin lock for gdma channel (v4.4)

See merge request espressif/esp-idf!17855
2022-04-24 18:16:58 +08:00
127d187743 Merge branch 'bugfix/i2c_iram_placement_fix_v4.4' into 'release/v4.4'
i2c: Correct hal functions iram placement and remove IRAM_ATTR for i2c_hw_fsm_reset (backport v4.4)

See merge request espressif/esp-idf!17808
2022-04-21 18:28:59 +08:00
5e49369a2c lcd: spi lcd support transmit lsb first
Closes https://github.com/espressif/esp-idf/issues/8790
2022-04-21 10:11:20 +00:00
2f1393ad53 gdma: add spin lock for gdma channel
... because we allow several control functions to be runable under ISR
context
2022-04-21 10:11:20 +00:00
7071506033 Merge branch 'feature/esp32c3_eco4_v4.4' into 'release/v4.4'
esp32c3: Adds ECO4 revision (v4.4)

See merge request espressif/esp-idf!17717
2022-04-21 18:06:41 +08:00
86b39a5042 Merge branch 'bugfix/spi_free_crash_uninitialized_v4.4' into 'release/v4.4'
spi: fixed crash when calling spi_bus_free when not initialized (v4.4)

See merge request espressif/esp-idf!17608
2022-04-21 15:47:13 +08:00
e365f0782e UART: Fix custom ISR registration function
* Closes https://github.com/espressif/esp-idf/issues/8491
2022-04-21 03:05:01 +00:00
7bf3277692 Merge branch 'update/c3_s3_phy_lib_20220419_v4.4' into 'release/v4.4'
Update esp c3/s3 phy lib aa05aec (backport v4.4)

See merge request espressif/esp-idf!17815
2022-04-21 11:01:00 +08:00
be2bd983f4 Merge branch 'feature/vfs_semihosting_c3_v4.4' into 'release/v4.4'
vfs: add support for semihosting on ESP32-C3 (v4.4)

See merge request espressif/esp-idf!17527
2022-04-21 04:43:02 +08:00
de7d69e5cc Merge branch 'bugfix/fatfs_warning_fix_v4.4' into 'release/v4.4'
fatfs: Fix putc_bfd compilation warning (v4.4)

See merge request espressif/esp-idf!17521
2022-04-21 01:56:22 +08:00
fccd450304 fatfs: Fix putc_bfd compilation warning
Fixed FatFs\ff.c: warning: argument of type "TCHAR **" is incompatible with parameter of type "const TCHAR **"

Closes https://github.com/espressif/esp-idf/issues/5870
2022-04-20 16:38:28 +00:00
7494f12319 Merge branch 'bugfix/linenoise_unint_buffer_and_color_v4.4' into 'release/v4.4'
console: linenoise: fix usage of an uninitialized buffer, fix no-color output (v4.4)

See merge request espressif/esp-idf!17829
2022-04-20 20:30:29 +08:00
784b46be11 pm_impl: fix neither enter light sleep nor enter waiti state in idle task 2022-04-20 19:37:46 +08:00
6eeaf50da8 spiffs: add init checks for partition alignment and data types
Closes https://github.com/espressif/esp-idf/issues/8593
2022-04-20 12:53:30 +02:00
43f929de4d driver: spi_slave: make sure CS helpers are in IRAM if the ISR is
Closes https://github.com/espressif/esp-idf/issues/3870
2022-04-20 12:49:49 +02:00
c0b97b6749 console: linenoise: fix usage of an uninitialized buffer
Reported in https://github.com/espressif/esp-idf/issues/6440

The issue could occur if esp_console_config_t::hint_color
was set to -1.
2022-04-20 16:03:09 +05:30
38a16e05d9 console: disable colored hints if CONFIG_LOG_COLORS is not set 2022-04-20 16:03:08 +05:30
2231a3bcbe wpa_supplicant: Remove scan done event in task 2022-04-20 10:08:45 +00:00
fee9509d5d wpa_supplicant: static analysis fixes 2022-04-20 10:08:45 +00:00
f6da49c3c9 wpa_supplicant: Add BTM security checks 2022-04-20 10:08:45 +00:00
bac4173161 esp_example: Enable MbedTLS for DPP enrollee by default 2022-04-20 10:08:45 +00:00
6e826523b1 wpa_supplicant: Correct task deletion for RRM and DPP tasks
Closes https://github.com/espressif/esp-idf/issues/7409
2022-04-20 10:08:45 +00:00
73164b87ae esp32c3: Adds ECO4 revision 2022-04-20 08:40:56 +00:00
4b2098bc58 Merge branch 'docs/update_cn_trans_jtag_debugging_docs_4.4' into 'release/v4.4'
docs: update jtag_debugging docs and get-started-devkitc.rst (backport v4.4)

See merge request espressif/esp-idf!17493
2022-04-20 16:21:04 +08:00
3d6f7f7fe0 Merge branch 'docs/mr16635_backport_v4.4' into 'release/v4.4'
docs: Update CN translation for !16635, !16702, !17043 (v4.4)

See merge request espressif/esp-idf!17465
2022-04-20 16:20:42 +08:00
fefa65239b Merge branch 'docs/mr16425_backport_v4.4' into 'release/v4.4'
docs: Update CN translation for !16425 (v4.4)

See merge request espressif/esp-idf!17459
2022-04-20 16:19:48 +08:00
20e0e9e502 Merge branch 'feature/add_h2_target_to_tools_v4.4' into 'release/v4.4'
tools: add RISC-V toolchain for esp32h2 and target (v4.4)

See merge request espressif/esp-idf!17690
2022-04-20 13:56:24 +08:00
7c740c38cd Merge branch 'feature/flash_size_gt_16mb_pr_v4.4' into 'release/v4.4'
add support for Flash 32MB..128MB (S2, S3) (Github PR + fixups) (v4.4)

See merge request espressif/esp-idf!17423
2022-04-20 13:26:10 +08:00
70adf8f631 Merge branch 'bugfix/fix_spp_initiator_connect_failed_v4.4' into 'release/v4.4'
Component_bt/Fix SPP initiator can not free resource when connection is failed[backport 4.4]

See merge request espressif/esp-idf!17744
2022-04-20 11:01:30 +08:00
5ad3fe66be tools: add RISC-V toolchain for esp32h2 target 2022-04-20 09:52:32 +07:00
01d950feea Merge branch 'bugfix/sdspi_example_esp32s3_v4.4' into 'release/v4.4'
examples: sdspi: re-enable for ESP32-S3, add Kconfig options for pins (v4.4)

See merge request espressif/esp-idf!17420
2022-04-20 06:11:48 +08:00
3604770abb Merge branch 'bugfix/websocket_example_echo_server_v4.4' into 'release/v4.4'
websocket: Updated Kconfig to use 'echo.websocket.events' echo server(v4.4)

See merge request espressif/esp-idf!17604
2022-04-20 05:42:00 +08:00
333fc0c9f8 Merge branch 'bugfix/sdmmc_example_esp32s3_v4.4' into 'release/v4.4'
examples: sdmmc: re-enable for ESP32-S3, add Kconfig options for pins (v4.4)

See merge request espressif/esp-idf!17422
2022-04-20 02:33:42 +08:00
438834b150 Merge branch 'contrib/github_pr_8564_v4.4' into 'release/v4.4'
Fix nested redirect (GitHub PR) (v4.4)

See merge request espressif/esp-idf!17734
2022-04-19 23:36:22 +08:00
213da04fcd Merge branch 'bugfix/esp_lcd_improvements_v4.4' into 'release/v4.4'
bunch of esp lcd improvements (v4.4)

See merge request espressif/esp-idf!17555
2022-04-19 22:39:10 +08:00
6e9414206a partition_table: add a test for total partition size error 2022-04-19 14:00:11 +00:00
04959af635 add support for Flash 32MB..128MB (S2, S3)
ESP32-S2 and ESP32-S3
supports up to 1 GB of external flash and RAM
add support for
-    32MB
-    64MB
-    128MB ( example NOR spiFLASH 1G-BIT W25Q01JVZEIQ Winbond 0xEF 0x40 0x21 )

Merges https://github.com/espressif/esp-idf/pull/7688

Signed-off-by: Ivan Grokhotkov <ivan@espressif.com>
2022-04-19 14:00:11 +00:00
c9db320410 xtensa: fix semihosting arguments potentially begin optimized out
The compiler was not informed that the assembly block should be
treated as a memory barrier and could optimize out the initialization
of local arrays which could be used as semihosting arguments.
This resulted in garbage values being passed as semihosting call
arguments.

Additionally this commit changes the approach for placing values into
specific register. Instead of clobbers, local register variables are
used. This results in simpler generated code, since the compiler is
able to place values directly into the registers used for semihosting
arguments, avoiding additional moves.
2022-04-19 13:55:36 +00:00
ad532236ae vfs: add support for semihosting on ESP32-C3 2022-04-19 13:55:36 +00:00
050d6977f0 Merge branch 'bugfix/idfpy_erase_otadata_v4.4' into 'release/v4.4'
tools: set baudrate and port with otatool. (v4.4)

See merge request espressif/esp-idf!17466
2022-04-19 21:49:11 +08:00
cc3e13305d Merge branch 'bugfix/fix-monitor-attribute-error-coredump_v4.4' into 'release/v4.4'
Fix missing coredump in idf_monitor.py (v4.4)

See merge request espressif/esp-idf!17678
2022-04-19 21:48:54 +08:00
0a79719b27 Merge branch 'bugfix/python_env_not_installed_by_install.ps1_v4.4' into 'release/v4.4'
tools: fix python-env install by install.ps1 (v4.4)

See merge request espressif/esp-idf!17751
2022-04-19 21:48:36 +08:00
c00c343161 Merge branch 'bugfix/flash_from_monitor_on_windows_v4.4' into 'release/v4.4'
Tools: IDF Monitor should flash with the unmodified port (v4.4)

See merge request espressif/esp-idf!17257
2022-04-19 21:46:10 +08:00
76037c66d8 Merge branch 'bugfix/s3_otg_compressed_flash_with_stub_v4.4' into 'release/v4.4'
esptool_py: Support ESP32-S3 USB OTG compressed flashing with stub (v4.4)

See merge request espressif/esp-idf!17780
2022-04-19 21:45:21 +08:00
3e262942fb esp_lcd: remove lvgl v7 port in test cases
LVGL porting examples are temporarily left in test folder.
Now we can remove it, as we have lvgl examples in esp-idf.
And lvgl v7 is legacy, we recommend to use lvgl v8
2022-04-19 13:01:13 +00:00
d23c3fb314 gdma: correct the iram placement logic 2022-04-19 13:01:13 +00:00
5f28db177d i80_lcd: support PSRAM buffer for esp32s3 2022-04-19 13:01:13 +00:00
3e7448d0f3 i80_lcd: support I2S1 LCD mode for esp32 2022-04-19 13:01:13 +00:00
862ccae396 spi_lcd: support large color transfer 2022-04-19 13:01:13 +00:00
ab3d75ab75 rgb_lcd: workaround auto-next frame bug
Closes https://github.com/espressif/esp-idf/issues/8620
2022-04-19 13:01:13 +00:00
c7ee618b25 Update esp c3/s3 phy lib (aa05aec) 2022-04-19 20:17:21 +08:00
d54df43d4c Merge branch 'bugfix/bt_add_some_debug_log_v4.4' into 'release/v4.4'
component_bt: Add some bluetooth debug log(v4.4)

See merge request espressif/esp-idf!17614
2022-04-19 20:12:00 +08:00
37da6d5ede Merge branch 'bugfix/hfp_disc_audio_err_v4.4' into 'release/v4.4'
bugfix/fix_err_when_ag_disc_audio_v4.4

See merge request espressif/esp-idf!17473
2022-04-19 20:07:41 +08:00
98c41377cc Merge branch 'bugfix/crash_when_reconnect_to_sink_v4.4' into 'release/v4.4'
bugfix/fix the failure of reconnect to sink (v4.4)

See merge request espressif/esp-idf!17476
2022-04-19 20:06:38 +08:00
4a88aed12b add missing unlock in btc_spp_cb_handler of BTA_JV_RFCOMM_WRITE_EVT 2022-04-19 20:06:32 +08:00
3897d12024 fix SPP initiator can not free resource when connection is failed 2022-04-19 20:06:32 +08:00
3fe117f84d examples: sdmmc: re-enable for ESP32-S3, add Kconfig options for pins 2022-04-19 13:48:54 +02:00
be56c85b18 examples: file_serving: add support for ESP32-S3, refactoring
* Move filesystem mounting code into a separate file to simplify the
  main source file.
* Clean up SDMMC and SDSPI related code. Move pin configuration into
  Kconfig.
* Use same base_path ('/data') for either SPIFFS or SD. Remove the
  check in file_server.c about the base path.
* Update README according to the changes above.
2022-04-19 13:46:37 +02:00
b76971d353 examples: sdspi: use default DMA channel 2022-04-19 13:46:37 +02:00
2d54f4584e driver: sdspi: set default DMA channel compatible with S3, C3 or later 2022-04-19 13:46:37 +02:00
9b1e76360b examples: sdspi: re-enable for ESP32-S3, add Kconfig options for pins 2022-04-19 13:46:36 +02:00
792eb70334 Merge branch 'https_server/min_cert_auth_mode_v4.4' into 'release/v4.4'
https_server: Add config option to set minimum certificate auth mode (v4.4)

See merge request espressif/esp-idf!17796
2022-04-19 16:26:22 +08:00
0c6ad1b7ba Merge branch 'bugfix/smtp_client_v4.4' into 'release/v4.4'
smtp_client: Fix heap leakage (v4.4)

See merge request espressif/esp-idf!17794
2022-04-19 16:24:35 +08:00
2afe86be7f Merge branch 'bugfix/http_code_v4.4' into 'release/v4.4'
esp_http_client, esp_https_ota: Handle HTTP 303 status code (v4.4)

See merge request espressif/esp-idf!17732
2022-04-19 16:24:20 +08:00
1861ca5700 Merge branch 'bugfix/wifi_prov_mgr_conn_issue_v4.4' into 'release/v4.4'
Wifi_prov_mgr: Fix for device disconnection after pairing (v4.4)

See merge request espressif/esp-idf!17618
2022-04-19 15:47:12 +08:00
677a01851f Merge branch 'bugfix/security_update_pppos_crash_v4.4' into 'release/v4.4'
lw-ip: Apply security fixes from upstream; Fix PPPoS and NAPT ip-forward (v4.4)

See merge request espressif/esp-idf!17419
2022-04-19 15:45:31 +08:00
5b54b1d2c0 websocket: Updated Kconfig to use 'echo.websocket.events' echo server
Updated README to show how to run websocket echo server using Flask

Merges https://github.com/espressif/esp-idf/pull/8262
2022-04-19 07:36:53 +00:00
7509ca57b5 advanced_https_ota/example_test.py: Update redirect URL test to include two redirects 2022-04-19 07:34:33 +00:00
3529b9450e esp_http_client: Add comment for clearing location field in esp_http_client_prepare 2022-04-19 07:34:33 +00:00
9a7d85c09b esp_http_client: fix redirect by resetting location before parsing
Closes #8563.

Signed-off-by: Nicklas Frahm <nicklas.frahm@gmail.com>
2022-04-19 07:34:33 +00:00
b8050b365e Merge branch 'update/version_4_4_1' into 'release/v4.4'
Update version to 4.4.1

See merge request espressif/esp-idf!17791
2022-04-19 15:29:27 +08:00
00229547b2 i2c: Correct hal functions iram placement and remove IRAM_ATTR for i2c_hw_fsm_reset
Closes https://github.com/espressif/esp-idf/issues/8422

(cherry picked from commit 1ceb7c8cd6)
2022-04-18 22:24:47 +08:00
25668f96e4 gpio: fix wrong GPIO_IS_DEEP_SLEEP_WAKEUP_VALID_GPIO macro
Closes https://github.com/espressif/esp-idf/issues/8733

(cherry picked from commit 0d52cb04dc)
2022-04-18 22:18:17 +08:00
c1bb9032c2 https_server: Add config option to min. cert. auth mode
- Added a config option to set the minimum Certificate Verification
  mode to Optional
- When this option is enabled, the peer (the client) certificate
  is checked by the server, however the handshake continues even if
  verification failed.
- By default, the peer certificate is not checked and ignored by the server.

Closes https://github.com/espressif/esp-idf/issues/8664
2022-04-18 11:10:14 +05:30
b8263bb5ba smtp_client: Fixed garbage characters being printed
- The R/W buffers were not cleared before reading/writing
  anything new
2022-04-18 10:33:02 +05:30
fd80ad82c2 smtp_client: Fix heap leakage
- Freed all allocated resources by Mbed TLS at the end of routine
2022-04-18 10:33:02 +05:30
3e494ec5fd Add some bluetooth debug log 2022-04-16 07:14:51 +00:00
1329b19fe4 versions: Update version to 4.4.1 2022-04-16 09:43:14 +08:00
9b75e5664e Merge branch 'bugfix/iperf_performance_v4.4' into 'release/v4.4'
Bugfix/iperf performance (v4.4)

See merge request espressif/esp-idf!17600
2022-04-15 15:52:13 +08:00
82f5cc3402 Merge branch 'bugfix/gdbgui_deps_4.4' into 'release/v4.4'
Tools: Fix incompatible package dependencies of gdbgui

See merge request espressif/esp-idf!17742
2022-04-15 15:07:05 +08:00
4a7f5f41ea spi_flash: esptool temporarily supports H2 clock configurations 2022-04-14 13:22:50 +02:00
71c2f2618f opi_flash: Add new 16MB opi flash (MXIC25UW12345G) support,
Closes https://github.com/espressif/esp-idf/issues/7996
2022-04-14 19:06:18 +08:00
ff84535758 esptool_py: Update to support ESP32-S3 USB OTG compressed flashing with stub 2022-04-14 12:28:28 +02:00
fdb756b8f9 Merge branch 'bugfix/fix_phy_i2c_crash_v4.4' into 'release/v4.4'
esp_phy: Add IRAM_ATTR for phy i2c spinlock (backport v4.4)

See merge request espressif/esp-idf!17757
2022-04-14 18:26:35 +08:00
c4c8aab39d esp_wifi: Update wifi lib
1. In scan, correctly identify AP's with mixed key mgmt
2. Add API to disable PMF configuration
2022-04-13 10:22:00 +05:30
ea1a9f9e3a esp_phy: Add IRAM_ATTR for phy i2c spinlock 2022-04-13 12:15:38 +08:00
0b7068f287 tools: fix python-env install by install.ps1
Closes https://github.com/espressif/esp-idf/issues/8647
2022-04-12 15:06:25 +02:00
734c6f8998 Tools: Fix incompatible package dependencies of gdbgui
Closes https://github.com/espressif/esp-idf/issues/8760
2022-04-12 08:59:30 +02:00
d58b394dc5 Merge branch 'bugfix/fix_i2c_critical_and_iram_funcations_v4.4' into 'release/v4.4'
Update esp c3/s3 phy lib (dcbe608)

See merge request espressif/esp-idf!17714
2022-04-11 15:02:15 +08:00
d485a8cd35 esp_https_ota: Add check for 303 and 308 status code
Closes https://github.com/espressif/esp-idf/issues/8581
2022-04-11 09:42:51 +05:30
98c2132498 esp_http_client: Add new status code 303 and 308 2022-04-11 09:42:47 +05:30
b37df7e3df Update esp c3/s3 phy lib (dcbe608) 2022-04-08 16:42:50 +08:00
b436132f9f Merge branch 'bugfix/phy_regi2c_critical_section_v4.4' into 'release/v4.4'
esp_phy: use spinlock to avoid regi2c access conflicts (v4.4)

See merge request espressif/esp-idf!17691
2022-04-07 19:23:51 +08:00
2dff50c3e2 Eth iperf default sdkconfig: Enable lwIP IRAM optimization 2022-04-06 10:44:31 +00:00
4d581456e4 Added bandwidth limitaion option to iperf test scripts 2022-04-06 10:44:31 +00:00
3f7cf8a540 iperf: added Tx bandwidth limit option 2022-04-06 10:44:31 +00:00
ba62cbc04f Fixed Ethernet lwIP netif error indication 2022-04-06 10:44:31 +00:00
d378ca2b78 esp_phy: use spinlock to avoid regi2c access conflicts 2022-04-06 12:18:23 +08:00
8522bb1178 regi2c: use safe version of spinlock, instead of ISR ver 2022-04-06 09:34:43 +08:00
154778c2a3 example/modbus_master: fix the assert for uart_set_pin
Signed-off-by: aleks <aleks@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/8607
2022-04-05 09:14:08 +00:00
1459ac0915 Fix coredump attribute error in idf_monitor.py
Closes https://github.com/espressif/esp-idf/issues/8651
2022-04-04 14:20:44 +02:00
b33e7f27ea vfs: bugfix vfs_fat_write/pwrite upon disk-full
Closes https://github.com/espressif/esp-idf/issues/5027
2022-03-30 09:55:57 +02:00
f5ee7093b8 Merge branch 'test/disable_touch_sleep_testcase_v4.4' into 'release/v4.4'
touch: add protection for touch sleep case (v4.4)

See merge request espressif/esp-idf!17611
2022-03-30 15:24:15 +08:00
4e827ca09b adc_cal: fixed the assertion failure or returning wrong error code when ADC2 failed the arbitration
Issue exist since first IDF version supporting ESP32-S2.
2022-03-28 10:23:48 +00:00
916533ef92 Merge branch 'bugfix/wifi_prov_mgr_conn_issue' into 'release/v4.4'
NimBLE: Fixed device disconnection issue of wifi prov mgr

Closes IDF-4655

See merge request espressif/esp-idf!17618
2022-03-28 11:49:09 +05:30
472cbbe73b Merge branch 'bugfix/disable_touch_sleep_s3_v4.4' into 'release/v4.4'
touch_sensor: forbid from using touch sensor with sleep on ESP32-S3 (v4.4)

See merge request espressif/esp-idf!17579
2022-03-28 11:27:51 +08:00
b6c2c80e44 touch: add protection for touch sleep case 2022-03-27 02:44:47 +08:00
36d989b16c spi: fixed crash when calling spi_bus_free when not initialized
introduced in 49a48644e4

Closes: https://github.com/espressif/esp-idf/issues/8642
2022-03-27 02:33:18 +08:00
3503ee41ca sleep: fixed the issue error log not printed 2022-03-25 14:50:26 +08:00
ea27a8543a touch_sensor: forbid from using touch sensor with sleep on ESP32-S3
This is not supported yet.
2022-03-25 14:50:26 +08:00
161eaeed25 usb_host: Don't build CDC host driver for unsupported targets 2022-03-18 14:49:58 +01:00
cc054605a0 docs: backport jtag_debugging docs 2022-03-15 18:59:21 +08:00
e9e77e3598 docs: backport cn translation for mr16635 2022-03-14 11:36:43 +08:00
c265a31c97 fix the failure of reconnect to sink 2022-03-14 11:24:17 +08:00
500e4bd06d correct the rate of data-producing
Closes https://github.com/espressif/esp-idf/issues/7911
2022-03-14 10:42:36 +08:00
fdee1faf1e tools: set baudrate and port with otatool.
Bugfix: Allow setting options port -p and baudrate -b, with idf.py otatool commands.

Closes https://github.com/espressif/esp-idf/issues/8317
2022-03-11 15:30:56 +01:00
c29343eb94 Merge branch 'feature/update_esptool_v4.4' into 'release/v4.4'
esptool: Update esptool submodule (v4.4)

See merge request espressif/esp-idf!17454
2022-03-11 16:00:22 +08:00
5da4a79b04 docs: backport cn translation for mr16425 2022-03-11 15:25:52 +08:00
353abc5702 esptool: Update esptool submodule 2022-03-11 06:39:30 +00:00
19faa6ef43 touch: fix the touch sensor wait cycle on s3 2022-03-11 06:24:07 +00:00
47414efe0b lwip: Security fixes; PPPoS null-deref; NAPT ip-forward
* Cherry-pick important fixes to 2.1.2-esp
  - CVE-2020-22283: Attacker could craft a packet that would disclose 8 bytes of some heap memory:
    - icmp6: Don't copy too much data
    - icmp6: Fix copying of chained pbuf in reply
    - icmp6: keep to the RFC and send as much as possible with icmp6 error messages
  - CVE-2020-22284: ZEP - ZigBee Encapsulation Protocol/6LoWPAN is not supported in IDF,
    the netif module (zepif.c) is not included in the build, but users can still inject
    the file into compilation process, implement IO interface and use this.
    - zepif: Copy possibly chained output pbuf properly
    - Add #define for minimum IPv6 MTU length
    - pbuf: Add pbuf_copy_partial_pbuf library function
* PPPoS: Fix null-deref when processing double break packet
  - pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
  - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
* NAPT: Fix PBUF_REF type to clone the pbuf before forwarding
  - IP-FORWARD: If packet-type is PBUF_REF clone it before forwarding
  - Add NAPT unit test to exercise NAT feature for both RAM and REF pbuf types
* version: Update version numbers to match 2.1.2-esp

* Update submodule: 2749568fe1...76303df238
  - test/napt: Add unit test for IP forward with PBUF_REF (espressif/esp-lwip@76303df2)
  - napt: Fix PBUF_REF type to clone the pbuf before forwarding (espressif/esp-lwip@39068263)
  - version: Update version numbers to match 2.1.2-esp (espressif/esp-lwip@2b922919)
  - pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
  - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
  - pbuf: Add pbuf_copy_partial_pbuf library function (espressif/esp-lwip@1c9cd9c1)
  - Add #define for minimum IPv6 MTU length (espressif/esp-lwip@d2dc577b)
  - zepif: Copy possibly chained output pbuf properly (espressif/esp-lwip@64ab7f2a)
  - icmp6: Don't copy too much data (espressif/esp-lwip@4a64731b)
  - icmp6: Fix copying of chained pbuf in reply (espressif/esp-lwip@7c822ff4)
  - icmp6: keep to the RFC and send as much as possible with icmp6 error messages (espressif/esp-lwip@29100ab6)
  - dns: Add API to clear dns cache (espressif/esp-lwip@ee59f77d)
  - CI: Fixed adding gitlab key (espressif/esp-lwip@5a2bdba7)
  - test case: modify test case test_tcp_new_max_num_remove_FIN_WAIT_1 (espressif/esp-lwip@6b090f7d)

Closes https://github.com/espressif/esp-idf/issues/8300
Closes https://github.com/espressif/esp-idf/issues/8451
2022-03-11 06:05:39 +00:00
45dcc4384c Merge branch 'feature/emac_start_stop_test_v4.4' into 'release/v4.4'
test_emac: extended Ethernet start/stop stress test (v4.4)

See merge request espressif/esp-idf!17306
2022-03-11 10:38:40 +08:00
11ae0ed007 increased parallel count of UT_T1_1 test 2022-03-10 15:59:07 +01:00
7a2068c864 Merge branch 'feature/update_hfp_hf_version_v4.4' into 'release/v4.4'
Update HFP_HF version to 1.7.2(v4.4)

See merge request espressif/esp-idf!17382
2022-03-10 20:20:16 +08:00
7768c389ad Created EMAC start/stop stress test under heavy traffic 2022-03-10 10:15:34 +01:00
d53094bdc0 esp_eth: EMAC start/stop optimization 2022-03-10 10:15:34 +01:00
c469316970 Merge branch 'docs/add_note_for_malloc_cap_dma_backport_v4.4' into 'release/v4.4'
docs: add note for MALLOC_CAP_DMA for ESP32-S2 according to customer feedback (backport v4.4)

See merge request espressif/esp-idf!17343
2022-03-10 17:10:10 +08:00
0fca632ffd Merge branch 'bugfix/modbus_fix_start_after_destroy_issues_v44' into 'release/v4.4'
modbus: fix tcp slave destroy issues (backport v4.4)

See merge request espressif/esp-idf!17406
2022-03-09 09:48:36 +08:00
c9ce438466 Merge branch 'bugfix/inline_intrmask_from_isr_v4.4' into 'release/v4.4'
freertos: always inline xPortSetInterruptMaskFromISR and vPortClearInterruptMaskFromISR (v4.4)

See merge request espressif/esp-idf!17325
2022-03-09 09:38:36 +08:00
121ddb87e5 Merge branch 'bugfix/fix_adc_digital_not_reset_issue_v4.4' into 'release/v4.4'
adc: fix adc digital part not reset issue (v4.4)

See merge request espressif/esp-idf!17375
2022-03-08 23:16:33 +08:00
d7fafdc916 freemodbus: fix port enable disable sequence for tcp master and slave 2022-03-08 10:07:19 +01:00
ba9c0c29a9 modbus: fix tcp slave destroy issues
Closes https://github.com/espressif/esp-idf/issues/8211
2022-03-08 09:52:54 +01:00
c45dee0a7a Merge branch 'bugfix/idf_size_assertions_v4.4' into 'release/v4.4'
tools: Fix assertion messages and fix some of them in idf_size.py (v4.4)

See merge request espressif/esp-idf!17348
2022-03-08 02:58:04 +08:00
1b06c55ab1 Merge branch 'bugfix/fix_adc_calibration_light_sleep_issue_v4.4' into 'release/v4.4'
adc: fix calibration error when waking up from light sleep (v4.4)

See merge request espressif/esp-idf!16930
2022-03-07 19:01:31 +08:00
898a7d071b Update HFP_HF version to 1.7.2 2022-03-07 18:16:05 +08:00
dc7cb6de4b Merge branch 'bugfix/ignore_pmf_capable_flag_v4.4' into 'release/v4.4'
Always connect Station in PMF mode if possible (Backport v4.4)

See merge request espressif/esp-idf!17036
2022-03-07 16:24:44 +08:00
e1515beb26 adc: fix adc digital not reset issue 2022-03-07 11:40:18 +08:00
d53ea1166d rng: fix rng adc digital inpu not disabled issue 2022-03-07 11:39:27 +08:00
32afe6a498 sleep: restore analog calibration registers after waking up from light sleep
Closes https://github.com/espressif/esp-idf/issues/8287
Closes https://github.com/espressif/esp-idf/issues/7921
2022-03-07 11:28:48 +08:00
92a67e0fff Merge branch 'bugfix/add-resolution-suggestion-for-coredump_v4.4' into 'release/v4.4'
idf_monitor.py: Remove line finalization when coredump is in progress to avoid coredump failure (v4.4)

See merge request espressif/esp-idf!17364
2022-03-07 11:04:50 +08:00
a97dd5e0e9 Merge branch 'bugfix/ble_mesh_console_correct_repl_config_prompt_forv4.4' into 'release/v4.4'
ble mesh:example:correct repl config prompt in ble mesh console(v4.4)

See merge request espressif/esp-idf!17183
2022-03-07 11:03:54 +08:00
b2e67d6ff1 ble mesh:example:correct repl config prompt in ble mesh console(v4.4) 2022-03-07 11:03:54 +08:00
3d2700146e Merge branch 'bugfix/uart_no_int_after_flush_v4.4' into 'release/v4.4'
UART: RX interrupts are now properly restored after a flush (backport v4.4)

See merge request espressif/esp-idf!17122
2022-03-07 11:03:33 +08:00
d326c5283d Merge branch 'bugfix/ledc_consecutive_fade_v4.4' into 'release/v4.4'
ledc: Bugfixes for issues related to fade protection (backport v4.4)

See merge request espressif/esp-idf!16953
2022-03-07 11:00:46 +08:00
964db79c0e Merge branch 'docs/add_a_note_to_mck_io_num_v4.4' into 'release/v4.4'
docs: add a note to mck_io_num: for esp32, only gpio0/gpio1/gpio3 can be set (v4.4)

See merge request espressif/esp-idf!16694
2022-03-07 11:00:25 +08:00
3c9657fa4e Merge branch 'feature/add_proxy_conn_and_disconn_event_v4.4' into 'release/v4.4'
ble_mesh: stack: Add proxy server connect and disconnect event (v4.4)

See merge request espressif/esp-idf!16993
2022-03-06 14:10:20 +08:00
90083fcbb7 ble_mesh: stack: Bugfix the proxy client abnormal disconnection 2022-03-04 12:33:15 +00:00
1016801eaf ble_mesh: stack: Add proxy server connect and disconnect event 2022-03-04 12:33:15 +00:00
eed93ac5bb Remove line finalization when coredump is active to avoid coredump failure
Closes https://github.com/espressif/esp-idf/issues/8099
2022-03-04 11:40:32 +01:00
21cdaeade9 docs: add a note to mck_io_num: for esp32, only gpio0/gpio1/gpio3 can be set 2022-03-04 07:00:18 +00:00
380ee4b87a Merge branch 'bugfix/update_stack_init_check_v4.4' into 'release/v4.4'
Nimble: Remove stack initialization status from unwanted functions (v4.4)

See merge request espressif/esp-idf!17234
2022-03-04 14:11:23 +08:00
975b525e03 Merge branch 'bugfix/add_pll_track_feature_mr_4.4' into 'release/v4.4'
Add pll track feature

See merge request espressif/esp-idf!17285
2022-03-04 13:54:19 +08:00
f17a435ea7 Merge branch 'refactor/i2s_deprecate_confusing_names_v4.4' into 'release/v4.4'
i2s: Add detailed comments for confusing names (v4.4)

See merge request espressif/esp-idf!16748
2022-03-04 13:18:32 +08:00
103cab3664 Merge branch 'bugfix/tcp_iperf_example_issue_for_4.4' into 'release/v4.4'
wifi:bugfix for iperf issue(backport v4.4)

See merge request espressif/esp-idf!17334
2022-03-04 11:15:11 +08:00
75cfdc63c8 Merge branch 'ci/test_utils_ipc_stack_v4.4' into 'release/v4.4'
CI: increase IPC stack size for test_utils configs (v4.4)

See merge request espressif/esp-idf!17353
2022-03-04 10:44:19 +08:00
03cf81087b CI: increase IPC stack size for test_utils configs 2022-03-04 09:19:09 +08:00
89f57f3402 Merge branch 'bugfix/rom_time_t_size_deps_v4.4' into 'release/v4.4'
esp_rom: remove functions which depend on sizeof(struct stat) and all their callers (v4.4)

See merge request espressif/esp-idf!17040
2022-03-04 04:38:42 +08:00
169008616b Merge branch 'bugfix/a2dp_sniff_v4.4' into 'release/v4.4'
Fix crash when host exit sniff mode(v4.4)

See merge request espressif/esp-idf!17313
2022-03-03 23:37:37 +08:00
aa260a9376 Merge branch 'bugfix/i2s_mono_issue_on_c3_s3_v4.4' into 'release/v4.4'
🔧 i2s: fix bug of switching mono/stereo mode by 'i2s_set_clk' on c3/s3 (v4.4)

See merge request espressif/esp-idf!17331
2022-03-03 21:54:20 +08:00
524da1e4af Tools/idf_size.py: Support .noinit sections
Closes https://github.com/espressif/esp-idf/issues/8428
2022-03-03 13:55:46 +01:00
68a8a7de0d tools/idf_size.py: Identify objects without extension in MAP files 2022-03-03 13:55:46 +01:00
0f11ac2bd3 Merge branch 'bugfix/i2s_dac_incorrect_clock_v4.4' into 'release/v4.4'
i2s: fix adc/dac clock calculation (v4.4)

See merge request espressif/esp-idf!17336
2022-03-03 20:37:43 +08:00
a472035d97 Merge branch 'feature/websocket_server_support_close_handle_v4.4' into 'release/v4.4'
esp_http_server: Websocket CLOSE frame can support callback function (backport v4.4)

See merge request espressif/esp-idf!17339
2022-03-03 18:40:34 +08:00
e6bbfb085f Merge branch 'bugfix/http_client_body_v4.4' into 'release/v4.4'
esp_http_client: Fix data corruption in http_on_body callback (v4.4)

See merge request espressif/esp-idf!17314
2022-03-03 18:29:26 +08:00
d7f8526207 docs: add note for MALLOC_CAP_DMA for ESP32-S2 according to customer feedback 2022-03-03 16:54:18 +08:00
e00580109b examples/common_components: iperf: fix closing of client socket in TCP server mode
Details of the problem : After iperf ended, the socket was not closed, resulting in the WIFI buffer not being released.
2022-03-03 15:47:58 +08:00
3b91281c91 esp_http_server: Websocket CLOSE frame can support callback function
Closes https://github.com/espressif/esp-idf/issues/7493
2022-03-03 15:46:09 +08:00
299d496c30 i2s: add detailed comments to some fileds (v4.4) 2022-03-03 05:55:35 +00:00
15e8601cfc i2s: add mclk_div underflow check
Closes https://github.com/espressif/esp-idf/issues/8344
2022-03-03 12:23:47 +08:00
19f4eca4b9 Fix for mclk/bclk divisors #8326
Merges https://github.com/espressif/esp-idf/pull/8327
2022-03-03 12:23:47 +08:00
7600869c35 esp_http_client: Cache received data in http_on_body callback.
This change fixes issue with data loss when multiple body chunks are
received after calling esp_http_client_fetch_headers.
2022-03-03 03:54:37 +00:00
86d78c1592 i2s: fix bug of switching mono/stereo mode by 'i2s_set_clk' on c3/s3 2022-03-03 03:23:41 +00:00
eff03cbbd9 Merge branch 'feat/support_mxic_unlock_v4.4' into 'release/v4.4'
spi_flash: support unlock MXIC flash chips (v4.4)

See merge request espressif/esp-idf!17251
2022-03-03 11:13:09 +08:00
d8c7c41a43 Fix crash when host exit sniff mode 2022-03-03 02:59:31 +00:00
2792b95c83 docs: fix missing static file path
Also update layout of version table
2022-03-03 10:48:20 +08:00
1690785432 spi flash: fix cache accessed while disabled issues at -O0
mask_get_id and gpio_hal_iomux_func_sel were called while cache
is disabled, but were not inlined as expected at -0O.
Force these functions to always be inlined.
2022-03-03 09:45:22 +08:00
3a7ec8acfa freertos: always inline xPortSetInterruptMaskFromISR and vPortClearInterruptMaskFromISR
These were called from IRAM context where the caller expect them to be inlined
and accessible when cache is disabled. This was not the case when compiled with -O0.

Closes https://github.com/espressif/esp-idf/issues/8301
2022-03-03 09:44:31 +08:00
6ee5e622e8 Merge branch 'bugfix/http_client_ci_v4.4' into 'release/v4.4'
esp_http_client example: Use dl.espressif.com URL for performing request with Range header (v4.4)

See merge request espressif/esp-idf!17316
2022-03-03 00:55:23 +08:00
f0e894e540 Merge branch 'bugfix/remove_c_series_chips_unsupported_efuse_field_backport_v4.4' into 'release/v4.4'
efuse: free esp32c3/esp32h2 unused efuse field (backport v4.4)

See merge request espressif/esp-idf!17292
2022-03-02 18:36:13 +08:00
05bf1cd0f5 Merge branch 'fix/prod_mode_in_configure_ds_script_v4.4' into 'release/v4.4'
configure_ds.py: Fix the error for prod mode. They script now only verifies... (v4.4)

See merge request espressif/esp-idf!17209
2022-03-02 17:19:23 +08:00
27e49aee72 Merge branch 'bugfix/check_chip_id_at_start_ota_v4.4' into 'release/v4.4'
esp_https_ota: fix for checking chip id at start of OTA (v4.4)

See merge request espressif/esp-idf!17220
2022-03-02 17:19:14 +08:00
5f56bbd2d0 Merge branch 'bugfix/rtcio_increase_size_v4.4' into 'release/v4.4'
sleep: fixed ext1 cannot wakeup via RTCIO >= 18 issue (v4.4)

See merge request espressif/esp-idf!17201
2022-03-02 16:53:05 +08:00
ae2a6e40ab Merge branch 'bugfix/spiffs_example_test_v4.4' into 'release/v4.4'
examples/spiffs: increase test timeout (v4.4)

See merge request espressif/esp-idf!17265
2022-03-02 16:51:59 +08:00
64f41ed6c4 Merge branch 'bugfix/bootloader_uart_custom_gpio_v4.4' into 'release/v4.4'
bootloader: fixed the issue custom_uart_gpio doesn't take effect (v4.4)

See merge request espressif/esp-idf!17307
2022-03-02 16:50:49 +08:00
2e8df440c1 Merge branch 'feature/usb_host_cleanup_v4.4' into 'release/v4.4'
USB: Host stack cleanup and QOL update + wTotalLength Fix + omit MSC reset (v4.4.1)

See merge request espressif/esp-idf!16678
2022-03-02 16:49:38 +08:00
0ccee00059 Merge branch 'bugfix/coredump_data_section_v4.4' into 'release/v4.4'
espcoredump: fix a bug where tracked DRAM data where not dumped (v4.4)

See merge request espressif/esp-idf!17120
2022-03-02 16:48:00 +08:00
66e6cac168 Merge branch 'bugfix/tools_fix_gdb_2021r2_patch3_v4.4' into 'release/v4.4'
tools: update esp-2021r2-patch3 toolchain for fixing GDB (v4.4)

See merge request espressif/esp-idf!17245
2022-03-02 16:47:04 +08:00
143c62d95d Merge branch 'bugfix/uart_custom_isr_test_disable_brk' into 'release/v4.4'
UART: Fix custom ISR unit test (v4.4)

See merge request espressif/esp-idf!17232
2022-03-02 16:45:07 +08:00
81f8dce34c examples/esp_http_client: Use dl.espressif.com URL for performing request with Range header
esp_http_client_test.py: Add check for range request log
2022-03-02 13:20:28 +05:30
2ef6b8845b uart: fixed reset logic on ESP32-S3 2022-03-02 02:42:46 +08:00
bdd7610e66 uart: fixed incorrect channel number on ESP32S2, S3 and C3 2022-03-02 02:42:06 +08:00
8543d1b88a bootloader: fixed the issue custom_uart_gpio doesn't take effect 2022-03-02 02:40:45 +08:00
2bdea81b2a Update ESP32-C3 and ESP32-S3 bt lib and phy lib
Add the pll track feature to keep the ble connection stable when the environment
temprature increase form 0 to 74.
2022-03-01 14:56:47 +08:00
659306b243 esp_wifi: Always connect Station in PMF mode if possible
While using esp_wifi_set_config, flag pmf_capable defaults to 0.
Users may not bother to enable it, which prevents connection to a
WPA3 AP. Or the AP may reset into WPA3 mode failing the re-connection.
To ensure better security, deprecate the pmf_capable flag and set it to
true internally.
2022-02-28 17:55:42 +05:30
e6e76195e8 remove in esptool 2022-02-28 17:40:02 +08:00
6c2f5a16bb remove esp32h2 unsupported efuse field 2022-02-28 17:33:12 +08:00
c6aa1cf732 remove esp32c3 unsupported efuse field 2022-02-28 17:26:28 +08:00
377267775c examples/spiffs: increase test timeout
This is to address frequent CI test failure where test most likely
timeouts during SPIFFS formatting operation.
2022-02-24 09:19:53 +05:30
b600c5f30a Tools: IDF Monitor should flash with the unmodified port
Closes https://github.com/espressif/esp-idf/issues/8432
2022-02-23 13:35:42 +01:00
e835599979 bootloader: support unlock MXIC flash chips 2022-02-23 16:23:34 +08:00
48f8a7a26e test_apps/panic: GDB in esp-2021r2-patch3 toolchain doesn't contain the fix for interrupted backtraced
Revert "test_apps/panic: remove workaround for incorrect GDB backtrace"

This reverts commit 4548b6da63.
2022-02-23 10:52:05 +07:00
1982883618 tools: update esp-2021r2-patch3 toolchain for fixing GDB
Closes https://github.com/espressif/esp-idf/issues/8065
    Closes https://github.com/espressif/esp-idf/issues/8342
    Closes https://github.com/espressif/openocd-esp32/issues/210
2022-02-23 09:20:43 +07:00
ae546316d3 Nimble: Check stack initialization status before executing stack command
Previous commit added checks in some functions that can be called
    without stack initalization. Corrected such instances.
2022-02-22 10:26:43 +05:30
2fb3824dfa UART: Fix custom ISR unit test
On ESP32, UART_INTR_BRK_DET may be triggered after setting the new ISR handler.
Disable these interrrupts.
2022-02-22 10:54:06 +08:00
9a36ced294 espcoredump: add a test for coredump dumped sections 2022-02-22 02:38:00 +00:00
b868fd2a95 espcoredump: fix a bug where tracked DRAM data where not dumped
Variables marked as COREDUMP_DRAM_ATTR will now be part of the core dump.

* Closes https://github.com/espressif/esp-idf/issues/8151
2022-02-22 02:38:00 +00:00
1e117f2f83 UART: RX interrupts are now properly restored after a flush
Added a unit test to make sure the expected behavior happens
2022-02-22 02:28:21 +00:00
bf7934aa84 esp_https_ota: fix for checking chip id at start of OTA 2022-02-21 13:55:53 +05:30
e37d149233 configure_ds.py: Fix the error for prod mode. They script now only verifies the purpose in the prod mode.
Closes https://github.com/espressif/esp-idf/issues/8285
2022-02-21 01:33:00 +05:30
d2a2a315ba Bugfix: omit MSC reset during initialization 2022-02-18 15:51:05 +08:00
e898e4b2f5 Bugfix: make wTotalLength uint16_t to avoid truncation 2022-02-18 15:51:05 +08:00
c46b74191e usb: Add USB Host Library documentation
This commit adds the USB Host Library documentation and fixes some nitpicks
in the Host Stack types.

Closes https://github.com/espressif/esp-idf/issues/6408
2022-02-18 15:51:05 +08:00
6f6986277c usb: Add USB Host Library Example
The commit adds a basic example for the USB Host Library
2022-02-18 15:51:05 +08:00
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
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
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
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
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
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
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
cdfd59cc0e docs: update copyright date for docs automatically 2022-02-18 12:59:12 +08:00
a8c073c1cc fixed trailing whitespace 2022-02-18 12:58:53 +08:00
dc4783945a freertos: Move Espressif's specific esp_reent_init into collective ifdef 2022-02-18 12:58:53 +08:00
7caacf20c1 Documentation: added ESP32S3 interrupt allocation doc 2022-02-18 12:36:05 +08:00
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
21b80a969f soc: updated soc_caps about rtc_io and the format 2022-02-18 11:44:43 +08:00
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
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
f3639dafc8 freertos: add pm_trace header include 2022-02-17 22:22:26 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
d011404607 esptool: Fixes esp32h2 target name 2022-02-17 00:14:45 +08:00
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
5c7b597594 efuse: Fixes eFuse timesettings issue on esp32S3 2022-02-16 15:15:27 +08:00
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
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
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
175132a874 adc: upgrade adc calibration algorithm to version 2 on c3 2022-02-16 14:58:42 +08:00
492afe4d4a esp_adc_cal: move esp_adc_cal_get_voltage into common source file 2022-02-16 14:58:42 +08:00
be542db463 esp_adc_cal: simplify CMakeLists.txt 2022-02-16 14:58:42 +08:00
9991b1b021 ci: increase target-test.yml UT_T1_1 job to support newly added ut test 2022-02-16 14:52:39 +08:00
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
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
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
c0e105cc41 mdns: Fix potential null deref reported by fuzzer test 2022-02-16 06:23:57 +00:00
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
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
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
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
6ba07ccfaa Merge branch 'bugfix/typo_in_i2c_macro_v4.4' into 'release/v4.4'
I2C: Fix typo in I2C_TIMING_VAL_ERR_STR macro name (backport v4.4)

See merge request espressif/esp-idf!17116
2022-02-16 02:49:01 +00:00
118478cd51 Merge branch 'docs/add_an_example_list_for_esp32-wrover-kit_v4.4' into 'release/v4.4'
docs: add an example list for esp-wrover-kit (v4.4)

See merge request espressif/esp-idf!16691
2022-02-16 02:39:04 +00:00
192503abbb Merge branch 'example/nimble_readme_cleanup_v4.4' into 'release/v4.4'
docs/examples Changes on README files on Bluetooth Examples (v4.4)

See merge request espressif/esp-idf!16374
2022-02-16 02:30:04 +00:00
ee908e4ef1 Merge branch 'feature/mdns_null_value_txt_v4.4' into 'release/v4.4'
mdns: Support for null-value TXT records (v4.4)

See merge request espressif/esp-idf!17172
2022-02-16 02:27:25 +00:00
35b2b3e24c components/bt: Fix ble adv_underrun issue
components/bt: Fix LLCP collision for channel map update
2022-02-16 00:39:00 +08:00
a145a5ee48 mdns: Use memcpy() for copy to support non-text TXTs 2022-02-15 13:32:53 +01:00
ec9dbd922d mdns: Support for null-value TXT records
Closes https://github.com/espressif/esp-idf/issues/8267
2022-02-15 13:32:53 +01:00
93be7d5192 usb_serial_jtag: remove the strict condition check in esp_phy 2022-02-15 18:56:49 +08:00
bf523af21d usb_serial_jtag: can print when wifi enabled by default
Closes https://github.com/espressif/esp-idf/issues/8131
2022-02-15 18:56:48 +08:00
a74e06560b USB_SERIAL_JTAG: Fix the issue that there is no rom log when restarting 2022-02-15 18:56:06 +08:00
83daa6dabb Merge branch 'bugfix/bump_docs_docker_tag_v4.4' into 'release/v4.4'
ci: bump esp-docs image tag to v5

See merge request espressif/esp-idf!17157
2022-02-15 10:15:14 +00:00
ed8f29c406 ci: bump esp-docs image tag to v5 2022-02-15 11:55:01 +08:00
8c61c5c565 Merge branch 'bugfix/lcd_rgb_memory_alignment_v4.4' into 'release/v4.4'
rgb lcd memory alignment(v4.4)

See merge request espressif/esp-idf!16883
2022-02-14 15:34:49 +00:00
21b6c46d11 Merge branch 'bugfix/sdio_slave_dma_desc_int_v4.4' into 'release/v4.4'
sdio_slave: Fixed the issue that DMA descriptors allocated to non-DMA capable area (v4.4)

See merge request espressif/esp-idf!17135
2022-02-14 06:27:47 +00:00
13d30652cc Merge branch 'bugfix/wps_fixes_v4.4' into 'release/v4.4'
wpa_supplicant: Add WPS Fixes (Backport V4.4)

See merge request espressif/esp-idf!17064
2022-02-14 06:24:16 +00:00
71b81e4a01 Merge branch 'bugfix/support_esp32s2_eco1_v4.4' into 'release/v4.4'
esp_phy: Update ESP32S2 phy lib to support eco1 chip(V4.4)

See merge request espressif/esp-idf!16715
2022-02-14 05:55:29 +00:00
21b4cd8325 sdio_slave: fixed the issue DMA desc not capable 2022-02-13 22:35:04 +08:00
c2c4b126f7 Merge branch 'feature/support_new_psram_v4.4' into 'release/v4.4'
psram: add ESP32-D0WD-R2-V3 support(backport v4.4)

See merge request espressif/esp-idf!16705
2022-02-13 14:13:38 +00:00
246f72020f Merge branch 'bugfix/modbus_port_fix_lgpl_licensed_files_v4.4' into 'release/v4.4'
freemodbus: fix port contains lgpl licensed files (v4.4)

See merge request espressif/esp-idf!16550
2022-02-12 20:43:22 +00:00
136c5b8204 wpa_supplicant: Fix invalid memory dereference 2022-02-12 10:32:33 +05:30
f60a914bae I2C: Fix I2C Master operation with repeated start condition
* Closes https://github.com/espressif/esp-idf/pull/8353
2022-02-11 15:37:24 +08:00
8f3b47da39 I2C: Fix typo in I2C_TIMING_VAL_ERR_STR macro name
* Closes https://github.com/espressif/esp-idf/pull/8012
2022-02-11 15:29:52 +08:00
47583770a1 Merge branch 'bugfix/fix_esp_http_client_example_v4.4' into 'release/v4.4'
esp_http_client: Fix memory leak in esp_http_client_example (backport v4.4)

See merge request espressif/esp-idf!17095
2022-02-11 04:56:29 +00:00
83ef7b6a95 Merge branch 'feature/limit_component_manager_version' into 'release/v4.4'
Tools: Limit idf-component-manager version

See merge request espressif/esp-idf!16405
2022-02-10 16:07:02 +00:00
730ca0ea43 Merge branch 'bugfix/cpu_reset_perip_clk_disable_v4.4' into 'release/v4.4'
esp_system: change range comparsion for reset reason to specifc cpu reset reason comparison (backport v4.4)

See merge request espressif/esp-idf!15898
2022-02-10 10:32:09 +00:00
0658a5b1da esp_wifi: Add an example for EAP-FAST. 2022-02-10 15:55:21 +05:30
e21832cabb esp_wifi: Add support for EAP-FAST authentication method 2022-02-10 15:54:15 +05:30
8b86834a72 Merge branch 'bugfix/gpio_pin_num_fix_v4.4' into 'release/v4.4'
gpio: Fix some gpio pin num errors on esp32s2 and esp32c3 (backport v4.4)

See merge request espressif/esp-idf!16594
2022-02-10 10:21:52 +00:00
954d52ff3a Merge branch 'flash/add_th_support_v4.4' into 'release/v4.4'
spi_flash: add support for th 1M flash(backport v4.4)

See merge request espressif/esp-idf!16714
2022-02-10 09:40:40 +00:00
fb1695ade7 Merge branch 'bugfix/fix_spi_cs_hold_time_issue_v4.4' into 'release/v4.4'
spi_master: fix spi cs_ena_posttrans issue (v4.4)

See merge request espressif/esp-idf!16686
2022-02-10 09:12:15 +00:00
38b5c012f9 Merge branch 'bugfix/rmt_s2_doesnt_support_rx_wrap_v4.4' into 'release/v4.4'
rmt: do not support rx wrap on esp32s2 (v4.4)

See merge request espressif/esp-idf!17076
2022-02-10 09:11:32 +00:00
9e000d4177 LEDC: divisor calculation will now be rounded up when necessary
Closes https://github.com/espressif/esp-idf/issues/7722
2022-02-10 16:56:07 +08:00
63afc84de5 LEDC: improved support for ESP32-C3 and refactored divisor calculation
As ESP32C3 does not have support for REF_TICK source clock, it is now not
possible to select it anymore.
Auto cfg clock has been improved for all boards.
2022-02-10 16:54:00 +08:00
98647cf351 i2c: fix buffer check when SPIRAM used as a heap
* Closes https://github.com/espressif/esp-idf/issues/8173
2022-02-10 16:16:01 +08:00
5355ba06f1 transport_ssl: use return value from close for non-TLS case 2022-02-10 13:03:32 +05:30
9e892fbf46 Set success when closing socket
Closes https://github.com/espressif/esp-idf/pull/8337
Closes IDFGH-6709
2022-02-10 13:02:58 +05:30
1b8c04bb57 esp_http_client: Fix memory leak in esp_http_client_example
Closes https://github.com/espressif/esp-idf/issues/8346
2022-02-10 14:35:13 +08:00
50302e4157 esp_phy: Update ESP32S2 phy lib to support eco1 chip 2022-02-10 14:13:02 +08:00
14b52e9d83 Merge branch 'bugfix/improve_ota_test_success_rate_v4.4' into 'release/v4.4'
OTA examples: Reduce example test failure rate (v4.4)

See merge request espressif/esp-idf!16613
2022-02-10 05:52:27 +00:00
c7b9f94733 Merge branch 'bugfix/fix_bluedroid_compile_issue_v4.4' into 'release/v4.4'
components/bt: Fix bluedroid compile issue(backport release/v4.4)

See merge request espressif/esp-idf!16592
2022-02-09 11:28:57 +00:00
5cc185c442 Merge branch 'bugfix/controller_hci_uart_esp32c3_readme_v4.4' into 'release/v4.4'
Added support for ESP32-S3 chip in controller_hci_uart_esp32c3_and_esp32s3's README (v4.4)

See merge request espressif/esp-idf!16738
2022-02-09 11:18:40 +00:00
4ecd0ef9fc advanced_https_ota: Move example tests on ethernet runners
Move BT tests to nightly run
2022-02-09 15:03:04 +05:30
42e389263d native_ota_example: Move all example tests to ethernet based runners 2022-02-09 15:03:04 +05:30
f2c5c8e6d8 simple_ota_example: Move redundant and failing example_tests to nightly run 2022-02-09 15:03:04 +05:30
690d7a5d6b target-test.yml: Add EXAMPLE_ETH_OTA runner to OTA on ethernet based runners 2022-02-09 15:03:04 +05:30
956c6b889f rmt: do not support rx wrap on esp32s2
Closes https://github.com/espressif/esp-idf/issues/8354
2022-02-09 17:29:09 +08:00
c8075df214 Merge branch 'bugfix/a2dp_source_congest_v4.4' into 'release/v4.4'
component_bt: Fixed a2dp source audio data packet congestion causing choppy audio in a2dp sink (v4.4)

See merge request espressif/esp-idf!16733
2022-02-09 08:16:01 +00:00
4158da586b Merge branch 'demo/opt_a2dp_demo_doc_v4.4' into 'release/v4.4'
demo/optimize a2dp demo documents (v4.4)

See merge request espressif/esp-idf!16587
2022-02-09 08:13:55 +00:00
afe82b4e1b Merge branch 'bugfix/filter_repeated_packages_v4.4' into 'release/v4.4'
filter repeated packages but not send response(v4.4)

See merge request espressif/esp-idf!16817
2022-02-09 06:18:43 +00:00
006b4456e7 filter repeated packages but not send response(v4.4) 2022-02-09 06:18:42 +00:00
4b7eea25ca Merge branch 'feature/pro_recv_hb_forv4.4' into 'release/v4.4'
provisioner receive heartbeat message (v4.4)

See merge request espressif/esp-idf!16636
2022-02-09 06:18:14 +00:00
006c679f85 provisioner receive heartbeat message (v4.4) 2022-02-09 06:18:13 +00:00
690ff75346 Merge branch 'doc/esp32s3_sdmmc_v4.4' into 'release/v4.4'
docs: peripherals: update SD related docs for ESP32-S3 (v4.4)

See merge request espressif/esp-idf!17043
2022-02-09 03:28:57 +00:00
c2a6f0fe29 Merge branch 'bugfix/perfmon_s3_v4.4' into 'release/v4.4'
perfmon: re-enable example for ESP32-S3, remove warning from the docs (v4.4)

See merge request espressif/esp-idf!17042
2022-02-09 03:28:01 +00:00
54e416d3b8 docs: Updates apptrace menuconfig options in examples 2022-02-08 22:25:33 +03:00
e366d569d8 example/gcov: Adds support for esp32s2, esp32s3, esp32c3 and esp32h2 2022-02-08 22:25:33 +03:00
89fe956ebc gcov: Fixes interference of gcov dump with normal IPC calls 2022-02-08 22:25:33 +03:00
792f510d0d gcov: Do not use shrunk ROM's fake stdout and stderr FILE struct 2022-02-08 22:24:54 +03:00
1bbefc3e5d debug_stubs: Refactor and add support for RISCV 2022-02-08 22:24:54 +03:00
1603b8181f Merge branch 'bugfix/win_rename_delay_v4.4' into 'release/v4.4'
Tools: Use delay between rename attempts on Windows in the installer (v4.4)

See merge request espressif/esp-idf!17056
2022-02-08 18:23:56 +00:00
330da63548 Merge branch 'bugfix/nvs_oom_check_wrong_pointer_v4.4' into 'release/v4.4'
nvs: fixed OOM check wrong pointer issue (backport 4.4)

See merge request espressif/esp-idf!16976
2022-02-08 14:54:48 +00:00
6c0c3029ab Merge branch 'bugfix/vfs_open_errno_v4.4' into 'release/v4.4'
vfs: don't overwrite errno by a hard coded ENOENT (Github PR) (v4.4)

See merge request espressif/esp-idf!17044
2022-02-08 14:37:29 +00:00
757445422d wpa_supplicant: Add WPS Fixes
Add following bugfixes

1. Station not able to connect when WPS pin is pressed first on AP.
2. PBC overlap getting detected for selected registrar PIN APs.
3. Station not considering authorised MACs for PIN method.
4. For PIN methodm If no AP is found, station will loop through
   APs in its vicinity and try to do WPS with them one by one till
   WPS timeout occurs. This is for some APs which do not set
   selected registrar correctly.
2022-02-08 17:22:40 +05:30
e26318bcac freemodbus: fix port contains lgpl licensed files
Initial version of freemodbus master port files have been added to ESP-IDF based on https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.
The overall repository license, at the time of adding these files, has been BSD 3-clause. However at that time, several port files carried LGPL license headers. As the author of these files confirmed in https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32/issues/61#issuecomment-977828450, this wasn't intentional. ESP-IDF version of modbus master port has been rewritten to target FreeRTOS instead of RT-Thread, but the license headers remained from the original version. This commit corrects this, replacing the license of these files with BSD 3-clause.
2022-02-08 12:43:08 +01:00
f4e54541f3 ws_client: Optimize example test payloads and timeouts
Important update: NO_DATA_TIMEOUT_SEC=5, as some ws-servers typically send pings in 30s or 10s intervals, so we might never fire shutdown test
2022-02-08 18:15:53 +08:00
ff1846bebe ci/websockets: Run ws-client example test on ethernet runners 2022-02-08 18:15:53 +08:00
936bbdc75b ci/mdns: Run mdns test on ethernet runners 2022-02-08 18:15:49 +08:00
63dda9f1d9 ci: Increase parallel job count for Eth runners 2022-02-08 18:15:49 +08:00
2b62d7bfdc ci/mqtt: Move publish-connect test to ethernet runners 2022-02-08 18:15:48 +08:00
d24241d5ad ci/mqtt: Move mqtt example tests to ethernet runners 2022-02-08 18:15:48 +08:00
18da1180ad Tools: Use delay between rename attempts on Windows in the installer 2022-02-08 11:06:14 +01:00
6934a0164a Merge branch 'bugfix/fix_common_clock_bug_v4.4' into 'release/v4.4'
esp_wifi: fix common clock bug (backport v4.4)

See merge request espressif/esp-idf!16971
2022-02-08 09:10:34 +00:00
f98ec313f2 Merge branch 'revert-0a1e309e' into 'release/v4.4'
Revert "Merge branch 'bugfix/temp_disable_f8r8_test_v4.4' into 'release/v4.4'"

See merge request espressif/esp-idf!17037
2022-02-07 14:51:55 +00:00
93855605f3 Merge branch 'bugfix/esp32c3_sysview_examples_build_error_v4.4' into 'release/v4.4'
riscv: fix portSTACK_GROWTH redefinition error (v4.4)

See merge request espressif/esp-idf!17038
2022-02-07 12:48:02 +00:00
23b0cdad8a vfs: add test for errno value after 'open' 2022-02-07 11:36:00 +01:00
931dd74da6 vfs: don't overwrite errno by a hard coded ENOENT
Calling "open" in CHECK_AND_CALL sets a perfectly correct errno.
There is no need to overwrite that with a value of ENOENT, since doing
so hides lower level errors like EIO.

Closes https://github.com/espressif/esp-idf/pull/8036
2022-02-07 11:35:59 +01:00
aaa2a344c6 docs: peripherals: update SD related docs for ESP32-S3 2022-02-07 11:31:17 +01:00
faac0e7589 perfmon: re-enable example for ESP32-S3, remove warning from the docs
Includes minor fix for formatting of code blocks in the example readme
2022-02-07 11:28:57 +01:00
096c013675 esp_rom: remove functions which depend on sizeof(struct stat)
...and all their callers.

With the upcoming switch from sizeof(time_t)==4 to sizeof(time_t)==8,
sizeof(struct stat) is also increasing.

A few newlib functions present in ROM allocate 'struct stat' on the
stack and call _fstat_r on this structure. The implementation of
fstat is provided in ESP-IDF. This implementation will often do
memset(st, 0, sizeof(*st)), where st is 'struct stat*', before setting
some fields of this structure. If IDF is built with sizeof(st)
different from sizeof(st) which ROM was built with, this will lead
to an out-of-bounds write and a stack corruption.

This commit removes problematic ROM functions from the linker script.
Here are the functions which allocate 'struct stat':
* _isatty_r (in ROM)
* __swhatbuf_r, called by __smakebuf_r, called by __swsetup_r and
  __srefill_r (in ROM)
* _fseeko_r (not in ROM)
* glob2 (not in ROM)
* _gettemp (not in ROM)

As a result, these functions are used from libc.a, and use correct
size of 'stat' structure.

Closes https://github.com/espressif/esp-idf/issues/7980
2022-02-07 11:23:59 +01:00
1e80a52de4 Merge branch 'bugfix/i2s_mclk_stopped_when_set_clock' into 'release/v4.4'
i2s: fix mclk stop issue when setting clock (v4.4)

See merge request espressif/esp-idf!16706
2022-02-07 09:47:19 +00:00
8fc5f8ae55 heap: use HEAP_TRACING_STACK_DEPTH default value for riscv 2022-02-07 09:47:57 +01:00
5c8bfa9b46 esp32c3: fix portSTACK_GROWTH redefinition error 2022-02-07 09:47:57 +01:00
2fe53759c9 components/bt: Fix bluedroid compile issue 2022-02-07 16:04:50 +08:00
0a0b652815 Merge branch 'bugfix/fix_bluedroid_ble50_adv_data_length_issue_v4.4' into 'release/v4.4'
components/bt: Fix bluedroid ble50 adv data length issue(backport release/v4.4)

See merge request espressif/esp-idf!16579
2022-02-07 08:01:55 +00:00
aae55512b7 Update copyright headers 2022-02-07 07:41:03 +00:00
371ab10bcd Revert "Merge branch 'bugfix/temp_disable_f8r8_test_v4.4' into 'release/v4.4'"
This reverts merge request !17031
2022-02-07 15:39:25 +08:00
a9df58c776 i2s: fix mclk stopped when setting clock 2022-02-07 15:27:35 +08:00
1140036424 spi_master: fix spi cs_ena_posttrans issue 2022-02-07 12:19:51 +08:00
5e5af3606b Merge branch 'bugfix/nimble_spp_v4.4' into 'release/v4.4'
NimBLE :  SPP example fails to build on Windows (v4.4)

See merge request espressif/esp-idf!17013
2022-02-07 02:35:30 +00:00
7c986a64c7 Merge branch 'feature/adds_tips_to_run_ci_example_tests_v4.4' into 'release/v4.4'
examples: Adds a note on how to meet requirements to run the example_test.py (v4.4)

See merge request espressif/esp-idf!16944
2022-02-06 09:25:40 +00:00
0a1e309ee4 Merge branch 'bugfix/temp_disable_f8r8_test_v4.4' into 'release/v4.4'
ci: temporarily disable MSPI_F8R8 test (v4.4)

See merge request espressif/esp-idf!17031
2022-02-05 05:34:09 +00:00
e67ecd998c ci: temporarily disable MSPI_F8R8 test 2022-02-04 15:23:05 +01:00
d501a53f2f Merge branch 'feature/mbedtls-2.28.0_v4.4' into 'release/v4.4'
mbedtls: Upgrading to v2.28.0 (v4.4)

See merge request espressif/esp-idf!17004
2022-02-02 13:52:54 +00:00
db80244920 Merge branch 'bugfix/nimble_spp' into 'release/v4.4'
NimBLE : Fixed BLE SPP build fail on Windows

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

See merge request espressif/esp-idf!17013
2022-02-02 15:15:24 +05:30
51fc67f5fa ci: Fix issues for build stage
- Fixed logs expecting different format specifier
- Updated ignore list for check_public_header test
- Updated functions ported from mbedTLS
- Fix for make-system build errors
2022-02-02 15:03:48 +05:30
11366d643f mbedtls: Added option MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
- Removed code regarding MBEDTLS_DYNAMIC_FREE_PEER_CERT
  (config was kept for backward compatibility)
- Combined mbedTLS v2.28.x related options under a separate Kconfig menu
2022-02-02 10:56:48 +05:30
c3d2f2361c protocomm: Updated function for constant time buffer comparison
- mbedtls_ssl_safer_memcmp() -> mbedtls_ct_memcmp()
2022-02-02 10:56:48 +05:30
b10d0a533c wpa_supplicant: Saved message-type digest used in handshake for PRF operations 2022-02-02 10:56:48 +05:30
76b9beff3c mbedtls: Moved mbedtls_mpi_mul_int to port layer 2022-02-02 10:56:48 +05:30
76658d5066 mbedtls: Added config options for v2.28.0 upgrade 2022-02-02 10:56:48 +05:30
0fdc5f7490 mbedtls: Upgrade to v2.28.0 2022-02-02 10:56:13 +05:30
28489ac412 Merge branch 'bugfix/provisioning_not_stopping_v4.4' into 'release/v4.4'
wifi_prov_mgr: Fix provisioning not stopping in release mode (v4.4)

See merge request espressif/esp-idf!17002
2022-02-01 05:22:38 +00:00
b7c1c4913e wifi_prov_mgr: Fix provisioning not stopping in release mode
- For the wifi_prov_mgr example in release mode (with NDEBUG defined -
  assertions disabled), the task to stop provisioning is never started
  as it is voided by the assert function it is called in.

Closes https://github.com/espressif/esp-idf/issues/8309
2022-02-01 09:49:45 +05:30
602b26ccd4 Merge branch 'feature/upgrade_expat_component_v4.4' into 'release/v4.4'
expat: upgrade to v2.4.3 release

See merge request espressif/esp-idf!16981
2022-01-31 07:14:04 +00:00
3dbe641c6b expat: upgrade to v2.4.3 release
Detailed changelog: https://github.com/libexpat/libexpat/blob/R_2_4_3/expat/Changes
2022-01-31 11:13:26 +05:30
eb3797dc3f Merge branch 'provisioning/update_readme_v4.4' into 'release/v4.4'
provisioning: Remove legacy examples reference (v4.4)

See merge request espressif/esp-idf!16987
2022-01-29 10:46:56 +00:00
bfd3e9c54c Merge branch 'ci/split_assign_test_and_add_c3_integration_test_4.4' into 'release/v4.4'
Ci: split assign test and add c3 integration test 4.4

See merge request espressif/esp-idf!16925
2022-01-28 14:39:16 +00:00
b9eda8431e Merge branch 'test/esp32s2_fatfs_speedtest_ci_fix_v4.4' into 'release/v4.4'
[Storage]: Re-enable FatFS write/read speed test (v4.4)

See merge request espressif/esp-idf!16080
2022-01-28 10:37:10 +00:00
954844a308 esp_prov.py: Replaced deprecated function for loading modules 2022-01-28 15:46:27 +05:30
e0968e506c Merge branch 'bugfix/unused_tag_string' into 'release/v4.4'
build: fix unused tag string (v4.4)

See merge request espressif/esp-idf!16838
2022-01-28 07:58:40 +00:00
0113e2768d esp_wifi: Fixed issue of weak md for certificates in wifi_enterprise example. 2022-01-28 11:02:06 +05:30
42abd894d4 build: fix unused tag string
Closes https://github.com/espressif/esp-idf/issues/8250
2022-01-28 11:59:45 +08:00
c8eb02bb39 bugfix (nvs): fixed wrong pointer check 2022-01-28 11:37:53 +08:00
257d95fc22 Merge branch 'docs/pinlayout_image_update_backport_v4.4' into 'release/v4.4'
docs: Update ESP32-DevKitC Pin Layout figure of higher resolution (backport v4.4)

See merge request espressif/esp-idf!16364
2022-01-28 03:22:51 +00:00
036e3f2e46 Merge branch 'bugfix/address_already_used_exception_in_ota_tests_v4.4' into 'release/v4.4'
Fix 'address already in use' exception in OTA tests (v4.4)

See merge request espressif/esp-idf!16416
2022-01-27 12:32:45 +00:00
6e6c8bb682 esp_wifi: fix common clock bug (backport v4.4) 2022-01-27 20:19:41 +08:00
7acb7a9e00 Merge branch 'bugfix/rm_copyright_ignore_list' into 'release/v4.4'
CI: Remove unused copyright ignore list

See merge request espressif/esp-idf!16963
2022-01-27 12:15:56 +00:00
4649f3a46e CI: Remove unused copyright ignore list 2022-01-27 12:26:33 +01:00
e64ae67888 fix: pin definitions for other boards
fix: re-enabled fatfs r/w test on sdspi
fix: copyright notice
add: pin definitions for esp32c3
fix: Changed fixed spi dma channel to a macro definition
2022-01-27 12:06:41 +01:00
d16aaae498 Merge branch 'feature/memprot_api_unified_c3_v4.4' into 'release/v4.4'
Memprot API unified - ESP32C3 (v4.4.1)

See merge request espressif/esp-idf!16489
2022-01-27 11:00:03 +00:00
3d5b947355 Tools: Limit idf-component-manager version 2022-01-27 11:46:54 +01:00
b80a070395 esp_system: replace the range comparsion for reset reason in perip clk init with specific reset reason check, also add a test case in LEDC to check for the perip clk not being disabled after cpu reset
(cherry picked from commit f57456e9dd919e5eea1d3cd0caa64b5c97a4df73)
2022-01-27 09:51:00 +00:00
26a876e63f docs:update ESP32-DevKitC Pin Layout figure of higher resolution 2022-01-27 17:05:01 +08:00
8ec62d1d86 Merge branch 'docs/translation_backport_v4.4' into 'release/v4.4'
docs: update CN translation for MR15221 for v4.4

See merge request espressif/esp-idf!16756
2022-01-27 08:27:06 +00:00
3c76a058aa docs: update CN translation for MR15221 for v4.4 2022-01-27 08:27:04 +00:00
c02f6b96af Merge branch 'docs/update_inconsistency_backport_v4.4' into 'release/v4.4'
docs: Update incorrect pins for S3 documentation, set a default value for future targets, and remove line breaks inside paragraphs (backport v4.4)

See merge request espressif/esp-idf!16367
2022-01-27 08:26:07 +00:00
1f45f160a8 Merge branch 'bugfix/fix_console_linenosie_backport_v4.4' into 'release/v4.4'
console: fix console stuck in auto test (backport v4.4)

See merge request espressif/esp-idf!16914
2022-01-27 07:18:46 +00:00
9af4484ce3 examples: Adds a note on how to meet requirements to run the example_test.py
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages"
python -m pip install -r $IDF_PATH/tools/ci/python_packages/ttfw_idf/requirements.txt

It helps to fix the ModuleNotFoundError issue with ttfw_idf and tiny_test_fw modules.

Closes https://github.com/espressif/esp-idf/issues/7815
2022-01-27 14:40:10 +08:00
8ab30f72b2 Merge branch 'bugfix/rd_rem_ext_feats_delayed_cs_v4.4' into 'release/v4.4'
bugfix/fix cs event for rd_rem_ext_feats delayed issue (v4.4)

See merge request espressif/esp-idf!16813
2022-01-27 05:45:35 +00:00
6114ac2994 Merge branch 'bugfix/fix_smartconfig_setopt_fail_v4.4' into 'release/v4.4'
smartconfig: Fix smartconfig set socket option fail (backport v4.4)

See merge request espressif/esp-idf!16772
2022-01-27 05:44:35 +00:00
d982a9a5e1 Merge branch 'bugfix/config_parse_crash_after_flash_erase_v4.4' into 'release/v4.4'
component_bt: fixed config parse crash after flash_erase(v4.4)

See merge request espressif/esp-idf!16730
2022-01-27 05:44:17 +00:00
4f9afec016 Merge branch 'bugfix/ci_check_blobs_v4.4' into 'release/v4.4'
ci: improve checks for Wi-Fi/PHY libraries (v4.4)

See merge request espressif/esp-idf!16659
2022-01-27 05:42:56 +00:00
551cd2793b Merge branch 'doc/optimize_hfp_doc_4_4' into 'release/v4.4'
Doc/optimize hfp doc [backport v4.4]

See merge request espressif/esp-idf!16451
2022-01-27 05:42:17 +00:00
bfd68507d8 Merge branch 'bugfix/PRs_on_esp_hid_v4.4' into 'release/v4.4'
bugfix/handle_3_esp_hid_PRs (v4.4)

See merge request espressif/esp-idf!16590
2022-01-27 05:41:52 +00:00
80a395e319 Merge branch 'Doc/optimize_spp_doc_v4.4' into 'release/v4.4'
Doc/Optimize SPP Document[backport 4.4]

See merge request espressif/esp-idf!16603
2022-01-27 05:41:33 +00:00
5788a393ea Merge branch 'doc/update_document_of_demo_bt_discovery_v4.4' into 'release/v4.4'
Doc/update document of demo bt discovery v4.4

See merge request espressif/esp-idf!16575
2022-01-27 05:40:52 +00:00
7d9b93e2e0 Merge branch 'bugfix/MR16031_v4.4' into 'release/v4.4'
heap: adjust the order of RTC memory heap caps and regions(backport v4.4)

See merge request espressif/esp-idf!16704
2022-01-27 05:30:02 +00:00
7d9652dccf System/Security: Memprot API unified (ESP32C3,ESP32S3)
Unified Memory protection API for all PMS-aware chips

Closes JIRA IDF-3849
2022-01-27 12:40:27 +08:00
386c2a2322 bugfix: checkout ref failed for origin branches 2022-01-27 11:55:58 +08:00
fc1b518ef7 ci: exclude git files when uploading artifacts 2022-01-27 11:55:58 +08:00
beda92a7a5 ci: update intergration test to support esp32c3 2022-01-27 11:55:53 +08:00
606f8fd59b ci: optimize downloading build_ssc artifacts 2022-01-26 22:33:14 +08:00
641bfa388a ci: move integration test related files outside of components 2022-01-26 22:33:14 +08:00
2ba22c4c6e ci: fix target_test label usage 2022-01-26 22:33:14 +08:00
6e11783992 ci: split assign tests 2022-01-26 22:33:09 +08:00
55b1756d5f Merge branch 'contrib/github_pr_8139_backport_v4.4' into 'release/v4.4'
ledc.h - fix extern "C" to include ledc_cb_register() (backport v4.4)

See merge request espressif/esp-idf!16585
2022-01-26 13:40:22 +00:00
b5217ba9a2 Merge branch 'ci/enable_s3_examples_build_v4.4' into 'release/v4.4'
ci: re-enable s3 build for few examples (v4.4)

See merge request espressif/esp-idf!16894
2022-01-26 13:38:14 +00:00
56e854bb4e Merge branch 'bugfix/set_authmode_by_switching_number_to_string_v4.4' into 'release/v4.4'
CI: change ap authmode from number to string (backport v4.4)

See merge request espressif/esp-idf!16553
2022-01-26 11:53:30 +00:00
46fba83ac8 Merge branch 'bugfix/idf_tools_python_env_v4.4' into 'release/v4.4'
tools: improve virtualenv diagnostics, set python path explicitly (v4.4)

See merge request espressif/esp-idf!16807
2022-01-26 10:00:32 +00:00
65b3e0601f Merge branch 'bugfix/add_dummy_to_total_size_v4.4' into 'release/v4.4'
Tools: fix bug with total size calculation issue (v4.4)

See merge request espressif/esp-idf!16859
2022-01-26 09:59:48 +00:00
a59e3ab59d Merge branch 'feature/esp32s3_apptrace_v4.4' into 'release/v4.4'
Feature/esp32s3 apptrace v4.4

See merge request espressif/esp-idf!16649
2022-01-26 09:58:35 +00:00
ea62bcfaf0 Merge branch 'feature/ccache_in_ci_v4.4' into 'release/v4.4'
ci: enable ccache for build jobs (v4.4)

See merge request espressif/esp-idf!16806
2022-01-26 09:12:32 +00:00
a76f908074 Merge branch 'test/remove_spi_flash_perf_thr_v4.4' into 'release/v4.4'
spi_flash_test: remove threshold from unit test (v4.4)

See merge request espressif/esp-idf!16821
2022-01-26 08:20:26 +00:00
446d3bfec8 Fix for advanced_ota_redirect_url example failure in CI 2022-01-26 10:42:13 +08:00
839c34fd0a Fix 'address already in use' exception in OTA tests
We will stop the server instance at the end of each test case. This will solve the "address already in use" exception
2022-01-26 10:42:13 +08:00
f546d5e493 Merge branch 'fix/http2_request_example_v4.4' into 'release/v4.4'
http2_request_example: Change the target http2 server to http2.github.io (v4.4)

See merge request espressif/esp-idf!16670
2022-01-26 02:39:16 +00:00
f5ef3e2cf2 Merge branch 'wifi_prov_mgr/service_key_check_v4.4' into 'release/v4.4'
wifi_prov_mgr: Added check for passphrase length in softAP scheme (v4.4)

See merge request espressif/esp-idf!16569
2022-01-26 02:37:43 +00:00
48eea7c479 Merge branch 'bugfix/fix_esp_https_ota_v4.4' into 'release/v4.4'
esp_https_ota: Fix esp_https_ota_begin may return error and exist memory leak (backport v4.4)

See merge request espressif/esp-idf!16777
2022-01-26 02:36:56 +00:00
39386e05a5 Merge branch 'bugfix/invalid_url_cause_to_crash_v4.4' into 'release/v4.4'
http: Fix parsing invalid url cause to crash (v4.4)

See merge request espressif/esp-idf!16478
2022-01-26 02:34:29 +00:00
e19cc280d9 Merge branch 'docs/update_ws_server_example_readme_v4.4' into 'release/v4.4'
docs: Add user-friendly guide about how to use ws_server_example_test.py (backport v4.4)

See merge request espressif/esp-idf!16782
2022-01-26 02:31:22 +00:00
fb1d00a9d1 Merge branch 'bugfix/efuse_timesettigs_in_burn_op_v4.4' into 'release/v4.4'
efuse: Fixes eFuse timesettings issue on esp32c3 (v4.4)

See merge request espressif/esp-idf!16921
2022-01-26 00:52:33 +00:00
979745417b Merge branch 'refactor/tinyusb_uses_usb_phy_v4.4' into 'release/v4.4'
tinyusb: Update tinyusb.c to use the usb_phy API to configure PHY (v4.4)

See merge request espressif/esp-idf!16855
2022-01-26 00:51:42 +00:00
40949e8d43 Merge branch 'bugfix/app_compatible_with_3_1_bootloader_v4.4' into 'release/v4.4'
esp_system: Fix RTC_WDT protection in esp_restart_noos (v4.4)

See merge request espressif/esp-idf!16740
2022-01-26 00:50:54 +00:00
eb13f8a61d Merge branch 'bugfix/freertos_pd_ticks_to_ms_precision_v4.4' into 'release/v4.4'
Freertos: Fix loss of precision in pdTICKS_TO_MS (v4.4)

See merge request espressif/esp-idf!16673
2022-01-26 00:50:35 +00:00
3ea2a2ba9c Merge branch 'bugfix/bootloader_common_get_sha256_of_partition_when_image_invalid_v4.4' into 'release/v4.4'
bootloader: Fixes bootloader_common_get_sha256_of_partition. Adds hash check. (v4.4)

See merge request espressif/esp-idf!16923
2022-01-26 00:50:09 +00:00
0b5d4edbc6 bootloader: Fixes bootloader_common_get_sha256_of_partition. Adds hash check.
Closes https://github.com/espressif/esp-idf/issues/8274
2022-01-25 19:58:29 +08:00
1638b36804 efuse: Fixes eFuse timesettings issue on esp32c3 2022-01-25 19:14:31 +08:00
c11b6f4885 fix console stuck in auto test 2022-01-25 17:04:48 +08:00
780b9b6d78 Merge branch 'update/version_4_4_0' into 'release/v4.4'
Update version to 4.4.0

See merge request espressif/esp-idf!16909
2022-01-25 08:42:49 +00:00
c899c1b1da Merge branch 'bugfix/mdns_txt_alloc_issue_v4.4' into 'release/v4.4'
mdns: Fix alloc issue if TXT has empty value(Backport v4.4)

See merge request espressif/esp-idf!16889
2022-01-25 06:33:54 +00:00
8153bfe412 versions: Update version to 4.4.0 2022-01-24 23:05:26 +01:00
9f3b116e4f optmize a2dp demo document 2022-01-24 14:23:09 +08:00
e088379b26 ci: re-enable s3 build for few examples 2022-01-24 09:54:08 +05:30
9f0a6d8e16 Merge branch 'bugfix/mdns_txt_alloc_issue_v4.4' into 'release/v4.4'
mdns: Fix alloc issue if TXT has empty value

See merge request espressif/esp-idf!16889
2022-01-21 18:55:51 +00:00
b3f913a058 mdns: Fix alloc issue if TXT has empty value 2022-01-21 22:52:33 +04:00
0b46ac1732 Merge branch 'bugfix/pppos_client_docs_power' into 'release/v4.4'
Examples/PPPoS: Add troubleshooting to correctly power modem (v4.4)

See merge request espressif/esp-idf!16235
2022-01-21 09:46:13 +00:00
88486324db Merge branch 'bugfix/fix_tcp_transport_exception_v4.4' into 'release/v4.4'
tcp_transport: fix tcp trasnport exception(backport release/v4.4)

See merge request espressif/esp-idf!16811
2022-01-21 09:45:45 +00:00
f4c97455c4 Merge branch 'bugfix/apll_coeff_calculate_v4.4' into 'release/v4.4'
i2s: impove the clock division calculation (v4.4)

See merge request espressif/esp-idf!16783
2022-01-21 07:06:30 +00:00
b4fbd87f42 http2_request_example: Change the target http2 server to http2.github.io and
perform only a `GET` request.
2022-01-21 09:15:32 +05:30
f6ab703390 lcd: alloc framebuffer in alignment 2022-01-21 11:30:20 +08:00
9c262ce065 lcd: split gpio check for de and hv mode 2022-01-21 11:30:20 +08:00
ab118fe8be Merge branch 'bugfix/i2s_return_error_code_v4.4' into 'release/v4.4'
i2s: revert the reading/writing can return timeout error (v4.4)

See merge request espressif/esp-idf!16749
2022-01-21 01:21:07 +00:00
a48c6e097a tcp_transport: fix tcp trasnport exception 2022-01-20 15:38:44 +08:00
960672b979 add test for checking memory segments with esptool.py 2022-01-19 17:32:19 +01:00
40eede261e tools/idf_size: Fixed bug with wrong memory calculation 2022-01-19 17:32:18 +01:00
6a6801e357 tinyusb: Update tinyusb.c to use the usb_phy API to configure PHY 2022-01-19 18:18:08 +08:00
0382215ec7 spi_flash_test: remove threshold from unit test 2022-01-17 15:07:06 +08:00
a0e20e17f0 fix cs event for rd_rem_ext_feats delayed issue 2022-01-17 13:02:26 +08:00
2e3f4ff6dd tools: improve virtualenv diagnostics, set python path explicitly
- Check if pip is installed for sys.executable before attempting to
  create the virtual environment, bail out with an error if not.
- Don't pass --seeder argument to virtualenv if its version is
  too old. For example, on Ubuntu 18.04, virtualenv 15.1.0 doesn't
  support this argument.
- Pass --python argument to virtualenv to request specific interpreter
  to be used.

Closes https://github.com/espressif/esp-idf/issues/8045
2022-01-16 21:45:30 +01:00
698b406e56 ci: enable ccache for build jobs 2022-01-16 21:43:15 +01:00
d17194caea ci: disable ccache when running CMake build system tests
Some tests check if certain files are rebuilt when source files are
'touch'ed. With ccache, 'touch'ing source files doesn't cause a
rebuild, hence the test fails. In case IDF_CCACHE_ENABLE was set in
the environment, unset it before starting the tests.
2022-01-16 21:43:15 +01:00
816b0ce878 i2s: impove the apll and clock division calculation 2022-01-13 11:06:40 +08:00
f3e0c8bc41 Merge branch 'feature/oocd_ver_upgrade_v4.4' into 'release/v4.4'
tools: Updates OpenOCD version to 'v0.11.0-esp32-20211220' (v4.4)

See merge request espressif/esp-idf!16765
2022-01-12 14:19:54 +00:00
2a89b3c15a docs: Add user-friendly guide about how to use ws_server_example_test.py
Closes https://github.com/espressif/esp-idf/issues/8060
2022-01-12 20:36:59 +08:00
dbb0eeecc7 esp_https_ota: Fix esp_https_ota_begin may return ESP_OK when http status code is not 200 and may exist memory leak
Closes https://github.com/espressif/esp-idf/issues/8195
2022-01-12 19:53:08 +08:00
a3a05dc056 tools: Updates OpenOCD version to 'v0.11.0-esp32-20211220' 2022-01-12 16:39:07 +08:00
813948d137 Merge branch 'bugfix/tools_win_patch2_v4.4' into 'release/v4.4'
Add toolchain patch2 version for Windows with --with-gnu-ld option (v4.4)

See merge request espressif/esp-idf!16758
2022-01-12 08:33:35 +00:00
d0d3a2f2a0 Merge branch 'bugfix/idf_tools_test_without_versions_v4.4' into 'release/v4.4'
Tools: Load tool versions automatically for IDF Tools tests (v4.4)

See merge request espressif/esp-idf!16510
2022-01-12 08:29:46 +00:00
9cf57a86a0 smartconfig: Fix smartconfig set socket option fail
Closes https://github.com/espressif/esp-idf/issues/8189
2022-01-12 14:48:02 +08:00
c22e33d2ca tools: Add toolchain esp-2021r2-patch2 version for Windows with --with-gnu-ld option
Closes https://github.com/espressif/esp-idf/issues/7864
2022-01-11 20:20:43 +07:00
f0aaf48a93 i2s: revert reading/writing return error code
Closes https://github.com/espressif/esp-idf/issues/8121

Revert reading/writing return ESP_ERR_TIMEOUT introduced in commit b26da6f
2022-01-11 15:43:29 +08:00
7aa2577d86 esp_phy: move lib_printf.c to esp_phy
* fix the issue when esp32h2 target using phy_printf and rtc_printf
2022-01-11 12:09:11 +08:00
8f2045f0da esp_system: Fix RTC_WDT protection in esp_restart_noos
Fixed issue - v4.3 app not compatible with 3.1 bootloader
2022-01-10 21:57:29 +08:00
f4b329f9a5 Rename controller_hci_uart_esp32c3 to controller_hci_uart_esp32c3_and_esp32s3 2022-01-10 20:18:24 +08:00
b5d76c8c32 Added support for ESP32-S3 chip in controller_hci_uart_esp32c3's README 2022-01-10 20:18:17 +08:00
121b33be29 add nvs initialize 2022-01-10 20:18:12 +08:00
7485b4d4b2 btc_a2dp_control_set_datachnl_stat is only used by a2dp sink 2022-01-10 19:17:13 +08:00
49f496e539 remove btc_a2dp_dispatch_datapath_evt and event 2022-01-10 19:16:25 +08:00
e4277d5202 Fixed the crash caused by calling esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_START) after stream started 2022-01-10 19:15:30 +08:00
d338750b86 Fixed a2dp source audio data packet congestion causing choppy audio in a2dp sink 2022-01-10 19:15:17 +08:00
50e00e641b fixed config parse crash after flash_erase
Closes https://github.com/espressif/esp-idf/issues/6170
2022-01-10 17:41:57 +08:00
03d3c43882 Merge branch 'bugfix/fix_null_pointer_deference_issue_4.4_mr' into 'release/v4.4'
Fix the null pointer deference issue via Reconnection Spamming

See merge request espressif/esp-idf!16637
2022-01-10 08:31:33 +00:00
67b4ba33dd spi_flash: add support for th 1M flash 2022-01-10 12:39:09 +08:00
e2ef65e117 psram: add ESP32-D0WD-R2-V3 support 2022-01-10 10:39:00 +08:00
23ec015d75 adjust the order of RTC memory heap caps and regions 2022-01-08 16:19:35 +08:00
81936fd2b6 docs: add an example list for esp-wrover-kit 2022-01-07 16:47:54 +08:00
22b57850bd Merge branch 'bugfix/dpp_no_ip_issue_v4.4' into 'release/v4.4'
Fix STA not getting IP after DPP issue (Backport v4.4)

See merge request espressif/esp-idf!16645
2022-01-06 10:07:02 +00:00
bead7c2eeb freertos: Fix loss of precision in pdTICKS_TO_MS
Closes https://github.com/espressif/esp-idf/pull/7856
Closes https://github.com/espressif/esp-idf/issues/7853

[darian@espressif.com: Updated commit message]
Signed-off-by: Darian Leung <darian@espressif.com>
2022-01-06 15:44:17 +08:00
c1162b15dc Merge branch 'docs/s3_update_v4.4' into 'release/v4.4'
docs: update remaining programming guide docs for S3 (v4.4)

See merge request espressif/esp-idf!16668
2022-01-06 06:39:19 +00:00
b5a1df1db4 Merge branch 'bugfix/spi_slave_test_non_dma_v4.4' into 'release/v4.4'
spi-slave: fix single-board: hd test failing due to DMA buffers ending up in PSRAM (v4.4)

See merge request espressif/esp-idf!16305
2022-01-06 03:11:12 +00:00
219242de89 Merge branch 'bugfix/uart_custom_isr_broken' into 'release/v4.4'
UART: fix a bug preventing the user from freeing a previously registered ISR

See merge request espressif/esp-idf!16581
2022-01-06 03:10:29 +00:00
b64925c567 Merge branch 'docs/fatal_errors_update_4.4' into 'release/v4.4'
refactor (docs): improved fatal errors doc (backport v4.4)

See merge request espressif/esp-idf!16626
2022-01-06 03:10:05 +00:00
116ecf098c docs: Refactor FreeRTOS documentation
This commit refactors the FreeRTOS documentation as follows:

- Rewrite FreeRTOS SMP changes document (ESP-IDF FreeRTOS SMP)
    - Reorganized sections in kernel behavior changes
    - Rewrote descriptions of each kernel behavior changes
    - Added notes about using ESP-IDF FreeRTOS for single core targets
- Moved TLSP callback section to FreeRTOS Additions document
- Moved FreeRTOS configuration section to FreeRTOS API document
- Added notes about FreeRTOS applications in ESP-IDF
2022-01-06 10:19:33 +08:00
5869a4854f docs: fix hard coded target name in essl doc 2022-01-06 10:14:58 +08:00
65e9385d0a docs: Update Power Management and Sleep Modes docs for ESP32-S3 2022-01-06 10:14:57 +08:00
b0812baacd docs: Update TWAI docs for ESP32-S3 2022-01-06 10:14:57 +08:00
a0ed387f71 docs: update performance guide docs with S3 information 2022-01-06 10:14:57 +08:00
02bf07a1a0 docs: update docs with S3 specific information. 2022-01-06 10:14:54 +08:00
2e4c95c1ee update s3 doc 2022-01-06 10:09:51 +08:00
8c2990fcea trax: Adds ESP32-S3 support 2022-01-05 19:34:28 +01:00
18cd2ea3e6 apptrace: Adds ESP32-S3 support 2022-01-05 19:26:33 +01:00
fd9f97b5f4 emac_hal_start/stop function description added 2022-01-05 16:26:37 +01:00
63366f011a phy: update phy lib to remove ets_printf references 2022-01-05 17:29:55 +08:00
09552fdf68 ci: improve checks for Wi-Fi/PHYlibraries
- add missing Wi-Fi header MD5 checks for esp32c3, esp32s3
- check PHY libraries for references to ets_printf, in addition to
  checking Wi-Fi libraries. This used to happen until libphy.a was
  moved into a separate submodule.

Reported in https://github.com/espressif/esp-phy-lib/issues/3
2022-01-05 17:29:35 +08:00
b9989d3644 esp_wifi: Update wifi lib
Fix STA not getting IP after DPP
2022-01-05 16:24:00 +08:00
d83021a6e8 Merge branch 'bugfix/ftm_misc_issues_v4.4' into 'release/v4.4'
Miscellaneous FTM bugfixes (Backport v4.4)

See merge request espressif/esp-idf!16644
2022-01-05 08:12:39 +00:00
52224aebcf Fixed left right key confusion in comments.
"Left" and "Right" were swapped in some comments.
2022-01-05 10:46:46 +08:00
53c2b1f65b esp_wifi: Miscellaneous FTM bugfixes
1. Update wifi libs with bugfixes for corner cases
2. Avoid ASSERT for scan failure in FTM example
2022-01-04 15:49:45 +05:30
4288588751 UART: fix a bug preventing the user from freeing a previously registered ISR
* Closes https://github.com/espressif/esp-idf/issues/8150
2022-01-04 13:38:03 +08:00
d1f1b03beb Merge branch 'contrib/github_pr_7971_v4.4' into 'release/v4.4'
bugfix: Conflicting declaration error when include<rom/secure_boot.h> (v4.4)

See merge request espressif/esp-idf!16566
2022-01-04 03:37:35 +00:00
9a00ef1bc2 Merge branch 'feature/s3_rng_v4.4' into 'release/v4.4'
Bootloader add rng sampling (v4.4)

See merge request espressif/esp-idf!16623
2022-01-04 03:37:15 +00:00
abc18659e6 Merge branch 'bugfix/freertos_appcpu_int_disable_v4.4' into 'release/v4.4'
freertos: ensure interrupts are disabled before enabling tick timer (v4.4)

See merge request espressif/esp-idf!16606
2022-01-04 03:36:54 +00:00
8628079c42 There is an issue that if the the btm_cb.p_sec_dev_rec_list is full,but at the same
time we can't find old device to be replaced,then this can cause crash. So we need
to change the way to malloc the new device or replace the old in the list.
2022-01-04 10:42:09 +08:00
f9e7eb1fbf refactor (docs): improved fatal errors doc 2022-01-04 10:02:29 +08:00
ee24264c75 feat (bootloader): added rng sampling
Set maximum RNG query frequency to save value known from tests
2022-01-03 16:24:41 +05:30
bd9ee38f3c http: Fix parsing invalid url cause to crash
Reason:
For example, if an url is lack of leading 'http:' by mistake, it causes to http_parser_parse_url() cannot parse http host item,
and then pass the null host pointer to _get_host_header(), crash happens.

Fix:
http added null pointer check now.

Closes https://jira.espressif.com:8443/browse/ESPAT-953
2021-12-31 14:40:21 +08:00
f29492dc9d fix typos and format 2021-12-31 11:18:17 +08:00
dc707d5933 freertos: ensure interrupts are disabled before enabling tick timer
xPortStartScheduler calls vPortSetupTimer -> _frxt_tick_timer_init,
which enables tick timer interrupt and sets up the first timeout.
From that point on, the interrupt can fire. If the interrupt happens
while _frxt_dispatch is running, the scheduler will enter an infinite
loop. This is because _frxt_dispatch isn't supposed to be preemptable,
and the tick interrupt will overwrite some of the registers used by
_frxt_dispatch.
Note that this situation doesn't practically occur on the real
hardware, where the execution of vPortSetupTimer and _frxt_dispatch
happens quickly enough. However it can be reproduced on an emulator
if the tick period is set to 1ms.

Add an explicit call to portDISABLE_INTERRUPTS in xPortStartScheduler
to guarantee that _frxt_dispatch doesn't run with interrupts enabled.
This is similar to the esprv_intc_int_set_threshold(1); call in
RISC-V version of port.c.
2021-12-30 18:00:59 +08:00
3b1bdce816 optimize SPP documents 2021-12-30 16:11:56 +08:00
b25fb1111d gpio: Fix some gpio pin num errors on esp32s2 and esp32c3 2021-12-30 12:27:14 +08:00
e39b0dcd2e spacing styling correction 2021-12-30 10:47:49 +08:00
a61a935506 minor styling changes 2021-12-30 10:47:49 +08:00
b72a03fd07 esp_hid: fix output report char declaration
Current issue: output reports sent by Windows not received.
The report characteristic declaration should also support write without
response as specified by HIDS profile:
See https://www.bluetooth.com/specifications/GATT/ (page 14)
2021-12-30 10:47:49 +08:00
629bd67001 fix on esp_hidh report map length checking function
Closes https://github.com/espressif/esp-idf/issues/7586
2021-12-30 10:47:49 +08:00
8423e7d785 ledc.h - fix extern "C" to include ledc_cb_register()
(cherry picked from commit d4de08182e)
2021-12-29 21:14:37 +08:00
bf6b3ec0a8 component/bt: Support set HW CCA threshold value 2021-12-29 14:43:33 +08:00
5fc5016981 component/bt: fix periodic adv parameters detection issue 2021-12-29 14:43:22 +08:00
ace24fd3f8 components/bt: modify name of file 2021-12-29 14:31:54 +08:00
f4c6c48123 components/bt: Update the document of demo bt discovery 2021-12-29 14:31:38 +08:00
55bd48b24e components/bt: Modify demo bt_discovery 2021-12-29 14:31:20 +08:00
474ff3e38f wifi_prov_mgr: Added check for passphrase length in softAP scheme
Closes https://github.com/espressif/esp-idf/issues/8063
2021-12-28 18:13:40 +05:30
9d73448272 Fix copyright headers for few include files 2021-12-28 14:29:33 +05:30
530a06cf61 bugfix: Conflicting declaration error with include<esp_efuse.h>, and Unified secure_boot.h include guard to "pragma once". 2021-12-28 14:29:28 +05:30
bd8e9d98ba CI: change ap authmode from number to string (backport v4.4) 2021-12-27 19:57:40 +08:00
214d62b9ad Merge branch 'bugfix/install_key_refactor_v4.4' into 'release/v4.4'
esp_wifi: Refactor key install code(backport v4.4)

See merge request espressif/esp-idf!16532
2021-12-24 11:48:51 +00:00
d57b946bbf esp_wifi: Refactor key install code 2021-12-24 11:58:18 +08:00
f9ab0ac458 Merge branch 'feature/usb-msc_v4.4' into 'release/v4.4'
USB MSC class (v4.4)

See merge request espressif/esp-idf!16530
2021-12-24 03:48:29 +00:00
84ac488837 Merge branch 'bugfix/alarm_update_invalid_v4.4' into 'release/v4.4'
timer: stop alarm if alarm value doesn't change in ISR callback (v4.4)

See merge request espressif/esp-idf!16524
2021-12-24 03:48:10 +00:00
3171667845 Merge branch 'bugfix/rtc_section_alignment_v4.4_2' into 'release/v4.4'
System: fix RTCFAST section alignment (v4.4)

See merge request espressif/esp-idf!16517
2021-12-24 03:47:02 +00:00
3b4c2b8281 Merge branch 'bugfix/doc_for_ipc_isr_v4.4' into 'release/v4.4'
esp_ipc: Update documentation and API descriptions (v4.4)

See merge request espressif/esp-idf!16032
2021-12-24 03:35:54 +00:00
11cbcdf46a Merge branch 'bugfix/wpa3_memory_leak_v4.4' into 'release/v4.4'
esp_wifi: Fixes memory leak in wpa3.

See merge request espressif/esp-idf!16528
2021-12-24 03:27:31 +00:00
204aa05d0b USB: added MSC Host Driver with VFS support
Closes https://github.com/espressif/esp-idf/issues/6401
2021-12-23 18:30:24 +01:00
88acf66506 Merge branch 'bugfix/freemodbus_timer_struct_not_initialized' into 'release/v4.4'
freemodbus: fixed timer config struct not initialized issue (v4.4)

See merge request espressif/esp-idf!16117
2021-12-23 17:15:00 +00:00
e093575e39 freemodbus: fixed timer config struct not initialized issue (v4.4) 2021-12-23 17:15:00 +00:00
ec554944b7 Merge branch 'feature/backport/usb_host/cdc_driver' into 'release/v4.4'
USB: Add CDC-ACM subclass host driver (backport v4.4)

See merge request espressif/esp-idf!16363
2021-12-23 17:02:33 +00:00
7cd52401b0 esp_wifi: Fixes memory leak in wpa3. 2021-12-23 19:05:03 +05:30
5b80dd44be Merge branch 'feature/gdma_iram_interrupt_v4.4' into 'release/v4.4'
gdma: support IRAM interrupt (v4.4)

See merge request espressif/esp-idf!15993
2021-12-23 12:50:22 +00:00
9f5c6f287e Merge branch 'feature/update_adc_cali_due_to_efuse_version_change_v4.4' into 'release/v4.4'
adc: update s3 adc calibration efuse version (v4.4)

See merge request espressif/esp-idf!16357
2021-12-23 12:49:11 +00:00
81f81b97c3 Merge branch 'feature/adc_dma_driver_4.4' into 'release/v4.4'
adc: dma driver (v4.4)

See merge request espressif/esp-idf!16437
2021-12-23 12:48:47 +00:00
9a42760b22 Merge branch 'feature/posix_compat_functions_v4.4' into 'release/v4.4'
newlib: implement posix_memalign, sysconf, realpath (v4.4)

See merge request espressif/esp-idf!16464
2021-12-23 11:20:54 +00:00
66dd3dade9 Merge branch 'bugfix/ldgen_plus_in_archive_name_v4.4' into 'release/v4.4'
ldgen: allow + sign in archive names (v4.4)

See merge request espressif/esp-idf!16467
2021-12-23 11:15:47 +00:00
b0122177b7 timer: stop alarm if alarm value doesn't change in ISR handler
Alarm will be disabled by hardware when alarm event happend.
In the ISR, if auto-reload is enabled, we should re-enable the alarm.
If the alarm target value is changed in user's callback,
the alarm will be reenabled as well.

Closes https://github.com/espressif/esp-idf/issues/7001
Closes https://github.com/espressif/esp-idf/issues/8095
2021-12-23 18:58:43 +08:00
ec380d04b2 Merge branch 'refactor/fun_pointer_opi_v4.4' into 'release/v4.4'
opi_flash: Add a function pointer for opi required registers(backport v4.4)

See merge request espressif/esp-idf!16359
2021-12-23 09:24:18 +00:00
61149302e5 Merge branch 'bugfix/fix_spp_open_err_bda_v4.4' into 'release/v4.4'
Component_bt/Fix SPP acceptor open with wrong remote address[backport 4.4]

See merge request espressif/esp-idf!16519
2021-12-23 09:23:33 +00:00
1ec46ad3b8 adc: support adc dma driver on all chips 2021-12-23 17:13:46 +08:00
6279f9eb62 Merge branch 'bugfix/fix_heap_memory_corruption_v4.4' into 'release/v4.4'
Heap: Fix a possible bug in the TLSF allocator (backport v4.4)

See merge request espressif/esp-idf!16507
2021-12-23 03:29:45 +00:00
7f48664eda Merge branch 'feature/mbedtls-2.16.12-integration_v4.4' into 'release/v4.4'
mbedtls: upgrade to release v2.16.12 (v4.4)

See merge request espressif/esp-idf!16483
2021-12-23 03:26:17 +00:00
cb2906c7b2 Merge branch 'bugfix/fix_blufi_encryption_fail_v4.4' into 'release/v4.4'
components/bt: fix blufi encryption fail(backport release/v4.4)

See merge request espressif/esp-idf!16314
2021-12-23 03:23:24 +00:00
3390caf994 fix SPP open with wrong remote bd_addr 2021-12-23 10:02:39 +08:00
60386410ae System: fix RTCFAST section alignment
This bugfix contains 3 fixes:
1. .rtc_dummy section is removed (not needed for C3)
2. .rtc_text section is padded with 16B for possible CPU prefetch
3. .rtc_text section is aligned to 4B boundary to comply with PMS Memprot requirements
2021-12-22 21:58:20 +01:00
ba50a4e25e Merge branch 'bugfix/stdatomic_sync_op_and_fetch_v4.4' into 'release/v4.4'
newlib: stdatomic: implement missing "op_fetch", "nand" builtins (v4.4)

See merge request espressif/esp-idf!16465
2021-12-22 12:44:09 +00:00
62322caf38 Merge branch 'contrib/github_pr_7966_v4.4' into 'release/v4.4'
Changed argument pointer to correct data (GitHub PR) (v4.4)

See merge request espressif/esp-idf!16423
2021-12-22 12:42:27 +00:00
3051ad2159 components/bt: fix blufi encryption fail 2021-12-22 20:40:48 +08:00
710883d9bf Merge branch 'bugfix/scannable_adv_duration_estimation_v4.4' into 'release/v4.4'
[Coexistence]: fixed BLE scannable extended adv performance issue in case of Wi-Fi coexistence(backport v4.4)

See merge request espressif/esp-idf!16476
2021-12-22 12:38:17 +00:00
af429e56bb Merge branch 'bugfix/esp_eth_start_tx_buff_v4.4' into 'release/v4.4'
Fixed ESP32 EMAC driver `insufficient TX buffer size` (v4.4)

See merge request espressif/esp-idf!16497
2021-12-22 12:36:40 +00:00
a15bac6b5c Merge branch 'docs/fix_typo_in_header_file' into 'release/v4.4'
docs: Fix typo in sdmmc_cmd.h and inconsistency in spi_master.h (backport release/v4.4)

See merge request espressif/esp-idf!16382
2021-12-22 12:34:05 +00:00
451a173960 Merge branch 'bugfix/idf_exe_dll_deps_v4.4' into 'release/v4.4'
tools: fix idf_exe dependency on vcruntime140.dll, move it out of IDF (v4.4)

See merge request espressif/esp-idf!16352
2021-12-22 12:29:58 +00:00
255ca3d18e Merge branch 'feature/cmake_linux_arm64_v4.4' into 'release/v4.4'
tools: updates for linux-arm64 (aarch64) platform (v4.4)

See merge request espressif/esp-idf!16353
2021-12-22 12:29:33 +00:00
abc7365777 Merge branch 'docs/pthread_rw_lock' into 'release/v4.4'
Docs: documentation about reader-writer-lock impl (v4.4)

See merge request espressif/esp-idf!16148
2021-12-22 12:29:19 +00:00
07221ebaf5 Merge branch 'bugifx/freertos_missing_api_config_v4.4' into 'release/v4.4'
freertos: Add missing INCLUDE_ configurations for some functions (v4.4)

See merge request espressif/esp-idf!16267
2021-12-22 12:28:35 +00:00
c2a71ce5c6 Merge branch 'feature/mbedtls_dynamic_memory_v4.4' into 'release/v4.4'
fix(mbedtls): fix compiling error when open MBEDTLS_SSL_PROTO_DTLS and disable...(backport v4.4)

See merge request espressif/esp-idf!16472
2021-12-22 12:27:27 +00:00
f158a0d538 newlib: implement posix_memalign, sysconf, realpath
Closes https://github.com/espressif/esp-idf/issues/6119
Closes https://github.com/espressif/esp-idf/issues/7798
2021-12-22 10:54:54 +01:00
0b43544a24 Tools: Load tool versions automatically for IDF Tools tests 2021-12-22 10:31:17 +01:00
155de9c49e Heap: Add a target test to check that TLFS allocates the requested size 2021-12-22 14:06:41 +08:00
09db8845c6 Heap: Fix a possible bug in the TLSF allocator
Fix a bug that could return a chunk of memory smaller than requested,
easily leading to a memory corruption, when the required memory alignment
passed to the allocator is 4.
2021-12-22 14:06:41 +08:00
5f5f8bd64e Merge branch 'bugifx/nimble_timer_memory_leak_v4.4' into 'release/v4.4'
[NimBLE]: Fixed memory leak of timer during NimBLE Host start-stop process(backport v4.4)

See merge request espressif/esp-idf!16445
2021-12-22 05:45:23 +00:00
02c7dbab81 Merge branch 'ci/upload_build_example_for_release_test_4.4' into 'release/v4.4'
ci: preserve artifacts for local test apps (4.4)

See merge request espressif/esp-idf!16291
2021-12-22 05:44:01 +00:00
775f2886cc Merge branch 'bugfix/fix_rx_fragment_error_issue_v4.4' into 'release/v4.4'
esp_wifi: fix fragment issue and PMF compatible for faulty APs(Backport v4.4)

See merge request espressif/esp-idf!16390
2021-12-22 05:40:19 +00:00
74ba1175b6 Fixed ESP32 EMAC driver insufficient TX buffer size which could followed esp_eth_stop and esp_eth_start sequence 2021-12-21 14:04:55 +01:00
c91afab332 fix(mbedtls): fix compiling error when open MBEDTLS_SSL_PROTO_DTLS and disable MBEDTLS_SSL_PROTO_DTLS when open MBEDTLS_DYNAMIC_BUFFER 2021-12-21 16:31:47 +08:00
3e3e1a9a9d mbedtls: upgrade to release v2.16.12
For release notes, please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.12
2021-12-21 13:58:40 +05:30
d0b465c7cd mbedtls: small documentation update 2021-12-21 13:58:40 +05:30
8152978d73 component/bt: fixed coexistence scannable extended adv performance issue 2021-12-21 12:43:33 +08:00
bcd47fa0cc component/bt/host/nimble: fixed memory leak due to timer not destroyed during NimBLE host start-stop 2021-12-21 12:31:42 +08:00
d037359359 Merge branch 'bugfix/static_analysis_fixes_v4.4' into 'release/v4.4'
ESP_WIFI: Remove static analysis warnings(backport v4.4)

See merge request espressif/esp-idf!16333
2021-12-21 04:11:22 +00:00
187f47d232 Merge branch 'feature/support_ble_direct_ind_low_adv_v4.4' into 'release/v4.4'
components/bt: Support low duty cycle directed advertising(backport release/v4.4)

See merge request espressif/esp-idf!16377
2021-12-21 04:07:13 +00:00
c50eec53d1 Merge branch 'bugfix/fix_spp_listen_err_v4.4' into 'release/v4.4'
Component_bt/Fix SPP cannot malloc slot bugs[backport v4.4]

See merge request espressif/esp-idf!16383
2021-12-21 04:06:40 +00:00
a650995a2e Merge branch 'bugfix/bt_enc_proc_finish_v4.4' into 'release/v4.4'
bt/bugfix: ACL Rx data is sent to host before enc change event

See merge request espressif/esp-idf!16424
2021-12-21 04:06:22 +00:00
8529a1da35 Merge branch 'bugfix/wpa_supplicant_logs_release_v4.4' into 'release/v4.4'
esp_wifi: Change the verbosity of wpa_supplicant logs (Backport v4.4)

See merge request espressif/esp-idf!16340
2021-12-21 04:03:17 +00:00
f01fa89404 Merge branch 'mesh/bugfix_fix_no_ip_issue_v4.4' into 'release/v4.4'
esp_wifi_mesh: fix the device can not receive IP_EVENT_STA_GOT_IP when the router restarted(backport_v4.4)

See merge request espressif/esp-idf!16343
2021-12-21 04:02:14 +00:00
518f94270b Merge branch 'bugfix/v4.4-otbr-crash' into 'release/v4.4'
openthread: update libraries to v4.4 release

See merge request espressif/esp-idf!16447
2021-12-21 04:01:38 +00:00
f72baac109 freertos: Add missing INCLUDE_ configurations for some functions
This commit adds missing INCLUDE_ configurations to FreeRTOSConfig.h for
the following functions:

- xTaskAbortDelay()
- xTaskGetHandle()

Unit tests for these functions were also added.

Closes https://github.com/espressif/esp-idf/issues/7902
2021-12-21 10:54:28 +08:00
fbdb781fcb ldgen: allow + sign in archive names
Closes https://github.com/espressif/esp-idf/issues/8073
2021-12-21 02:16:32 +01:00
c8c65a2854 newlib: stdatomic: implement missing "op_fetch", "nand" builtins
* Adds implementations of __{atomic,sync}_nand_fetch_n. These builtins
  were implemented for other operations but were not defined for NAND.
* Adds implementation of __atomic_OP_fetch_n for all OPs.
* Adds implementation of __sync_OP_and_fetch_n for all OPs.

Reported in https://github.com/espressif/arduino-esp32/issues/5948
2021-12-21 02:15:45 +01:00
8763c82e26 Fix Typos 2021-12-20 17:04:24 +08:00
dec183dbb5 Optimize HFP Documents 2021-12-20 17:04:15 +08:00
9688cf5c04 openthread: update libraries to v4.4 release
Fixes the library mismatch and border router crash issue in v4.4
release.
2021-12-20 16:16:10 +08:00
63ac2111ce esp_ipc: Update documentation and API descriptions
This commit updates the documentation and API descriptions of
the esp_ipc and esp_ipc_isr features.
2021-12-20 12:41:10 +08:00
a79dc75f0a Merge branch 'bugfix/fix_variable_on_stack_bug_in_seg_slave_example_v4.4' into 'release/v4.4'
spi_slave_hd: fix stack variable bug in seg_slave example (v4.4)

See merge request espressif/esp-idf!16388
2021-12-16 10:17:56 +00:00
161d7ee25a Merge branch 'bugfix/mcpwm_ll_missing_type_conversion_v4.4' into 'release/v4.4'
mcpwm: fix implicit conversion in LL function (v4.4)

See merge request espressif/esp-idf!16407
2021-12-16 10:16:03 +00:00
a2b88eb1a0 Merge branch 'bugfix/fix_adc1_chan8_9_not_defined_on_s3_v4.4' into 'release/v4.4'
adc: fix adc1 channel 8 and 9 not defined bug on s3 (v4.4)

See merge request espressif/esp-idf!16399
2021-12-16 10:14:17 +00:00
431bf72295 bt/bugfix: ACL Rx data is sent to host before enc change event 2021-12-16 15:41:31 +05:30
04fab6f1ac Fixed pcap summary print of 802.11 frame
802.11 Packet Type and Packet Subtype is now correctly decoded
2021-12-16 10:28:30 +01:00
762031424b Changed argument pointer to correct data 2021-12-16 10:28:30 +01:00
b67c833c88 esp_wifi_mesh: fix the device can not receive IP_EVENT_STA_GOT_IP when the router restarted 2021-12-16 17:23:55 +08:00
23e4c12a86 mcpwm: fix implicit conversion in LL function
Closes https://github.com/espressif/esp-idf/issues/8066
2021-12-15 10:24:42 +08:00
2aed35b804 adc: fix adc1 channel 8 and 9 not defined bug on s3 2021-12-14 20:10:47 +08:00
40ae2037bc esp_wifi: Change the verbosity of wpa_supplicant log. 2021-12-14 14:29:09 +05:30
416b3b9465 allow for minimal scope of wifi_init_config_t
With this change one can use the default config as a variable with minimal scope: esp_wifi_init(&(wifi_init_config_t)WIFI_INIT_CONFIG_DEFAULT())
2021-12-14 12:46:37 +08:00
c42db9308f docs: Update miswritten and abbreviated words and syntax errors for initialize WiFi section in esp_wifi.h header file 2021-12-14 12:46:11 +08:00
094b3dba33 esp_wifi: fix fragment issue and PMF compatible for faulty APs
1. fix(pp): fix fragment plt loss when 2td pn compare with 1th pn
2. pmf allow keyindex in big endian format to workaround faulty APs
3. docs: update miswritten and abbreviated words and syntax errors for initialize WiFi section in esp_wifi.h header file
4. allow for minimal scope of wifi_init_config_t
2021-12-14 12:42:25 +08:00
39ed1b2862 spi_slave_hd: fix stack variable bug in seg_slave example
Closes https://github.com/espressif/esp-idf/issues/7163
2021-12-14 12:36:40 +08:00
b8602d4bf9 fix SPP server bugs when the BTC layer can not allocate a slot for the listen port 2021-12-14 11:03:57 +08:00
215f8fe68e docs: fix typo in header files 2021-12-14 11:01:17 +08:00
a628ef5be0 components/bt: Fix high duty cycle directed advertising will not be stopped when timeout 2021-12-14 09:32:34 +08:00
5086d6f3d2 components/bt: Support low duty cycle directed advertising 2021-12-14 09:32:15 +08:00
7506a725be docs: Rebase and typos fixed for the bluetooth README files 2021-12-13 10:31:09 +00:00
4a429d59ac adc: update adc calibration efuse version
ADC calibration scheme and algorithm are not changed. Only the eFuse bit BLOCK1_VERSION is changed. This MR updated the logic to recognize the adc efuse version
2021-12-13 13:03:23 +08:00
f64f2e4955 docs: Update inconsistency parts for S3 documentation, set a default value for future targets, and remove line breaks inside paragraphs 2021-12-13 11:23:18 +08:00
e04eae6659 usb: Add USB host CDC-ACM class driver 2021-12-10 10:04:16 +01:00
a9a5894fe9 opi_flash: Add a function pointer for opi required registers 2021-12-10 15:11:33 +08:00
36934317b0 tools: don't install binutils-esp32ulp on aarch64
Once new binutils-esp32ulp is made and aarch64 artifacts are added,
will add these tools back.

Related to https://github.com/espressif/esp-idf/issues/6432
2021-12-09 17:36:00 +01:00
4949d55ea0 tools: add CMake for linux-arm64 (aarch64) platform
Allows installing cmake on aarch64 linux platforms. Also necessary
when building IDF docker image on macOS aarch64.

Part of https://github.com/espressif/esp-idf/issues/6432
2021-12-09 17:36:00 +01:00
8b4b2234e4 tools: upgrade idf_exe to 1.0.3
https://github.com/espressif/idf_py_exe_tool/releases/tag/v1.0.3
2021-12-09 17:24:43 +01:00
07644ee5cd tools: move idf_exe out of IDF
Source code moved into https://github.com/espressif/idf_py_exe_tool,
so that releases can be built in CI and hosted on Github.
2021-12-09 17:24:43 +01:00
f23dcd3555 Merge branch 'bugfix/fix_phy_enable_watchdog_timeout_issue_4.4' into 'release/v4.4'
Fix the ble task watchdog timeout issue

See merge request espressif/esp-idf!16287
2021-12-09 08:32:34 +00:00
a39af9b000 Merge branch 'bugfix/s3_rtc_ram_deepsleep_test_v4.4' into 'release/v4.4'
ci: fix "can set sleep wake stub from stack in RTC RAM" test case failure (v4.4)

See merge request espressif/esp-idf!16341
2021-12-09 08:25:04 +00:00
25873a668a Merge branch 'bugfix/remove_PIP_USER_v4.4' into 'release/v4.4'
tools: Add check for PIP_USER variable (backport v4.4)

See merge request espressif/esp-idf!16338
2021-12-09 08:11:55 +00:00
d730c84038 ci: fix "can set sleep wake stub from stack in RTC RAM" test case failure
"can set sleep wake stub from stack in RTC RAM" would randomly fail on S3 due to stack overflow.

Fixed wrong usage of stack size and slightly increased it.
2021-12-09 13:59:30 +08:00
fd2000184a ci: add test dir examples/bluetooth/hci/controller_hci_uart_esp32 2021-12-09 13:48:38 +08:00
4d73d4db36 example: build ble_mesh_console example on c3 and s3 as well 2021-12-09 13:48:38 +08:00
4a11276cf4 ci: preserve artifacts for local test apps 2021-12-09 13:48:38 +08:00
e104dd7f27 Merge branch 'bugfix/fix_wifi_bugs_v4.4' into 'release/v4.4'
esp_wifi: fix wifi bugs (Backport v4.4)

See merge request espressif/esp-idf!16278
2021-12-08 15:46:40 +00:00
1e39970e91 tools: Add check for PIP_USER variable
Closes https://github.com/espressif/esp-idf/issues/7910
2021-12-08 16:25:17 +01:00
bd650062ca Merge branch 'feature/update_rtc_memory_heap_caps' into 'release/v4.4'
heap: update RTC memory heap caps (backport v4.4)

See merge request espressif/esp-idf!15941
2021-12-08 13:35:18 +00:00
141c1cd004 Merge branch 'bugfix/crypto_allocate_lldesc_v4.4' into 'release/v4.4'
crypto: dont create DMA descriptors on the stack (v4.4)

See merge request espressif/esp-idf!16323
2021-12-08 13:31:41 +00:00
a77ab8c03e ESP_WIFI: Remove static analysis warnings 2021-12-08 18:03:43 +05:30
c190ab1830 Merge branch 'fix/remove_warning_when_disabling_rom_dl_mode_v4.4' into 'release/v4.4'
secure_boot: Fix warning when UART ROM DL mode is disabled (v4.4)

See merge request espressif/esp-idf!16228
2021-12-08 11:56:15 +00:00
9c686ff341 Update esp32c3 and esp32s3 phy lib and bb lib
Fix the ble task watchdog timeout issue caused by phy enable when exit modem sleep.
2021-12-08 19:16:28 +08:00
fe5ee1041c Merge branch 'bugfix/minimal_stacksize_watchpoint_aware_4.4' into 'release/v4.4'
[freertos]: Changed minimal stack size to regard watchpoint usage (backport v4.4)

See merge request espressif/esp-idf!16303
2021-12-08 10:28:05 +00:00
f2db4c7520 Merge branch 'bugfix/ringbuf_send_semaphore_release_order_v4.4' into 'release/v4.4'
esp_ringbuf: Fix order of semaphore release in xRingbufferSend (v4.4)

See merge request espressif/esp-idf!16229
2021-12-08 10:26:12 +00:00
b4a32e3812 Merge branch 'bugfix/html_redirect_v4.4' into 'release/v4.4'
docs: fix html redirects not working (v4.4)

See merge request espressif/esp-idf!16284
2021-12-08 10:25:47 +00:00
a6e31652b8 Merge branch 'feature/mbedtls_dynamic_memory_v4.4' into 'release/v4.4'
feat(mbedtls): modify __wrap_mbedtls_ssl_setup to decrease SSL peak heap cost(backport v4.4)

See merge request espressif/esp-idf!16275
2021-12-08 10:21:04 +00:00
7d7f91e1d8 Merge branch 'docs/update_the_pinout_figure_of_esp32_devkitc_v4.4' into 'release/v4.4'
docs: update the module on esp32-devkitc from esp32-wrover to esp32-wroom (v4.4)

See merge request espressif/esp-idf!15963
2021-12-08 10:15:54 +00:00
a89ff2677b Merge branch 'bugfix/fix_esp32h2_efuse_get_ext_mac_v4.4' into 'release/v4.4'
efuse_table_gen: Fixes wrong joining fields with omitted names (v4.4)

See merge request espressif/esp-idf!15735
2021-12-08 10:12:25 +00:00
67fcfc2e02 Merge branch 'feature/freertos_try_enter_critical_v4.4' into 'release/v4.4'
freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions (v4.4)

See merge request espressif/esp-idf!16040
2021-12-08 10:10:17 +00:00
ff3922d217 Merge branch 'bugfix/fix_select_timeout_v4.4' into 'release/v4.4'
VFS: `select` function's timeout is now POSIX compliant (and fix eventfd example) (backport v4.4)

See merge request espressif/esp-idf!16189
2021-12-08 08:32:42 +00:00
2a2d8f5cbc efuse_example_test: Fix the example test
*Unify the log messages when UART ROM Download mode is kept enabled
2021-12-08 16:11:59 +08:00
2c0081b286 secure_boot: Fix warning when UART ROM DL mode is disabled
*Additionally use updated calls to enable rom secure download mode
2021-12-08 16:11:59 +08:00
a1ee43fe9d crypto: also apply cache writeback/invalidate for SPIRAM_USE_MEMMAP
Closes https://github.com/espressif/esp-idf/issues/7944
2021-12-08 16:10:19 +08:00
3b3826b61c crypto: allocate all DMA descriptors to DMA capable memory.
These were previously placed on the stack, but the stack could be placed in
RTC RAM which is not DMA capable.
2021-12-08 16:10:18 +08:00
36e1d1c180 Merge branch 'bugfix/wifi_netif_on_off_cycle_race_v4.4' into 'release/v4.4'
wifi: Fix race conditon invoking invalid callback on deinit (v4.4)

See merge request espressif/esp-idf!16309
2021-12-08 07:31:13 +00:00
feee6a2f36 Merge branch 'bugfix/eth_emac_reset_dma_desc_v4.4' into 'release/v4.4'
esp-eth: emac: Reset Tx DMA channel owner on init (v4.4)

See merge request espressif/esp-idf!16008
2021-12-08 07:18:42 +00:00
f4e5948102 Merge branch 'bugfix/lcd_rgb_pclk_default_to_low_v4.4' into 'release/v4.4'
lcd: rgb pclk idle default to low && RMT IR protocol example for esp32s3 (v4.4)

See merge request espressif/esp-idf!16211
2021-12-08 07:01:08 +00:00
1b7cc59b10 wifi: Fix race conditon invoking invalid callback on deinit
Closes https://github.com/espressif/esp-idf/issues/7579
2021-12-08 07:14:08 +01:00
32077601c4 bugfix (freertos): Changed minimal stack size to regard watchpoint usage 2021-12-08 11:29:09 +08:00
68fc49c4d2 spi-slave: fix single-board: hd test failing due to DMA buffers ending up in PSRAM 2021-12-08 10:59:26 +08:00
d1dc428820 docs: fix html redirects not working
HTML redirects for docs broke during migration to esp-docs.
2021-12-07 09:12:46 +08:00
d7599a53b8 esp_wifi: Update wifi lib
1. Fix FTM failures after repeated operations
2. Update Mexico channel refer to FCC
3. Mesh: fix the issue that layer2 node connect to lower-layer node when FIXED-ROOT root disappeared
4. Decouple softap and 8684 support
2021-12-06 17:45:57 +08:00
f490adf800 esp_wifi: support station only mode for code size down 2021-12-06 17:34:56 +08:00
440b0001d0 esp_wifi: Reset event bits in ftm example to avoid repeated failures
Closes https://github.com/espressif/esp-idf/pull/7773
2021-12-06 17:34:00 +08:00
03b7ffdf4a feat(mbedtls): modify __wrap_mbedtls_ssl_setup to decrease SSL peak heap cost 2021-12-06 17:07:11 +08:00
220a91ae30 Merge branch 'feature/adds_fault_injection_protection_for_check_anti_rollback_v4.4' into 'release/v4.4'
bootloader_support: Adds fault injection protection for check_anti_rollback (v4.4)

See merge request espressif/esp-idf!16179
2021-12-06 04:03:11 +00:00
6affb3da3c Merge branch 'bugfix/scheduler_state_query_thread_safety_v4.4' into 'release/v4.4'
freertos: fix thread safety for checking scheduler state (v4.4)

See merge request espressif/esp-idf!16126
2021-12-06 04:02:53 +00:00
3211346669 Merge branch 'bugfix/hardware_mpi_fallback_issue_v4.4' into 'release/v4.4'
mbedtls: fix hardware MPI (bignum) related regression (v4.4)

See merge request espressif/esp-idf!16236
2021-12-06 04:00:36 +00:00
0c8391acb1 Merge branch 'reduce_bootup_time_when_using_usb-serial-jtag_v4.4' into 'release/v4.4'
rtc_clk: reduce bootup time when using usb-serial-jtag(backport v4.4)

See merge request espressif/esp-idf!16260
2021-12-06 04:00:01 +00:00
b458a60791 Merge branch 'bugfix/fix_can_not_find_mac_addr_error_mr_4.4' into 'release/v4.4'
fix can not find mac addr error

See merge request espressif/esp-idf!16145
2021-12-06 03:37:24 +00:00
5e9c085ae9 Merge branch 'bugfix/xStreamBufferReset_crashing_v4.4' into 'release/v4.4'
FreeRTOS: Fix xStreamBufferReset function always crashing (backport v4.4)

See merge request espressif/esp-idf!16170
2021-12-06 03:36:51 +00:00
faa6ec04f2 Merge branch 'feature/update_option_len_default_value_v4.4' into 'release/v4.4'
lw-ip: Update LWIP_DHCP_OPTIONS_LEN default value when LWIP_DHCP_DISABLE_VENDOR_CLASS_ID disabled(backport v4.4)

See merge request espressif/esp-idf!16253
2021-12-06 03:36:03 +00:00
7ae887dead rmt: update ir example to work with esp32s3 out of box 2021-12-06 10:02:55 +08:00
e311554554 lcd: rgb pclk idle default to low 2021-12-06 10:02:55 +08:00
1d6c95000b reduce bootup time when using usb-serial-jtag 2021-12-03 20:50:22 +08:00
3ebb1a2a00 lwip: Update LWIP_DHCP_OPTIONS_LEN default value when LWIP_DHCP_DISABLE_VENDOR_CLASS_ID disabled
Closes https://github.com/espressif/esp-idf/issues/7742
2021-12-03 17:23:35 +08:00
4fca21b67c Merge branch 'feature/remove_component_manager_tests_v4.4' into 'release/v4.4'
ci: Remove component manager test from build system tests (v4.4)

See merge request espressif/esp-idf!16106
2021-12-02 12:09:49 +00:00
a28e0bf064 mbedtls: remove wrap from component.mk as well
Note: This was not required in original MR, as master branch does
not support GNU Make.
2021-12-02 17:13:31 +05:30
2af37752fe Merge branch 'docs/update_s3_wroom_datasheet_link_backport_v4.4' into 'release/v4.4'
Fix link to esp32-s3-wroom-1 datasheet link (backport v4.4)

See merge request espressif/esp-idf!16093
2021-12-02 09:37:19 +00:00
7fe9d41e33 esp_bignum: move check for supported MPI bits at start of API
This can allow hardware MPI API to return as soon as it identifies
that it can handle require bitlength operation.
2021-12-02 15:07:08 +05:30
9cb4948a23 mbedtls: update mbedtls submodule pointer for MPI API change 2021-12-02 15:07:08 +05:30
99c9637e9b mbedtls: fix hardware MPI (bignum) related regression
In commit de22f3a4e5, combination of
hardware and software MPI (bignum) related approach was used to
work around chip (e.g. ESP32-C3) limitation of max 3072 bits support.

This was done using linker "--wrap" flag but since the relevant API is
being used in same translation (compilation unit), hardware mode was not
getting used in some cases (e.g., RSA key generation).

This commit modified internal mbedTLS API and makes software+hardware
combination deterministic.
2021-12-02 15:07:08 +05:30
e0e6523c09 mbedtls: update kconfig help to correct on supported MPI bits 2021-12-02 15:07:07 +05:30
c25408a009 docs:update the link to esp32-s3-wroom-1 datasheet 2021-12-02 16:51:23 +08:00
288b2a22a5 Examples/PPPoS: Add troubleshooting to correctly power modem
Closes https://github.com/espressif/esp-idf/issues/7807
2021-12-02 09:09:23 +01:00
b98a2a41e0 Merge branch 'bugfix/ksz8081_loopback' into 'release/v4.4'
KSZ8081 Loopback Callback Fix

See merge request espressif/esp-idf!16081
2021-12-02 07:29:31 +00:00
d5c607c54a Merge branch 'bugfix/dm9051_tx_throughput_rate_optimization_v4.4' into 'release/v4.4'
esp_eth: optimize dm9051 Tx throughput(v4.4)

See merge request espressif/esp-idf!15885
2021-12-02 06:51:22 +00:00
92829f66c8 esp_ringbuf: Fix assertion xQueueGenericSend queue.c:818
The release of the semaphore indicating the item was successfully sent must be the last semaphore released.  The receiver may be in another task and may delete the Ringbuffer (such as with a return code across tasks design pattern) if they are through with the Ringbuffer.

The function xRingbufferSendAcquire followed by xRingbufferSendComplete had the semaphores released in the proper order and that same pattern should have been used in xRingbufferSend and xRingbufferSendFromISR.  This commit fixes this order.

Issue (IDFGH-6030) #7716 describes the problem in more detail.

Closes IDFGH-6030, https://github.com/espressif/esp-idf/issues/7716
Closes IDFGH-6036, https://github.com/espressif/esp-idf/pull/7721
2021-12-02 10:25:06 +05:30
762689de86 ci: Fix build system tests to clean the dir 2021-12-01 18:19:15 +01:00
aa96a98c0c Merge branch 'bugfix/riscv_fix_vector_mcause_v4.4' into 'release/v4.4'
RISC-V: fix usage of special register when interrupts are enabled (backport v4.4)

See merge request espressif/esp-idf!16187
2021-12-01 04:20:54 +00:00
66c547e5ab Merge branch 'bugfix/ringbuf_read_pointer_wrap_v4.4' into 'release/v4.4'
ringbuf: Fix bug where comparision between a signed and unsigned operand resulted in incorrect free size for no-split/allow-split buffers (v4.4)

See merge request espressif/esp-idf!15881
2021-12-01 04:18:48 +00:00
3a1e8a9810 Merge branch 'bugfix/avoid-exception-messages-while-export_v4.4' into 'release/v4.4'
Avoid exception messages while autocomplete initialization in export.sh (v4.4)

See merge request espressif/esp-idf!16199
2021-11-30 15:48:55 +00:00
376514480d Merge branch 'feature/backport_v4.4_add_get_errno_api_for_http_client' into 'release/v4.4'
esp_http_client: add a get HTTP client session errno API for esp_http_client(backport v4.4)

See merge request espressif/esp-idf!16195
2021-11-30 12:23:31 +00:00
ee881e3f96 Avoid exception messages while autocomplete initialization in export.sh 2021-11-30 12:42:53 +01:00
8848462d50 Merge branch 'nimble/add_throughput_example_v4.4' into 'release/v4.4'
NimBLE: Add NimBLE throughput demo examples (v4.4)

See merge request espressif/esp-idf!16138
2021-11-30 08:02:35 +00:00
5c08cd3fe1 esp_http_client: add a get HTTP client session errno API for esp_http_client(backport v4.4) 2021-11-30 15:26:48 +08:00
a96b8e151d Add the feature that switch random address to origin mac addr in the ADV
report data.
2021-11-30 14:24:52 +08:00
e91fd5ece9 Example: Fix eventfd example test and added a diagram to explain printed values 2021-11-30 12:01:43 +08:00
51e295b5c2 Merge branch 'bugfix/vfs-select-lock-latency-4.4' into 'release/v4.4'
vfs: reduce lock in vfs_select (v4.4)

See merge request espressif/esp-idf!16172
2021-11-30 03:56:08 +00:00
95eb17a61a Merge branch 'nimble_spp_v4.4' into 'release/v4.4'
NimBLE: BLE example for SPP service (v4.4)

See merge request espressif/esp-idf!16122
2021-11-30 03:54:44 +00:00
db6bc89b8c Merge branch 'bugfix/leedarson_v4.4' into 'release/v4.4'
component_bt: Fix some code logic errors (v4.4)

See merge request espressif/esp-idf!16016
2021-11-30 03:52:24 +00:00
cf21312d8d VFS: select function's timeout is now POSIX compliant
`select` function will now round up the timeout passed as a parameter (if any).
It  makes it POSIX compliant.

* Closes https://github.com/espressif/esp-idf/issues/7514
2021-11-30 11:51:46 +08:00
7cab983b86 RISC-V: fix usage of special register when interrupts are enabled 2021-11-30 11:45:18 +08:00
18612738db Merge branch 'docs/blink_update_supported_targets_on_readme_v4.4' into 'release/v4.4'
example: Update on the README file to change from ESP32-S3-Addax-1 to ESP32-S3-DevKitC-1 (v4.4)

See merge request espressif/esp-idf!15956
2021-11-29 20:40:51 +00:00
5f7037d143 bootloader: add anti-FI checks around secure version in anti-rollback scheme 2021-11-29 18:49:22 +05:30
26baeaca60 esp_eth: add loopback for ksz8081 2021-11-29 20:16:35 +08:00
ce7c936633 vfs: reduce lock in vfs_select 2021-11-29 17:32:43 +08:00
581f1c4550 FreeRTOS: Fix xStreamBufferReset function always crashing
This function resets the spinlock given as a parameter after taking it
(when entering the critical section). This then results in a panic once
it tries to exit the same critical section.

* Closes https://github.com/espressif/esp-idf/issues/7725
2021-11-29 15:31:30 +08:00
75fa6d7e3f Merge branch 'feature/add_coex_hci_command_v4.4' into 'release/v4.4'
Add hci command to set coexistence status (v4.4)

See merge request espressif/esp-idf!16053
2021-11-29 03:23:32 +00:00
a524bd85fd Merge branch 'bugfix/bootloader_utility_warnings_v4.4' into 'release/v4.4'
bootloader_support: Fix compiler warnings (v4.4)

See merge request espressif/esp-idf!16139
2021-11-26 13:32:28 +00:00
3c02b30a54 Merge branch 'bugfix/app_trace_tmo_init_v4.4' into 'release/v4.4'
startup: init timer before calling esp_apptrace_tmo_init (v4.4)

See merge request espressif/esp-idf!16136
2021-11-26 11:53:09 +00:00
8179e858a9 docs(pthread): documentation about reader-writer-lock impl 2021-11-26 16:21:03 +08:00
8fec43eecb Merge branch 'nimble/add_throughput_example' into 'master'
NimBLE throughput example: Changed write api to write without response

See merge request espressif/esp-idf!16138
2021-11-26 12:07:11 +05:30
19727b4968 Merge branch 'docs/examples_bluedroid_ble50_v4.4' into 'release/v4.4'
Readme for the bluedroid ble50 example with tutorial of walkthrough example (v4.4)

See merge request espressif/esp-idf!16099
2021-11-26 06:35:06 +00:00
fe91b306e4 Merge branch 'bugfix/multi_heap_get_info_impl_backport_v4.4' into 'release/v4.4'
heap: fix multi_heap_get_info_impl(backport v4.4)

See merge request espressif/esp-idf!16119
2021-11-26 05:44:49 +00:00
6f6538f053 bootloader_support: Fix unused-but-set-variable compiler warning
When building with BOOTLOADER_LOG_LEVEL lesser then VERBOSE, an error
code variable was being set but not consumed, resulting in a compiler
warning.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-26 01:34:42 -03:00
d21ef9b10a bootloader_support: Fix unused-variable compiler warning
Builds for every chip other than ESP32 resulted in a compiler warning
due to "drom_load_addr_aligned" and "irom_load_addr_aligned" not being
used, besides being possible to actually reuse them.
Furthermore, extended the logic for the other similar variables.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-26 01:34:40 -03:00
279e135c8f NimBLE throughput example: Add espressif license 2021-11-26 10:03:06 +05:30
76e3e3476e NimBLE throughput example: make multi target support readable 2021-11-26 10:03:06 +05:30
ed43a4eb50 NimBLE: Add throughput demo examples
- Added blecent_throughput(client) and bleprph_throughput(server) examples to
  demonstrate application throughput.
2021-11-26 10:03:06 +05:30
1ef94299a5 Merge branch 'nimble_spp' of ssh://gitlab.espressif.cn:27227/espressif/esp-idf into 'release/v4.4'
Nimble: Added BLE SPP Service

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

See merge request espressif/esp-idf!16122
2021-11-26 09:58:42 +05:30
b748053e2e startup: init timer before calling esp_apptrace_tmo_init 2021-11-25 23:58:36 +01:00
41906a8d31 freertos: fix thread safety for checking scheduler state
This issue was earlier fixed in commit 79e74e5d5f
but during migration to newer FreeRTOS release, it got introduced again.

This commit fixes thread safety issues with configASSERT() calls
regarding the value of uxSchedulerSuspended. A false negative
occurs if a context switch to the opposite core occurs in between
the getting the core ID and the assesment.

Relevant https://github.com/espressif/esp-idf/issues/4230
Closes https://github.com/espressif/esp-idf/issues/7726
Closes IDFGH-6041
2021-11-25 15:43:07 +05:30
02237e4b77 Merge branch 'bugfix/bt_assert_failed_when_interrupt_hlevel_disable_v4.4' into 'release/v4.4'
component/bt: fix assert fail when interrupt hlevel disable(backport release/v4.4)

See merge request espressif/esp-idf!16043
2021-11-25 06:30:08 +00:00
98a932d406 Merge branch 'feature/docker_build_use_git_mirror_v4.4' into 'release/v4.4'
ci: use LOCAL_GIT_MIRROR in docker build job, if set (v4.4)

See merge request espressif/esp-idf!16110
2021-11-25 05:33:42 +00:00
666218d753 heap: fix multi_heap_get_info_impl 2021-11-25 10:34:06 +08:00
ac6793c02a ci: use LOCAL_GIT_MIRROR in docker build job, if set
When the build runner has a local git mirror configured via
LOCAL_GIT_MIRROR variable, use that mirror when cloning IDF insider
the docker build job. Follows similar logic for
LOCAL_GITLAB_HTTPS_HOST, which is used for geo nodes.
2021-11-24 15:40:36 +01:00
adf61033a7 ci: Remove component manager test from build system tests
Component manager itself has a set of integration tests
that run against different ESP-IDF versions
2021-11-24 13:49:46 +01:00
426c79c7ad Readme for the bluedroid ble50 example with tutorial of walkthrough example. 2021-11-24 14:56:53 +05:30
4ce9678c2b Merge branch 'feature/json_schema_for_idf_size_v4.4' into 'release/v4.4'
tools: add json schema for idf_size (v4.4)

See merge request espressif/esp-idf!15959
2021-11-24 09:00:09 +00:00
c193371028 Merge branch 'bugfix/bootloader_debug_buffers_v4.4' into 'release/v4.4'
bootloader_support: Fix and re-enable bootloader_debug_buffer function (v4.4)

See merge request espressif/esp-idf!16073
2021-11-24 03:38:57 +00:00
18dc2cfcc2 bootloader_support: Fix and re-enable bootloader_debug_buffer function
The body of the bootloader_debug_buffer function was conditioned to
macros that were never defined, resulting in deactivated code.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-23 09:01:24 -03:00
d7995a650e component/bt: fix assert fail when interrupt hlevel disable 2021-11-23 19:50:54 +08:00
8539939c7d Merge branch 'bugfix/nimble_dirty_timer_handle_after_deinit_v4.4' into 'release/v4.4'
[NimBLE]: clear timer handler during de-initialization(backport for v4.4)

See merge request espressif/esp-idf!16028
2021-11-23 07:15:50 +00:00
e073663660 Merge branch 'bugfix/11kv_scan_event_removal_v4.4' into 'release/v4.4'
esp_wifi: Fixes related to 802.11kv (v4.4)

See merge request espressif/esp-idf!16034
2021-11-23 07:15:31 +00:00
09a892a44f Merge branch 'bugfix/sleep_wrong_log_lvl_v4.4' into 'release/v4.4'
Sleep: fix wrong debug level (backport v4.4)

See merge request espressif/esp-idf!16036
2021-11-23 07:15:02 +00:00
958d63a8d2 Merge branch 'bugfix/fix_static_check_error_mr_4.4' into 'release/v4.4'
Fix the high-impact issues from the code analysis report from customer.

See merge request espressif/esp-idf!16044
2021-11-23 07:14:41 +00:00
81e0c7f662 Merge branch 'bugfix/nvs_partition_encrypted_flag_compatibility_v4.4' into 'release/v4.4'
nvs: add config to ignore "encrypted" flag of nvs partitions (v4.4)

See merge request espressif/esp-idf!15920
2021-11-23 05:46:44 +00:00
a24ea59820 Add hci command to set coexistence status 2021-11-23 11:34:34 +08:00
d43f5af6ef Missing break in switch 2021-11-23 11:31:06 +08:00
c48dec0d44 Dereference null return value 2021-11-23 11:31:06 +08:00
74be458e62 already defined in bt_target.h 2021-11-23 11:31:06 +08:00
a946b6042a Dereference after null check 2021-11-23 11:31:06 +08:00
abbc552f5f Dereference before null check 2021-11-23 11:31:06 +08:00
86ea712aa4 Logically dead code 2021-11-23 11:31:06 +08:00
4345e15f23 Fix the high-impact issues from the code analysis report from customer.
For the CID10564,10384,10280,10098,10038,The memory was released in other place.
For the CID10365,it release the memory in the function when sent successfully.
For the CID10268,10011, we need not change the code.
2021-11-22 19:41:50 +08:00
c5efb55d43 freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions
Add TRY_ENTRY_CRITICAL() API to all for timeouts when entering critical sections.
The following port API were added:
- portTRY_ENTER_CRITICAL()
- portTRY_ENTER_CRITICAL_ISR()
- portTRY_ENTER_CRITICAL_SAFE()

Deprecated legacy spinlock API in favor of spinlock.h. The following API were deprecated:
- vPortCPUInitializeMutex()
- vPortCPUAcquireMutex()
- vPortCPUAcquireMutexTimeout()
- vPortCPUReleaseMutex()

Other Changes:
- Added portMUX_INITIALIZE() to replace vPortCPUInitializeMutex()
- The assembly of the critical section functions ends up being about 50 instructions longer,
  thus the spinlock test pass threshold had to be increased to account for the extra runtime.

Closes https://github.com/espressif/esp-idf/issues/5301
2021-11-22 18:42:10 +08:00
2ca86a3eaf Sleep: fix wrong debug level
Fix usage of ESP_LOGD in sleep_modes.c which triggers a panic when
used in debug log level.

* Closes https://github.com/espressif/esp-idf/issues/7942
2021-11-22 16:32:21 +08:00
1780c7d8da esp_wifi: Remove scan done event for supplicant scans
Closes https://github.com/espressif/esp-idf/issues/7423
2021-11-22 13:37:42 +05:30
57dc6de613 wpa_supplicant: Fix compilation error when debug enabled
Closes https://github.com/espressif/esp-idf/issues/7789
2021-11-22 13:37:42 +05:30
e5091bb7af wpa_supplicant: Optimize BTM request scan 2021-11-22 13:37:42 +05:30
4aa2ca369b Merge branch 'ci/add_esp32s3_ssc_build_jobs_v4.4' into 'release/v4.4'
CI: add esp32s3 SSC build jobs

See merge request espressif/esp-idf!15910
2021-11-22 07:43:44 +00:00
81ce15f0e0 Merge branch 'bugfix/fix_esp32s3_usb_otg_v4.4' into 'release/v4.4'
esp_phy: fix esp32s3 phy work with USB-OTG issue(v4.4)

See merge request espressif/esp-idf!15914
2021-11-22 06:17:21 +00:00
7816b597a1 Merge branch 'bugfix/fix_modem_sleep_hw_error_mr_4.4' into 'release/v4.4'
fix modem sleep hw error

See merge request espressif/esp-idf!16017
2021-11-22 03:33:54 +00:00
9d67cd8ac6 [nimble]: clear timer handler during de-initialization 2021-11-22 11:17:23 +08:00
ddc44956bf Merge branch 'bugfix/esp32s3_esp_timer_test_failure_v4.4' into 'release/v4.4'
examples: esp_timer: disable secondary console for S3/C3 that can affect test timing (v4.4)

See merge request espressif/esp-idf!16021
2021-11-19 14:35:01 +00:00
997040222d examples: esp_timer: disable secondary console for S3/C3 that can affect test timing 2021-11-19 14:46:06 +05:30
f952b9f71b Merge branch 'feature/oocd_ver_upgrade_v4.4' into 'release/v4.4'
tools: Updates OpenOCD version to 'v0.10.0-esp32-20211111' (v4.4)

See merge request espressif/esp-idf!15999
2021-11-19 08:56:24 +00:00
9b450e19da It is abnormal when getting the deep sleep state bit. So we need to check
the state again and run the "ble_master_soft_rst()" if neesed.
2021-11-19 15:54:20 +08:00
1c792fe57d Fix the issue of device name len limited 2021-11-19 15:50:18 +08:00
056ec73dd2 Merge branch 'bugfix/protocomm_nimble_allocation_v4.4' into 'release/v4.4'
Fix for potential allocation bug in protocomm_nimble.c (v4.4)

See merge request espressif/esp-idf!15996
2021-11-19 05:26:32 +00:00
b2e1c6eb57 Merge branch 'bugfix/fix_custmoer_issues_v4.4' into 'release/v4.4'
bugfix/fix_3_controller_issues_v4.4

See merge request espressif/esp-idf!15973
2021-11-19 03:34:13 +00:00
b7377f0e53 Merge branch 'bugfix/ci_fix_using_branch_name_v4.4' into 'release/v4.4'
ci: fix using HEAD and SHA since we started using merged result pipelines (v4.4)

See merge request espressif/esp-idf!15721
2021-11-19 03:31:20 +00:00
f16bad24ec Merge branch 'bugfix/wifi_prov_mgr_crash_v4.4' into 'release/v4.4'
NimBLE: Fixed wifi_prov_mgr crash after provisioning (v4.4)

See merge request espressif/esp-idf!15859
2021-11-19 03:00:47 +00:00
bafb157749 Merge branch 'bugfix/remove_mcpwm_deprecations_v4.4' into 'release/v4.4'
mcpwm: revert back to allow user register isr handler (v4.4)

See merge request espressif/esp-idf!15940
2021-11-18 09:58:33 +00:00
43811dc172 esp-eth: emac: Reset Tx DMA channel owner on init
Reset ethernet TX DMA descriptors sets owner to CPU, so re-installing the ethernet driver will now not result in packet loss

Merges https://github.com/espressif/esp-idf/pull/7752
2021-11-18 10:46:07 +01:00
5ba6ac26c4 Merge branch 'bugfix/protocomm_nimble_allocation' into 'master'
NimBLE: Fixed potential allocation bug in protocomm_nimble.c

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

See merge request espressif/esp-idf!15669
2021-11-18 14:17:35 +05:30
44b1f9272c Merge branch 'feature/usb_serial_default_option_v4.4' into 'release/v4.4'
vfs_usb_serial: set secondary selection for making usb port can output under default menu (backport v4.4)

See merge request espressif/esp-idf!15877
2021-11-18 07:16:55 +00:00
37dc255bc4 idf_tools: Adds 'linux-armhf' platform support 2021-11-17 23:27:45 +03:00
b7bee807ed tools: Updates OpenOCD version to 'v0.10.0-esp32-20211111' 2021-11-17 23:27:45 +03:00
45bc50b2d2 NimBLE: Fixed wifi_prov_mgr crash after provisioning
See merge request espressif/esp-idf!15793
2021-11-17 18:37:20 +05:30
fcecbde778 vfs_usb_serial: set secondary selection for making usb port can output under default menu 2021-11-17 19:54:15 +08:00
8517af090d Merge branch 'bugfix/fix_memory_leak_controller_deinit_v4.4' into 'release/v4.4'
Bugfix/fix memory leak controller deinit v4.4

See merge request espressif/esp-idf!15968
2021-11-17 10:22:32 +00:00
66b887a680 fix HCI_Read_Clock error
fix HCI_Create_Connection_Cancel error
fix ASSERT_WARN during epr
2021-11-17 17:59:26 +08:00
e54802113d Merge branch 'bugfix/esp_timer_before_init_v4.4' into 'release/v4.4'
esp_timer: allow querying the timer before esp_timer_init is called(backport v4.4)

See merge request espressif/esp-idf!15876
2021-11-17 09:20:35 +00:00
ee00029c05 gdma: support IRAM interrupt 2021-11-17 12:57:52 +08:00
c3951d5e9d esp_phy: fix esp32s3 phy work with USB-OTG issue 2021-11-17 11:12:40 +08:00
adc83d532c Merge branch 'bugfix/ps_export_prs_v4.4' into 'release/v4.4'
Tools: PowerShell export script improvements from PRs (v4.4)

See merge request espressif/esp-idf!15923
2021-11-16 15:48:37 +00:00
1891761fbb ESP32: Fix memory leak in controller deinit function
Added change to dealloc s_pm_lock in controller deinit as it gets allocated
during init procedure.

Closes https://github.com/espressif/esp-idf/issues/7653
2021-11-16 10:41:32 +05:30
e6ee8b2fcf mcpwm: revert back to allow user register isr handler
Closes https://github.com/espressif/esp-idf/issues/7890
2021-11-16 11:38:48 +08:00
1d4fda8890 docs: replace the module on esp32-devkitc from esp32-wrover to esp32-wroom 2021-11-15 14:48:54 +01:00
35b20cadce Merge branch 'bugfix/efuse_utility_header_v4.4' into 'release/v4.4'
efuse: Add missing esp_rom_sys.h include file (v4.4)

See merge request espressif/esp-idf!15955
2021-11-15 13:19:39 +00:00
1846c29693 Merge branch 'bugfix/efuse_stdbool_v4.4' into 'release/v4.4'
efuse: Add missing stdbool.h include file (v4.4)

See merge request espressif/esp-idf!15935
2021-11-15 12:58:46 +00:00
e9dd044712 tools: add json schema for idf_size 2021-11-15 13:57:24 +01:00
ad233f4896 Merge branch 'bugfix/aes_gcm_unaligned_psram_v4.4' into 'release/v4.4'
aes: fix potential unaligned access in aes-gcm (v4.4)

See merge request espressif/esp-idf!15801
2021-11-15 12:54:50 +00:00
deff19706f spi_flash: No CPU release time for an erase operation when OS is not running
During the early start, the virtual eFuse mode can call erase operations when OS is not yet running.

Possible workaround: CONFIG_SPI_FLASH_YIELD_DURING_ERASE=n

Fixed for the legacy flash driver as well.
2021-11-15 19:38:09 +08:00
99caa4950c esp_timer: init rtc timer and system timer in early init 2021-11-15 19:38:09 +08:00
85bc2d7240 esp_timer: allow querying the timer before esp_timer_init is called 2021-11-15 19:38:09 +08:00
23be52fa89 example: Update on the README file to change from ESP32-S3-Addax-1 to ESP32-S3-DevKitC-1 2021-11-15 12:02:04 +01:00
8d9ab894c3 efuse: Add missing esp_rom_sys.h include file
This prevents the compiler error for the implicit declaration of
function "esp_rom_printf".

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-15 07:52:01 -03:00
ebaffab2fb Merge branch 'bugfix/freertos_round_robin_scheduling_retain_skip_v4.4' into 'release/v4.4'
freertos: Implement best effort round robin scheduling (v4.4)

See merge request espressif/esp-idf!15907
2021-11-15 07:47:43 +00:00
a0f339fead Merge branch 'bugfix/usb_hcd_robustness_v4.4' into 'release/v4.4'
USB Host: Fix how disconnections an EP halts are handled (v4.4)

See merge request espressif/esp-idf!15908
2021-11-15 07:47:37 +00:00
3a7024990e Merge branch 'bugfix/wifi_bt_mac_bb_pd_light_sleep_v4.4' into 'release/v4.4'
backport v4.4: fixes some sleep related issues

See merge request espressif/esp-idf!15932
2021-11-15 07:18:56 +00:00
8d33d54af7 heap: update RTC memory heap caps 2021-11-15 10:56:08 +08:00
3c341364eb efuse: Enable C++ linkage for the include headers on esp_efuse.h
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-12 13:29:58 -03:00
0132d2c868 efuse: Add missing stdbool.h include file
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-12 13:29:58 -03:00
e75762b02f sleep: deep sleep does not need cpu and wifi/bt mac retention 2021-11-12 19:38:32 +08:00
0665e0165b light sleep: replace new kconfig option of mac bb power down & phy reduce tx power 2021-11-12 19:38:09 +08:00
4083c4ae33 Tools: Make clear the used platform in the PowerShell export script 2021-11-12 07:51:53 +01:00
74950663cf Define $IsWindows if not defined.
The `$IsWindows` PowerShell variable was added in PowerShell Core 6 and
PowerShell 7, and is not present in earlier PowerShell versions. Set to
true if undefined. This fixes https://github.com/espressif/esp-idf/issues/7820.

The first version to run on non-Windows platforms was PowerShell Core
6.0[^1] which means that IsWindows is guaranteed to be defined on all
non-Windows systems. So, if undefined this indicates a Windows platform.

[^1]: https://docs.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.2#release-history

Closes https://github.com/espressif/esp-idf/pull/7858

Closes https://github.com/espressif/esp-idf/issues/7820
2021-11-12 07:51:53 +01:00
4975197d1d Initialize $envvars_array to an empty list.
With strict debugging, i.e. `Set-PSDebug -strict`, execution of export.ps1 will
report the following error:

```
The variable '$envars_array' cannot be retrieved because it has not been set.
At C:\path\to\export.ps1:15 char:1
+ $envars_array # will be filled like:
+ ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (envars_array:String) [], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined
```

Closes https://github.com/espressif/esp-idf/pull/7819
2021-11-12 07:51:53 +01:00
e3a771511a aes: fix potential unaligned access in aes-gcm 2021-11-12 12:28:28 +08:00
29aba769f2 spi_flash: minor cleanup, use type/subtype from esp_partition.h 2021-11-12 09:43:51 +05:30
e2fb582cf8 nvs: add config to ignore "encrypted" flag of nvs partitions
This is to allow having pre IDF v4.3 behavior where "encrypted"
flag was not being checked for NVS partitions.

It is recommended to enable this new config only if you have
production devices where NVS partition was being set with "encrypted"
flag by mistake.

Please see commit aca9ec28b3 which
introduced check to not allow NVS partitions with "encrypted" flag set.

More discussion on this at:
https://github.com/espressif/esp-idf/issues/5747#issuecomment-956223024
https://github.com/espressif/esp-idf/issues/7839#issuecomment-961477667

Closes https://github.com/espressif/esp-idf/issues/7839
Closes IDFGH-6162
2021-11-12 09:43:51 +05:30
df0929009a Merge branch 'bugfix/gpio_interrupt_on_app_cpu_v4.4' into 'release/v4.4'
gpio: Fix the bug that esp32 gpio interrupt cannot be triggered on core 1 (backport v4.4)

See merge request espressif/esp-idf!15902
2021-11-11 17:01:36 +00:00
d9ae8068fc CI: add esp32s3 SSC build jobs 2021-11-11 18:03:10 +08:00
9b46f4e086 Merge branch 'feature/update_adc_calibration_doc_on_c3_s3_v4.4' into 'release/v4.4'
doc: add adc calibration programming guide on c3 and s3 (v4.4)

See merge request espressif/esp-idf!15896
2021-11-11 08:57:53 +00:00
dd5d452428 Merge branch 'bugfix/power_down_bluetooth_module_when_deinit_v4.4' into 'release/v4.4'
component/bt: Power down bluetooth module when deinit

See merge request espressif/esp-idf!15717
2021-11-11 08:27:51 +00:00
1af36a5b9d usb: Change API and refactor tests
This commit updates the USB Host Library API in the following wasy:
- usb_host_client_handle_t and usb_device_handle_t made into struct pointers
  to generate compiler warnings about conflicting handle types
- usb_host_client_config_t changed to future proof API for Synchronous Clients
- Added usb_host_lib_unblock()
- Added usb_host_device_addr_list_fill()
- Return of usb_host_device_free_all() updated to indicate whether there
  are still devices yet to be freed.
- Blockg APIs are now marked explicitly
- Fixed a bug in usb_host_transfer_submit_control() when checking the bEndpointAddress
  of a control transfer.

Tests are also refactored to move some common macros into shared headers

Closes https://github.com/espressif/esp-idf/issues/7786
2021-11-11 16:26:56 +08:00
891c979c64 usb: Add USB Host Library sudden disconnect tests 2021-11-11 16:26:35 +08:00
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
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
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
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
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
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
0c0d0f9b35 components/bt: Fix the issue caused by the power off the bt power domain 2021-11-11 11:33:15 +08:00
a2790756b0 fix the wifi scan fail issue caused by the power off the wifi power domain 2021-11-11 11:33:04 +08:00
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
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
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
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
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
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
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
4a8d4b584a docs: add adc calibration docs on c3 and s3 2021-11-10 18:12:54 +08:00
3b0de88cad tools: Fix missed DLLs in GDB for Windows 2021-11-10 17:07:46 +07:00
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
2c24beca04 esp_eth: optimize dm9051 Tx throughput 2021-11-10 17:08:21 +08:00
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
44b9e6e055 Fix crash caused by bluetooth high level interrupt 2021-11-10 16:14:52 +08:00
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
d5218e84e2 spi_flash: make 120m config only visible on s3 sdr mode 2021-11-10 12:04:49 +08:00
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
1ed627d022 gitlab: simplify approvals for backports (v4.4) 2021-11-09 18:39:26 +01:00
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
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
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
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
2f39639c20 secure_boot: Do not allow key revocation in bootloader 2021-11-09 15:19:47 +05:30
7fe2a4815d secure_boot: Added Kconfig option for aggressive key revoke
Applicable to S2, C3, and S3
2021-11-09 15:19:47 +05:30
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
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
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
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
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
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
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
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
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
4d0e72dc5f efuse example: Fix pre-load SB test for S2, C3 (erase revoke bits) 2021-11-08 12:48:12 +08:00
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
cc8214c59d doc: add flash and psram configuration doc in programming guide 2021-11-08 04:32:18 +00:00
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
7a6a61feef component/bt: fix crash when shutdown bt(backport v4.4) 2021-11-08 10:55:12 +08:00
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
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
43b62a5b62 Copyright message fix for 'Increased LAN8720 ETH-PHY reset assertion time' 2021-11-05 11:39:04 +01:00
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
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
f7f9683ef1 i2s: fix ws signal polarity in tdm mode 2021-11-05 11:35:02 +08:00
b298795e37 Merge branch 'bugfix/sig_ble_mesh_errata_e16350_v4.4' into 'release/v4.4'
ble_mesh: stack: Apply the errata E16350 from Bluetooth SIG (v4.4)

See merge request espressif/esp-idf!15815
2021-11-05 03:16:51 +00:00
b1102bb581 Merge branch 'bugfix/ble_mesh_host_init_v4.4' into 'release/v4.4'
ble_mesh: nimble: return error if init host twice (v4.4)

See merge request espressif/esp-idf!15816
2021-11-05 03:14:57 +00:00
fd89e8dae4 Merge branch 'docs/update_mock_doc_v4.4' into 'release/v4.4'
DOCs: Update mocking documentation (backport v4.4)

See merge request espressif/esp-idf!15809
2021-11-05 02:25:00 +00:00
lly
461ffffd77 ble_mesh: nimble: return error if init host twice 2021-11-04 20:31:57 +08:00
lly
c255c6a6f8 ble_mesh: stack: Apply the errata E16350 from Bluetooth SIG 2021-11-04 20:29:38 +08:00
dc20c1fd41 Merge branch 'bugfix/ble_mesh_update_license_v4.4' into 'release/v4.4'
ble_mesh: stack: Update license of esp specific files (v4.4)

See merge request espressif/esp-idf!15765
2021-11-04 12:12:05 +00:00
423b6697ac Merge branch 'bugfix/freertos_prvTaskIsTaskSuspended_v4.4' into 'release/v4.4'
freertos: Fix prvTaskIsTaskSuspended check (v4.4)

See merge request espressif/esp-idf!15612
2021-11-04 10:26:54 +00:00
7c4c5b51de Merge branch 'ci/enable_s3_example_test_v4.4' into 'release/v4.4'
ci: run example test for c3 as well (v4.4)

See merge request espressif/esp-idf!15810
2021-11-04 05:00:42 +00:00
295387167c ci: run example test for c3 as well 2021-11-04 12:12:12 +08:00
40e0d733c2 docs: Update mocking documentation 2021-11-04 11:49:35 +08:00
9fae314f50 Merge branch 'feature/freertos_static_allocation_task_memory_callbacks_v4.4' into 'release/v4.4'
freertos: Add memory hooks for static IDLE and Timer tasks (v4.4)

See merge request espressif/esp-idf!15614
2021-11-03 11:20:10 +00:00
lly
c1df3636b7 ble_mesh: stack: Update license of esp specific files 2021-11-03 14:22:31 +08:00
226f49f37d Merge branch 'bugfix/heartbeat_filter_with_acceptlist_v4.4' into 'release/v4.4'
ble_mesh: stack: Fix heartbeat filter with accept list (v4.4)

See merge request espressif/esp-idf!15675
2021-11-03 06:21:32 +00:00
21b366da73 Merge branch 'feature/add_dhcp_option_v4.4' into 'release/v4.4'
lwip/dhcp: add configure for enable vendor class identify option (backport v4.4)

See merge request espressif/esp-idf!15619
2021-11-02 15:17:19 +00:00
1232094197 change --archive_details output 2021-11-02 14:08:31 +01:00
970132c94b tools: fix bug with idf_size argument archive_details 2021-11-02 14:08:31 +01:00
lly
9e82f7fdcf ble_mesh: stack: Update the license of provisioner_main.c 2021-11-02 20:56:25 +08:00
77eb671168 ble_mesh: stack: Fix heartbeat filter with accept list 2021-11-02 20:54:02 +08:00
9303bc00b2 Merge branch 'bugfix/pppos_report_unknown_line' into 'release/v4.4'
esp_modem: Fix report unknown line (GitHub PR)

See merge request espressif/esp-idf!15621
2021-11-02 12:14:49 +00:00
89873937eb lwip/dhcp: add configure for enable vendor class identify option
Closes https://github.com/espressif/esp-idf/issues/6786
2021-11-02 18:02:22 +08:00
2d3ec44011 Merge branch 'bugfix/ble_conn_latency_max_value_v4.4' into 'release/v4.4'
BLE: Set connection max latency value to 499.

See merge request espressif/esp-idf!15754
2021-11-02 09:11:12 +00:00
14a652376f Examples/PPPoS: Fix handling empty lines with CRLF only
Tokenizing data by '\n' will effectively replace all LF characters by '\0' so checking for phantom lines has to be adjusted:
* minimal empty line is CR only (strlen = 1)
* checking for lines containing CR only
2021-11-02 09:00:34 +01:00
d89112badf component/bt: check the ble ext conn parameter 2021-11-02 15:54:27 +08:00
5ac3b05cbe freertos: Add memory hooks for static IDLE and Timer tasks
This commit adds the following hook functions to obtain memory
for the IDLE and Timer Daemon tasks when configSUPPORT_STATIC_ALLOCATION
is enabled:

- vApplicationGetIdleTaskMemory()
- vApplicationGetTimerTaskMemory()

Currently, both functions simply allocate from the same memory as
regular tasks (i.e., internal memory for both the stack and TCB)

Closes https://github.com/espressif/esp-idf/issues/7511
2021-11-02 14:54:01 +08:00
efad5e56ae freertos: Fix prvTaskIsTaskSuspended check
This commit fixes prvTaskIsTaskSuspended(). Both pending ready lists
should be checked to confirm that is truly suspended.

Closes https://github.com/espressif/esp-idf/issues/7564
2021-11-02 14:51:17 +08:00
6a93575d97 Merge branch 'bugfix/xtensa_clang_version_regex_v4.4' into 'release/v4.4'
fix(tool): export.sh cannot export xtensa-clang if installed (v4.4)

See merge request espressif/esp-idf!15763
2021-11-02 03:38:57 +00:00
dfe91ded9a Merge branch 'bugfix/rm_copyright_check_v4.4' into 'release/v4.4'
CI: Remove the copyright header check from the release branch

See merge request espressif/esp-idf!15758
2021-11-02 03:38:18 +00:00
d269be1861 fix(tool): export.sh cannot export xtensa-clang if installed issue 2021-11-02 09:32:45 +08:00
de136451f1 CI: Remove the copyright header check from the release branch 2021-11-01 12:44:10 +01:00
affe1a0692 BLE: Set connection max latency value to 499. 2021-11-01 16:45:16 +05:30
148e0fce84 Merge branch 'feature/ci_runner_failure_retries_v4.4' into 'release/v4.4'
ci: runner system failure retries (v4.4)

See merge request espressif/esp-idf!15722
2021-11-01 11:11:16 +00:00
86f8d65508 Merge branch 'bugfix/memprot_bad_esp_restart_check_v4.4' into 'release/v4.4'
System/Security: wrong check of the Memprot feature in esp_restart()/panic_restart() (v4.4)

See merge request espressif/esp-idf!15742
2021-11-01 11:07:06 +00:00
ea4f069b45 fix hfp_ag demo audio not sine_v4.4 2021-11-01 12:12:10 +08:00
3f26866533 System/Security: wrong check of the Memprot feature in esp_restart()/panic_restart()
esp_restart()/panic_restart() never resets the Digital system (so far required only by the Memprot feature) as there's a typo in the corresponding #define:
it checks CONFIG_ESP_SYSTEM_CONFIG_MEMPROT_FEATURE instead of CONFIG_ESP_SYSTEM_MEMPROT_FEATURE.
Issue fixed.

IDF-4094
2021-10-29 15:02:17 +02:00
fb3c88510c efuse_table_gen: Fixes wrong joining fields with omitted names
The issue is related to the non-sequential way of description when
such fields going together sequential.

Related to esp32h2 chip for eFuses: MAC_FACTORY and MAC_EXT.
The issue is in wrong indexes of MAC_EXT.
MAC_EXT got indexes like it is joined to MAC_FACTORY.

const esp_efuse_desc_t* ESP_EFUSE_MAC_FACTORY[] = {
    &MAC_FACTORY[0],
    &MAC_FACTORY[1],
    &MAC_FACTORY[2],
    &MAC_FACTORY[3],
    &MAC_FACTORY[4],
    &MAC_FACTORY[5],
    NULL
};

const esp_efuse_desc_t* ESP_EFUSE_MAC_EXT[] = {
    &MAC_EXT[6],
    &MAC_EXT[7],
    NULL
};

This commit fixed it to:

const esp_efuse_desc_t* ESP_EFUSE_MAC_EXT[] = {
    &MAC_EXT[0],
    &MAC_EXT[1],
    NULL
};
2021-10-29 19:17:51 +08:00
281598077a efuse: fix esp32h2 get ext_mac 2021-10-29 19:17:51 +08:00
006ab2d454 ci: Add retries on runner system failures 2021-10-29 13:49:37 +07:00
10741e2254 ci: fix using HEAD and SHA with merged result pipelines 2021-10-29 13:34:53 +07:00
d6e438f3c7 ci: add variable PIPELINE_COMMIT_SHA 2021-10-29 13:34:53 +07:00
1383785aa1 Remove dummy defines of Classic BT 2021-10-29 14:21:26 +08:00
8153b43705 Make ESP32 Bluetooth stack architecture Doc only visible for ESP32 2021-10-29 14:21:18 +08:00
f4aad85f8b Make Classic BT related document links only visible for ESP32 2021-10-29 14:21:12 +08:00
6a7d83af19 Merge branch 'bugfix/fix_http_head_request_v4.4' into 'release/v4.4'
esp_http_client: Fix HEAD request will affect the all next HTTP requests unless we close the HTTP request(backport v4.4)

See merge request espressif/esp-idf!15715
2021-10-29 04:47:22 +00:00
89d290f17a component/bt: Power down bluetooth module when deinit 2021-10-29 10:44:02 +08:00
9705ea5e97 esp_http_client: Fix HEAD request will affect the all next HTTP requests unless we close the HTTP request
Closes https://github.com/espressif/esp-idf/issues/7777
2021-10-29 10:16:12 +08:00
4aaec00c41 Merge branch 'bugfix/define__DOXYGEN___v4.4' into 'release/v4.4'
docs: define __DOXYGEN__ for doxygen builds (v4.4)

See merge request espressif/esp-idf!15679
2021-10-28 06:40:50 +00:00
697f829d60 Merge branch 'bugfix/gdbstub_4_c3_v4.4' into 'release/v4.4'
bugfix/esp-gdbstrub: add missing function for esp32c3/esp32h2. (backport v4.4)

See merge request espressif/esp-idf!15664
2021-10-27 16:49:21 +00:00
7aa3dfc087 Merge branch 'bugfix/fix_phy_usb_issue_v4.4' into 'release/v4.4'
esp_phy: fix esp32c3/s3 phy USB & RSSI issue(v4.4)

See merge request espressif/esp-idf!15646
2021-10-27 14:01:48 +00:00
bd2b1c88ad Merge branch 'bugfix/remove_assert_when_inq_done_4.4' into 'release/v4.4'
component_bt: fix crash after inquiry has finished (v4.4)

See merge request espressif/esp-idf!15673
2021-10-27 11:28:50 +00:00
0c5b5d759a Remove table for all supported chips as useless. 2021-10-27 13:36:58 +03:00
a4821fac21 docs: define __DOXYGEN__ for doxygen builds
Some docs depended on __DOXYGEN__ but this was never defined anywhere.
2021-10-27 17:10:26 +08:00
3187b9b5a4 1. Fix the scan failed issue.
2. Fix connection failed with LG 5.0 phone
3. Remove assert when inquiry done
2021-10-27 14:54:37 +08:00
1703b9d0f3 bugfix/esp-gdbstrub: add missing function for esp32c3/esp32h2. 2021-10-26 20:00:58 +03:00
43a81fb2f9 Merge branch 'bugfix/asio_ssl_build' into 'release/v4.4'
asio: Fix ssl example build removing openssl warning

See merge request espressif/esp-idf!15498
2021-10-26 14:26:12 +00:00
bf4ef23067 Merge branch 'bugfix/pppos_event_deinit_exit_ppp' into 'release/v4.4'
Examples/PPPoS: Minor fixes related to init/deinit cycling

See merge request espressif/esp-idf!15553
2021-10-26 14:25:37 +00:00
044e79ad99 Merge branch 'bugfix/highint_hdl_link_gnumake_v4.4' into 'release/v4.4'
esp_system: fix high level interrupt handler not linked for GNU Make (v4.4)

See merge request espressif/esp-idf!15651
2021-10-26 13:14:25 +00:00
d47d413e25 esp_system: fix high level interrupt handler not linked for GNU Make
In 4972605, high-level interrupt handler hook was renamed from
ld_include_highint_hdl to ld_include_panic_highint_hdl. However the
change wasn't applied in GNU Make based build system. As a result,
the default interrupt handler was linked and features which depended
on the high-level interrupt didn't work.

Closes https://github.com/espressif/esp-idf/issues/7759
Closes https://github.com/espressif/esp-idf/issues/7447
2021-10-26 11:26:45 +02:00
9ceadb4e18 Examples/PPPoS: Fix copyright headers 2021-10-26 10:45:19 +02:00
12f4f8f7f8 Examples/PPPoS: Fixed missed NETIF_PPP_STATUS event unregister
NETIF_PPP_STATUS is registerd while modem gets attached to the related netif.
we don't have any network detach functionality in the modem component, so we
unregister the event during esp_modem_netif_clear_default_handlers().

Related https://esp32.com/viewtopic.php?f=13&t=23632
Related https://github.com/espressif/esp-idf/issues/7469
2021-10-26 10:45:12 +02:00
28d534ad33 Examples/PPPoS: Add mandatory delay after +++ command
Switching back from data (PPP) mode to command mode must be done is the following sequence:
* No characters entered for T1 time (1 second)
* "+++" characters entered with no characters in between (1 second)
* No characters entered for T1 timer (1 second)
(per specification of SIM800 SIM800_Series_AT_Command_Manual_V1.09.pdf)

Related https://github.com/espressif/esp-idf/issues/7608
2021-10-26 10:45:05 +02:00
a0371c1a8f Merge branch 'feature/toolchain_2021r2_v4.4' into 'release/v4.4'
Update toolchains to esp-2021r2 (v4.4)

See merge request espressif/esp-idf!15637
2021-10-26 08:19:22 +00:00
5eb55d2e7a esp_phy: fix esp32c3/s3 phy USB & RSSI issue 2021-10-26 15:48:27 +08:00
076697a56d Update toolchains to esp-2021r2
Updated GDB to 9.2 version for xtensa chips
    Fixed coredump work for xtensa chips
    Fixed backtrace for xtensa chips
    Fixed multilib for riscv32 chips
    Fixed running GDB on some RaspberryPi configuration for riscv32 chip
    Fixed support of fnmatch(), iconv() and some other posix functions in stdlib

    Closes https://github.com/espressif/esp-idf/issues/6124
    Closes https://github.com/espressif/esp-idf/issues/2484
    Closes https://github.com/espressif/esp-idf/issues/3264
    Closes https://github.com/espressif/crosstool-NG/issues/13
    Closes https://github.com/espressif/crosstool-NG/pull/16
2021-10-25 19:55:41 +07:00
4548b6da63 test_apps/panic: remove workaround for incorrect GDB backtrace 2021-10-25 19:55:41 +07:00
91696b9d6d coredump: update test data for toolchain 2021r2 2021-10-25 19:55:41 +07:00
0a8c1259dc asio: Fix ssl example build removing openssl warning
Regression from e68afcb45036901ebc9174b2c8f3804f7921410c causing
non-clean builds for standard asio-ssl example (warning was
suppressed in the CI build only)
2021-10-25 11:59:02 +00:00
ac485b2824 Merge branch 'feature/add_README_for_controller_hci_uart_demo_v4.4' into 'release/v4.4'
feature/add README.md for demo controller_hci_uart_demo_v4.4

See merge request espressif/esp-idf!15571
2021-10-25 07:39:34 +00:00
2720d45e71 Merge branch 'bugfix/newlib_fix_stdatomic_clang_v4.4' into 'release/v4.4'
newlib: fix clang atomics (v4.4)

See merge request espressif/esp-idf!15600
2021-10-22 14:48:56 +00:00
cb6e5b0980 newlib: fix clang atomics
Correction of the SYNC_LOCK_* macros in stdatomic
2021-10-21 17:34:48 +01:00
25ae00cd11 Merge branch 'ci/update_esp_eth_cert_v4.4' into 'release/v4.4'
ci: update cert used for esp_eth test (v4.4)

See merge request espressif/esp-idf!15583
2021-10-21 04:23:34 +00:00
108f85f8b3 ci: update cert used for esp_eth test 2021-10-21 10:05:56 +08:00
99f1687db7 add README.md for demo controller_hci_uart_demo 2021-10-20 09:09:46 +08:00
0a15cc5e5a esp_modem: Fix report unknown line
In esp_dte_handle_line(), it tokenize the data to call handlers separately
for each *line*. So it needs to post the tokenized data when report unknown
line instead of the first token (which could be a '\r' in my test).

Fixes: 336de29413 ("Examples/pppos_client: Fix manual parsing to accept unexpected lines")
Signed-off-by: Axel Lin <axel.lin@gmail.com>
2021-10-18 10:14:31 +08:00
2089 changed files with 89091 additions and 49274 deletions

View File

@ -19,14 +19,6 @@ trim_trailing_whitespace = false
indent_style = tab
indent_size = 2
[*/freertos/**]
indent_style = tab
indent_size = 4
[{*/freertos/**.S,**/FreeRTOSConfig.h}]
indent_style = space
indent_size = 4
[*.pem]
insert_final_newline = false

View File

@ -152,6 +152,7 @@ exclude =
components/openthread/openthread,
components/tinyusb,
components/unity/unity,
components/spiffs/spiffs,
examples/build_system/cmake/import_lib/main/lib/tinyxml2,
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib,
# autogenerated scripts

75
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,75 @@
name: docker
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
on:
push:
branches:
- 'master'
- 'release/*'
tags:
- 'v*.*'
env:
# Platforms to build the image for
BUILD_PLATFORMS: linux/amd64,linux/arm64
DOCKERHUB_REPO: ${{ github.repository_owner }}/idf
jobs:
docker:
# Disable the job in forks
if: ${{ github.repository_owner == 'espressif' }}
runs-on: ubuntu-latest
steps:
# Depending on the branch/tag, set CLONE_BRANCH_OR_TAG variable (used in the Dockerfile
# as a build arg) and TAG_NAME (used when tagging the image).
#
# The following 3 steps cover the alternatives (tag, release branch, master branch):
- name: Set variables (tags)
if: ${{ github.ref_type == 'tag' }}
run: |
echo "CLONE_BRANCH_OR_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
echo "TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Set variables (release branches)
if: ${{ github.ref_type == 'branch' && startsWith(github.ref_name, 'release/') }}
run: |
echo "CLONE_BRANCH_OR_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
echo "TAG_NAME=release-${GITHUB_REF_NAME##release/}" >> $GITHUB_ENV
- name: Set variables (main branch)
if: ${{ github.ref_type == 'branch' && github.ref_name == 'master' }}
run: |
echo "CLONE_BRANCH_OR_TAG=master" >> $GITHUB_ENV
echo "TAG_NAME=latest" >> $GITHUB_ENV
# Display the variables set above, just in case.
- name: Check variables
run: |
echo "CLONE_BRANCH_OR_TAG: $CLONE_BRANCH_OR_TAG"
echo "CHECKOUT_REF: $CHECKOUT_REF"
echo "TAG_NAME: $TAG_NAME"
# The following steps are the standard boilerplate from
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU for multiarch builds
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
context: tools/docker
push: true
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.TAG_NAME }}
platforms: ${{ env.BUILD_PLATFORMS }}
build-args: |
IDF_CLONE_URL=${{ github.server_url }}/${{ github.repository }}.git
IDF_CLONE_BRANCH_OR_TAG=${{ env.CLONE_BRANCH_OR_TAG }}

View File

@ -14,6 +14,14 @@ workflow:
# Disable those non-protected push triggered pipelines
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
when: never
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
- if: $CI_OPEN_MERGE_REQUESTS != null
variables:
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
- if: $CI_OPEN_MERGE_REQUESTS == null
variables:
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
- when: always
variables:
@ -48,7 +56,7 @@ variables:
# Docker images
BOT_DOCKER_IMAGE_TAG: ":latest"
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v4.4-1-v4"
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v4.4-1-v6"
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env:v4.4-1"
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test:v4.4-1-1"
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis:v4.4-1-2"
@ -59,8 +67,6 @@ variables:
# target test repo parameters
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
CI_AUTO_TEST_SCRIPT_REPO_URL: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/auto_test_script.git"
CI_AUTO_TEST_SCRIPT_REPO_BRANCH: "ci/v3.1"
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
@ -80,6 +86,7 @@ variables:
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- source tools/ci/setup_python.sh
- add_gitlab_ssh_keys
- source tools/ci/configure_ci_environment.sh
@ -91,6 +98,7 @@ before_script:
before_script:
- echo "Not setting up GitLab key, not fetching submodules"
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- source tools/ci/setup_python.sh
- source tools/ci/configure_ci_environment.sh
@ -98,11 +106,15 @@ before_script:
before_script:
- echo "Only load utils.sh"
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
.before_script_macos:
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
# Clean up idf-env.json which might not be compatible with one produced by newer ESP-IDF versions
- rm -f ${IDF_TOOLS_PATH}/idf-env.json
- $IDF_PATH/tools/idf_tools.py install-python-env
# On macOS, these tools need to be installed
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
@ -115,6 +127,12 @@ before_script:
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
- fetch_submodules
default:
retry:
max: 2
# In case of a runner failure we could hop to another one, or a network error could go away.
when: runner_system_failure
include:
- '.gitlab/ci/rules.yml'
- '.gitlab/ci/docs.yml'

View File

@ -2,210 +2,5 @@
#
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
#
# If more than one rule matches a given file, the latest rule is used.
# The file should be generally kept sorted, except when it is necessary
# to use a different order due to the fact above. In that case, use
# '# sort-order-reset' comment line to reset the sort order.
#
# Recipes for a few common cases:
#
# 1. Specific directory with all its contents:
#
# /components/app_trace/
#
# Note the trailing slash!
#
# 2. File with certain extension in any subdirectory of a certain directory:
#
# /examples/**/*.py
#
# This includes an *.py files in /examples/ directory as well.
#
# 3. Contents of a directory with a certain name, anywhere in the tree:
#
# test_*_host/
#
# Will match everything under components/efuse/test_efuse_host/,
# components/heap/test_multi_heap_host/, components/lwip/test_afl_host/, etc.
#
# 4. Same as above, except limited to a specific place in the tree:
#
# /components/esp32*/
#
# Matches everything under /components/esp32, /components/esp32s2, etc.
# Doesn't match /tools/some-test/components/esp32s5.
#
# 5. Specific file:
#
# /tools/tools.json
#
# 6. File with a certain name anywhere in the tree
#
# .gitignore
#
* @esp-idf-codeowners/other
/.* @esp-idf-codeowners/tools
/.gitlab-ci.yml @esp-idf-codeowners/ci
/.gitlab/ci/ @esp-idf-codeowners/ci
/.pre-commit-config.yaml @esp-idf-codeowners/ci
/.readthedocs.yml @esp-idf-codeowners/docs
/CMakeLists.txt @esp-idf-codeowners/build-config
/Kconfig @esp-idf-codeowners/build-config
/add_path.sh @esp-idf-codeowners/tools
/export.* @esp-idf-codeowners/tools
/install.* @esp-idf-codeowners/tools
/sdkconfig.rename @esp-idf-codeowners/build-config
/sonar-project.properties @esp-idf-codeowners/ci
# sort-order-reset
/components/app_trace/ @esp-idf-codeowners/tools
/components/app_update/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/asio/ @esp-idf-codeowners/network
/components/bootloader*/ @esp-idf-codeowners/system @esp-idf-codeowners/security
/components/bt/ @esp-idf-codeowners/bluetooth
/components/cbor/ @esp-idf-codeowners/app-utilities
/components/cmock/ @esp-idf-codeowners/system
/components/coap/ @esp-idf-codeowners/app-utilities
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/cxx/ @esp-idf-codeowners/system
/components/driver/ @esp-idf-codeowners/peripherals
/components/efuse/ @esp-idf-codeowners/system
/components/esp32*/ @esp-idf-codeowners/system
/components/esp_adc_cal/ @esp-idf-codeowners/peripherals
/components/esp_common/ @esp-idf-codeowners/system
/components/esp_eth/ @esp-idf-codeowners/network
/components/esp_event/ @esp-idf-codeowners/system
/components/esp_gdbstub/ @esp-idf-codeowners/tools
/components/esp_hid/ @esp-idf-codeowners/bluetooth
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
/components/esp_hw_support/ @esp-idf-codeowners/system
/components/esp_ipc/ @esp-idf-codeowners/system
/components/esp_lcd/ @esp-idf-codeowners/peripherals
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
/components/esp_netif/ @esp-idf-codeowners/network
/components/esp_phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/components/esp_pm/ @esp-idf-codeowners/power-management @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_ringbuf/ @esp-idf-codeowners/system
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_serial_slave_link/ @esp-idf-codeowners/peripherals
/components/esp_system/ @esp-idf-codeowners/system
/components/esp_timer/ @esp-idf-codeowners/system
/components/esp-tls/ @esp-idf-codeowners/app-utilities
/components/esp_websocket_client/ @esp-idf-codeowners/network
/components/esp_wifi/ @esp-idf-codeowners/wifi
/components/espcoredump/ @esp-idf-codeowners/tools
/components/esptool_py/ @esp-idf-codeowners/tools
/components/expat/ @esp-idf-codeowners/app-utilities
/components/fatfs/ @esp-idf-codeowners/storage
/components/freemodbus/ @esp-idf-codeowners/peripherals
/components/freertos/ @esp-idf-codeowners/system
/components/hal/ @esp-idf-codeowners/peripherals
/components/heap/ @esp-idf-codeowners/system
/components/idf_test/ @esp-idf-codeowners/ci
/components/ieee802154/ @esp-idf-codeowners/ieee802154
/components/jsmn/ @esp-idf-codeowners/app-utilities
/components/json/ @esp-idf-codeowners/app-utilities
/components/libsodium/ @esp-idf-codeowners/security
/components/log/ @esp-idf-codeowners/system
/components/lwip/ @esp-idf-codeowners/lwip
/components/mbedtls/ @esp-idf-codeowners/app-utilities @esp-idf-codeowners/security
/components/mdns/ @esp-idf-codeowners/network
/components/mqtt/ @esp-idf-codeowners/network
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
/components/nghttp/ @esp-idf-codeowners/app-utilities
/components/nvs_flash/ @esp-idf-codeowners/storage
/components/openssl/ @esp-idf-codeowners/network
/components/openthread/ @esp-idf-codeowners/ieee802154
/components/partition_table/ @esp-idf-codeowners/system
/components/perfmon/ @esp-idf-codeowners/tools
/components/protobuf-c/ @esp-idf-codeowners/app-utilities
/components/protocomm/ @esp-idf-codeowners/app-utilities
/components/pthread/ @esp-idf-codeowners/system
/components/sdmmc/ @esp-idf-codeowners/storage
/components/soc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/spi_flash/ @esp-idf-codeowners/peripherals
/components/spiffs/ @esp-idf-codeowners/storage
/components/tcp_transport/ @esp-idf-codeowners/network
/components/tcpip_adapter/ @esp-idf-codeowners/network
/components/tinyusb/ @esp-idf-codeowners/peripherals/usb
/components/touch_element/ @esp-idf-codeowners/peripherals
/components/ulp/ @esp-idf-codeowners/system
/components/unity/ @esp-idf-codeowners/ci
/components/usb/ @esp-idf-codeowners/peripherals/usb
/components/vfs/ @esp-idf-codeowners/storage
/components/wear_levelling/ @esp-idf-codeowners/storage
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities
/components/wpa_supplicant/ @esp-idf-codeowners/wifi
/components/xtensa/ @esp-idf-codeowners/system
/docs/ @esp-idf-codeowners/docs
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
/docs/**/api-reference/network/ @esp-idf-codeowners/network
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
/docs/**/api-reference/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/docs/**/api-reference/provisioning/ @esp-idf-codeowners/app-utilities
/docs/**/api-reference/storage/ @esp-idf-codeowners/storage
/docs/**/api-reference/system/ @esp-idf-codeowners/system
/docs/**/security/ @esp-idf-codeowners/security
/examples/bluetooth/ @esp-idf-codeowners/bluetooth
/examples/build_system/ @esp-idf-codeowners/build-config
/examples/common_components/ @esp-idf-codeowners/system
/examples/cxx/ @esp-idf-codeowners/system
/examples/ethernet/ @esp-idf-codeowners/network
/examples/get-started/ @esp-idf-codeowners/system
/examples/mesh/ @esp-idf-codeowners/wifi
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
/examples/openthread/ @esp-idf-codeowners/ieee802154
/examples/peripherals/ @esp-idf-codeowners/peripherals
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/examples/provisioning/ @esp-idf-codeowners/app-utilities
/examples/security/ @esp-idf-codeowners/security
/examples/storage/ @esp-idf-codeowners/storage
/examples/system/ @esp-idf-codeowners/system
/examples/wifi/ @esp-idf-codeowners/wifi
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/make/ @esp-idf-codeowners/build-config
/tools/ @esp-idf-codeowners/tools
/tools/*_apps.py @esp-idf-codeowners/ci
/tools/ble/ @esp-idf-codeowners/app-utilities
/tools/catch/ @esp-idf-codeowners/ci
/tools/ci/ @esp-idf-codeowners/ci
/tools/cmake/ @esp-idf-codeowners/build-config
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
/tools/find_build_apps/ @esp-idf-codeowners/ci
/tools/idf_size_yaml/ @esp-idf-codeowners/peripherals
/tools/kconfig*/ @esp-idf-codeowners/build-config
/tools/ldgen/ @esp-idf-codeowners/build-config
/tools/mass_mfg/ @esp-idf-codeowners/app-utilities
/tools/mocks/ @esp-idf-codeowners/system
## Note: owners here should be the same as the owners for the same example subdir, above
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/tools/test_apps/security/ @esp-idf-codeowners/security
/tools/test_apps/system/ @esp-idf-codeowners/system
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
requirements.txt @esp-idf-codeowners/tools
# sort-order-reset
# ignore lists
/tools/ci/check_copyright_ignore.txt @esp-idf-codeowners/tools
/tools/ci/check_copyright_permanent_ignore.txt @esp-idf-codeowners/all-maintainers
/tools/ci/check_examples_cmake_make-cmake_ignore.txt @esp-idf-codeowners/tools
/tools/ci/check_examples_cmake_make-make_ignore.txt @esp-idf-codeowners/tools
/tools/ci/mypy_ignore_list.txt @esp-idf-codeowners/tools
* @esp-idf-codeowners/all-maintainers

View File

@ -1,54 +1,137 @@
assign_test:
extends: .rules:test:any_test
tags:
- assign_test
.assign_test_template:
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
stage: assign_test
# gitlab ci do not support match job with RegEx or wildcard now in dependencies.
# we have a lot build example jobs. now we don't use dependencies, just download all artifacts of build stage.
dependencies: # Here is not a hard dependency relationship, could be skipped. so we do not use "needs" here.
- build_ssc_esp32
- build_esp_idf_tests_cmake_esp32
- build_esp_idf_tests_cmake_esp32s2
- build_esp_idf_tests_cmake_esp32s3
- build_esp_idf_tests_cmake_esp32c3
tags:
- assign_test
variables:
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
EXAMPLE_TEST_DIR: "${CI_PROJECT_DIR}/examples"
CUSTOM_TEST_DIR: "${CI_PROJECT_DIR}/tools/test_apps"
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
SUBMODULES_TO_FETCH: components/esptool_py/esptool
artifacts:
paths:
- ${TEST_DIR}/test_configs
- ${BUILD_DIR}/artifact_index.json
when: always
expire_in: 1 week
script:
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py $TEST_TYPE $TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_DIR/test_configs
assign_example_test:
extends:
- .assign_test_template
- .rules:build:example_test
needs:
- job: build_examples_cmake_esp32
artifacts: false
optional: true
- job: build_examples_cmake_esp32s2
artifacts: false
optional: true
- job: build_examples_cmake_esp32c3
artifacts: false
optional: true
- job: build_examples_cmake_esp32s3
artifacts: false
optional: true
variables:
TEST_TYPE: example_test
TEST_DIR: ${CI_PROJECT_DIR}/examples
BUILD_DIR: ${CI_PROJECT_DIR}/build_examples
assign_custom_test:
extends:
- .assign_test_template
- .rules:build:custom_test
needs:
- job: build_test_apps_esp32
artifacts: false
optional: true
- job: build_test_apps_esp32s2
artifacts: false
optional: true
- job: build_test_apps_esp32c3
artifacts: false
optional: true
- job: build_test_apps_esp32s3
artifacts: false
optional: true
variables:
TEST_TYPE: custom_test
TEST_DIR: ${CI_PROJECT_DIR}/tools/test_apps
BUILD_DIR: ${CI_PROJECT_DIR}/build_test_apps
assign_component_ut:
extends:
- .assign_test_template
- .rules:build:component_ut
needs:
- job: build_component_ut_esp32
artifacts: false
optional: true
- job: build_component_ut_esp32s2
artifacts: false
optional: true
- job: build_component_ut_esp32c3
artifacts: false
optional: true
- job: build_component_ut_esp32s3
artifacts: false
optional: true
variables:
TEST_TYPE: component_ut
TEST_DIR: ${CI_PROJECT_DIR}/component_ut
BUILD_DIR: ${CI_PROJECT_DIR}/build_component_ut
script:
# COMPONENT_UT_DIRS is set by `set_component_ut_vars` in `utils.sh`
COMPONENT_UT_OUTPUT_DIR: "${CI_PROJECT_DIR}/component_ut"
INTEGRATION_CONFIG_OUTPUT_PATH: "${CI_PROJECT_DIR}/components/idf_test/integration_test/CIConfigs"
- set_component_ut_vars
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py $TEST_TYPE $COMPONENT_UT_DIRS -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_DIR/test_configs
assign_unit_test:
extends:
- .assign_test_template
- .rules:build:unit_test
needs:
- job: build_esp_idf_tests_cmake_esp32
optional: true
- job: build_esp_idf_tests_cmake_esp32s2
optional: true
- job: build_esp_idf_tests_cmake_esp32c3
optional: true
- job: build_esp_idf_tests_cmake_esp32s3
optional: true
variables:
TEST_TYPE: unit_test
TEST_DIR: ${CI_PROJECT_DIR}/components/idf_test/unit_test
BUILD_DIR: ${CI_PROJECT_DIR}/tools/unit-test-app/builds
script:
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py $TEST_TYPE $TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_DIR/test_configs
assign_integration_test:
extends:
- .assign_test_template
- .rules:test:integration_test
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
needs:
- build_ssc_esp32
- build_ssc_esp32c3
artifacts:
paths:
- $TEST_DIR/test_configs
variables:
TEST_DIR: ${CI_PROJECT_DIR}/tools/ci/integration_test
BUILD_DIR: ${CI_PROJECT_DIR}/SSC/ssc_bin
INTEGRATION_TEST_CASE_PATH: "${CI_PROJECT_DIR}/auto_test_script/TestCaseFiles"
ASSIGN_TEST_CASE_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIAssignTestCases.py"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
# auto_test_script only supports python 3.7.x
PYTHON_VER: 3.7.7
artifacts:
paths:
- components/idf_test/*/CIConfigs
- $EXAMPLE_TEST_DIR/test_configs
- $CUSTOM_TEST_DIR/test_configs
- $COMPONENT_UT_OUTPUT_DIR/test_configs
- build_examples/artifact_index.json
- build_test_apps/artifact_index.json
- build_component_ut/artifact_index.json
- tools/unit-test-app/builds/artifact_index.json
expire_in: 1 week
GIT_LFS_SKIP_SMUDGE: 1
script:
- set_component_ut_vars
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py example_test $EXAMPLE_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_DIR/test_configs
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py custom_test $CUSTOM_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $CUSTOM_TEST_DIR/test_configs
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py component_ut $COMPONENT_UT_DIRS -c $CI_TARGET_TEST_CONFIG_FILE -o $COMPONENT_UT_OUTPUT_DIR/test_configs
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py unit_test $UNIT_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $UNIT_TEST_DIR/CIConfigs
- add_gitlab_ssh_keys
# clone test script to assign tests
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# assign integration test cases
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b $IDF_PATH/SSC/ssc_bin -o $INTEGRATION_CONFIG_OUTPUT_PATH
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b ${BUILD_DIR} -o $TEST_DIR/test_configs
update_test_cases:
extends: .rules:ref:master-schedule
@ -70,10 +153,10 @@ update_test_cases:
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
PYTHON_VER: 3.7.7
script:
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
- export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
- retry_failed git clone $TEST_MANAGEMENT_REPO
- python $CHECKOUT_REF_SCRIPT test-management test-management
- cd test-management

View File

@ -5,6 +5,11 @@
- build
variables:
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/size_info.txt"
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
IDF_CCACHE_ENABLE: "1"
after_script:
# Show ccache statistics if enabled globally
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true
dependencies: []
.build_template_app_template:
@ -34,10 +39,6 @@
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
# Only do the default cmake build for each target, remaining part are done in the build_template_app job
- tools/ci/build_template_app.sh ${BUILD_COMMAND_ARGS}
# Check if there are any stray printf/ets_printf references in WiFi libs
- cd components/esp_wifi/lib
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w printf | wc -l) -eq 0; done;
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w ets_printf | wc -l) -eq 0; done;
# build-related-pre-check-jobs ------------------------------------------------
# Build at least one project for each target at earliest stage to reduce build cost for obvious failing commits
@ -82,6 +83,12 @@ build_ssc_esp32c3:
variables:
TARGET_NAME: "ESP32C3"
build_ssc_esp32s3:
extends: .build_ssc_template
parallel: 3
variables:
TARGET_NAME: "ESP32S3"
.build_esp_idf_tests_cmake_template:
extends: .build_template
dependencies: # set dependencies to null to avoid missing artifacts issue
@ -361,8 +368,9 @@ build_docker:
script:
- export LOCAL_CI_REPOSITORY_URL=$CI_REPOSITORY_URL
- if [ -n "$LOCAL_GITLAB_HTTPS_HOST" ]; then export LOCAL_CI_REPOSITORY_URL="https://gitlab-ci-token:${CI_JOB_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"; fi
- if [ -n "$LOCAL_GIT_MIRROR" ]; then export LOCAL_CI_REPOSITORY_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"; fi
- echo "Using repository at $LOCAL_CI_REPOSITORY_URL"
- export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${LOCAL_CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
- export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${LOCAL_CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$PIPELINE_COMMIT_SHA}"
# Build
- docker build --tag ${DOCKER_TMP_IMAGE_NAME} ${DOCKER_BUILD_ARGS} tools/docker/
# We can't mount $PWD/examples/get-started/blink into the container, see https://gitlab.com/gitlab-org/gitlab-ce/issues/41227.
@ -370,31 +378,6 @@ build_docker:
# Therefore, build a copy of the example located inside the container.
- docker run --rm --workdir /opt/esp/idf/examples/get-started/blink ${DOCKER_TMP_IMAGE_NAME} idf.py build
.test-on-windows:
extends:
- .before_script_minimal
- .rules:build:windows
stage: host_test
needs: []
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
tags:
- build
script:
- cd $TEST_DIR
- mkdir build
- cd build
- cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-i686-w64-mingw32.cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake --build .
build_idf_exe:
extends: .test-on-windows
artifacts:
paths:
- tools/windows/idf_exe/build/idf-exe-v*.zip
expire_in: 4 days
variables:
TEST_DIR: tools/windows/idf_exe
# This job builds template app with permutations of targets and optimization levels
build_template_app:
extends:

View File

@ -61,6 +61,9 @@
patterns:
- build_components
- build_system
included_in:
- "build:{0}"
- build:target_test
build:integration_test:
labels:
@ -68,19 +71,8 @@ build:integration_test:
patterns:
- build_components
- build_system
# -------------
# Special Cases
# -------------
"build:example_test-esp32c3": # esp32c3 test is only run by label, but build jobs should always be triggered
labels:
- build
- example_test
patterns:
- build_components
- build_system
- build-example_test
- example_test
included_in:
- build:target_test
####################
# Target Test Jobs #
@ -92,14 +84,14 @@ build:integration_test:
labels: # For each rule, use labels <test_type> and <test_type>-<target>
- "{0}"
- "{0}_{1}"
- target_test
patterns: # For each rule, use patterns <test_type> and build-<test_type>
- "{0}"
- "build-{0}"
included_in: # Parent rules
- "build:{0}"
- "build:{0}-{1}"
- build:target_test
- test:target_test
- test:any_test
# -------------
# Special Cases
@ -112,42 +104,30 @@ build:integration_test:
- "component_ut_{0}"
- unit_test
- "unit_test_{0}"
- target_test
patterns:
- component_ut
- "build-component_ut-{0}"
included_in:
- build:component_ut
- "build:component_ut-{0}"
- build:target_test
- test:target_test
- test:any_test
"test:example_test-esp32c3": # For esp32c3 we trigger only with label
"labels:example_test-esp32c3":
labels:
- example_test_esp32c3
included_in:
- build:example_test-esp32c3
- build:target_test
"test:integration_test":
labels:
- "integration_test"
- integration_test
- target_test
patterns:
- "integration_test"
- integration_test
included_in:
- "build:integration_test"
- build:integration_test
- build:target_test
- test:target_test
- test:any_test
"test:host_test":
labels:
- host_test
patterns:
- host_test
included_in:
- test:any_test
"test:submodule":
labels:
@ -162,17 +142,17 @@ build:integration_test:
labels:
- iperf_stress_test
included_in:
- build:example_test
- build:example_test-esp32
- build:target_test
- test:any_test
"labels:weekend_test": # custom test
labels:
- weekend_test
included_in:
- build:custom_test
- build:custom_test-esp32
- build:target_test
- test:any_test
"labels:nvs_coverage": # host_test
labels:

View File

@ -21,7 +21,7 @@ deploy_test_result:
extends:
- .deploy_job_template
- .before_script_minimal
- .rules:ref:master-schedule-always
- .rules:ref:master-always
image: $CI_DOCKER_REGISTRY/bot-env
tags:
- deploy_test
@ -39,8 +39,8 @@ deploy_test_result:
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
script:
- add_gitlab_ssh_keys
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
- export REV_COUNT=$(git rev-list --count HEAD)
- export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
- export REV_COUNT=$(git rev-list --count ${PIPELINE_COMMIT_SHA} --)
- export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
# artifacts of job update_test_cases creates test-management folder
# we need to remove it so we can clone test-management folder again

View File

@ -58,13 +58,14 @@ check_docs_lang_sync:
.build_docs_template:
image: $ESP_IDF_DOC_ENV_IMAGE
variables:
PYTHON_VER: 3.6.13
PYTHON_VER: 3.7.10
tags:
- build_docs
dependencies: []
script:
- cd docs
- pip install -r requirements.txt
- cd docs
- pip install -U -r requirements.txt
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
parallel:
matrix:
@ -74,13 +75,14 @@ check_docs_lang_sync:
check_docs_gh_links:
image: $ESP_IDF_DOC_ENV_IMAGE
variables:
PYTHON_VER: 3.6.13
PYTHON_VER: 3.7.10
extends:
- .pre_check_job_template
- .doc-rules:build:docs
script:
- cd docs
- pip install -r requirements.txt
- cd docs
- pip install -U -r requirements.txt
- build-docs gh-linkcheck
# stage: build_doc
@ -150,20 +152,19 @@ build_docs_pdf:
extends:
- .before_script_no_sync_submodule
image: $ESP_IDF_DOC_ENV_IMAGE
variables:
PYTHON_VER: 3.6.13
stage: test_deploy
tags:
- deploy
- shiny
variables:
PYTHON_VER: 3.7.10
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
PYTHONUNBUFFERED: 1
dependencies: []
script:
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always)
- pip install -r docs/requirements.txt
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
- pip install -U -r docs/requirements.txt
- deploy-docs
# stage: test_deploy
@ -224,7 +225,7 @@ check_doc_links:
expire_in: 1 week
allow_failure: true
script:
- cd docs
- pip install -r requirements.txt
# At the moment this check will always fail due to multiple known limitations, ignore result
- build-docs -t $DOCTGT -l $DOCLANG linkcheck || { echo "THERE ARE ISSUES DUE TO KNOWN LIMITATIONS, PLEASE FIX THEM. Nowadays we're ignored them to pass pipeline."; true; }
- cd docs
- pip install -U -r requirements.txt
- build-docs -t $DOCTGT -l $DOCLANG linkcheck

View File

@ -245,7 +245,7 @@ test_espcoredump:
expire_in: 1 week
variables:
IDF_COREDUMP_ELF_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/idf-coredump-elf.git"
IDF_COREDUMP_ELF_TAG: idf-20210910-00
IDF_COREDUMP_ELF_TAG: idf-20210915
# install CMake version specified in tools.json
SETUP_TOOLS_LIST: "all"
script:

View File

@ -15,6 +15,7 @@
image: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
check_pre_commit_master_release:
@ -22,7 +23,7 @@ check_pre_commit_master_release:
- .check_pre_commit_template
- .rules:protected
script:
- git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | xargs pre-commit run --files
- git diff-tree --no-commit-id --name-only -r $PIPELINE_COMMIT_SHA | xargs pre-commit run --files
check_pre_commit_MR:
extends:
@ -83,15 +84,20 @@ test_check_kconfigs:
script:
- python ${IDF_PATH}/tools/ci/test_check_kconfigs.py
check_wifi_lib_md5:
check_blobs:
extends: .pre_check_base_template
tags:
- build
variables:
SUBMODULES_TO_FETCH: "components/esp_wifi/lib"
SUBMODULES_TO_FETCH: "components/esp_wifi/lib;components/esp_phy/lib"
script:
# Check if Wi-Fi library header files match between IDF and the version used when compiling the libraries
- IDF_TARGET=esp32 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32s2 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32s3 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c3 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
# Check if Wi-Fi, PHY, BT blobs contain references to specific symbols
- bash $IDF_PATH/tools/ci/check_blobs.sh
check_fuzzer_compilation:
extends: .pre_check_base_template
@ -157,10 +163,14 @@ scan_tests:
TEST_APPS_OUTPUT_DIR: ${CI_PROJECT_DIR}/tools/test_apps/test_configs
COMPONENT_UT_OUTPUT_DIR: ${CI_PROJECT_DIR}/component_ut/test_configs
CI_SCAN_TESTS_PY: ${CI_PROJECT_DIR}/tools/ci/python_packages/ttfw_idf/CIScanTests.py
EXTRA_TEST_DIRS: >-
examples/bluetooth/esp_ble_mesh/ble_mesh_console
examples/bluetooth/hci/controller_hci_uart_esp32
examples/wifi/iperf
script:
- set_component_ut_vars
- run_cmd python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b make --exclude examples/build_system/idf_as_lib -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR
- run_cmd python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b cmake --exclude examples/build_system/idf_as_lib -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR
- run_cmd python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b cmake --exclude examples/build_system/idf_as_lib -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR --extra_test_dirs $EXTRA_TEST_DIRS
- run_cmd python $CI_SCAN_TESTS_PY test_apps $TEST_APPS_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_APPS_OUTPUT_DIR
- run_cmd python $CI_SCAN_TESTS_PY component_ut $COMPONENT_UT_DIRS --exclude $COMPONENT_UT_EXCLUDES -c $CI_TARGET_TEST_CONFIG_FILE -o $COMPONENT_UT_OUTPUT_DIR
@ -190,6 +200,6 @@ check_commit_msg:
extends: .pre_check_job_template
script:
- git status
- git log -n10 --oneline
- git log -n10 --oneline ${PIPELINE_COMMIT_SHA}
# commit start with "WIP: " need to be squashed before merge
- 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
- 'git log --pretty=%s origin/master..${PIPELINE_COMMIT_SHA} -- | grep -i "^WIP:" && exit 1 || exit 0'

View File

@ -89,6 +89,7 @@
.patterns-integration_test: &patterns-integration_test
- "tools/ci/python_packages/tiny_test_fw/**/*"
- "tools/ci/integration_test/**/*"
.patterns-host_test: &patterns-host_test
- ".gitlab/ci/host-test.yml"
@ -221,12 +222,10 @@
- <<: *if-ref-master
- <<: *if-schedule
.rules:ref:master-schedule-always:
.rules:ref:master-always:
rules:
- <<: *if-ref-master
when: always
- <<: *if-schedule
when: always
.rules:patterns:clang_tidy:
rules:
@ -336,6 +335,9 @@
.if-label-submodule: &if-label-submodule
if: '$BOT_LABEL_SUBMODULE || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*submodule(?:,[^,\n\r]+)*$/i'
.if-label-target_test: &if-label-target_test
if: '$BOT_LABEL_TARGET_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
.if-label-unit_test: &if-label-unit_test
if: '$BOT_LABEL_UNIT_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test(?:,[^,\n\r]+)*$/i'
@ -366,12 +368,35 @@
- <<: *if-dev-push
changes: *patterns-build_system
.rules:build:component_ut:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:build:component_ut-esp32:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-dev-push
@ -387,6 +412,7 @@
- <<: *if-label-build
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c3
- <<: *if-dev-push
@ -402,6 +428,7 @@
- <<: *if-label-build
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-dev-push
@ -417,6 +444,7 @@
- <<: *if-label-build
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
@ -426,12 +454,31 @@
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:build:custom_test:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:build:custom_test-esp32:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-target_test
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build_components
@ -446,6 +493,7 @@
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -459,6 +507,7 @@
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -472,6 +521,7 @@
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -487,6 +537,26 @@
- <<: *if-dev-push
changes: *patterns-docker
.rules:build:example_test:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-example_test
.rules:build:example_test-esp32:
rules:
- <<: *if-protected
@ -494,6 +564,7 @@
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -509,6 +580,7 @@
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32c3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -524,6 +596,7 @@
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -539,6 +612,7 @@
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -553,6 +627,7 @@
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-integration_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -590,6 +665,7 @@
- <<: *if-label-example_test_esp32s3
- <<: *if-label-integration_test
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
@ -613,10 +689,28 @@
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:build:unit_test:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:build:unit_test-esp32:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-dev-push
@ -630,6 +724,7 @@
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c3
- <<: *if-dev-push
@ -643,6 +738,7 @@
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-dev-push
@ -656,6 +752,7 @@
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
@ -675,12 +772,6 @@
- <<: *if-dev-push
changes: *patterns-windows
.rules:labels:example_test-esp32c3:
rules:
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test_esp32c3
.rules:labels:fuzzer_test-weekend_test:
rules:
- <<: *if-label-fuzzer_test
@ -698,49 +789,6 @@
rules:
- <<: *if-label-weekend_test
.rules:test:any_test:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-host_test
- <<: *if-label-integration_test
- <<: *if-label-iperf_stress_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-custom_test
- <<: *if-dev-push
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-host_test
- <<: *if-dev-push
changes: *patterns-integration_test
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:component_ut-esp32:
rules:
- <<: *if-protected
@ -748,6 +796,7 @@
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-dev-push
@ -760,6 +809,7 @@
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c3
- <<: *if-dev-push
@ -772,6 +822,7 @@
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-dev-push
@ -784,6 +835,7 @@
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
@ -796,6 +848,7 @@
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-custom_test
@ -806,6 +859,7 @@
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-custom_test
@ -816,6 +870,7 @@
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-custom_test
@ -826,6 +881,7 @@
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-custom_test
@ -836,6 +892,20 @@
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32c3:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32c3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -848,6 +918,7 @@
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -860,6 +931,7 @@
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -880,6 +952,7 @@
- <<: *if-label-build-only
when: never
- <<: *if-label-integration_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-integration_test
@ -892,49 +965,12 @@
- <<: *if-dev-push
changes: *patterns-submodule
.rules:test:target_test:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-integration_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-custom_test
- <<: *if-dev-push
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-integration_test
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-dev-push
@ -945,6 +981,7 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c3
- <<: *if-dev-push
@ -955,6 +992,7 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-dev-push
@ -965,6 +1003,7 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push

View File

@ -65,6 +65,7 @@ check_pylint:
name: $SONARQUBE_SCANNER_IMAGE
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
- fetch_submodules
# Exclude the submodules, all paths ends with /**
@ -123,7 +124,7 @@ code_quality_report:
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
-Dsonar.cxx.clangtidy.reportPath=$REPORT_PATTERN
-Dsonar.exclusions=$EXCLUSIONS
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
-Dsonar.gitlab.commit_sha=$PIPELINE_COMMIT_SHA
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
-Dsonar.host.url=$SONAR_HOST_URL
-Dsonar.login=$SONAR_LOGIN

View File

@ -7,13 +7,13 @@
.target_test_job_template:
stage: target_test
needs:
- assign_test
artifacts:
when: always
paths:
- "**/*.log"
- $LOG_PATH
exclude:
- .git/**/*
expire_in: 1 week
reports:
junit: $LOG_PATH/*/XUNIT_RESULT.xml
@ -38,6 +38,8 @@
.example_test_template:
extends: .target_test_job_template
needs:
- assign_example_test
variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/examples/test_configs"
@ -55,7 +57,7 @@ test_weekend_mqtt:
- .rules:labels:weekend_test
tags:
- ESP32
- Example_WIFI
- Example_EthKitV1
script:
- export MQTT_PUBLISH_TEST=1
- export TEST_PATH=$CI_PROJECT_DIR/tools/test_apps/protocols/mqtt/publish_connect_test
@ -75,7 +77,7 @@ test_weekend_mqtt:
.example_test_esp32c3_template:
extends:
- .example_test_template
- .rules:labels:example_test-esp32c3
- .rules:test:example_test-esp32c3
.example_test_esp32s3_template:
extends:
@ -115,10 +117,9 @@ example_test_001D:
example_test_OTA:
extends: .example_test_esp32_template
parallel: 2
tags:
- ESP32
- Example_WIFI_OTA
- EXAMPLE_ETH_OTA
example_test_protocols:
extends: .example_test_esp32_template
@ -127,6 +128,13 @@ example_test_protocols:
- ESP32
- Example_WIFI_Protocols
# This job is only triggered by env var `NIGHTLY_RUN`, please do NOT remove
example_test_esp32_WIFI_OTA:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_WIFI_OTA
example_test_002:
extends: .example_test_esp32_template
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
@ -295,6 +303,8 @@ example_test_ESP32C3_SDSPI:
.test_app_template:
extends: .target_test_job_template
needs:
- assign_custom_test
variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/test_apps"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/test_apps/test_configs"
@ -333,6 +343,12 @@ test_app_test_002:
- ESP32
- Example_WIFI
test_app_test_eth:
extends: .test_app_esp32_template
tags:
- ESP32
- Example_EthKitV1
test_app_test_003:
extends: .test_app_esp32_template
tags:
@ -381,6 +397,8 @@ test_app_test_flash_psram_f8r8:
.component_ut_template:
extends: .target_test_job_template
needs: # the assign already needs all the build jobs
- assign_component_ut
variables:
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/component_ut/test_configs"
script:
@ -443,9 +461,11 @@ component_ut_test_esp32c3:
.unit_test_template:
extends: .target_test_job_template
needs: # the assign already needs all the build jobs
- assign_unit_test
variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/components/idf_test/unit_test/CIConfigs"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/components/idf_test/unit_test/test_configs"
.unit_test_esp32_template:
extends:
@ -513,7 +533,7 @@ UT_006:
UT_007:
extends: .unit_test_esp32_template
parallel: 4
parallel: 7
tags:
- ESP32_IDF
- UT_T1_1
@ -664,7 +684,7 @@ UT_046:
UT_047:
extends: .unit_test_esp32s2_template
parallel: 5
parallel: 7
tags:
- ESP32S2_IDF
- UT_T1_1
@ -683,7 +703,7 @@ UT_S2_SDSPI:
UT_C3:
extends: .unit_test_esp32c3_template
parallel: 33
parallel: 35
tags:
- ESP32C3_IDF
- UT_T1_1
@ -727,7 +747,7 @@ UT_C3_SDSPI:
UT_S3:
extends: .unit_test_esp32s3_template
parallel: 31
parallel: 32
tags:
- ESP32S3_IDF
- UT_T1_1
@ -761,36 +781,46 @@ component_ut_test_lan8720:
extends:
- .target_test_job_template
- .rules:test:integration_test
needs:
- assign_test
- build_ssc_esp32
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
needs: # the assign already needs all the build jobs
- assign_integration_test
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
LOG_PATH: "${CI_PROJECT_DIR}/TEST_LOGS"
TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/auto_test_script/TestCaseFiles"
MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/components/idf_test/integration_test/CIConfigs"
KNOWN_ISSUE_FILE: "${CI_PROJECT_DIR}/components/idf_test/integration_test/KnownIssues"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/ci/integration_test/test_configs"
KNOWN_ISSUE_FILE: "${CI_PROJECT_DIR}/tools/ci/integration_test/KnownIssues"
CI_RUNNER_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIRunner.py"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
# auto_test_script only supports python 3.7.x
PYTHON_VER: 3.7.7
PREPARE_TEST_BIN_SCRIPT: "${CI_PROJECT_DIR}/tools/ci/integration_test/prepare_test_bins.py"
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${CI_PROJECT_DIR}/tools/ci/python_packages:${PYTHONPATH}"
INITIAL_CONDITION_RETRY_COUNT: "1"
GIT_LFS_SKIP_SMUDGE: 1
script:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
- add_gitlab_ssh_keys
# clone local test env configs
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# Merge known issues
- cat ${KNOWN_ISSUE_FILE} >> ${TEST_CASE_FILE_PATH}/KnownIssues
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
.integration_test_esp32c3_template:
extends:
- .integration_test_template
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C3_IDF"
nvs_compatible_test:
extends: .integration_test_template
artifacts:
@ -806,23 +836,24 @@ nvs_compatible_test:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
- add_gitlab_ssh_keys
# clone local test env configs
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
# prepare nvs bins
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# prepare nvs bins
- ./tools/prepare_nvs_bin.sh
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
IT_001:
extends: .integration_test_template
parallel: 3
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_4
@ -835,34 +866,26 @@ IT_002:
IT_003:
extends: .integration_test_template
parallel: 14
parallel: 9
tags:
- ESP32_IDF
- SSC_T2_5
IT_004:
extends: .integration_test_template
tags:
- ESP32_IDF
- SSC_T1_APC
IT_005:
extends: .integration_test_template
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_5
IT_006:
extends: .integration_test_template
parallel: 12
parallel: 5
tags:
- ESP32_IDF
- SSC_T1_6
IT_007:
extends: .integration_test_template
parallel: 3
tags:
- ESP32_IDF
- SSC_T1_7
@ -873,12 +896,6 @@ IT_008:
- ESP32_IDF
- SSC_T1_8
IT_009:
extends: .integration_test_template
tags:
- ESP32_IDF
- SSC_T1_3
IT_011:
extends: .integration_test_template
tags:
@ -931,7 +948,6 @@ IT_018:
IT_019:
extends: .integration_test_template
parallel: 2
tags:
- ESP32_IDF
- SSC_T2_2
@ -942,8 +958,15 @@ IT_020:
- ESP32_IDF
- SSC_T2_3
IT_021:
IT_022:
extends: .integration_test_template
tags:
- ESP32_IDF
- SSC_T2_4
- SSC_T3_2
IT_C3_001:
extends: .integration_test_esp32c3_template
parallel: 6
tags:
- ESP32C3_IDF
- SSC_T2_5

View File

@ -12,12 +12,16 @@ repos:
# 2 - any file matching *test*/*expected* (for host tests, if possible use this naming pattern always)
# 3 - any directory named 'testdata'
# 4 - IDF monitor test data
# 5 - protobuf auto-generated files
exclude: &whitespace_excludes |
(?x)^(
.+\.(md|rst|map|bin)|
.+test.*\/.*expected.*|
.+\/testdata\/.+|
.+test_idf_monitor\/tests\/.+
.+test_idf_monitor\/tests\/.+|
.*_pb2.py|
.*.pb-c.h|
.*.pb-c.c
)$
- id: end-of-file-fixer
exclude: *whitespace_excludes
@ -35,6 +39,11 @@ repos:
hooks:
- id: isort
name: isort (python)
exclude: >
(?x)^(
.*_pb2.py
)$
- repo: local
hooks:
- id: check-executables
@ -95,19 +104,12 @@ repos:
additional_dependencies:
- 'mypy==0.800'
- 'mypy-extensions==0.4.3'
exclude: >
(?x)^(
.*_pb2.py
)$
language: python
types: [python]
- id: check-copyright
name: Check copyright notices
entry: tools/ci/check_copyright.py --verbose --replace
additional_dependencies:
- 'comment_parser == 1.2.3'
- 'thefuzz == 0.19.0'
- 'thefuzz[speedup] == 0.19.0; sys_platform != "win32"'
# don't depend on python-Levenshtein on Windows, as it requires Microsoft C++ Build Tools to install
language: python
files: \.(py|c|h|cpp|hpp|ld)$
require_serial: true
- id: check-tools-files-patterns
name: Check tools dir files patterns
entry: tools/ci/check_tools_files_patterns.py
@ -120,4 +122,4 @@ repos:
rev: v4.0.1
hooks:
- id: file-contents-sorter
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt|check_copyright_permanent_ignore\.txt)'
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt)'

View File

@ -7,11 +7,8 @@ if(CMAKE_CURRENT_LIST_DIR STREQUAL CMAKE_SOURCE_DIR)
"again.")
endif()
unset(compile_options)
unset(c_compile_options)
unset(cxx_compile_options)
unset(compile_definitions)
unset(link_options)
# Variables compile_options, c_compile_options, cxx_compile_options, compile_definitions, link_options shall
# not be unset as they may already contain flags, set by toolchain-TARGET.cmake files.
# Add the following build specifications here, since these seem to be dependent
# on config values on the root Kconfig.
@ -119,6 +116,9 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
# Multiple cases of attributes unknown to clang, for example
# __attribute__((optimize("-O3")))
list(APPEND compile_options "-Wno-unknown-attributes")
# Disable Clang warnings for atomic operations with access size
# more then 4 bytes
list(APPEND compile_options "-Wno-atomic-alignment")
# Clang also produces many -Wunused-function warnings which GCC doesn't.
# However these aren't treated as errors.
endif()
@ -181,6 +181,7 @@ endif()
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "${c_compile_options}" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "${cxx_compile_options}" APPEND)
idf_build_set_property(ASM_COMPILE_OPTIONS "${asm_compile_options}" APPEND)
idf_build_set_property(COMPILE_DEFINITIONS "${compile_definitions}" APPEND)
idf_build_set_property(LINK_OPTIONS "${link_options}" APPEND)

View File

@ -18,11 +18,13 @@ menu "Application Level Tracing"
config APPTRACE_DEST_TRAX
bool
depends on IDF_TARGET_ARCH_XTENSA && !ESP32_TRAX && !ESP32S2_TRAX
depends on IDF_TARGET_ARCH_XTENSA && !ESP32_TRAX && !ESP32S2_TRAX && !ESP32S3_TRAX
select ESP32_MEMMAP_TRACEMEM
select ESP32S2_MEMMAP_TRACEMEM
select ESP32S3_MEMMAP_TRACEMEM
select ESP32_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S2_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S3_MEMMAP_TRACEMEM_TWOBANKS
default n
help
Enables/disable TRAX tracing HW.

View File

@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <sys/param.h>
#include <string.h>
#include "sdkconfig.h"
@ -93,7 +99,8 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
if (proto->hw->host_data_pending() && hdr->block_sz > 0) {
// TODO: add support for multiple blocks from host, currently there is no need for that
uint8_t *p = proto->blocks[new_block_num].start + proto->blocks[new_block_num].sz;
ESP_APPTRACE_LOGD("Recvd %d bytes from host [%x %x %x %x %x %x %x %x .. %x %x %x %x %x %x %x %x]", hdr->block_sz,
ESP_APPTRACE_LOGD("Recvd %d bytes from host (@ 0x%x) [%x %x %x %x %x %x %x %x .. %x %x %x %x %x %x %x %x]",
hdr->block_sz, proto->blocks[new_block_num].start,
*(proto->blocks[new_block_num].start+0), *(proto->blocks[new_block_num].start+1),
*(proto->blocks[new_block_num].start+2), *(proto->blocks[new_block_num].start+3),
*(proto->blocks[new_block_num].start+4), *(proto->blocks[new_block_num].start+5),

View File

@ -60,22 +60,16 @@ esp_err_t esp_apptrace_lock_take(esp_apptrace_lock_t *lock, esp_apptrace_tmo_t *
int res;
while (1) {
//Todo: Replace the current locking mechanism and int_state with portTRY_ENTER_CRITICAL() instead.
// do not overwrite lock->int_state before we actually acquired the mux
unsigned int_state = portENTER_CRITICAL_NESTED();
// FIXME: if mux is busy it is not good idea to loop during the whole tmo with disabled IRQs.
// So we check mux state using zero tmo, restore IRQs and let others tasks/IRQs to run on this CPU
// while we are doing our own tmo check.
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
bool success = vPortCPUAcquireMutexTimeout(&lock->mux, 0, __FUNCTION__, __LINE__);
#else
unsigned int_state = portSET_INTERRUPT_MASK_FROM_ISR();
bool success = vPortCPUAcquireMutexTimeout(&lock->mux, 0);
#endif
if (success) {
lock->int_state = int_state;
return ESP_OK;
}
portEXIT_CRITICAL_NESTED(int_state);
// we can be preempted from this place till the next call (above) to portENTER_CRITICAL_NESTED()
portCLEAR_INTERRUPT_MASK_FROM_ISR(int_state);
// we can be preempted from this place till the next call (above) to portSET_INTERRUPT_MASK_FROM_ISR()
res = esp_apptrace_tmo_check(tmo);
if (res != ESP_OK) {
break;
@ -90,12 +84,8 @@ esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock)
unsigned int_state = lock->int_state;
// after call to the following func we can not be sure that lock->int_state
// is not overwritten by other CPU who has acquired the mux just after we released it. See esp_apptrace_lock_take().
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
vPortCPUReleaseMutex(&lock->mux, __FUNCTION__, __LINE__);
#else
vPortCPUReleaseMutex(&lock->mux);
#endif
portEXIT_CRITICAL_NESTED(int_state);
portCLEAR_INTERRUPT_MASK_FROM_ISR(int_state);
return ESP_OK;
}

View File

@ -52,18 +52,11 @@ void gcov_dump_task(void *pvParameter)
}
ESP_EARLY_LOGV(TAG, "Config apptrace down buf");
esp_apptrace_down_buffer_config(down_buf, ESP_GCOV_DOWN_BUF_SIZE);
/* we are directing the std outputs to the fake ones in order to reduce stack usage */
FILE *old_stderr = stderr;
FILE *old_stdout = stdout;
stderr = (FILE *) &__sf_fake_stderr;
stdout = (FILE *) &__sf_fake_stdout;
ESP_EARLY_LOGV(TAG, "Dump data...");
__gcov_dump();
// reset dump status to allow incremental data accumulation
__gcov_reset();
free(down_buf);
stderr = old_stderr;
stdout = old_stdout;
ESP_EARLY_LOGV(TAG, "Finish file transfer session");
dump_result = esp_apptrace_fstop(ESP_APPTRACE_DEST_TRAX);
if (dump_result != ESP_OK) {

View File

@ -68,7 +68,7 @@ typedef struct {
*/
static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock)
{
vPortCPUInitializeMutex(&lock->mux);
portMUX_INITIALIZE(&lock->mux);
lock->int_state = 0;
}

View File

@ -3,6 +3,10 @@ archive: libapp_trace.a
entries:
app_trace (noflash)
app_trace_util (noflash)
if APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE:
app_trace_membufs_proto (noflash)
if APPTRACE_DEST_JTAG = y:
port (noflash)
if APPTRACE_SV_ENABLE = y:
SEGGER_SYSVIEW (noflash)
SEGGER_RTT_esp (noflash)

View File

@ -1,6 +1,13 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_log.h"
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
#include "riscv/semihosting.h"
/** RISCV HW transport data */
typedef struct {
@ -20,8 +27,6 @@ typedef struct {
esp_apptrace_mem_block_t * mem_blocks;
} esp_apptrace_riscv_ctrl_block_t;
#define RISCV_APPTRACE_SYSNR 0x64
#define ESP_APPTRACE_RISCV_BLOCK_LEN_MSK 0x7FFFUL
#define ESP_APPTRACE_RISCV_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
#define ESP_APPTRACE_RISCV_BLOCK_LEN_GET(_v_) ((_v_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
@ -94,25 +99,10 @@ esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) int esp_apptrace_advertise_ctrl_block(void *ctrl_block_addr)
{
register int sys_nr = RISCV_APPTRACE_SYSNR;
register int host_ret = 0;
if (!esp_cpu_in_ocd_debug_mode()) {
return 0;
}
__asm__ volatile ( \
".option push\n" \
".option norvc\n" \
"mv a0, %[sys_nr]\n" \
"mv a1, %[arg1]\n" \
"slli zero,zero,0x1f\n" \
"ebreak\n" \
"srai zero,zero,0x7\n" \
"mv %[host_ret], a0\n" \
".option pop\n" \
:[host_ret]"=r"(host_ret)
:[sys_nr]"r"(sys_nr),[arg1]"r"(ctrl_block_addr):"a0","a1");
return host_ret;
return (int) semihosting_call_noerrno(ESP_SEMIHOSTING_SYS_APPTRACE_INIT, (long*)ctrl_block_addr);
}
/* Returns up buffers config.

View File

@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
//
// How It Works
// ************
@ -143,9 +149,9 @@
#include "sdkconfig.h"
#include "soc/soc.h"
#include "soc/dport_access.h"
#if CONFIG_IDF_TARGET_ESP32
#include "soc/dport_reg.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "soc/tracemem_config.h"
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#include "soc/sensitive_reg.h"
#endif
#include "eri.h"
@ -154,18 +160,6 @@
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
// TODO: move these (and same definitions in trax.c to dport_reg.h)
#if CONFIG_IDF_TARGET_ESP32
#define TRACEMEM_MUX_PROBLK0_APPBLK1 0
#define TRACEMEM_MUX_BLK0_ONLY 1
#define TRACEMEM_MUX_BLK1_ONLY 2
#define TRACEMEM_MUX_PROBLK1_APPBLK0 3
#elif CONFIG_IDF_TARGET_ESP32S2
#define TRACEMEM_MUX_BLK0_NUM 19
#define TRACEMEM_MUX_BLK1_NUM 20
#define TRACEMEM_BLK_NUM2ADDR(_n_) (0x3FFB8000UL + 0x4000UL*((_n_)-4))
#endif
// TRAX is disabled, so we use its registers for our own purposes
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
@ -182,18 +176,6 @@
#define ESP_APPTRACE_TRAX_INITED(_hw_) ((_hw_)->inited & (1 << cpu_hal_get_core_id()))
#if CONFIG_IDF_TARGET_ESP32
static uint8_t * const s_trax_blocks[] = {
(uint8_t *) 0x3FFFC000,
(uint8_t *) 0x3FFF8000
};
#elif CONFIG_IDF_TARGET_ESP32S2
static uint8_t * const s_trax_blocks[] = {
(uint8_t *)TRACEMEM_BLK_NUM2ADDR(TRACEMEM_MUX_BLK0_NUM),
(uint8_t *)TRACEMEM_BLK_NUM2ADDR(TRACEMEM_MUX_BLK1_NUM)
};
#endif
#define ESP_APPTRACE_TRAX_BLOCK_SIZE (0x4000UL)
/** TRAX HW transport data */
@ -223,6 +205,12 @@ static bool esp_apptrace_trax_host_data_pending(void);
const static char *TAG = "esp_apptrace";
static uint8_t * const s_trax_blocks[] = {
(uint8_t *)TRACEMEM_BLK0_ADDR,
(uint8_t *)TRACEMEM_BLK1_ADDR
};
esp_apptrace_hw_t *esp_apptrace_uart_hw_get(int num, void **data)
{
return NULL;
@ -300,6 +288,14 @@ static inline void esp_apptrace_trax_select_memory_block(int block_num)
DPORT_WRITE_PERI_REG(DPORT_TRACEMEM_MUX_MODE_REG, block_num ? TRACEMEM_MUX_BLK0_ONLY : TRACEMEM_MUX_BLK1_ONLY);
#elif CONFIG_IDF_TARGET_ESP32S2
WRITE_PERI_REG(DPORT_PMS_OCCUPY_3_REG, block_num ? BIT(TRACEMEM_MUX_BLK0_NUM-4) : BIT(TRACEMEM_MUX_BLK1_NUM-4));
#elif CONFIG_IDF_TARGET_ESP32S3
// select memory block to be exposed to the TRAX module (accessed by host)
uint32_t block_bits = block_num ? TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
block_bits |= block_num ? TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
ESP_EARLY_LOGV(TAG, "Select block %d @ %p (bits 0x%x)", block_num, s_trax_blocks[block_num], block_bits);
DPORT_WRITE_PERI_REG(SENSITIVE_INTERNAL_SRAM_USAGE_2_REG, block_bits);
#endif
}

View File

@ -73,6 +73,8 @@ Revision: $Rev: 3734 $
#include "esp32/clk.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/clk.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/clk.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/clk.h"
#endif
@ -142,6 +144,8 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
#define SYSVIEW_TIMESTAMP_FREQ (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000)
#elif CONFIG_IDF_TARGET_ESP32S2
#define SYSVIEW_TIMESTAMP_FREQ (CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000)
#elif CONFIG_IDF_TARGET_ESP32S3
#define SYSVIEW_TIMESTAMP_FREQ (CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000)
#endif
#endif // TS_USE_CCOUNT

View File

@ -76,9 +76,6 @@ Notes:
*
**********************************************************************
*/
#ifndef portSTACK_GROWTH
#define portSTACK_GROWTH ( -1 )
#endif
#define SYSVIEW_FREERTOS_MAX_NOF_TASKS CONFIG_APPTRACE_SV_MAX_TASKS

View File

@ -327,9 +327,9 @@ typedef enum {
/**
* @brief Revokes the old signature digest. To be called in the application after the rollback logic.
*
* Relevant for Secure boot v2 on ESP32-S2 where upto 3 key digests can be stored (Key #N-1, Key #N, Key #N+1).
* When key #N-1 used to sign an app is invalidated, an OTA update is to be sent with an app signed with key #N-1 & Key #N.
* After successfully booting the OTA app should call this function to revoke Key #N-1.
* Relevant for Secure boot v2 on ESP32-S2, ESP32-S3, ESP32-C3 where upto 3 key digests can be stored (Key \#N-1, Key \#N, Key \#N+1).
* When key \#N-1 used to sign an app is invalidated, an OTA update is to be sent with an app signed with key \#N-1 & Key \#N.
* After successfully booting the OTA app should call this function to revoke Key \#N-1.
*
* @param index - The index of the signature block to be revoked
*

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -824,3 +824,25 @@ static void test_flow6(void)
// 2 Stage: run factory -> check it -> copy factory to OTA0 -> reboot --//--
// 3 Stage: run OTA0 -> check it -> erase OTA_DATA for next tests -> PASS
TEST_CASE_MULTIPLE_STAGES("Switching between factory, OTA0 using esp_ota_write_with_offset", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow6, test_flow6);
TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_INVALID when image is ivalid", "[partitions]")
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
const esp_partition_t *other_app = get_next_update_partition();
copy_current_app_to_next_part(cur_app, other_app);
erase_ota_data();
uint8_t sha_256_cur_app[32];
uint8_t sha_256_other_app[32];
TEST_ESP_OK(bootloader_common_get_sha256_of_partition(cur_app->address, cur_app->size, cur_app->type, sha_256_cur_app));
TEST_ESP_OK(bootloader_common_get_sha256_of_partition(other_app->address, other_app->size, other_app->type, sha_256_other_app));
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha_256_cur_app, sha_256_other_app, sizeof(sha_256_cur_app), "must be the same");
uint32_t data = 0;
bootloader_flash_write(other_app->address + 0x50, &data, sizeof(data), false);
TEST_ESP_ERR(ESP_ERR_IMAGE_INVALID, bootloader_common_get_sha256_of_partition(other_app->address, other_app->size, other_app->type, sha_256_other_app));
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha_256_cur_app, sha_256_other_app, sizeof(sha_256_cur_app), "must be the same");
}

View File

@ -193,6 +193,14 @@ menu "Bootloader config"
The GPIO must be held low continuously for this period of time after reset
before a factory reset or test partition boot (as applicable) is performed.
config BOOTLOADER_REGION_PROTECTION_ENABLE
bool "Enable protection for unmapped memory regions"
default y
help
Protects the unmapped memory regions of the entire address space from unintended accesses.
This will ensure that an exception will be triggered whenever the CPU performs a memory
operation on unmapped regions of the address space.
config BOOTLOADER_WDT_ENABLE
bool "Use RTC watchdog in start code"
default y
@ -501,7 +509,7 @@ menu "Security features"
config SECURE_BOOT
bool "Enable hardware Secure Boot in bootloader (READ DOCS FIRST)"
default n
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || ESP32C3_REV_MIN_3 || IDF_TARGET_ESP32S3
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || ESP32C3_REV_MIN >= 3 || IDF_TARGET_ESP32S3
select ESPTOOLPY_NO_STUB if !IDF_TARGET_ESP32 && !IDF_TARGET_ESP32S2
help
Build a bootloader which enables Secure Boot on first boot.
@ -614,6 +622,22 @@ menu "Security features"
Refer to the Secure Boot section of the ESP-IDF Programmer's Guide for this version before enabling.
config SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
bool "Enable Aggressive key revoke strategy"
depends on SECURE_BOOT && (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3)
default N
help
If this option is set, ROM bootloader will revoke the public key digest burned in efuse block
if it fails to verify the signature of software bootloader with it.
Revocation of keys does not happen when enabling secure boot. Once secure boot is enabled,
key revocation checks will be done on subsequent boot-up, while verifying the software bootloader
This feature provides a strong resistance against physical attacks on the device.
NOTE: Once a digest slot is revoked, it can never be used again to verify an image
This can lead to permanent bricking of the device, in case all keys are revoked
because of signature verification failure.
choice SECURE_BOOTLOADER_KEY_ENCODING
bool "Hardware Key Encoding"
depends on SECURE_BOOTLOADER_REFLASHABLE

View File

@ -111,8 +111,6 @@ SECTIONS
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
@ -125,6 +123,7 @@ SECTIONS
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
@ -183,4 +182,23 @@ SECTIONS
_etext = .;
} > iram_seg
/** This section will be used by the debugger and disassembler to get more information
* about raw data present in the code.
* Indeed, it may be required to add some padding at some points in the code
* in order to align a branch/jump destination on a particular bound.
* Padding these instructions will generate null bytes that shall be
* interpreted as data, and not code by the debugger or disassembler.
* This section will only be present in the ELF file, not in the final binary
* For more details, check GCC-212
*/
.xt.prop 0 :
{
KEEP (*(.xt.prop .gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit .gnu.linkonce.p.*))
}
}

View File

@ -1,14 +1,40 @@
/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
* We put 2nd bootloader in the high address space (before ROM stack/data/bss).
* See memory usage for ROM bootloader at the end of this file.
*
* ESP32-C3 ROM static data usage is as follows:
* - 0x3fccae00 - 0x3fcdc710: Shared buffers, used in UART/USB/SPI download mode only
* - 0x3fcdc710 - 0x3fcde710: PRO CPU stack, can be reclaimed as heap after RTOS startup
* - 0x3fcde710 - 0x3fce0000: ROM .bss and .data (not easily reclaimable)
*
* The 2nd stage bootloader can take space up to the end of ROM shared
* buffers area (0x3fcdc710).
*/
/* The offset between Dbus and Ibus. Used to convert between 0x403xxxxx and 0x3fcxxxxx addresses. */
iram_dram_offset = 0x700000;
/* We consider 0x3fcdc710 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
*/
/* These lengths can be adjusted, if necessary: */
bootloader_usable_dram_end = 0x3fcdc710;
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
bootloader_dram_seg_len = 0x5000;
bootloader_iram_loader_seg_len = 0x7000;
bootloader_iram_seg_len = 0x2000;
/* Start of the lower region is determined by region size and the end of the higher region */
bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead;
bootloader_dram_seg_start = bootloader_dram_seg_end - bootloader_dram_seg_len;
bootloader_iram_loader_seg_start = bootloader_dram_seg_start - bootloader_iram_loader_seg_len + iram_dram_offset;
bootloader_iram_seg_start = bootloader_iram_loader_seg_start - bootloader_iram_seg_len;
MEMORY
{
iram_seg (RWX) : org = 0x403CE000, len = 0x2000
iram_loader_seg (RWX) : org = 0x403D0000, len = 0x6000
dram_seg (RW) : org = 0x3FCD6000, len = 0x4000
iram_seg (RWX) : org = bootloader_iram_seg_start, len = bootloader_iram_seg_len
iram_loader_seg (RWX) : org = bootloader_iram_loader_seg_start, len = bootloader_iram_loader_seg_len
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* Default entry point: */
@ -99,8 +125,6 @@ SECTIONS
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
@ -113,6 +137,7 @@ SECTIONS
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.* .srodata .srodata.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
@ -177,17 +202,34 @@ SECTIONS
/**
* Appendix: Memory Usage of ROM bootloader
*
* +--------+--------------+------+ 0x3FCC_AE00
* | ^ |
* | | |
* | | data/bss |
* | | |
* | v |
* +------------------------------+ 0x3FCD_C710
* | ^ |
* | | |
* | | stack |
* | | |
* | v |
* +------------------------------+ 0x3FCD_E710
* 0x3fccae00 ------------------> _dram0_0_start
* | |
* | |
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
* | |
* | |
* 0x3fcdc710 ------------------> __stack_sentry
* | |
* | | 2. Startup pro cpu stack (freed when IDF app is running)
* | |
* 0x3fcde710 ------------------> __stack (pro cpu)
* | |
* | |
* | | 3. Shared memory only used in startup code or nonos/early boot*
* | | (can be freed when IDF runs)
* | |
* | |
* 0x3fcdf060 ------------------> _dram0_rtos_reserved_start
* | |
* | |
* | | 4. Shared memory used in startup code and when IDF runs
* | |
* | |
* 0x3fcdf664 ------------------> _dram0_rtos_reserved_end
* | |
* 0x3fcdf830 ------------------> _data_start_interface
* | |
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
* | |
* 0x3fce0000 ------------------> _data_end_interface
*/

View File

@ -1,14 +1,40 @@
/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
* We put 2nd bootloader in the high address space (before ROM stack/data/bss).
* See memory usage for ROM bootloader at the end of this file.
*
* ESP32-H2 ROM static data usage is as follows:
* - 0x3fccb900 - 0x3fcdd210: Shared buffers, used in UART/USB/SPI download mode only
* - 0x3fcdd210 - 0x3fcdf210: PRO CPU stack, can be reclaimed as heap after RTOS startup
* - 0x3fcdf210 - 0x3fce0000: ROM .bss and .data (not easily reclaimable)
*
* The 2nd stage bootloader can take space up to the end of ROM shared
* buffers area (0x3fce9704). For alignment purpose we shall use value (0x3fce9700).
*/
/* The offset between Dbus and Ibus. Used to convert between 0x403xxxxx and 0x3fcxxxxx addresses. */
iram_dram_offset = 0x700000;
/* We consider 0x3fce9700 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
*/
/* These lengths can be adjusted, if necessary: */
bootloader_usable_dram_end = 0x3fcdd120;
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
bootloader_dram_seg_len = 0x5000;
bootloader_iram_loader_seg_len = 0x7000;
bootloader_iram_seg_len = 0x2000;
/* Start of the lower region is determined by region size and the end of the higher region */
bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead;
bootloader_dram_seg_start = bootloader_dram_seg_end - bootloader_dram_seg_len;
bootloader_iram_loader_seg_start = bootloader_dram_seg_start - bootloader_iram_loader_seg_len + iram_dram_offset;
bootloader_iram_seg_start = bootloader_iram_loader_seg_start - bootloader_iram_seg_len;
MEMORY
{
iram_seg (RWX) : org = 0x403CE000, len = 0x2000
iram_loader_seg (RWX) : org = 0x403D0000, len = 0x6000
dram_seg (RW) : org = 0x3FCD6000, len = 0x4000
iram_seg (RWX) : org = bootloader_iram_seg_start, len = bootloader_iram_seg_len
iram_loader_seg (RWX) : org = bootloader_iram_loader_seg_start, len = bootloader_iram_loader_seg_len
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* Default entry point: */
@ -97,8 +123,6 @@ SECTIONS
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
@ -111,6 +135,7 @@ SECTIONS
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.* .srodata .srodata.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
@ -174,17 +199,34 @@ SECTIONS
/**
* Appendix: Memory Usage of ROM bootloader
*
* +--------+--------------+------+ 0x3FCC_B900
* | ^ |
* | | |
* | | data/bss |
* | | |
* | v |
* +------------------------------+ 0x3FCD_D210
* | ^ |
* | | |
* | | stack |
* | | |
* | v |
* +------------------------------+ 0x3FCD_F210
* 0x3fccb81c ------------------> _dram0_0_start
* | |
* | |
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
* | |
* | |
* 0x3fcdd120 ------------------> __stack_sentry
* | |
* | | 2. Startup pro cpu stack (freed when IDF app is running)
* | |
* 0x3fcdf120 ------------------> __stack (pro cpu)
* | |
* | |
* | | 3. Shared memory only used in startup code or nonos/early boot*
* | | (can be freed when IDF runs)
* | |
* | |
* 0x3fcdfa6c ------------------> _dram0_rtos_reserved_start
* | |
* | |
* | | 4. Shared memory used in startup code and when IDF runs
* | |
* | |
* 0x3fcdfe40 ------------------> _dram0_rtos_reserved_end
* | |
* 0x3fcdfe4c ------------------> _data_start_interface
* | |
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
* | |
* 0x3fce0000 ------------------> _data_end_interface
*/

View File

@ -99,8 +99,6 @@ SECTIONS
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
@ -113,6 +111,7 @@ SECTIONS
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
@ -171,4 +170,23 @@ SECTIONS
_etext = .;
} > iram_seg
/** This section will be used by the debugger and disassembler to get more information
* about raw data present in the code.
* Indeed, it may be required to add some padding at some points in the code
* in order to align a branch/jump destination on a particular bound.
* Padding these instructions will generate null bytes that shall be
* interpreted as data, and not code by the debugger or disassembler.
* This section will only be present in the ELF file, not in the final binary
* For more details, check GCC-212
*/
.xt.prop 0 :
{
KEEP (*(.xt.prop .gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit .gnu.linkonce.p.*))
}
}

View File

@ -1,16 +1,51 @@
/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
* We put 2nd bootloader in the high address space (before ROM stack/data/bss).
* See memory usage for ROM bootloader at the end of this file.
*
* ESP32-S3 ROM static data usage is as follows:
* - 0x3fcd7e00 - 0x3fce9704: Shared buffers, used in UART/USB/SPI download mode only
* - 0x3fce9710 - 0x3fceb710: PRO CPU stack, can be reclaimed as heap after RTOS startup
* - 0x3fceb710 - 0x3fced710: APP CPU stack, can be reclaimed as heap after RTOS startup
* - 0x3fced710 - 0x3fcf0000: ROM .bss and .data (not easily reclaimable)
*
* The 2nd stage bootloader can take space up to the end of ROM shared
* buffers area (0x3fce9704). For alignment purpose we shall use value (0x3fce9700).
*/
/* The offset between Dbus and Ibus. Used to convert between 0x403xxxxx and 0x3fcxxxxx addresses. */
iram_dram_offset = 0x6f0000;
/* We consider 0x3fce9700 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
*/
/* These lengths can be adjusted, if necessary: */
bootloader_usable_dram_end = 0x3fce9700;
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
bootloader_dram_seg_len = 0x4000;
bootloader_iram_loader_seg_len = 0x7000;
bootloader_iram_seg_len = 0x3000;
/* Start of the lower region is determined by region size and the end of the higher region */
bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead;
bootloader_dram_seg_start = bootloader_dram_seg_end - bootloader_dram_seg_len;
bootloader_iram_loader_seg_start = bootloader_dram_seg_start - bootloader_iram_loader_seg_len + iram_dram_offset;
bootloader_iram_seg_start = bootloader_iram_loader_seg_start - bootloader_iram_seg_len;
MEMORY
{
iram_seg (RWX) : org = 0x403B6000, len = 0x4000
iram_loader_seg (RWX) : org = 0x403BA000, len = 0x6000
dram_seg (RW) : org = 0x3FCD0000, len = 0x4000
iram_seg (RWX) : org = bootloader_iram_seg_start, len = bootloader_iram_seg_len
iram_loader_seg (RWX) : org = bootloader_iram_loader_seg_start, len = bootloader_iram_loader_seg_len
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* The app may use RAM for static allocations up to the start of iram_loader_seg.
* If you have changed something above and this assert fails:
* 1. Check what the new value of bootloader_iram_loader_seg start is.
* 2. Update the value in this assert.
* 3. Update SRAM_IRAM_END in components/esp_system/ld/esp32s3/memory.ld.in to the same value.
*/
ASSERT(bootloader_iram_loader_seg_start == 0x403cc700, "bootloader_iram_loader_seg_start inconsistent with SRAM_IRAM_END");
/* Default entry point: */
ENTRY(call_start_cpu0);
@ -30,7 +65,6 @@ SECTIONS
*libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
*libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
*libbootloader_support.a:bootloader_efuse_esp32s3.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
@ -100,8 +134,6 @@ SECTIONS
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
@ -114,6 +146,7 @@ SECTIONS
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
@ -172,29 +205,62 @@ SECTIONS
_etext = .;
} > iram_seg
}
/** This section will be used by the debugger and disassembler to get more information
* about raw data present in the code.
* Indeed, it may be required to add some padding at some points in the code
* in order to align a branch/jump destination on a particular bound.
* Padding these instructions will generate null bytes that shall be
* interpreted as data, and not code by the debugger or disassembler.
* This section will only be present in the ELF file, not in the final binary
* For more details, check GCC-212
*/
.xt.prop 0 :
{
KEEP (*(.xt.prop .gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit .gnu.linkonce.p.*))
}
}
/**
* Appendix: Memory Usage of ROM bootloader
*
* +--------+--------------+------+ 0x3FCD_8000
* | ^ |
* | | |
* | | data/bss |
* | | |
* | v |
* +------------------------------+ 0x3FCE_9910
* | ^ |
* | | |
* | | stack (pro) |
* | | |
* | v |
* +------------------------------+ 0x3FCE_B910
* | ^ |
* | | |
* | | stack (app) |
* | | |
* | v |
* +--------+--------------+------+ 0x3FCE_D910
* 0x3fcd7e00 ------------------> _dram0_0_start
* | |
* | |
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
* | |
* | |
* 0x3fce9710 ------------------> __stack_sentry
* | |
* | | 2. Startup pro cpu stack (freed when IDF app is running)
* | |
* 0x3fceb710 ------------------> __stack (pro cpu)
* | |
* | | Startup app cpu stack
* | |
* 0x3fced710 ------------------> __stack_app (app cpu)
* | |
* | |
* | | 3. Shared memory only used in startup code or nonos/early boot*
* | | (can be freed when IDF runs)
* | |
* | |
* 0x3fceee34 ------------------> _dram0_rtos_reserved_start
* | |
* | |
* | | 4. Shared memory used in startup code and when IDF runs
* | |
* | |
* 0x3fcef770 ------------------> _dram0_rtos_reserved_end
* | |
* 0x3fcef81c ------------------> _data_start_interface
* | |
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
* | |
* 0x3fcf0000 ------------------> _data_end_interface
*/

View File

@ -26,7 +26,7 @@
extern "C" {
#endif
/// Type of hold a GPIO in low state
// Type of hold a GPIO in low state
typedef enum {
GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */
GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */

View File

@ -9,6 +9,7 @@
#include <esp_spi_flash.h> /* including in bootloader for error values */
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#include "bootloader_flash_override.h"
#ifdef __cplusplus
extern "C" {
@ -32,14 +33,6 @@ uint32_t bootloader_read_flash_id(void);
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
#endif
/**
* @brief Unlock Flash write protect.
* Please do not call this function in SDK.
*
* @note This can be overridden because it's attribute weak.
*/
esp_err_t bootloader_flash_unlock(void);
/**
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
*
@ -47,6 +40,15 @@ esp_err_t bootloader_flash_unlock(void);
*/
esp_err_t bootloader_flash_xmc_startup(void);
/**
* @brief Unlock Flash write protect.
* Please do not call this function in SDK.
*
* @note This can be overridden because it's attribute weak.
*/
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,101 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_err.h"
#include "esp_attr.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned (*bootloader_flash_read_status_fn_t)(void);
typedef void (*bootloader_flash_write_status_fn_t)(unsigned);
typedef struct __attribute__((packed))
{
const char *manufacturer;
uint8_t mfg_id; /* 8-bit JEDEC manufacturer ID */
uint16_t flash_id; /* 16-bit JEDEC flash chip ID */
uint16_t id_mask; /* Bits to match on in flash chip ID */
bootloader_flash_read_status_fn_t read_status_fn;
bootloader_flash_write_status_fn_t write_status_fn;
uint8_t status_qio_bit;
} bootloader_qio_info_t;
/**
* @brief Read 8 bit status using RDSR command
*
* @return Value of SR1.
*/
unsigned bootloader_read_status_8b_rdsr(void);
/**
* @brief Read 8 bit status (second byte) using RDSR2 command
*
* @return Value of SR2
*/
unsigned bootloader_read_status_8b_rdsr2(void);
/**
* @brief Read 16 bit status using RDSR & RDSR2 (low and high bytes)
*
* @return Value of SR2#SR1.
*/
unsigned bootloader_read_status_16b_rdsr_rdsr2(void);
/**
* @brief Write 8 bit status using WRSR
*/
void bootloader_write_status_8b_wrsr(unsigned new_status);
/**
* @brief Write 8 bit status (second byte) using WRSR2.
*/
void bootloader_write_status_8b_wrsr2(unsigned new_status);
/**
* @brief Write 16 bit status using WRSR, (both write SR1 and SR2)
*/
void bootloader_write_status_16b_wrsr(unsigned new_status);
/**
* @brief Read 8 bit status of XM25QU64A.
*
* @return Value of 8 bit SR.
*/
unsigned bootloader_read_status_8b_xmc25qu64a(void);
/**
* @brief Write 8 bit status for XM25QU64A
*/
void bootloader_write_status_8b_xmc25qu64a(unsigned new_status);
/* Array of known flash chips and data to enable Quad I/O mode
Manufacturer & flash ID can be tested by running "esptool.py
flash_id"
If manufacturer ID matches, and flash ID ORed with flash ID mask
matches, enable_qio_mode() will execute "Read Cmd", test if bit
number "QIE Bit" is set, and if not set it will call "Write Cmd"
with this bit set.
Searching of this table stops when the first match is found.
*/
extern const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_support_list[];
/**
* @brief Unlock Flash write protect.
* Please do not call this function in SDK.
*
* @note This can be overridden because it's attribute weak.
*/
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
#ifdef __cplusplus
}
#endif

View File

@ -55,6 +55,9 @@ typedef enum {
ESP_IMAGE_FLASH_SIZE_4MB, /*!< SPI flash size 4 MB */
ESP_IMAGE_FLASH_SIZE_8MB, /*!< SPI flash size 8 MB */
ESP_IMAGE_FLASH_SIZE_16MB, /*!< SPI flash size 16 MB */
ESP_IMAGE_FLASH_SIZE_32MB, /*!< SPI flash size 32 MB */
ESP_IMAGE_FLASH_SIZE_64MB, /*!< SPI flash size 64 MB */
ESP_IMAGE_FLASH_SIZE_128MB, /*!< SPI flash size 128 MB */
ESP_IMAGE_FLASH_SIZE_MAX /*!< SPI flash size MAX */
} esp_image_flash_size_t;

View File

@ -96,9 +96,10 @@ void bootloader_atexit(void);
esp_err_t bootloader_sha256_hex_to_str(char *out_str, const uint8_t *in_array_hex, size_t len);
/**
* @brief Debug log contents of a buffer as hexadecimal
* @brief Debug log contents of a buffer as hexadecimal.
*
* @note Only works if component log level is DEBUG or higher.
* @note - Only works if component log level is DEBUG or higher.
* - It will print at most 128 bytes from @c buffer.
*
* @param buffer Buffer to log
* @param length Length of buffer in bytes. Maximum length 128 bytes.

View File

@ -168,6 +168,12 @@ esp_err_t bootloader_common_get_sha256_of_partition (uint32_t address, uint32_t
}
if (data.image.hash_appended) {
memcpy(out_sha_256, data.image_digest, ESP_PARTITION_HASH_LEN);
uint8_t calc_sha256[ESP_PARTITION_HASH_LEN];
// The hash is verified before returning, if app content is invalid then the function returns ESP_ERR_IMAGE_INVALID.
esp_err_t error = bootloader_sha256_flash_contents(address, data.image_len - ESP_PARTITION_HASH_LEN, calc_sha256);
if (error || memcmp(data.image_digest, calc_sha256, ESP_PARTITION_HASH_LEN) != 0) {
return ESP_ERR_IMAGE_INVALID;
}
return ESP_OK;
}
// If image doesn't have a appended hash then hash calculates for entire image.

View File

@ -73,10 +73,12 @@ void bootloader_console_init(void)
// Route GPIO signals to/from pins
const uint32_t tx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_TX_PIN_IDX);
const uint32_t rx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_RX_PIN_IDX);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[uart_rx_gpio], PIN_FUNC_GPIO);
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
esp_rom_gpio_pad_pullup_only(uart_rx_gpio);
esp_rom_gpio_connect_out_signal(uart_tx_gpio, tx_idx, 0, 0);
esp_rom_gpio_connect_in_signal(uart_rx_gpio, rx_idx, 0);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[uart_tx_gpio], PIN_FUNC_GPIO);
// Enable the peripheral
periph_ll_enable_clk_clear_rst(PERIPH_UART0_MODULE + uart_num);
}

View File

@ -8,8 +8,9 @@
#include "bootloader_clock.h"
#include "soc/efuse_reg.h"
#include "soc/syscon_reg.h"
#include "esp_attr.h"
uint8_t bootloader_common_get_chip_revision(void)
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
{
uint8_t eco_bit0, eco_bit1, eco_bit2;
eco_bit0 = (REG_READ(EFUSE_BLK0_RDATA3_REG) & 0xF000) >> 15;
@ -42,7 +43,7 @@ uint8_t bootloader_common_get_chip_revision(void)
return chip_ver;
}
uint32_t bootloader_common_get_chip_ver_pkg(void)
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
{
uint32_t pkg_version = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
uint32_t pkg_version_4bit = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG_4BIT);

View File

@ -6,14 +6,15 @@
#include <stdint.h>
#include "soc/efuse_reg.h"
#include "esp_attr.h"
uint8_t bootloader_common_get_chip_revision(void)
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
{
// should return the same value as esp_efuse_get_chip_ver()
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
}
uint32_t bootloader_common_get_chip_ver_pkg(void)
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
{
// should return the same value as esp_efuse_get_pkg_ver()
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);

View File

@ -6,14 +6,15 @@
#include <stdint.h>
#include "soc/efuse_reg.h"
#include "esp_attr.h"
uint8_t bootloader_common_get_chip_revision(void)
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
{
// should return the same value as esp_efuse_get_chip_ver()
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
}
uint32_t bootloader_common_get_chip_ver_pkg(void)
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
{
// should return the same value as esp_efuse_get_pkg_ver()
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -8,15 +8,15 @@
#include "bootloader_clock.h"
#include "bootloader_common.h"
#include "soc/efuse_reg.h"
#include "esp_attr.h"
uint8_t bootloader_common_get_chip_revision(void)
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
{
// should return the same value as esp_efuse_get_chip_ver()
/* No other revisions for ESP32-S2 */
return 0;
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
}
uint32_t bootloader_common_get_chip_ver_pkg(void)
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
{
// should return the same value as esp_efuse_get_pkg_ver()
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_4_REG, EFUSE_PKG_VERSION);

View File

@ -5,15 +5,16 @@
*/
#include <stdint.h>
#include "esp_attr.h"
uint8_t bootloader_common_get_chip_revision(void)
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
{
// should return the same value as esp_efuse_get_chip_ver()
/* No other revisions for ESP32-S3 */
return 0;
}
uint32_t bootloader_common_get_chip_ver_pkg(void)
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
{
// should return the same value as esp_efuse_get_pkg_ver()
return 0;

View File

@ -43,15 +43,15 @@
#define BYTESHIFT(VAR, IDX) (((VAR) >> ((IDX) * 8)) & 0xFF)
#define ISSI_ID 0x9D
#define MXIC_ID 0xC2
#define GD_Q_ID_HIGH 0xC8
#define GD_Q_ID_MID 0x40
#define GD_Q_ID_LOW 0x16
#define ESP_BOOTLOADER_SPIFLASH_BP_MASK_ISSI (BIT7 | BIT5 | BIT4 | BIT3 | BIT2)
#define ESP_BOOTLOADER_SPIFLASH_QE_16B BIT9 // QE position when you write 16 bits at one time.
#define ESP_BOOTLOADER_SPIFLASH_QE_8B BIT1 // QE position when you write 8 bits(for SR2) at one time.
#define ESP_BOOTLOADER_SPIFLASH_WRITE_8B (8)
#define ESP_BOOTLOADER_SPIFLASH_WRITE_16B (16)
#define ESP_BOOTLOADER_SPIFLASH_QE_GD_SR2 BIT1 // QE position when you write 8 bits(for SR2) at one time.
#define ESP_BOOTLOADER_SPIFLASH_QE_SR1_2BYTE BIT9 // QE position when you write 16 bits at one time.
#ifndef BOOTLOADER_BUILD
/* Normal app version maps to esp_spi_flash.h operations...
@ -495,72 +495,77 @@ FORCE_INLINE_ATTR bool is_gd_q_chip(const esp_rom_spiflash_chip_t* chip)
return BYTESHIFT(chip->device_id, 2) == GD_Q_ID_HIGH && BYTESHIFT(chip->device_id, 1) == GD_Q_ID_MID && BYTESHIFT(chip->device_id, 0) >= GD_Q_ID_LOW;
}
FORCE_INLINE_ATTR bool is_mxic_chip(const esp_rom_spiflash_chip_t* chip)
{
return BYTESHIFT(chip->device_id, 2) == MXIC_ID;
}
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void)
{
// At the beginning status == new_status == status_sr2 == new_status_sr2 == 0.
// If the register doesn't need to be updated, keep them the same (0), so that no command will be actually sent.
uint16_t status = 0; // status for SR1 or SR1+SR2 if writing SR with 01H + 2Bytes.
uint16_t new_status = 0;
uint8_t status_sr2 = 0; // status_sr2 for SR2.
uint8_t new_status_sr2 = 0;
uint8_t write_sr_bit = 0;
uint8_t sr1_bit_num = 0;
esp_err_t err = ESP_OK;
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
if (is_issi_chip(&g_rom_flashchip)) {
write_sr_bit = ESP_BOOTLOADER_SPIFLASH_WRITE_8B;
// ISSI chips have different QE position
if (is_issi_chip(&g_rom_flashchip) || is_mxic_chip(&g_rom_flashchip)) {
// Currently ISSI & MXIC share the same command and register layout, which is different from the default model.
// If any code here needs to be modified, check both chips.
status = bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
/* Clear all bits in the mask.
(This is different from ROM esp_rom_spiflash_unlock, which keeps all bits as-is.)
*/
sr1_bit_num = 8;
new_status = status & (~ESP_BOOTLOADER_SPIFLASH_BP_MASK_ISSI);
// Skip if nothing needs to be cleared. Otherwise will waste time waiting for the flash to clear nothing.
} else if (is_gd_q_chip(&g_rom_flashchip)) {
/* The GD chips behaviour is to clear all bits in SR1 and clear bits in SR2 except QE bit.
Use 01H to write SR1 and 31H to write SR2.
*/
write_sr_bit = ESP_BOOTLOADER_SPIFLASH_WRITE_8B;
status = bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
sr1_bit_num = 8;
new_status = 0;
status_sr2 = bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8);
new_status_sr2 = status_sr2 & ESP_BOOTLOADER_SPIFLASH_QE_8B;
new_status_sr2 = status_sr2 & ESP_BOOTLOADER_SPIFLASH_QE_GD_SR2;
} else {
/* For common behaviour, like XMC chips, Use 01H+2Bytes to write both SR1 and SR2*/
write_sr_bit = ESP_BOOTLOADER_SPIFLASH_WRITE_16B;
status = bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8) | (bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8) << 8);
/* Clear all bits except QE, if it is set.
(This is different from ROM esp_rom_spiflash_unlock, which keeps all bits as-is.)
*/
new_status = status & ESP_BOOTLOADER_SPIFLASH_QE_16B;
sr1_bit_num = 16;
new_status = status & ESP_BOOTLOADER_SPIFLASH_QE_SR1_2BYTE;
}
// When SR is written, set to true to indicate that WRDI need to be sent to ensure the protection is ON before return.
bool status_written = false;
// Skip if nothing needs to be changed. Meaningless writing to SR increases the risk during write and wastes time.
if (status != new_status) {
/* if the status in SR not equal to the ideal status, the status need to be updated */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WREN, 0, 0, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WRSR, new_status, write_sr_bit, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WRSR, new_status, sr1_bit_num, 0);
status_written = true;
}
if (status_sr2 != new_status_sr2) {
/* If the status in SR2 not equal to the ideal status, the status need to be updated.
It doesn't need to be updated if status in SR2 is 0.
Note: if we need to update both SR1 and SR2, the `CMD_WREN` needs to be sent again.
*/
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WREN, 0, 0, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WRSR2, new_status_sr2, write_sr_bit, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WRSR2, new_status_sr2, 8, 0);
status_written = true;
}
if (status_written) {
//Call esp_rom_spiflash_wait_idle to make sure previous WRSR is completed.
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WRDI, 0, 0, 0);
}
bootloader_execute_flash_command(CMD_WRDI, 0, 0, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
return err;
}

View File

@ -17,6 +17,8 @@ void bootloader_init_mem(void)
{
cpu_hal_init_hwloop();
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();
#endif
}

View File

@ -12,7 +12,11 @@
void __assert_func(const char *file, int line, const char *func, const char *expr)
{
#if !CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
esp_rom_printf("Assert failed in %s, %s:%d (%s)\r\n", func, file, line, expr);
#endif
while (1) {
}
}

View File

@ -18,6 +18,13 @@
}
#else
#if !defined CONFIG_IDF_TARGET_ESP32S3
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 32 * 2) /* extra factor of 2 is precautionary */
#else
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 23) /* 45 KHz reading frequency is the maximum we have tested so far on S3 */
#endif
__attribute__((weak)) void bootloader_fill_random(void *buffer, size_t length)
{
uint8_t *buffer_bytes = (uint8_t *)buffer;
@ -40,7 +47,7 @@
do {
random ^= REG_READ(WDEV_RND_REG);
now = cpu_hal_get_cycle_count();
} while (now - start < 80 * 32 * 2); /* extra factor of 2 is precautionary */
} while (now - start < RNG_CPU_WAIT_CYCLE_NUM);
}
buffer_bytes[i] = random >> ((i % 4) * 8);
}

View File

@ -6,18 +6,97 @@
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "esp_log.h"
static const char *TAG = "bootloader_random";
#include "soc/system_reg.h"
#include "soc/syscon_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/sens_reg.h"
#include "regi2c_ctrl.h"
#include "regi2c_saradc.h"
void bootloader_random_enable(void)
{
ESP_LOGW(TAG, "RNG for ESP32-S3 not currently supported"); // IDF-1878
// Don't forget to remove the following line
// *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
// In the bootloader.ld when RNG support is ready for ESP32-S3
SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_RNG_EN);
// Enable 8M clock source for RNG (this is actually enough to produce strong random results,
// but enabling the SAR ADC as well adds some insurance.)
REG_SET_BIT(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_CLK8M_EN);
/// Enable SAR ADC to read a disconnected input for additional entropy
// Reset ADC clock
SET_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, SYSTEM_APB_SARADC_CLK_EN);
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, SYSTEM_APB_SARADC_CLK_EN);
// Enable clock and select clock source for ADC digital controller
REG_SET_FIELD(APB_SARADC_APB_ADC_CLKM_CONF_REG, APB_SARADC_CLK_SEL, 2); //APB clock
SET_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_SAR_CLK_GATED);
SET_PERI_REG_MASK(APB_SARADC_APB_ADC_CLKM_CONF_REG, APB_SARADC_CLK_EN);
// Read freq = apb_clk / (APB_SARADC_CLKM_DIV_NUM + 1) / TIMER_TARGET / 2
// Internal ADC sample freq = apb_clk / (APB_SARADC_CLKM_DIV_NUM + 1) / (APB_SARADC_SAR_CLK_DIV + 1)
// Read frequency has to be at least 35 times lower than the sampling frequency
REG_SET_FIELD(APB_SARADC_APB_ADC_CLKM_CONF_REG, APB_SARADC_CLKM_DIV_NUM, 3);
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SAR_CLK_DIV, 3); // SAR clock divider has to be at least 2
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_TARGET, 70);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_START_FORCE);
REG_SET_FIELD(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 3);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL2_REG, APB_SARADC_MEAS_NUM_LIMIT);
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_WORK_MODE, 1);
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SAR2_PATT_LEN, 0);
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB1_REG,0xafffff); // Test internal voltage if the channel info is 0xa.
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SAR1_PATT_LEN, 0);
WRITE_PERI_REG(APB_SARADC_SAR1_PATT_TAB1_REG,0xafffff); // Test internal voltage if the channel info is 0xa.
// Enable adc1 digital controller
SET_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG, SENS_SAR1_DIG_FORCE);
// Set SARADC2 arbiter
CLEAR_PERI_REG_MASK(SENS_SAR_MEAS2_MUX_REG, SENS_SAR2_RTC_FORCE);
CLEAR_PERI_REG_MASK(APB_SARADC_APB_ADC_ARB_CTRL_REG, APB_SARADC_ADC_ARB_GRANT_FORCE);
CLEAR_PERI_REG_MASK(APB_SARADC_APB_ADC_ARB_CTRL_REG, APB_SARADC_ADC_ARB_FIX_PRIORITY);
// Disable ADC filter
REG_SET_FIELD(APB_SARADC_FILTER_CTRL0_REG, APB_SARADC_FILTER_CHANNEL0, 0xD);
REG_SET_FIELD(APB_SARADC_FILTER_CTRL0_REG, APB_SARADC_FILTER_CHANNEL1, 0xD);
// Start ADC sample
SET_PERI_REG_MASK(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_SEL);
SET_PERI_REG_MASK(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_EN);
/*Choose the appropriate internal voltage to measure*/
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENCAL_REF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_TSENS_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
}
//TODO: IDF-4714
void bootloader_random_disable(void)
{
ESP_LOGW(TAG, "RNG for ESP32-S3 not currently supported"); // IDF-1878
/* Restore internal I2C bus state */
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENCAL_REF_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_TSENS_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
//Power off SAR ADC
REG_SET_FIELD(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 0);
//return to ADC RTC controller
CLEAR_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG, SENS_SAR1_DIG_FORCE);
//Invalidate ADC digital trigger timer
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_EN);
//Disable ADC digital part
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, SYSTEM_APB_SARADC_CLK_EN);
//Hold reset bit for ADC digital part
SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN0_REG, SYSTEM_APB_SARADC_RST);
/* Note: the 8M CLK entropy source continues running even after this function is called,
but as mentioned above it's better to enable Wi-Fi or BT or call bootloader_random_enable()
in order to get a secondary entropy source.
*/
}

View File

@ -78,6 +78,7 @@
#include "bootloader_console.h"
#include "bootloader_soc.h"
#include "esp_efuse.h"
#include "esp_fault.h"
static const char *TAG = "boot";
@ -269,9 +270,16 @@ static esp_err_t write_otadata(esp_ota_select_entry_t *otadata, uint32_t offset,
static bool check_anti_rollback(const esp_partition_pos_t *partition)
{
#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
esp_app_desc_t app_desc;
esp_app_desc_t app_desc = {};
esp_err_t err = bootloader_common_get_partition_description(partition, &app_desc);
return err == ESP_OK && esp_efuse_check_secure_version(app_desc.secure_version) == true;
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to get partition description %d", err);
return false;
}
bool sec_ver = esp_efuse_check_secure_version(app_desc.secure_version);
/* Anti FI check */
ESP_FAULT_ASSERT(sec_ver == esp_efuse_check_secure_version(app_desc.secure_version));
return sec_ver;
#else
return true;
#endif
@ -284,6 +292,8 @@ static void update_anti_rollback(const esp_partition_pos_t *partition)
esp_err_t err = bootloader_common_get_partition_description(partition, &app_desc);
if (err == ESP_OK) {
esp_efuse_update_secure_version(app_desc.secure_version);
} else {
ESP_LOGE(TAG, "Failed to get partition description %d", err);
}
}
@ -700,7 +710,8 @@ static void set_cache_and_start_app(
uint32_t irom_size,
uint32_t entry_addr)
{
int rc;
int rc __attribute__((unused));
ESP_LOGD(TAG, "configure drom and irom and start");
#if CONFIG_IDF_TARGET_ESP32
Cache_Read_Disable(0);
@ -720,8 +731,8 @@ static void set_cache_and_start_app(
#endif
/* Clear the MMU entries that are already set up,
so the new app only has the mappings it creates.
*/
* so the new app only has the mappings it creates.
*/
#if CONFIG_IDF_TARGET_ESP32
for (int i = 0; i < DPORT_FLASH_MMU_TABLE_SIZE; i++) {
DPORT_PRO_FLASH_MMU_TABLE[i] = DPORT_FLASH_MMU_TABLE_INVALID_VAL;
@ -732,31 +743,33 @@ static void set_cache_and_start_app(
}
#endif
uint32_t drom_load_addr_aligned = drom_load_addr & MMU_FLASH_MASK;
uint32_t drom_addr_aligned = drom_addr & MMU_FLASH_MASK;
uint32_t drom_page_count = bootloader_cache_pages_to_map(drom_size, drom_load_addr);
ESP_LOGV(TAG, "d mmu set paddr=%08x vaddr=%08x size=%d n=%d",
drom_addr & MMU_FLASH_MASK, drom_load_addr_aligned, drom_size, drom_page_count);
drom_addr_aligned, drom_load_addr_aligned, drom_size, drom_page_count);
#if CONFIG_IDF_TARGET_ESP32
rc = cache_flash_mmu_set(0, 0, drom_load_addr_aligned, drom_addr & MMU_FLASH_MASK, 64, drom_page_count);
rc = cache_flash_mmu_set(0, 0, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count);
#elif CONFIG_IDF_TARGET_ESP32S2
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr & 0xffff0000, drom_addr & 0xffff0000, 64, drom_page_count, 0);
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32S3
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr & 0xffff0000, drom_addr & 0xffff0000, 64, drom_page_count, 0);
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32C3
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr & 0xffff0000, drom_addr & 0xffff0000, 64, drom_page_count, 0);
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32H2
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr & 0xffff0000, drom_addr & 0xffff0000, 64, drom_page_count, 0);
rc = Cache_Dbus_MMU_Set(MMU_ACCESS_FLASH, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count, 0);
#endif
ESP_LOGV(TAG, "rc=%d", rc);
#if CONFIG_IDF_TARGET_ESP32
rc = cache_flash_mmu_set(1, 0, drom_load_addr_aligned, drom_addr & MMU_FLASH_MASK, 64, drom_page_count);
rc = cache_flash_mmu_set(1, 0, drom_load_addr_aligned, drom_addr_aligned, 64, drom_page_count);
ESP_LOGV(TAG, "rc=%d", rc);
#endif
uint32_t irom_load_addr_aligned = irom_load_addr & MMU_FLASH_MASK;
uint32_t irom_addr_aligned = irom_addr & MMU_FLASH_MASK;
uint32_t irom_page_count = bootloader_cache_pages_to_map(irom_size, irom_load_addr);
ESP_LOGV(TAG, "i mmu set paddr=%08x vaddr=%08x size=%d n=%d",
irom_addr & MMU_FLASH_MASK, irom_load_addr_aligned, irom_size, irom_page_count);
irom_addr_aligned, irom_load_addr_aligned, irom_size, irom_page_count);
#if CONFIG_IDF_TARGET_ESP32
rc = cache_flash_mmu_set(0, 0, irom_load_addr_aligned, irom_addr & MMU_FLASH_MASK, 64, irom_page_count);
rc = cache_flash_mmu_set(0, 0, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count);
#elif CONFIG_IDF_TARGET_ESP32S2
uint32_t iram1_used = 0;
if (irom_load_addr + irom_size > IRAM1_ADDRESS_LOW) {
@ -767,17 +780,17 @@ static void set_cache_and_start_app(
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, IRAM1_ADDRESS_LOW, 0, 64, 64, 1);
REG_CLR_BIT(EXTMEM_PRO_ICACHE_CTRL1_REG, EXTMEM_PRO_ICACHE_MASK_IRAM1);
}
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr & 0xffff0000, irom_addr & 0xffff0000, 64, irom_page_count, 0);
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32S3
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr & 0xffff0000, irom_addr & 0xffff0000, 64, irom_page_count, 0);
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32C3
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr & 0xffff0000, irom_addr & 0xffff0000, 64, irom_page_count, 0);
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count, 0);
#elif CONFIG_IDF_TARGET_ESP32H2
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr & 0xffff0000, irom_addr & 0xffff0000, 64, irom_page_count, 0);
rc = Cache_Ibus_MMU_Set(MMU_ACCESS_FLASH, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count, 0);
#endif
ESP_LOGV(TAG, "rc=%d", rc);
#if CONFIG_IDF_TARGET_ESP32
rc = cache_flash_mmu_set(1, 0, irom_load_addr_aligned, irom_addr & MMU_FLASH_MASK, 64, irom_page_count);
rc = cache_flash_mmu_set(1, 0, irom_load_addr_aligned, irom_addr_aligned, 64, irom_page_count);
ESP_LOGV(TAG, "rc=%d", rc);
DPORT_REG_CLR_BIT( DPORT_PRO_CACHE_CTRL1_REG,
(DPORT_PRO_CACHE_MASK_IRAM0) | (DPORT_PRO_CACHE_MASK_IRAM1 & 0) |
@ -865,22 +878,19 @@ esp_err_t bootloader_sha256_hex_to_str(char *out_str, const uint8_t *in_array_he
void bootloader_debug_buffer(const void *buffer, size_t length, const char *label)
{
#if BOOT_LOG_LEVEL >= LOG_LEVEL_DEBUG
assert(length <= 128); // Avoid unbounded VLA size
#if CONFIG_BOOTLOADER_LOG_LEVEL >= 4
const uint8_t *bytes = (const uint8_t *)buffer;
char hexbuf[length * 2 + 1];
hexbuf[length * 2] = 0;
for (size_t i = 0; i < length; i++) {
for (int shift = 0; shift < 2; shift++) {
uint8_t nibble = (bytes[i] >> (shift ? 0 : 4)) & 0x0F;
if (nibble < 10) {
hexbuf[i * 2 + shift] = '0' + nibble;
} else {
hexbuf[i * 2 + shift] = 'a' + nibble - 10;
}
}
}
const size_t output_len = MIN(length, 128);
char hexbuf[128 * 2 + 1];
bootloader_sha256_hex_to_str(hexbuf, bytes, output_len);
hexbuf[output_len * 2] = '\0';
ESP_LOGD(TAG, "%s: %s", label, hexbuf);
#else
(void) buffer;
(void) length;
(void) label;
#endif
}

View File

@ -79,7 +79,7 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
return err;
}
#else
ESP_LOGW(TAG, "Not disabling ROM Download mode - SECURITY COMPROMISED");
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS

View File

@ -38,7 +38,7 @@ esp_err_t esp_flash_encryption_enable_secure_features(void)
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#if defined(CONFIG_SECURE_BOOT_V2_ENABLED) && !defined(CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS)
// This bit is set when enabling Secure Boot V2, but we can't enable it until this later point in the first boot

View File

@ -16,13 +16,24 @@ static __attribute__((unused)) const char *TAG = "secure_boot";
esp_err_t esp_secure_boot_enable_secure_features(void)
{
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_efuse_write_field_bit(ESP_EFUSE_ENABLE_SECURITY_DOWNLOAD);
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
esp_err_t err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "Not enabling Security download mode - SECURITY COMPROMISED");
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG

View File

@ -142,7 +142,7 @@ static esp_err_t initialise_flash_encryption(void)
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
esp_err_t err = esp_efuse_batch_write_commit();
if (err != ESP_OK) {

View File

@ -248,13 +248,25 @@ esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *imag
return key_state;
}
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
esp_err_t err = ESP_FAIL;
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_efuse_write_field_bit(ESP_EFUSE_ENABLE_SECURITY_DOWNLOAD);
err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "Not enabling Security download mode - SECURITY COMPROMISED");
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
@ -272,7 +284,7 @@ esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *imag
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
esp_err_t err = esp_efuse_batch_write_commit();
err = esp_efuse_batch_write_commit();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Error programming security eFuses (err=0x%x).", err);
return err;

View File

@ -101,6 +101,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
size = 32;
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
size = 64;
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
size = 128;
break;
default:
size = 2;
}
@ -174,6 +183,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
str = "32MB";
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
str = "64MB";
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
str = "128MB";
break;
default:
str = "2MB";
break;

View File

@ -21,9 +21,20 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_efuse_write_field_bit(ESP_EFUSE_ENABLE_SECURITY_DOWNLOAD);
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
esp_err_t err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "Not enabling Security download mode - SECURITY COMPROMISED");
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG

View File

@ -103,6 +103,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
size = 32;
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
size = 64;
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
size = 128;
break;
default:
size = 2;
}
@ -176,6 +185,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
str = "32MB";
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
str = "64MB";
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
str = "128MB";
break;
default:
str = "2MB";
break;

View File

@ -39,7 +39,7 @@ esp_err_t esp_flash_encryption_enable_secure_features(void)
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#if defined(CONFIG_SECURE_BOOT_V2_ENABLED) && !defined(CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS)
// This bit is set when enabling Secure Boot V2, but we can't enable it until this later point in the first boot

View File

@ -16,13 +16,24 @@ static __attribute__((unused)) const char *TAG = "secure_boot";
esp_err_t esp_secure_boot_enable_secure_features(void)
{
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_efuse_write_field_bit(ESP_EFUSE_ENABLE_SECURITY_DOWNLOAD);
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
esp_err_t err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "Not enabling Security download mode - SECURITY COMPROMISED");
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG

View File

@ -31,6 +31,8 @@
#include "esp32h2/rom/secure_boot.h"
#endif
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
/* Checking signatures as part of verifying images is necessary:
- Always if secure boot is enabled
- Differently in bootloader and/or app, depending on kconfig
@ -102,7 +104,7 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
while(0)
static esp_err_t process_image_header(esp_image_metadata_t *data, uint32_t part_offset, bootloader_sha256_handle_t *sha_handle, bool do_verify, bool silent);
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent);
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent);
static esp_err_t process_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data, bool silent, bool skip_check_checksum);
static esp_err_t __attribute__((unused)) verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest);
@ -152,7 +154,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
CHECK_ERR(process_segments(data, silent, do_load, sha_handle, checksum));
bool skip_check_checksum = !do_verify || esp_cpu_in_ocd_debug_mode();
CHECK_ERR(process_checksum(sha_handle, checksum_word, data, silent, skip_check_checksum));
CHECK_ERR(process_appended_hash(data, part->size, do_verify, silent));
CHECK_ERR(process_appended_hash_and_sig(data, part->offset, part->size, do_verify, silent));
if (verify_sha) {
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
// secure boot images have a signature appended
@ -250,7 +252,11 @@ esp_err_t bootloader_load_image(const esp_partition_pos_t *part, esp_image_metad
#if CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS
mode = ESP_IMAGE_LOAD_NO_VALIDATE;
#elif CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON) {
if (esp_rom_get_reset_reason(0) == RESET_REASON_CHIP_POWER_ON
#if SOC_EFUSE_HAS_EFUSE_RST_BUG
|| esp_rom_get_reset_reason(0) == RESET_REASON_CORE_EFUSE_CRC
#endif
) {
mode = ESP_IMAGE_LOAD_NO_VALIDATE;
}
#endif // CONFIG_BOOTLOADER_SKIP_...
@ -288,7 +294,7 @@ esp_err_t esp_image_get_metadata(const esp_partition_pos_t *part, esp_image_meta
CHECK_ERR(process_segments(metadata, silent, do_load, NULL, NULL));
bool skip_check_checksum = true;
CHECK_ERR(process_checksum(NULL, 0, metadata, silent, skip_check_checksum));
CHECK_ERR(process_appended_hash(metadata, part->size, true, silent));
CHECK_ERR(process_appended_hash_and_sig(metadata, part->offset, part->size, true, silent));
return ESP_OK;
err:
return err;
@ -737,7 +743,7 @@ esp_err_t esp_image_verify_bootloader_data(esp_image_metadata_t *data)
data);
}
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent)
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent)
{
esp_err_t err = ESP_OK;
if (data->image.hash_appended) {
@ -748,8 +754,34 @@ static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part
data->image_len += HASH_LEN;
}
if (data->image_len > part_len) {
FAIL_LOAD("Image length %d doesn't fit in partition length %d", data->image_len, part_len);
uint32_t sig_block_len = 0;
const uint32_t end = data->image_len;
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
// Case I: Bootloader part
if (part_offset == ESP_BOOTLOADER_OFFSET) {
// For bootloader with secure boot v1, signature stays in an independant flash
// sector (offset 0x0) and does not get appended to the image.
#if CONFIG_SECURE_BOOT_V2_ENABLED
// Sanity check - secure boot v2 signature block starts on 4K boundary
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
sig_block_len += sizeof(ets_secure_boot_signature_t);
#endif
} else {
// Case II: Application part
#if CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
sig_block_len = sizeof(esp_secure_boot_sig_block_t);
#else
// Sanity check - secure boot v2 signature block starts on 4K boundary
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
sig_block_len += sizeof(ets_secure_boot_signature_t);
#endif
}
#endif // CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
const uint32_t full_image_len = end + sig_block_len;
if (full_image_len > part_len) {
FAIL_LOAD("Image length %d doesn't fit in partition length %d", full_image_len, part_len);
}
return err;
err:
@ -810,7 +842,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
// End of the image needs to be padded all the way to a 4KB boundary, after the simple hash
// (for apps they are usually already padded due to --secure-pad-v2, only a problem if this option was not used.)
uint32_t padded_end = (end + FLASH_SECTOR_SIZE - 1) & ~(FLASH_SECTOR_SIZE-1);
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
if (padded_end > end) {
const void *padding = bootloader_mmap(end, padded_end - end);
bootloader_sha256_data(sha_handle, padding, padded_end - end);
@ -901,6 +933,12 @@ int esp_image_get_flash_size(esp_image_flash_size_t app_flash_size)
return 8 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_16MB:
return 16 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_32MB:
return 32 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_64MB:
return 64 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_128MB:
return 128 * 1024 * 1024;
default:
return 0;
}

View File

@ -104,7 +104,8 @@ static esp_err_t check_and_generate_encryption_keys(void)
#endif // CONFIG_SECURE_FLASH_ENCRYPTION_AES256
#endif // CONFIG_IDF_TARGET_ESP32
esp_efuse_block_t blocks[BLOCKS_NEEDED];
/* Initialize all efuse block entries to invalid (max) value */
esp_efuse_block_t blocks[BLOCKS_NEEDED] = {[0 ... BLOCKS_NEEDED-1] = EFUSE_BLK_KEY_MAX};
bool has_key = true;
for (unsigned i = 0; i < BLOCKS_NEEDED; i++) {
bool tmp_has_key = esp_efuse_find_purpose(purposes[i], &blocks[i]);

View File

@ -30,39 +30,6 @@
static const char *TAG = "qio_mode";
typedef unsigned (*read_status_fn_t)(void);
typedef void (*write_status_fn_t)(unsigned);
typedef struct __attribute__((packed))
{
const char *manufacturer;
uint8_t mfg_id; /* 8-bit JEDEC manufacturer ID */
uint16_t flash_id; /* 16-bit JEDEC flash chip ID */
uint16_t id_mask; /* Bits to match on in flash chip ID */
read_status_fn_t read_status_fn;
write_status_fn_t write_status_fn;
uint8_t status_qio_bit;
} qio_info_t;
/* Read 8 bit status using RDSR command */
static unsigned read_status_8b_rdsr(void);
/* Read 8 bit status (second byte) using RDSR2 command */
static unsigned read_status_8b_rdsr2(void);
/* read 16 bit status using RDSR & RDSR2 (low and high bytes) */
static unsigned read_status_16b_rdsr_rdsr2(void);
/* Write 8 bit status using WRSR */
static void write_status_8b_wrsr(unsigned new_status);
/* Write 8 bit status (second byte) using WRSR2 */
static void write_status_8b_wrsr2(unsigned new_status);
/* Write 16 bit status using WRSR */
static void write_status_16b_wrsr(unsigned new_status);
/* Read 8 bit status of XM25QU64A */
static unsigned read_status_8b_xmc25qu64a(void);
/* Write 8 bit status of XM25QU64A */
static void write_status_8b_xmc25qu64a(unsigned new_status);
/* Array of known flash chips and data to enable Quad I/O mode
Manufacturer & flash ID can be tested by running "esptool.py
@ -75,13 +42,14 @@ static void write_status_8b_xmc25qu64a(unsigned new_status);
Searching of this table stops when the first match is found.
*/
const static qio_info_t chip_data[] = {
const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_support_list[] = {
/* Manufacturer, mfg_id, flash_id, id mask, Read Status, Write Status, QIE Bit */
{ "MXIC", 0xC2, 0x2000, 0xFF00, read_status_8b_rdsr, write_status_8b_wrsr, 6 },
{ "ISSI", 0x9D, 0x4000, 0xCF00, read_status_8b_rdsr, write_status_8b_wrsr, 6 }, /* IDs 0x40xx, 0x70xx */
{ "WinBond", 0xEF, 0x4000, 0xFF00, read_status_16b_rdsr_rdsr2, write_status_16b_wrsr, 9 },
{ "GD", 0xC8, 0x6000, 0xFF00, read_status_16b_rdsr_rdsr2, write_status_16b_wrsr, 9 },
{ "XM25QU64A", 0x20, 0x3817, 0xFFFF, read_status_8b_xmc25qu64a, write_status_8b_xmc25qu64a, 6 },
{ "MXIC", 0xC2, 0x2000, 0xFF00, bootloader_read_status_8b_rdsr, bootloader_write_status_8b_wrsr, 6 },
{ "ISSI", 0x9D, 0x4000, 0xCF00, bootloader_read_status_8b_rdsr, bootloader_write_status_8b_wrsr, 6 }, /* IDs 0x40xx, 0x70xx */
{ "WinBond", 0xEF, 0x4000, 0xFF00, bootloader_read_status_16b_rdsr_rdsr2, bootloader_write_status_16b_wrsr, 9 },
{ "GD", 0xC8, 0x6000, 0xFF00, bootloader_read_status_16b_rdsr_rdsr2, bootloader_write_status_16b_wrsr, 9 },
{ "XM25QU64A", 0x20, 0x3817, 0xFFFF, bootloader_read_status_8b_xmc25qu64a, bootloader_write_status_8b_xmc25qu64a, 6 },
{ "TH", 0xcd, 0x6000, 0xFF00, bootloader_read_status_16b_rdsr_rdsr2, bootloader_write_status_16b_wrsr, 9 },
/* Final entry is default entry, if no other IDs have matched.
@ -90,13 +58,13 @@ const static qio_info_t chip_data[] = {
FM25Q32 (QOUT mode only, mfg ID 0xA1, flash IDs including 4016)
BY25Q32 (mfg ID 0x68, flash IDs including 4016)
*/
{ NULL, 0xFF, 0xFFFF, 0xFFFF, read_status_8b_rdsr2, write_status_8b_wrsr2, 1 },
{ NULL, 0xFF, 0xFFFF, 0xFFFF, bootloader_read_status_8b_rdsr2, bootloader_write_status_8b_wrsr2, 1 },
};
#define NUM_CHIPS (sizeof(chip_data) / sizeof(qio_info_t))
#define NUM_CHIPS (sizeof(bootloader_flash_qe_support_list) / sizeof(bootloader_qio_info_t))
static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
write_status_fn_t write_status_fn,
static esp_err_t enable_qio_mode(bootloader_flash_read_status_fn_t read_status_fn,
bootloader_flash_write_status_fn_t write_status_fn,
uint8_t status_qio_bit);
/* Generic function to use the "user command" SPI controller functionality
@ -123,9 +91,9 @@ void bootloader_enable_qio_mode(void)
ESP_LOGD(TAG, "Manufacturer ID 0x%02x chip ID 0x%04x", mfg_id, flash_id);
for (i = 0; i < NUM_CHIPS - 1; i++) {
const qio_info_t *chip = &chip_data[i];
const bootloader_qio_info_t *chip = &bootloader_flash_qe_support_list[i];
if (mfg_id == chip->mfg_id && (flash_id & chip->id_mask) == (chip->flash_id & chip->id_mask)) {
ESP_LOGI(TAG, "Enabling QIO for flash chip %s", chip_data[i].manufacturer);
ESP_LOGI(TAG, "Enabling QIO for flash chip %s", bootloader_flash_qe_support_list[i].manufacturer);
break;
}
}
@ -133,16 +101,16 @@ void bootloader_enable_qio_mode(void)
if (i == NUM_CHIPS - 1) {
ESP_LOGI(TAG, "Enabling default flash chip QIO");
}
enable_qio_mode(chip_data[i].read_status_fn,
chip_data[i].write_status_fn,
chip_data[i].status_qio_bit);
enable_qio_mode(bootloader_flash_qe_support_list[i].read_status_fn,
bootloader_flash_qe_support_list[i].write_status_fn,
bootloader_flash_qe_support_list[i].status_qio_bit);
#if SOC_CACHE_SUPPORT_WRAP
bootloader_flash_wrap_set(FLASH_WRAP_MODE_DISABLE);
#endif
}
static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
write_status_fn_t write_status_fn,
static esp_err_t enable_qio_mode(bootloader_flash_read_status_fn_t read_status_fn,
bootloader_flash_write_status_fn_t write_status_fn,
uint8_t status_qio_bit)
{
uint32_t status;
@ -190,37 +158,37 @@ static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
return ESP_OK;
}
static unsigned read_status_8b_rdsr(void)
unsigned bootloader_read_status_8b_rdsr(void)
{
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
}
static unsigned read_status_8b_rdsr2(void)
unsigned bootloader_read_status_8b_rdsr2(void)
{
return bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8);
}
static unsigned read_status_16b_rdsr_rdsr2(void)
unsigned bootloader_read_status_16b_rdsr_rdsr2(void)
{
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8) | (bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8) << 8);
}
static void write_status_8b_wrsr(unsigned new_status)
void bootloader_write_status_8b_wrsr(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR, new_status, 8, 0);
}
static void write_status_8b_wrsr2(unsigned new_status)
void bootloader_write_status_8b_wrsr2(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR2, new_status, 8, 0);
}
static void write_status_16b_wrsr(unsigned new_status)
void bootloader_write_status_16b_wrsr(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR, new_status, 16, 0);
}
static unsigned read_status_8b_xmc25qu64a(void)
unsigned bootloader_read_status_8b_xmc25qu64a(void)
{
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
@ -229,7 +197,7 @@ static unsigned read_status_8b_xmc25qu64a(void)
return read_status;
}
static void write_status_8b_xmc25qu64a(unsigned new_status)
void bootloader_write_status_8b_xmc25qu64a(unsigned new_status)
{
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);

View File

@ -156,11 +156,11 @@ static esp_err_t check_and_generate_secure_boot_keys(const esp_image_metadata_t
return ret;
}
/* Initialize all efuse block entries to invalid (max) value */
esp_efuse_block_t blocks[SECURE_BOOT_NUM_BLOCKS] = {[0 ... SECURE_BOOT_NUM_BLOCKS-1] = EFUSE_BLK_KEY_MAX};
/* Check if secure boot digests are present */
esp_efuse_block_t blocks[SECURE_BOOT_NUM_BLOCKS];
bool has_secure_boot_digest = false;
for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
blocks[i] = EFUSE_BLK_KEY_MAX;
bool tmp_has_key = esp_efuse_find_purpose(secure_boot_key_purpose[i], &blocks[i]);
if (tmp_has_key) { // For ESP32: esp_efuse_find_purpose() always returns True, need to check whether the key block is used or not.
tmp_has_key &= !esp_efuse_key_block_unused(blocks[i]);
@ -198,6 +198,12 @@ static esp_err_t check_and_generate_secure_boot_keys(const esp_image_metadata_t
}
} else {
for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
/* Check if corresponding digest slot is used or not */
if (blocks[i] == EFUSE_BLK_KEY_MAX) {
ESP_LOGD(TAG, "SECURE_BOOT_DIGEST%d slot is not used", i);
continue;
}
#if SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS
if (esp_efuse_get_digest_revoke(i)) {
continue;

View File

@ -137,10 +137,13 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
#if SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS == 1
int sb_result = ets_secure_boot_verify_signature(sig_block, image_digest, trusted.key_digests[0], verified_digest);
#else
ets_secure_boot_key_digests_t trusted_key_digests;
ets_secure_boot_key_digests_t trusted_key_digests = {0};
for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
trusted_key_digests.key_digests[i] = &trusted.key_digests[i];
}
// Key revocation happens in ROM bootloader.
// Do NOT allow key revocation while verifying application
trusted_key_digests.allow_key_revoke = false;
int sb_result = ets_secure_boot_verify_signature(sig_block, image_digest, &trusted_key_digests, verified_digest);
#endif
if (sb_result != SB_SUCCESS) {

View File

@ -38,6 +38,8 @@ if(CONFIG_BT_ENABLED)
"common/osi/buffer.c"
"common/osi/config.c"
"common/osi/fixed_queue.c"
"common/osi/pkt_queue.c"
"common/osi/fixed_pkt_queue.c"
"common/osi/future.c"
"common/osi/hash_functions.c"
"common/osi/hash_map.c"

View File

@ -114,9 +114,9 @@ typedef struct {
} esp_blufi_ap_record_t;
/// Bluetooth address length
#define ESP_BD_ADDR_LEN 6
#define ESP_BLUFI_BD_ADDR_LEN 6
/// Bluetooth device address
typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN];
typedef uint8_t esp_blufi_bd_addr_t[ESP_BLUFI_BD_ADDR_LEN];
/**
* @brief BLUFI callback parameters union
@ -147,7 +147,7 @@ typedef union {
* @brief ESP_BLUFI_EVENT_CONNECT
*/
struct blufi_connect_evt_param {
esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
uint8_t server_if; /*!< server interface */
uint16_t conn_id; /*!< Connection id */
} connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */
@ -156,7 +156,7 @@ typedef union {
* @brief ESP_BLUFI_EVENT_DISCONNECT
*/
struct blufi_disconnect_evt_param {
esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
} disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */
/* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */

View File

@ -62,6 +62,10 @@
#endif /* #if CLASSIC_BT_INCLUDED */
#endif
#if (BLE_INCLUDED == TRUE)
#include "btc_gap_ble.h"
#endif
#if CONFIG_BLE_MESH
#include "btc_ble_mesh_ble.h"
#include "btc_ble_mesh_prov.h"
@ -77,6 +81,9 @@
#define BTC_TASK_STACK_SIZE (BT_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) //by menuconfig
#define BTC_TASK_NAME "BTC_TASK"
#define BTC_TASK_PRIO (BT_TASK_MAX_PRIORITIES - 6)
#define BTC_TASK_WORKQUEUE_NUM (2)
#define BTC_TASK_WORKQUEUE0_LEN (0)
#define BTC_TASK_WORKQUEUE1_LEN (5)
osi_thread_t *btc_thread;
@ -207,16 +214,7 @@ static void btc_thread_handler(void *arg)
static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
{
btc_msg_t *lmsg;
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
if (lmsg == NULL) {
return BT_STATUS_NOMEM;
}
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (osi_thread_post(btc_thread, btc_thread_handler, lmsg, 0, timeout) == false) {
if (osi_thread_post(btc_thread, btc_thread_handler, msg, 0, timeout) == false) {
return BT_STATUS_BUSY;
}
@ -234,30 +232,37 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
{
btc_msg_t lmsg;
btc_msg_t* lmsg;
if (msg == NULL) {
// arg XOR arg_len
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
return BT_STATUS_PARM_INVALID;
}
BTC_TRACE_DEBUG("%s msg %u %u %u %p\n", __func__, msg->sig, msg->pid, msg->act, arg);
memcpy(&lmsg, msg, sizeof(btc_msg_t));
if (arg) {
lmsg.arg = (void *)osi_malloc(arg_len);
if (lmsg.arg == NULL) {
return BT_STATUS_NOMEM;
}
memset(lmsg.arg, 0x00, arg_len); //important, avoid arg which have no length
memcpy(lmsg.arg, arg, arg_len);
if (copy_func) {
copy_func(&lmsg, lmsg.arg, arg);
}
} else {
lmsg.arg = NULL;
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
if (lmsg == NULL) {
return BT_STATUS_NOMEM;
}
return btc_task_post(&lmsg, OSI_THREAD_MAX_TIMEOUT);
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (arg) {
lmsg->arg = (void *)osi_malloc(arg_len);
if (lmsg->arg == NULL) {
osi_free(lmsg);
return BT_STATUS_NOMEM;
}
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
memcpy(lmsg->arg, arg, arg_len);
if (copy_func) {
copy_func(lmsg, lmsg->arg, arg);
}
} else {
lmsg->arg = NULL;
}
return btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
}
@ -410,7 +415,9 @@ error_exit:;
bt_status_t btc_init(void)
{
btc_thread = osi_thread_create(BTC_TASK_NAME, BTC_TASK_STACK_SIZE, BTC_TASK_PRIO, BTC_TASK_PINNED_TO_CORE, 2);
const size_t workqueue_len[] = {BTC_TASK_WORKQUEUE0_LEN, BTC_TASK_WORKQUEUE1_LEN};
btc_thread = osi_thread_create(BTC_TASK_NAME, BTC_TASK_STACK_SIZE, BTC_TASK_PRIO, BTC_TASK_PINNED_TO_CORE,
BTC_TASK_WORKQUEUE_NUM, workqueue_len);
if (btc_thread == NULL) {
return BT_STATUS_NOMEM;
}
@ -423,6 +430,7 @@ bt_status_t btc_init(void)
#if (BLE_INCLUDED == TRUE)
btc_gap_callback_init();
btc_gap_ble_init();
#endif ///BLE_INCLUDED == TRUE
#if SCAN_QUEUE_CONGEST_CHECK
@ -440,7 +448,9 @@ void btc_deinit(void)
osi_thread_free(btc_thread);
btc_thread = NULL;
#if (BLE_INCLUDED == TRUE)
btc_gap_ble_deinit();
#endif ///BLE_INCLUDED == TRUE
#if SCAN_QUEUE_CONGEST_CHECK
btc_adv_list_deinit();
#endif
@ -459,3 +469,8 @@ int get_btc_work_queue_size(void)
{
return osi_thread_queue_wait_size(btc_thread, 0);
}
osi_thread_t *btc_get_current_thread(void)
{
return btc_thread;
}

View File

@ -130,6 +130,13 @@ void btc_deinit(void);
bool btc_check_queue_is_congest(void);
int get_btc_work_queue_size(void);
/**
* get the BTC thread handle
* @return NULL: fail
* others: pointer of osi_thread structure of BTC
*/
osi_thread_t *btc_get_current_thread(void);
#ifdef __cplusplus
}
#endif

View File

@ -295,7 +295,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if,
p_data->conn.reason, p_data->conn.conn_id);
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t));
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.conn_id = p_data->conn.conn_id;
blufi_env.is_connected = true;
blufi_env.recv_seq = blufi_env.send_seq = 0;
@ -303,7 +303,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_CONNECT;
memcpy(param.connect.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t));
memcpy(param.connect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id);
conn_id = param.connect.conn_id;
server_if = p_data->conn.server_if;
@ -320,15 +320,21 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if,
p_data->conn.reason, p_data->conn.conn_id);
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t));
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.conn_id = p_data->conn.conn_id;
blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.sec_mode = 0x0;
blufi_env.offset = 0;
if (blufi_env.aggr_buf != NULL) {
osi_free(blufi_env.aggr_buf);
blufi_env.aggr_buf = NULL;
}
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t));
memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
break;
}

View File

@ -256,7 +256,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
assert(rc == 0);
memcpy(param.connect.remote_bda, desc.peer_id_addr.val, sizeof(esp_bd_addr_t));
memcpy(param.connect.remote_bda, desc.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
param.connect.conn_id = event->connect.conn_handle;
/* save connection handle */
@ -270,17 +270,24 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
return 0;
case BLE_GAP_EVENT_DISCONNECT:
ESP_LOGI(TAG, "disconnect; reason=%d\n", event->disconnect.reason);
memcpy(blufi_env.remote_bda, event->disconnect.conn.peer_id_addr.val, sizeof(esp_bd_addr_t));
memcpy(blufi_env.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.is_connected = false;
blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.sec_mode = 0x0;
blufi_env.offset = 0;
if (blufi_env.aggr_buf != NULL) {
osi_free(blufi_env.aggr_buf);
blufi_env.aggr_buf = NULL;
}
btc_msg_t msg;
esp_blufi_cb_param_t param;
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, sizeof(esp_bd_addr_t));
memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
return 0;

View File

@ -62,6 +62,12 @@
#define BTC_DYNAMIC_MEMORY FALSE
#endif
#if UC_BT_BLUEDROID_MEM_DEBUG
#define HEAP_MEMORY_DEBUG TRUE
#else
#define HEAP_MEMORY_DEBUG FALSE
#endif
#ifndef BT_BLE_DYNAMIC_ENV_MEMORY
#define BT_BLE_DYNAMIC_ENV_MEMORY FALSE
#endif

View File

@ -93,4 +93,11 @@
#define UC_BT_BLUFI_ENABLE FALSE
#endif
//MEMORY DEBUG
#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
#define UC_BT_BLUEDROID_MEM_DEBUG TRUE
#else
#define UC_BT_BLUEDROID_MEM_DEBUG FALSE
#endif
#endif /* __BT_USER_CONFIG_H__ */

View File

@ -143,7 +143,7 @@ static void alarm_cb_handler(struct alarm_t *alarm)
OSI_TRACE_WARNING("%s, invalid state %d\n", __func__, alarm_state);
return;
}
btc_msg_t msg;
btc_msg_t msg = {0};
btc_alarm_args_t arg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_ALARM;
@ -173,7 +173,7 @@ osi_alarm_t *osi_alarm_new(const char *alarm_name, osi_alarm_callback_t callback
goto end;
}
esp_timer_create_args_t tca;
esp_timer_create_args_t tca = {0};
tca.callback = (esp_timer_cb_t)alarm_cb_handler;
tca.arg = timer_id;
tca.dispatch_method = ESP_TIMER_TASK;

View File

@ -550,10 +550,12 @@ static void config_parse(nvs_handle_t fp, config_t *config)
const size_t keyname_bufsz = sizeof(CONFIG_KEY) + 5 + 1; // including log10(sizeof(i))
char *keyname = osi_calloc(keyname_bufsz);
int buf_size = get_config_size_from_flash(fp);
char *buf = osi_calloc(buf_size);
char *buf = NULL;
if(buf_size == 0) { //First use nvs
goto error;
}
buf = osi_calloc(buf_size);
if (!line || !section || !buf || !keyname) {
err_code |= 0x01;
goto error;

View File

@ -0,0 +1,161 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "osi/allocator.h"
#include "osi/pkt_queue.h"
#include "osi/fixed_pkt_queue.h"
#include "osi/osi.h"
#include "osi/semaphore.h"
typedef struct fixed_pkt_queue_t {
struct pkt_queue *pkt_list;
osi_sem_t enqueue_sem;
osi_sem_t dequeue_sem;
size_t capacity;
fixed_pkt_queue_cb dequeue_ready;
} fixed_pkt_queue_t;
fixed_pkt_queue_t *fixed_pkt_queue_new(size_t capacity)
{
fixed_pkt_queue_t *ret = osi_calloc(sizeof(fixed_pkt_queue_t));
if (!ret) {
goto error;
}
ret->capacity = capacity;
ret->pkt_list = pkt_queue_create();
if (!ret->pkt_list) {
goto error;
}
osi_sem_new(&ret->enqueue_sem, capacity, capacity);
if (!ret->enqueue_sem) {
goto error;
}
osi_sem_new(&ret->dequeue_sem, capacity, 0);
if (!ret->dequeue_sem) {
goto error;
}
return ret;
error:
fixed_pkt_queue_free(ret, NULL);
return NULL;
}
void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb)
{
if (queue == NULL) {
return;
}
fixed_pkt_queue_unregister_dequeue(queue);
pkt_queue_destroy(queue->pkt_list, (pkt_queue_free_cb)free_cb);
queue->pkt_list = NULL;
if (queue->enqueue_sem) {
osi_sem_free(&queue->enqueue_sem);
}
if (queue->dequeue_sem) {
osi_sem_free(&queue->dequeue_sem);
}
osi_free(queue);
}
bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue)
{
if (queue == NULL) {
return true;
}
return pkt_queue_is_empty(queue->pkt_list);
}
size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue)
{
if (queue == NULL) {
return 0;
}
return pkt_queue_length(queue->pkt_list);
}
size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue)
{
assert(queue != NULL);
return queue->capacity;
}
bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t timeout)
{
bool ret = false;
assert(queue != NULL);
assert(linked_pkt != NULL);
if (osi_sem_take(&queue->enqueue_sem, timeout) != 0) {
return false;
}
ret = pkt_queue_enqueue(queue->pkt_list, linked_pkt);
assert(ret == true);
osi_sem_give(&queue->dequeue_sem);
return ret;
}
pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout)
{
pkt_linked_item_t *ret = NULL;
assert(queue != NULL);
if (osi_sem_take(&queue->dequeue_sem, timeout) != 0) {
return NULL;
}
ret = pkt_queue_dequeue(queue->pkt_list);
osi_sem_give(&queue->enqueue_sem);
return ret;
}
pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue)
{
if (queue == NULL) {
return NULL;
}
return pkt_queue_try_peek_first(queue->pkt_list);
}
void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb)
{
assert(queue != NULL);
assert(ready_cb != NULL);
queue->dequeue_ready = ready_cb;
}
void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue)
{
assert(queue != NULL);
queue->dequeue_ready = NULL;
}
void fixed_pkt_queue_process(fixed_pkt_queue_t *queue)
{
assert(queue != NULL);
if (queue->dequeue_ready) {
queue->dequeue_ready(queue);
}
}

View File

@ -0,0 +1,79 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _FIXED_PKT_QUEUE_H_
#define _FIXED_PKT_QUEUE_H_
#include "osi/pkt_queue.h"
#include "osi/semaphore.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef FIXED_PKT_QUEUE_SIZE_MAX
#define FIXED_PKT_QUEUE_SIZE_MAX 254
#endif
#define FIXED_PKT_QUEUE_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT
struct fixed_pkt_queue_t;
typedef struct fixed_pkt_queue_t fixed_pkt_queue_t;
typedef void (*fixed_pkt_queue_free_cb)(pkt_linked_item_t *data);
typedef void (*fixed_pkt_queue_cb)(fixed_pkt_queue_t *queue);
// Creates a new fixed queue with the given |capacity|. If more elements than
// |capacity| are added to the queue, the caller is blocked until space is
// made available in the queue. Returns NULL on failure. The caller must free
// the returned queue with |fixed_pkt_queue_free|.
fixed_pkt_queue_t *fixed_pkt_queue_new(size_t capacity);
// Freeing a queue that is currently in use (i.e. has waiters
// blocked on it) results in undefined behaviour.
void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb);
// Returns a value indicating whether the given |queue| is empty. If |queue|
// is NULL, the return value is true.
bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue);
// Returns the length of the |queue|. If |queue| is NULL, the return value
// is 0.
size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue);
// Returns the maximum number of elements this queue may hold. |queue| may
// not be NULL.
size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue);
// Enqueues the given |data| into the |queue|. The caller will be blocked or immediately return or wait for timeout according to the parameter timeout.
// If enqueue failed, it will return false, otherwise return true
bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t timeout);
// Dequeues the next element from |queue|. If the queue is currently empty,
// this function will block the caller until an item is enqueued or immediately return or wait for timeout according to the parameter timeout.
// If dequeue failed, it will return NULL, otherwise return a point.
pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout);
// Returns the first element from |queue|, if present, without dequeuing it.
// This function will never block the caller. Returns NULL if there are no
// elements in the queue or |queue| is NULL.
pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue);
// Registers |queue| with |reactor| for dequeue operations. When there is an element
// in the queue, ready_cb will be called. The |context| parameter is passed, untouched,
// to the callback routine. Neither |queue|, nor |reactor|, nor |read_cb| may be NULL.
// |context| may be NULL.
void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb);
// Unregisters the dequeue ready callback for |queue| from whichever reactor
// it is registered with, if any. This function is idempotent.
void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue);
void fixed_pkt_queue_process(fixed_pkt_queue_t *queue);
#endif

View File

@ -0,0 +1,88 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _PKT_LIST_H_
#define _PKT_LIST_H_
#include "sys/queue.h"
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
struct pkt_queue;
typedef struct pkt_linked_item {
STAILQ_ENTRY(pkt_linked_item) next;
uint8_t data[];
} pkt_linked_item_t;
#define BT_PKT_LINKED_HDR_SIZE (sizeof (pkt_linked_item_t))
typedef void (*pkt_queue_free_cb)(pkt_linked_item_t *item);
/*
* brief: create a pkt_queue instance. pkt_queue is a wrapper class of a FIFO implemented by single linked list.
* The enqueue and dequeue operations of the FIFO are protected against race conditions of multiple tasks
* return: NULL if not enough memory, otherwise a valid pointer
*/
struct pkt_queue *pkt_queue_create(void);
/*
* brief: enqueue one item to the FIFO
* param queue: pkt_queue instance created using pkt_queue_create
* param item: the item to be enqueued to the FIFO
* return: true if enqueued successfully, false when the arguments passed in are invalid
*/
bool pkt_queue_enqueue(struct pkt_queue *queue, pkt_linked_item_t *item);
/*
* brief: dequeue one item for the FIFO
* param queue: pkt_queue instance created using pkt_queue_create
* return: pointer of type pkt_linked_item_t dequeued, NULL if the queue is empty or upon exception
*/
pkt_linked_item_t *pkt_queue_dequeue(struct pkt_queue *queue);
/*
* brief: get the pointer of the first item from the FIFO but not get it dequeued
* param queue: pkt_queue instance created using pkt_queue_create
* return: pointer of the first item in the FIFO, NULL if the FIFO is empty
*/
pkt_linked_item_t *pkt_queue_try_peek_first(struct pkt_queue *queue);
/*
* brief: retrieve the number of items existing in the FIFO
* param queue: pkt_queue instance created using pkt_queue_create
* return: total number of items in the FIFO
*/
size_t pkt_queue_length(const struct pkt_queue *queue);
/*
* brief: retrieve the status whether the FIFO is empty
* param queue: pkt_queue instance created using pkt_queue_create
* return: false if the FIFO is not empty, otherwise true
*/
bool pkt_queue_is_empty(const struct pkt_queue *queue);
/*
* brief: delete the item in the FIFO one by one
* param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default
*/
void pkt_queue_flush(struct pkt_queue *queue, pkt_queue_free_cb free_cb);
/*
* brief: delete the items in the FIFO and then destroy the pkt_queue instance.
* param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default
*/
void pkt_queue_destroy(struct pkt_queue *queue, pkt_queue_free_cb free_cb);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -28,6 +28,7 @@
#define OSI_THREAD_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT
struct osi_thread;
struct osi_event;
typedef struct osi_thread osi_thread_t;
@ -48,7 +49,7 @@ typedef enum {
* param work_queue_num: speicify queue number, the queue[0] has highest priority, and the priority is decrease by index
* return : if create successfully, return thread handler; otherwise return NULL.
*/
osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num);
osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num, const size_t work_queue_len[]);
/*
* brief: Destroy a thread or task
@ -88,4 +89,42 @@ const char *osi_thread_name(osi_thread_t *thread);
*/
int osi_thread_queue_wait_size(osi_thread_t *thread, int wq_idx);
/*
* brief: Create an osi_event struct and register the handler function and its argument
* An osi_event is a kind of work that can be posted to the workqueue of osi_thread to process,
* but the work can have at most one instance the thread workqueue before it is processed. This
* allows the "single post, multiple data processing" jobs.
* param func: the handler to process the job
* param context: the argument to be passed to the handler function when the job is being processed
* return: NULL if no memory, otherwise a valid struct pointer
*/
struct osi_event *osi_event_create(osi_thread_func_t func, void *context);
/*
* brief: Bind an osi_event to a specific work queue for an osi_thread.
* After binding is completed, a function call of API osi_thread_post_event will send a work
* to the workqueue of the thread, with specified queue index.
* param func: event: the pointer to osi_event that is created using osi_event_create
* param thread: the pointer to osi_thread that is created using osi_thread_create
* param queue_idx: the index of the workqueue of the specified osi_thread, with range starting from 0 to work_queue_num - 1
* return: true if osi_event binds to the thread's workqueue successfully, otherwise false
*/
bool osi_event_bind(struct osi_event* event, osi_thread_t *thread, int queue_idx);
/*
* brief: Destroy the osi_event struct created by osi_event_create and free the allocated memory
* param event: the pointer to osi_event
*/
void osi_event_delete(struct osi_event* event);
/*
* brief: try sending a work to the binded thread's workqueue, so that it can be handled by the worker thread
* param event: pointer to osi_event, created by osi_event_create
* param timeout: post timeout, OSI_THREAD_MAX_TIMEOUT means blocking forever, 0 means never blocking, others means block millisecond
* return: true if the message is enqueued to the thread workqueue, otherwise failed
* note: if the return value of function is false, it is the case that the workqueue of the thread is full, and users
* are expected to post the event sometime later to get the work handled.
*/
bool osi_thread_post_event(struct osi_event *event, uint32_t timeout);
#endif /* __THREAD_H__ */

View File

@ -0,0 +1,144 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "osi/pkt_queue.h"
#include "osi/allocator.h"
#include "osi/mutex.h"
STAILQ_HEAD(pkt_queue_header, pkt_linked_item);
struct pkt_queue {
osi_mutex_t lock;
size_t length;
struct pkt_queue_header header;
} pkt_queue_t;
struct pkt_queue *pkt_queue_create(void)
{
struct pkt_queue *queue = calloc(1, sizeof(struct pkt_queue));
if (queue == NULL) {
return NULL;
}
if (osi_mutex_new(&queue->lock) != 0) {
osi_free(queue);
}
struct pkt_queue_header *p = &queue->header;
STAILQ_INIT(p);
return queue;
}
static void pkt_queue_cleanup(struct pkt_queue *queue, pkt_queue_free_cb free_cb)
{
if (queue == NULL) {
return;
}
struct pkt_queue_header *header = &queue->header;
pkt_linked_item_t *item = STAILQ_FIRST(header);
pkt_linked_item_t *tmp;
pkt_queue_free_cb free_func = (free_cb != NULL) ? free_cb : (pkt_queue_free_cb)osi_free_func;
while (item != NULL) {
tmp = STAILQ_NEXT(item, next);
free_func(item);
item = tmp;
queue->length--;
}
STAILQ_INIT(header);
queue->length = 0;
}
void pkt_queue_flush(struct pkt_queue *queue, pkt_queue_free_cb free_cb)
{
if (queue == NULL) {
return;
}
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
pkt_queue_cleanup(queue, free_cb);
osi_mutex_unlock(&queue->lock);
}
void pkt_queue_destroy(struct pkt_queue *queue, pkt_queue_free_cb free_cb)
{
if (queue == NULL) {
return;
}
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
pkt_queue_cleanup(queue, free_cb);
osi_mutex_unlock(&queue->lock);
osi_mutex_free(&queue->lock);
osi_free(queue);
}
pkt_linked_item_t *pkt_queue_dequeue(struct pkt_queue *queue)
{
if (queue == NULL || queue->length == 0) {
return NULL;
}
struct pkt_linked_item *item;
struct pkt_queue_header *header;
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
header = &queue->header;
item = STAILQ_FIRST(header);
if (item != NULL) {
STAILQ_REMOVE_HEAD(header, next);
if (queue->length > 0) {
queue->length--;
}
}
osi_mutex_unlock(&queue->lock);
return item;
}
bool pkt_queue_enqueue(struct pkt_queue *queue, pkt_linked_item_t *item)
{
if (queue == NULL || item == NULL) {
return false;
}
struct pkt_queue_header *header;
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
header = &queue->header;
STAILQ_INSERT_TAIL(header, item, next);
queue->length++;
osi_mutex_unlock(&queue->lock);
return true;
}
size_t pkt_queue_length(const struct pkt_queue *queue)
{
if (queue == NULL) {
return 0;
}
return queue->length;
}
bool pkt_queue_is_empty(const struct pkt_queue *queue)
{
return pkt_queue_length(queue) == 0;
}
pkt_linked_item_t *pkt_queue_try_peek_first(struct pkt_queue *queue)
{
if (queue == NULL) {
return NULL;
}
struct pkt_queue_header *header = &queue->header;
pkt_linked_item_t *item;
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
item = STAILQ_FIRST(header);
osi_mutex_unlock(&queue->lock);
return item;
}

View File

@ -19,16 +19,28 @@
#include <string.h>
#include "osi/allocator.h"
#include "osi/fixed_queue.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "osi/semaphore.h"
#include "osi/thread.h"
#include "osi/mutex.h"
struct work_item {
osi_thread_func_t func;
void *context;
};
struct work_queue {
QueueHandle_t queue;
size_t capacity;
};
struct osi_thread {
void *thread_handle; /*!< Store the thread object */
int thread_id; /*!< May for some OS, such as Linux */
bool stop;
uint8_t work_queue_num; /*!< Work queue number */
fixed_queue_t **work_queues; /*!< Point to queue array, and the priority inverse array index */
struct work_queue **work_queues; /*!< Point to queue array, and the priority inverse array index */
osi_sem_t work_sem;
osi_sem_t stop_sem;
};
@ -39,13 +51,98 @@ struct osi_thread_start_arg {
int error;
};
typedef struct {
osi_thread_func_t func;
void *context;
} work_item_t;
struct osi_event {
struct work_item item;
osi_mutex_t lock;
uint16_t is_queued;
uint16_t queue_idx;
osi_thread_t *thread;
};
static const size_t DEFAULT_WORK_QUEUE_CAPACITY = 100;
static struct work_queue *osi_work_queue_create(size_t capacity)
{
if (capacity == 0) {
return NULL;
}
struct work_queue *wq = (struct work_queue *)osi_malloc(sizeof(struct work_queue));
if (wq != NULL) {
wq->queue = xQueueCreate(capacity, sizeof(struct work_item));
if (wq->queue != 0) {
wq->capacity = capacity;
return wq;
} else {
osi_free(wq);
}
}
return NULL;
}
static void osi_work_queue_delete(struct work_queue *wq)
{
if (wq != NULL) {
if (wq->queue != 0) {
vQueueDelete(wq->queue);
}
wq->queue = 0;
wq->capacity = 0;
osi_free(wq);
}
return;
}
static bool osi_thead_work_queue_get(struct work_queue *wq, struct work_item *item)
{
assert (wq != NULL);
assert (wq->queue != 0);
assert (item != NULL);
if (pdTRUE == xQueueReceive(wq->queue, item, 0)) {
return true;
} else {
return false;
}
}
static bool osi_thead_work_queue_put(struct work_queue *wq, const struct work_item *item, uint32_t timeout)
{
assert (wq != NULL);
assert (wq->queue != 0);
assert (item != NULL);
bool ret = true;
if (timeout == OSI_SEM_MAX_TIMEOUT) {
if (xQueueSend(wq->queue, item, portMAX_DELAY) != pdTRUE) {
ret = false;
}
} else {
if (xQueueSend(wq->queue, item, timeout / portTICK_PERIOD_MS) != pdTRUE) {
ret = false;
}
}
return ret;
}
static size_t osi_thead_work_queue_len(struct work_queue *wq)
{
assert (wq != NULL);
assert (wq->queue != 0);
assert (wq->capacity != 0);
size_t available_spaces = (size_t)uxQueueSpacesAvailable(wq->queue);
if (available_spaces <= wq->capacity) {
return wq->capacity - available_spaces;
} else {
assert (0);
}
return 0;
}
static void osi_thread_run(void *arg)
{
struct osi_thread_start_arg *start = (struct osi_thread_start_arg *)arg;
@ -62,11 +159,10 @@ static void osi_thread_run(void *arg)
break;
}
struct work_item item;
while (!thread->stop && idx < thread->work_queue_num) {
work_item_t *item = fixed_queue_dequeue(thread->work_queues[idx], 0);
if (item) {
item->func(item->context);
osi_free(item);
if (osi_thead_work_queue_get(thread->work_queues[idx], &item) == true) {
item.func(item.context);
idx = 0;
continue;
} else {
@ -107,32 +203,32 @@ static void osi_thread_stop(osi_thread_t *thread)
}
//in linux, the stack_size, priority and core may not be set here, the code will be ignore the arguments
osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num)
osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num, const size_t work_queue_len[])
{
int ret;
osi_thread_t *thread;
struct osi_thread_start_arg start_arg = {0};
if (stack_size <= 0 ||
core < OSI_THREAD_CORE_0 || core > OSI_THREAD_CORE_AFFINITY ||
work_queue_num <= 0) {
work_queue_num <= 0 || work_queue_len == NULL) {
return NULL;
}
thread = (osi_thread_t *)osi_malloc(sizeof(osi_thread_t));
osi_thread_t *thread = (osi_thread_t *)osi_malloc(sizeof(osi_thread_t));
if (thread == NULL) {
goto _err;
}
thread->stop = false;
thread->work_queue_num = work_queue_num;
thread->work_queues = (fixed_queue_t **)osi_malloc(sizeof(fixed_queue_t *) * work_queue_num);
thread->work_queues = (struct work_queue **)osi_malloc(sizeof(struct work_queue *) * work_queue_num);
if (thread->work_queues == NULL) {
goto _err;
}
for (int i = 0; i < thread->work_queue_num; i++) {
thread->work_queues[i] = fixed_queue_new(DEFAULT_WORK_QUEUE_CAPACITY);
size_t queue_len = work_queue_len[i] ? work_queue_len[i] : DEFAULT_WORK_QUEUE_CAPACITY;
thread->work_queues[i] = osi_work_queue_create(queue_len);
if (thread->work_queues[i] == NULL) {
goto _err;
}
@ -176,12 +272,14 @@ _err:
for (int i = 0; i < thread->work_queue_num; i++) {
if (thread->work_queues[i]) {
fixed_queue_free(thread->work_queues[i], osi_free_func);
osi_work_queue_delete(thread->work_queues[i]);
}
thread->work_queues[i] = NULL;
}
if (thread->work_queues) {
osi_free(thread->work_queues);
thread->work_queues = NULL;
}
if (thread->work_sem) {
@ -207,12 +305,14 @@ void osi_thread_free(osi_thread_t *thread)
for (int i = 0; i < thread->work_queue_num; i++) {
if (thread->work_queues[i]) {
fixed_queue_free(thread->work_queues[i], osi_free_func);
osi_work_queue_delete(thread->work_queues[i]);
thread->work_queues[i] = NULL;
}
}
if (thread->work_queues) {
osi_free(thread->work_queues);
thread->work_queues = NULL;
}
if (thread->work_sem) {
@ -236,15 +336,12 @@ bool osi_thread_post(osi_thread_t *thread, osi_thread_func_t func, void *context
return false;
}
work_item_t *item = (work_item_t *)osi_malloc(sizeof(work_item_t));
if (item == NULL) {
return false;
}
item->func = func;
item->context = context;
struct work_item item;
if (fixed_queue_enqueue(thread->work_queues[queue_idx], item, timeout) == false) {
osi_free(item);
item.func = func;
item.context = context;
if (osi_thead_work_queue_put(thread->work_queues[queue_idx], &item, timeout) == false) {
return false;
}
@ -274,5 +371,83 @@ int osi_thread_queue_wait_size(osi_thread_t *thread, int wq_idx)
return -1;
}
return fixed_queue_length(thread->work_queues[wq_idx]);
return (int)(osi_thead_work_queue_len(thread->work_queues[wq_idx]));
}
struct osi_event *osi_event_create(osi_thread_func_t func, void *context)
{
struct osi_event *event = osi_calloc(sizeof(struct osi_event));
if (event != NULL) {
if (osi_mutex_new(&event->lock) == 0) {
event->item.func = func;
event->item.context = context;
return event;
}
osi_free(event);
}
return NULL;
}
void osi_event_delete(struct osi_event* event)
{
if (event != NULL) {
osi_mutex_free(&event->lock);
memset(event, 0, sizeof(struct osi_event));
osi_free(event);
}
}
bool osi_event_bind(struct osi_event* event, osi_thread_t *thread, int queue_idx)
{
if (event == NULL || event->thread != NULL) {
return false;
}
if (thread == NULL || queue_idx >= thread->work_queue_num) {
return false;
}
event->thread = thread;
event->queue_idx = queue_idx;
return true;
}
static void osi_thread_generic_event_handler(void *context)
{
struct osi_event *event = (struct osi_event *)context;
if (event != NULL && event->item.func != NULL) {
osi_mutex_lock(&event->lock, OSI_MUTEX_MAX_TIMEOUT);
event->is_queued = 0;
osi_mutex_unlock(&event->lock);
event->item.func(event->item.context);
}
}
bool osi_thread_post_event(struct osi_event *event, uint32_t timeout)
{
assert(event != NULL && event->thread != NULL);
assert(event->queue_idx >= 0 && event->queue_idx < event->thread->work_queue_num);
bool ret = false;
if (event->is_queued == 0) {
uint16_t acquire_cnt = 0;
osi_mutex_lock(&event->lock, OSI_MUTEX_MAX_TIMEOUT);
event->is_queued += 1;
acquire_cnt = event->is_queued;
osi_mutex_unlock(&event->lock);
if (acquire_cnt == 1) {
ret = osi_thread_post(event->thread, osi_thread_generic_event_handler, event, event->queue_idx, timeout);
if (!ret) {
// clear "is_queued" when post failure, to allow for following event posts
osi_mutex_lock(&event->lock, OSI_MUTEX_MAX_TIMEOUT);
event->is_queued = 0;
osi_mutex_unlock(&event->lock);
}
}
}
return ret;
}

View File

@ -348,7 +348,7 @@ config BTDM_SCAN_DUPL_CACHE_SIZE
int "Maximum number of devices in scan duplicate filter"
depends on BTDM_BLE_SCAN_DUPL
range 10 1000
default 200
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
@ -364,7 +364,7 @@ config BTDM_MESH_DUPL_SCAN_CACHE_SIZE
int "Maximum number of Mesh adv packets in scan duplicate filter"
depends on BTDM_BLE_MESH_SCAN_DUPL_EN
range 10 1000
default 200
default 100
help
Maximum number of adv packets which can be recorded in duplicate scan cache for BLE Mesh.
When the maximum amount of device in the filter is reached, the cache will be refreshed.

View File

@ -35,6 +35,7 @@
#include "soc/dport_reg.h"
#include "esp32/clk.h"
#include "esp_coexist_internal.h"
#include "esp_timer.h"
#if !CONFIG_FREERTOS_UNICORE
#include "esp_ipc.h"
#endif
@ -90,11 +91,6 @@ do{\
#define OSI_VERSION 0x00010003
#define OSI_MAGIC_VALUE 0xFADEBEAD
/* SPIRAM Configuration */
#if CONFIG_SPIRAM_USE_MALLOC
#define BTDM_MAX_QUEUE_NUM (6)
#endif
/* Types definition
************************************************************************
*/
@ -112,14 +108,10 @@ typedef struct {
intptr_t end;
} btdm_dram_available_region_t;
/* PSRAM configuration */
#if CONFIG_SPIRAM_USE_MALLOC
typedef struct {
QueueHandle_t handle;
void *handle;
void *storage;
void *buffer;
} btdm_queue_item_t;
#endif
/* OSI function */
struct osi_funcs_t {
@ -239,6 +231,8 @@ extern uint8_t coex_schm_curr_period_get(void);
extern void * coex_schm_curr_phase_get(void);
extern int coex_wifi_channel_get(uint8_t *primary, uint8_t *secondary);
extern int coex_register_wifi_channel_change_callback(void *cb);
/* Shutdown */
extern void esp_bt_controller_shutdown(void);
extern char _bss_start_btdm;
extern char _bss_end_btdm;
@ -263,11 +257,6 @@ extern uint32_t _btdm_data_end;
/* Local Function Declare
*********************************************************************
*/
#if CONFIG_SPIRAM_USE_MALLOC
static bool btdm_queue_generic_register(const btdm_queue_item_t *queue);
static bool btdm_queue_generic_deregister(btdm_queue_item_t *queue);
#endif /* CONFIG_SPIRAM_USE_MALLOC */
#if CONFIG_BTDM_CTRL_HLI
static xt_handler set_isr_hlevel_wrapper(int n, xt_handler f, void *arg);
static void IRAM_ATTR interrupt_hlevel_disable(void);
@ -447,11 +436,6 @@ SOC_RESERVE_MEMORY_REGION(SOC_MEM_BT_DATA_START, SOC_MEM_BT_DATA_END,
static DRAM_ATTR struct osi_funcs_t *osi_funcs_p;
#if CONFIG_SPIRAM_USE_MALLOC
static DRAM_ATTR btdm_queue_item_t btdm_queue_table[BTDM_MAX_QUEUE_NUM];
static DRAM_ATTR SemaphoreHandle_t btdm_queue_table_mux = NULL;
#endif /* #if CONFIG_SPIRAM_USE_MALLOC */
/* Static variable declare */
// timestamp when PHY/RF was switched on
static DRAM_ATTR int64_t s_time_phy_rf_just_enabled = 0;
@ -503,52 +487,6 @@ static inline void btdm_check_and_init_bb(void)
}
}
#if CONFIG_SPIRAM_USE_MALLOC
static bool btdm_queue_generic_register(const btdm_queue_item_t *queue)
{
if (!btdm_queue_table_mux || !queue) {
return NULL;
}
bool ret = false;
btdm_queue_item_t *item;
xSemaphoreTake(btdm_queue_table_mux, portMAX_DELAY);
for (int i = 0; i < BTDM_MAX_QUEUE_NUM; ++i) {
item = &btdm_queue_table[i];
if (item->handle == NULL) {
memcpy(item, queue, sizeof(btdm_queue_item_t));
ret = true;
break;
}
}
xSemaphoreGive(btdm_queue_table_mux);
return ret;
}
static bool btdm_queue_generic_deregister(btdm_queue_item_t *queue)
{
if (!btdm_queue_table_mux || !queue) {
return false;
}
bool ret = false;
btdm_queue_item_t *item;
xSemaphoreTake(btdm_queue_table_mux, portMAX_DELAY);
for (int i = 0; i < BTDM_MAX_QUEUE_NUM; ++i) {
item = &btdm_queue_table[i];
if (item->handle == queue->handle) {
memcpy(queue, item, sizeof(btdm_queue_item_t));
memset(item, 0, sizeof(btdm_queue_item_t));
ret = true;
break;
}
}
xSemaphoreGive(btdm_queue_table_mux);
return ret;
}
#endif /* CONFIG_SPIRAM_USE_MALLOC */
#if CONFIG_BTDM_CTRL_HLI
struct interrupt_hlevel_cb{
uint32_t status;
@ -621,6 +559,9 @@ static void IRAM_ATTR task_yield_from_isr(void)
static void *semphr_create_wrapper(uint32_t max, uint32_t init)
{
btdm_queue_item_t *semphr = heap_caps_calloc(1, sizeof(btdm_queue_item_t), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL);
assert(semphr);
void *handle = NULL;
#if !CONFIG_SPIRAM_USE_MALLOC
@ -629,112 +570,94 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t init)
StaticQueue_t *queue_buffer = NULL;
queue_buffer = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (!queue_buffer) {
goto error;
}
assert(queue_buffer);
semphr->storage = queue_buffer;
handle = (void *)xSemaphoreCreateCountingStatic(max, init, queue_buffer);
if (!handle) {
goto error;
}
btdm_queue_item_t item = {
.handle = handle,
.storage = NULL,
.buffer = queue_buffer,
};
if (!btdm_queue_generic_register(&item)) {
goto error;
}
#endif
assert(handle);
#if CONFIG_BTDM_CTRL_HLI
SemaphoreHandle_t downstream_semaphore = handle;
assert(downstream_semaphore);
hli_queue_handle_t s_semaphore = hli_semaphore_create(max, downstream_semaphore);
assert(downstream_semaphore);
return s_semaphore;
assert(s_semaphore);
semphr->handle = (void *)s_semaphore;
#else
return handle;
semphr->handle = handle;
#endif /* CONFIG_BTDM_CTRL_HLI */
#if CONFIG_SPIRAM_USE_MALLOC
error:
if (handle) {
vSemaphoreDelete(handle);
}
if (queue_buffer) {
free(queue_buffer);
}
return NULL;
#endif
return semphr;
}
static void semphr_delete_wrapper(void *semphr)
{
if (semphr == NULL) {
return;
}
btdm_queue_item_t *semphr_item = (btdm_queue_item_t *)semphr;
void *handle = NULL;
#if CONFIG_BTDM_CTRL_HLI
if (((hli_queue_handle_t)semphr)->downstream != NULL) {
handle = ((hli_queue_handle_t)semphr)->downstream;
}
hli_queue_delete(semphr);
if (semphr_item->handle) {
handle = ((hli_queue_handle_t)(semphr_item->handle))->downstream;
hli_queue_delete((hli_queue_handle_t)(semphr_item->handle));
}
#else
handle = semphr;
handle = semphr_item->handle;
#endif /* CONFIG_BTDM_CTRL_HLI */
#if !CONFIG_SPIRAM_USE_MALLOC
vSemaphoreDelete(handle);
#else
btdm_queue_item_t item = {
.handle = handle,
.storage = NULL,
.buffer = NULL,
};
if (btdm_queue_generic_deregister(&item)) {
vSemaphoreDelete(item.handle);
free(item.buffer);
if (handle) {
vSemaphoreDelete(handle);
}
#ifdef CONFIG_SPIRAM_USE_MALLOC
if (semphr_item->storage) {
free(semphr_item->storage);
}
#endif
free(semphr);
}
static int32_t IRAM_ATTR semphr_take_from_isr_wrapper(void *semphr, void *hptw)
{
#if CONFIG_BTDM_CTRL_HLI
return (int32_t)xSemaphoreTakeFromISR(((hli_queue_handle_t)semphr)->downstream, hptw);
// Not support it
assert(0);
return 0;
#else
return (int32_t)xSemaphoreTakeFromISR(semphr, hptw);
void *handle = ((btdm_queue_item_t *)semphr)->handle;
return (int32_t)xSemaphoreTakeFromISR(handle, hptw);
#endif /* CONFIG_BTDM_CTRL_HLI */
}
static int32_t IRAM_ATTR semphr_give_from_isr_wrapper(void *semphr, void *hptw)
{
void *handle = ((btdm_queue_item_t *)semphr)->handle;
#if CONFIG_BTDM_CTRL_HLI
UNUSED(hptw);
assert(xPortGetCoreID() == CONFIG_BTDM_CTRL_PINNED_TO_CORE);
return hli_semaphore_give(semphr);
return hli_semaphore_give(handle);
#else
return (int32_t)xSemaphoreGiveFromISR(semphr, hptw);
return (int32_t)xSemaphoreGiveFromISR(handle, hptw);
#endif /* CONFIG_BTDM_CTRL_HLI */
}
static int32_t semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
{
bool ret;
void *handle = ((btdm_queue_item_t *)semphr)->handle;
#if CONFIG_BTDM_CTRL_HLI
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
ret = xSemaphoreTake(((hli_queue_handle_t)semphr)->downstream, portMAX_DELAY);
ret = xSemaphoreTake(((hli_queue_handle_t)handle)->downstream, portMAX_DELAY);
} else {
ret = xSemaphoreTake(((hli_queue_handle_t)semphr)->downstream, block_time_ms / portTICK_PERIOD_MS);
ret = xSemaphoreTake(((hli_queue_handle_t)handle)->downstream, block_time_ms / portTICK_PERIOD_MS);
}
#else
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
ret = xSemaphoreTake(semphr, portMAX_DELAY);
ret = xSemaphoreTake(handle, portMAX_DELAY);
} else {
ret = xSemaphoreTake(semphr, block_time_ms / portTICK_PERIOD_MS);
ret = xSemaphoreTake(handle, block_time_ms / portTICK_PERIOD_MS);
}
#endif /* CONFIG_BTDM_CTRL_HLI */
return (int32_t)ret;
@ -742,72 +665,22 @@ static int32_t semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
static int32_t semphr_give_wrapper(void *semphr)
{
void *handle = ((btdm_queue_item_t *)semphr)->handle;
#if CONFIG_BTDM_CTRL_HLI
return (int32_t)xSemaphoreGive(((hli_queue_handle_t)semphr)->downstream);
return (int32_t)xSemaphoreGive(((hli_queue_handle_t)handle)->downstream);
#else
return (int32_t)xSemaphoreGive(semphr);
return (int32_t)xSemaphoreGive(handle);
#endif /* CONFIG_BTDM_CTRL_HLI */
}
static void *mutex_create_wrapper(void)
{
#if CONFIG_SPIRAM_USE_MALLOC
StaticQueue_t *queue_buffer = NULL;
QueueHandle_t handle = NULL;
queue_buffer = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (!queue_buffer) {
goto error;
}
handle = xSemaphoreCreateMutexStatic(queue_buffer);
if (!handle) {
goto error;
}
btdm_queue_item_t item = {
.handle = handle,
.storage = NULL,
.buffer = queue_buffer,
};
if (!btdm_queue_generic_register(&item)) {
goto error;
}
return handle;
error:
if (handle) {
vSemaphoreDelete(handle);
}
if (queue_buffer) {
free(queue_buffer);
}
return NULL;
#else
return (void *)xSemaphoreCreateMutex();
#endif
}
static void mutex_delete_wrapper(void *mutex)
{
#if !CONFIG_SPIRAM_USE_MALLOC
vSemaphoreDelete(mutex);
#else
btdm_queue_item_t item = {
.handle = mutex,
.storage = NULL,
.buffer = NULL,
};
if (btdm_queue_generic_deregister(&item)) {
vSemaphoreDelete(item.handle);
free(item.buffer);
}
return;
#endif
}
static int32_t mutex_lock_wrapper(void *mutex)
@ -822,109 +695,93 @@ static int32_t mutex_unlock_wrapper(void *mutex)
static void *queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
{
btdm_queue_item_t *queue = NULL;
queue = (btdm_queue_item_t*)heap_caps_malloc(sizeof(btdm_queue_item_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue);
#if CONFIG_SPIRAM_USE_MALLOC
StaticQueue_t *queue_buffer = NULL;
uint8_t *queue_storage = NULL;
QueueHandle_t handle = NULL;
queue_buffer = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (!queue_buffer) {
goto error;
}
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue->storage);
queue_storage = heap_caps_malloc((queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (!queue_storage ) {
goto error;
}
queue->handle = xQueueCreateStatic( queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
assert(queue->handle);
handle = xQueueCreateStatic(queue_len, item_size, queue_storage, queue_buffer);
if (!handle) {
goto error;
}
btdm_queue_item_t item = {
.handle = handle,
.storage = queue_storage,
.buffer = queue_buffer,
};
if (!btdm_queue_generic_register(&item)) {
goto error;
}
return handle;
error:
if (handle) {
vQueueDelete(handle);
}
if (queue_storage) {
free(queue_storage);
}
if (queue_buffer) {
free(queue_buffer);
}
return NULL;
#else
return (void *)xQueueCreate(queue_len, item_size);
queue->handle = xQueueCreate( queue_len, item_size);
assert(queue->handle);
#endif
return queue;
}
static void queue_delete_wrapper(void *queue)
{
#if !CONFIG_SPIRAM_USE_MALLOC
vQueueDelete(queue);
#else
btdm_queue_item_t item = {
.handle = queue,
.storage = NULL,
.buffer = NULL,
};
btdm_queue_item_t *queue_item = (btdm_queue_item_t *)queue;
if (queue_item) {
if(queue_item->handle){
vQueueDelete(queue_item->handle);
}
if (btdm_queue_generic_deregister(&item)) {
vQueueDelete(item.handle);
free(item.storage);
free(item.buffer);
}
return;
#if CONFIG_SPIRAM_USE_MALLOC
if (queue_item->storage) {
free(queue_item->storage);
}
#endif
free(queue_item);
}
}
#if CONFIG_BTDM_CTRL_HLI
static void *queue_create_hlevel_wrapper(uint32_t queue_len, uint32_t item_size)
{
QueueHandle_t downstream_queue = queue_create_wrapper(queue_len, item_size);
assert(downstream_queue);
btdm_queue_item_t *queue_item = queue_create_wrapper(queue_len, item_size);
assert(queue_item);
QueueHandle_t downstream_queue = queue_item->handle;
assert(queue_item->handle);
hli_queue_handle_t queue = hli_queue_create(queue_len, item_size, downstream_queue);
assert(queue);
return queue;
queue_item->handle = queue;
return (void *)queue_item;
}
static void *customer_queue_create_hlevel_wrapper(uint32_t queue_len, uint32_t item_size)
{
QueueHandle_t downstream_queue = queue_create_wrapper(queue_len, item_size);
assert(downstream_queue);
btdm_queue_item_t *queue_item = queue_create_wrapper(queue_len, item_size);
assert(queue_item);
QueueHandle_t downstream_queue = queue_item->handle;
assert(queue_item->handle);
hli_queue_handle_t queue = hli_customer_queue_create(queue_len, item_size, downstream_queue);
assert(queue);
return queue;
queue_item->handle = queue;
return (void *)queue_item;
}
static void queue_delete_hlevel_wrapper(void *queue)
{
if (((hli_queue_handle_t)queue)->downstream != NULL) {
queue_delete_wrapper(((hli_queue_handle_t)queue)->downstream);
if (queue == NULL) {
return;
}
btdm_queue_item_t *queue_item = (btdm_queue_item_t *)queue;
if (queue_item->handle) {
void *handle = ((hli_queue_handle_t)(queue_item->handle))->downstream;
hli_queue_delete(queue_item->handle);
queue_item->handle = handle;
queue_delete_wrapper(queue_item);
}
hli_queue_delete(queue);
}
static int32_t queue_send_hlevel_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
void *handle = ((btdm_queue_item_t *)queue)->handle;
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
return (int32_t)xQueueSend(((hli_queue_handle_t)queue)->downstream, item, portMAX_DELAY);
return (int32_t)xQueueSend(((hli_queue_handle_t)handle)->downstream, item, portMAX_DELAY);
} else {
return (int32_t)xQueueSend(((hli_queue_handle_t)queue)->downstream, item, block_time_ms / portTICK_PERIOD_MS);
return (int32_t)xQueueSend(((hli_queue_handle_t)handle)->downstream, item, block_time_ms / portTICK_PERIOD_MS);
}
}
@ -943,16 +800,18 @@ static int32_t IRAM_ATTR queue_send_from_isr_hlevel_wrapper(void *queue, void *i
{
UNUSED(hptw);
assert(xPortGetCoreID() == CONFIG_BTDM_CTRL_PINNED_TO_CORE);
return hli_queue_put(queue, item);
void *handle = ((btdm_queue_item_t *)queue)->handle;
return hli_queue_put(handle, item);
}
static int32_t queue_recv_hlevel_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
bool ret;
void *handle = ((btdm_queue_item_t *)queue)->handle;
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
ret = xQueueReceive(((hli_queue_handle_t)queue)->downstream, item, portMAX_DELAY);
ret = xQueueReceive(((hli_queue_handle_t)handle)->downstream, item, portMAX_DELAY);
} else {
ret = xQueueReceive(((hli_queue_handle_t)queue)->downstream, item, block_time_ms / portTICK_PERIOD_MS);
ret = xQueueReceive(((hli_queue_handle_t)handle)->downstream, item, block_time_ms / portTICK_PERIOD_MS);
}
return (int32_t)ret;
@ -960,7 +819,9 @@ static int32_t queue_recv_hlevel_wrapper(void *queue, void *item, uint32_t block
static int32_t IRAM_ATTR queue_recv_from_isr_hlevel_wrapper(void *queue, void *item, void *hptw)
{
return (int32_t)xQueueReceiveFromISR(((hli_queue_handle_t)queue)->downstream, item, hptw);
// Not support it
assert(0);
return 0;
}
#else
@ -968,24 +829,24 @@ static int32_t IRAM_ATTR queue_recv_from_isr_hlevel_wrapper(void *queue, void *i
static int32_t queue_send_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
return (int32_t)xQueueSend(queue, item, portMAX_DELAY);
return (int32_t)xQueueSend(((btdm_queue_item_t*)queue)->handle, item, portMAX_DELAY);
} else {
return (int32_t)xQueueSend(queue, item, block_time_ms / portTICK_PERIOD_MS);
return (int32_t)xQueueSend(((btdm_queue_item_t*)queue)->handle, item, block_time_ms / portTICK_PERIOD_MS);
}
}
static int32_t IRAM_ATTR queue_send_from_isr_wrapper(void *queue, void *item, void *hptw)
{
return (int32_t)xQueueSendFromISR(queue, item, hptw);
return (int32_t)xQueueSendFromISR(((btdm_queue_item_t*)queue)->handle, item, hptw);
}
static int32_t queue_recv_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
bool ret;
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
ret = xQueueReceive(queue, item, portMAX_DELAY);
ret = xQueueReceive(((btdm_queue_item_t*)queue)->handle, item, portMAX_DELAY);
} else {
ret = xQueueReceive(queue, item, block_time_ms / portTICK_PERIOD_MS);
ret = xQueueReceive(((btdm_queue_item_t*)queue)->handle, item, block_time_ms / portTICK_PERIOD_MS);
}
return (int32_t)ret;
@ -993,7 +854,7 @@ static int32_t queue_recv_wrapper(void *queue, void *item, uint32_t block_time_m
static int32_t IRAM_ATTR queue_recv_from_isr_wrapper(void *queue, void *item, void *hptw)
{
return (int32_t)xQueueReceiveFromISR(queue, item, hptw);
return (int32_t)xQueueReceiveFromISR(((btdm_queue_item_t*)queue)->handle, item, hptw);
}
#endif /* CONFIG_BTDM_CTRL_HLI */
@ -1611,20 +1472,14 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGI(BTDM_LOG_TAG, "BT controller compile version [%s]", btdm_controller_get_compile_version());
#if CONFIG_SPIRAM_USE_MALLOC
btdm_queue_table_mux = xSemaphoreCreateMutex();
if (btdm_queue_table_mux == NULL) {
return ESP_ERR_NO_MEM;
}
memset(btdm_queue_table, 0, sizeof(btdm_queue_item_t) * BTDM_MAX_QUEUE_NUM);
#endif
s_wakeup_req_sem = semphr_create_wrapper(1, 0);
if (s_wakeup_req_sem == NULL) {
err = ESP_ERR_NO_MEM;
goto error;
}
esp_phy_pd_mem_init();
esp_bt_power_domain_on();
btdm_controller_mem_init();
@ -1758,20 +1613,23 @@ esp_err_t esp_bt_controller_deinit(void)
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
esp_timer_stop(s_btdm_slp_tmr);
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
if (s_btdm_slp_tmr != NULL) {
esp_timer_stop(s_btdm_slp_tmr);
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
s_pm_lock_acquired = false;
#endif
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
#if CONFIG_SPIRAM_USE_MALLOC
vSemaphoreDelete(btdm_queue_table_mux);
btdm_queue_table_mux = NULL;
memset(btdm_queue_table, 0, sizeof(btdm_queue_item_t) * BTDM_MAX_QUEUE_NUM);
#endif
free(osi_funcs_p);
osi_funcs_p = NULL;
@ -1782,18 +1640,28 @@ esp_err_t esp_bt_controller_deinit(void)
esp_bt_power_domain_off();
esp_phy_pd_mem_deinit();
return ESP_OK;
}
static void bt_controller_shutdown(void* arg)
{
esp_bt_controller_shutdown();
}
static void bt_shutdown(void)
{
esp_err_t ret = ESP_OK;
ESP_LOGD(BTDM_LOG_TAG, "stop Bluetooth");
ret = esp_bt_controller_disable();
if (ESP_OK != ret) {
ESP_LOGW(BTDM_LOG_TAG, "controller disable ret=%d", ret);
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return;
}
#if !CONFIG_FREERTOS_UNICORE
esp_ipc_call_blocking(CONFIG_BTDM_CTRL_PINNED_TO_CORE, bt_controller_shutdown, NULL);
#else
bt_controller_shutdown(NULL);
#endif
esp_phy_disable();
return;
}

View File

@ -66,6 +66,13 @@ config BT_CTRL_HW_CCA
help
It enables HW CCA feature in controller
config BT_CTRL_HW_CCA_VAL
int "CCA threshold value"
range 20 60
default 20
help
It is the threshold value of HW CCA, if the value is 30, it means CCA threshold is -30 dBm.
config BT_CTRL_HW_CCA_EFF
int
default 1 if BT_CTRL_HW_CCA
@ -131,8 +138,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
help
Specify default Tx power level
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
bool "-27dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
@ -163,26 +168,28 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
bool "+21dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
int
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 0
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
@ -344,9 +351,9 @@ menu "MODEM SLEEP Options"
bool "Main crystal"
help
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
other bluetooth low power clock sources.
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
than other bluetooth low power clock sources.
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on ESP32C3_RTC_CLK_SRC_EXT_CRYS
@ -361,9 +368,18 @@ menu "MODEM SLEEP Options"
help
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
endchoice
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
bool "power up main XTAL during light sleep"
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
default n
help
If this option is selected, the main crystal will power up during light sleep when the low power clock
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
selects the main crystal.
endmenu
config BT_CTRL_SLEEP_MODE_EFF

View File

@ -37,6 +37,7 @@
#include "esp32c3/rom/rom_layout.h"
#include "esp_timer.h"
#include "esp_sleep.h"
#include "phy.h"
#if CONFIG_BT_ENABLED
@ -70,7 +71,8 @@ typedef union {
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
uint32_t wakeup_timer_required : 1; // whether system timer is needed
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
uint32_t reserved : 26; // reserved
uint32_t main_xtal_pu : 1; // power up main XTAL
uint32_t reserved : 25; // reserved
};
uint32_t val;
} btdm_lpcntl_t;
@ -233,11 +235,13 @@ extern int ble_txpwr_get(int power_type);
extern uint16_t l2c_ble_link_get_tx_buf_num(void);
extern int coex_core_ble_conn_dyn_prio_get(bool *low, bool *high);
extern void coex_pti_v2(void);
extern bool btdm_deep_sleep_mem_init(void);
extern void btdm_deep_sleep_mem_deinit(void);
extern void btdm_ble_power_down_dma_copy(bool copy);
extern uint8_t btdm_sleep_clock_sync(void);
extern void sdk_config_extend_set_pll_track(bool enable);
#if CONFIG_MAC_BB_PD
extern void esp_mac_bb_power_down(void);
@ -902,25 +906,21 @@ void esp_release_wifi_and_coex_mem(void)
ESP_ERROR_CHECK(try_heap_caps_add_region((intptr_t)ets_rom_layout_p->data_start_interface_coexist,(intptr_t)ets_rom_layout_p->bss_end_interface_pp));
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_MAC_BB_PD
static void IRAM_ATTR btdm_mac_bb_power_down_cb(void)
{
if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd == 0) {
#if (CONFIG_MAC_BB_PD)
btdm_ble_power_down_dma_copy(true);
#endif
s_lp_stat.mac_bb_pd = 1;
}
}
static void IRAM_ATTR btdm_mac_bb_power_up_cb(void)
{
#if (CONFIG_MAC_BB_PD)
if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd) {
btdm_ble_power_down_dma_copy(false);
s_lp_stat.mac_bb_pd = 0;
}
#endif
}
#endif
@ -964,9 +964,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// overwrite some parameters
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
sdk_config_extend_set_pll_track(false);
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_init();
#endif
esp_phy_pd_mem_init();
esp_bt_power_domain_on();
btdm_controller_mem_init();
@ -1000,15 +1003,16 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// set default values for global states or resources
s_lp_stat.val = 0;
s_lp_cntl.val = 0;
s_lp_cntl.main_xtal_pu = 0;
s_wakeup_req_sem = NULL;
s_btdm_slp_tmr = NULL;
// configure and initialize resources
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
s_lp_cntl.no_light_sleep = 1;
s_lp_cntl.no_light_sleep = 0;
if (s_lp_cntl.enable) {
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
if (!btdm_deep_sleep_mem_init()) {
err = ESP_ERR_NO_MEM;
goto error;
@ -1048,33 +1052,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// check whether or not EXT_CRYS is working
if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_32K_XTAL) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
s_lp_cntl.no_light_sleep = 0;
} else {
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
"light sleep mode will not be able to apply when bluetooth is enabled");
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
}
#elif (CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL)
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
// check whether or not EXT_CRYS is working
// check whether or not internal 150 kHz RC oscillator is working
if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_RTC) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
} else {
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
assert(0);
}
#else
s_lp_cntl.no_light_sleep = 1;
#endif
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
s_lp_cntl.main_xtal_pu = 1;
#endif
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get() * 2);
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get());
assert(select_src_ret && set_div_ret);
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
@ -1093,6 +1105,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_INVALID_ARG;
goto error;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
@ -1100,6 +1115,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
ESP_LOGW(BTDM_LOG_TAG, "Light sleep mode will not be able to apply when bluetooth is enabled.");
}
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
err = ESP_ERR_NO_MEM;
@ -1115,6 +1131,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif
periph_module_enable(PERIPH_BT_MODULE);
periph_module_reset(PERIPH_BT_MODULE);
esp_phy_enable();
s_lp_stat.phy_enabled = 1;
@ -1123,6 +1140,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
coex_pti_v2();
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
@ -1155,7 +1173,7 @@ error:
s_btdm_slp_tmr = NULL;
}
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
@ -1168,6 +1186,22 @@ error:
s_wakeup_req_sem = NULL;
}
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1201,7 +1235,7 @@ esp_err_t esp_bt_controller_deinit(void)
// deinit low power control resources
do {
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
btdm_deep_sleep_mem_deinit();
#endif
@ -1230,6 +1264,21 @@ esp_err_t esp_bt_controller_deinit(void)
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1237,13 +1286,21 @@ esp_err_t esp_bt_controller_deinit(void)
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
/* Fix the issue caused by the power off the bt power domain.
* This issue is only on ESP32C3.
*/
phy_init_flag();
esp_bt_power_domain_off();
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
#endif
esp_phy_pd_mem_deinit();
free(osi_funcs_p);
osi_funcs_p = NULL;
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}

View File

@ -81,6 +81,13 @@ config BT_CTRL_HW_CCA
help
It enables HW CCA feature in controller
config BT_CTRL_HW_CCA_VAL
int "CCA threshold value"
range 20 60
default 20
help
It is the threshold value of HW CCA, if the value is 30, it means CCA threshold is -30 dBm.
config BT_CTRL_HW_CCA_EFF
int
default 1 if BT_CTRL_HW_CCA
@ -146,8 +153,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
help
Specify default Tx power level
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
bool "-27dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
@ -178,27 +183,29 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+21dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
int
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 0
@ -361,9 +368,9 @@ menu "MODEM SLEEP Options"
bool "Main crystal"
help
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
other bluetooth low power clock sources.
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
than other bluetooth low power clock sources.
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on ESP32S3_RTC_CLK_SRC_EXT_CRYS
@ -378,9 +385,17 @@ menu "MODEM SLEEP Options"
help
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
endchoice
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
bool "power up main XTAL during light sleep"
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
default n
help
If this option is selected, the main crystal will power up during light sleep when the low power clock
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
selects the main crystal.
endmenu
config BT_CTRL_SLEEP_MODE_EFF

View File

@ -70,7 +70,8 @@ typedef union {
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
uint32_t wakeup_timer_required : 1; // whether system timer is needed
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
uint32_t reserved : 26; // reserved
uint32_t main_xtal_pu : 1; // power up main XTAL
uint32_t reserved : 25; // reserved
};
uint32_t val;
} btdm_lpcntl_t;
@ -130,6 +131,11 @@ typedef struct {
intptr_t end;
} btdm_dram_available_region_t;
typedef struct {
void *handle;
void *storage;
} btdm_queue_item_t;
typedef void (* osi_intr_handler)(void);
/* OSI function */
@ -232,11 +238,13 @@ extern int ble_txpwr_get(int power_type);
extern uint16_t l2c_ble_link_get_tx_buf_num(void);
extern int coex_core_ble_conn_dyn_prio_get(bool *low, bool *high);
extern void coex_pti_v2(void);
extern bool btdm_deep_sleep_mem_init(void);
extern void btdm_deep_sleep_mem_deinit(void);
extern void btdm_ble_power_down_dma_copy(bool copy);
extern uint8_t btdm_sleep_clock_sync(void);
extern void sdk_config_extend_set_pll_track(bool enable);
#if CONFIG_MAC_BB_PD
extern void esp_mac_bb_power_down(void);
@ -478,36 +486,64 @@ static void IRAM_ATTR task_yield_from_isr(void)
static void *semphr_create_wrapper(uint32_t max, uint32_t init)
{
return (void *)xSemaphoreCreateCounting(max, init);
btdm_queue_item_t *semphr = heap_caps_calloc(1, sizeof(btdm_queue_item_t), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL);
assert(semphr);
#if !CONFIG_SPIRAM_USE_MALLOC
semphr->handle = (void *)xSemaphoreCreateCounting(max, init);
#else
semphr->storage = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(semphr->storage);
semphr->handle = (void *)xSemaphoreCreateCountingStatic(max, init, semphr->storage);
#endif
assert(semphr->handle);
return semphr;
}
static void semphr_delete_wrapper(void *semphr)
{
vSemaphoreDelete(semphr);
if (semphr == NULL) {
return;
}
btdm_queue_item_t *semphr_item = (btdm_queue_item_t *)semphr;
if (semphr_item->handle) {
vSemaphoreDelete(semphr_item->handle);
}
#ifdef CONFIG_SPIRAM_USE_MALLOC
if (semphr_item->storage) {
free(semphr_item->storage);
}
#endif
free(semphr);
}
static int IRAM_ATTR semphr_take_from_isr_wrapper(void *semphr, void *hptw)
{
return (int)xSemaphoreTakeFromISR(semphr, hptw);
return (int)xSemaphoreTakeFromISR(((btdm_queue_item_t *)semphr)->handle, hptw);
}
static int IRAM_ATTR semphr_give_from_isr_wrapper(void *semphr, void *hptw)
{
return (int)xSemaphoreGiveFromISR(semphr, hptw);
return (int)xSemaphoreGiveFromISR(((btdm_queue_item_t *)semphr)->handle, hptw);
}
static int semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
{
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
return (int)xSemaphoreTake(semphr, portMAX_DELAY);
return (int)xSemaphoreTake(((btdm_queue_item_t *)semphr)->handle, portMAX_DELAY);
} else {
return (int)xSemaphoreTake(semphr, block_time_ms / portTICK_PERIOD_MS);
return (int)xSemaphoreTake(((btdm_queue_item_t *)semphr)->handle, block_time_ms / portTICK_PERIOD_MS);
}
}
static int semphr_give_wrapper(void *semphr)
{
return (int)xSemaphoreGive(semphr);
return (int)xSemaphoreGive(((btdm_queue_item_t *)semphr)->handle);
}
static void *mutex_create_wrapper(void)
@ -532,40 +568,71 @@ static int mutex_unlock_wrapper(void *mutex)
static void *queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
{
return (void *)xQueueCreate(queue_len, item_size);
btdm_queue_item_t *queue = NULL;
queue = (btdm_queue_item_t*)heap_caps_malloc(sizeof(btdm_queue_item_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue);
#if CONFIG_SPIRAM_USE_MALLOC
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue->storage);
queue->handle = xQueueCreateStatic( queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
assert(queue->handle);
#else
queue->handle = xQueueCreate( queue_len, item_size);
assert(queue->handle);
#endif
return queue;
}
static void queue_delete_wrapper(void *queue)
{
vQueueDelete(queue);
btdm_queue_item_t *queue_item = (btdm_queue_item_t *)queue;
if (queue_item) {
if(queue_item->handle){
vQueueDelete(queue_item->handle);
}
#if CONFIG_SPIRAM_USE_MALLOC
if (queue_item->storage) {
free(queue_item->storage);
}
#endif
free(queue_item);
}
}
static int queue_send_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
return (int)xQueueSend(queue, item, portMAX_DELAY);
return (int)xQueueSend(((btdm_queue_item_t*)queue)->handle, item, portMAX_DELAY);
} else {
return (int)xQueueSend(queue, item, block_time_ms / portTICK_PERIOD_MS);
return (int)xQueueSend(((btdm_queue_item_t*)queue)->handle, item, block_time_ms / portTICK_PERIOD_MS);
}
}
static int IRAM_ATTR queue_send_from_isr_wrapper(void *queue, void *item, void *hptw)
{
return (int)xQueueSendFromISR(queue, item, hptw);
return (int)xQueueSendFromISR(((btdm_queue_item_t*)queue)->handle, item, hptw);
}
static int queue_recv_wrapper(void *queue, void *item, uint32_t block_time_ms)
{
if (block_time_ms == OSI_FUNCS_TIME_BLOCKING) {
return (int)xQueueReceive(queue, item, portMAX_DELAY);
return (int)xQueueReceive(((btdm_queue_item_t*)queue)->handle, item, portMAX_DELAY);
} else {
return (int)xQueueReceive(queue, item, block_time_ms / portTICK_PERIOD_MS);
return (int)xQueueReceive(((btdm_queue_item_t*)queue)->handle, item, block_time_ms / portTICK_PERIOD_MS);
}
}
static int IRAM_ATTR queue_recv_from_isr_wrapper(void *queue, void *item, void *hptw)
{
return (int)xQueueReceiveFromISR(queue, item, hptw);
return (int)xQueueReceiveFromISR(((btdm_queue_item_t*)queue)->handle, item, hptw);
}
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id)
@ -870,25 +937,21 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
return ESP_OK;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_MAC_BB_PD
static void IRAM_ATTR btdm_mac_bb_power_down_cb(void)
{
if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd == 0) {
#if (CONFIG_MAC_BB_PD)
btdm_ble_power_down_dma_copy(true);
#endif
s_lp_stat.mac_bb_pd = 1;
}
}
static void IRAM_ATTR btdm_mac_bb_power_up_cb(void)
{
#if (CONFIG_MAC_BB_PD)
if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd) {
btdm_ble_power_down_dma_copy(false);
s_lp_stat.mac_bb_pd = 0;
}
#endif
}
#endif
@ -932,9 +995,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// overwrite some parameters
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
sdk_config_extend_set_pll_track(false);
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_init();
#endif
esp_phy_pd_mem_init();
esp_bt_power_domain_on();
btdm_controller_mem_init();
@ -968,15 +1034,16 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// set default values for global states or resources
s_lp_stat.val = 0;
s_lp_cntl.val = 0;
s_lp_cntl.main_xtal_pu = 0;
s_wakeup_req_sem = NULL;
s_btdm_slp_tmr = NULL;
// configure and initialize resources
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
s_lp_cntl.no_light_sleep = 1;
s_lp_cntl.no_light_sleep = 0;
if (s_lp_cntl.enable) {
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
if (!btdm_deep_sleep_mem_init()) {
err = ESP_ERR_NO_MEM;
goto error;
@ -1016,33 +1083,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// check whether or not EXT_CRYS is working
if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_32K_XTAL) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
s_lp_cntl.no_light_sleep = 0;
} else {
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
"light sleep mode will not be able to apply when bluetooth is enabled");
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
}
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
// check whether or not EXT_CRYS is working
#elif CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL
ESP_LOGI(BT_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW
// check whether or not internal 150 kHz RC oscillator is working
if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_RTC) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
} else {
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
assert(0);
}
#else
s_lp_cntl.no_light_sleep = 1;
#endif
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
s_lp_cntl.main_xtal_pu = 1;
#endif
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get() * 2);
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get());
assert(select_src_ret && set_div_ret);
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
@ -1061,6 +1136,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_INVALID_ARG;
goto error;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
@ -1068,6 +1146,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
ESP_LOGW(BT_LOG_TAG, "light sleep mode will not be able to apply when bluetooth is enabled.");
}
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
err = ESP_ERR_NO_MEM;
@ -1083,6 +1162,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif
periph_module_enable(PERIPH_BT_MODULE);
periph_module_reset(PERIPH_BT_MODULE);
esp_phy_enable();
s_lp_stat.phy_enabled = 1;
@ -1091,6 +1171,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
coex_pti_v2();
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
@ -1123,7 +1204,7 @@ error:
s_btdm_slp_tmr = NULL;
}
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
@ -1136,6 +1217,22 @@ error:
s_wakeup_req_sem = NULL;
}
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1144,8 +1241,6 @@ error:
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
esp_bt_power_domain_off();
if (osi_funcs_p != NULL) {
free(osi_funcs_p);
osi_funcs_p = NULL;
@ -1171,7 +1266,7 @@ esp_err_t esp_bt_controller_deinit(void)
// deinit low power control resources
do {
#if (CONFIG_MAC_BB_PD)
#if CONFIG_MAC_BB_PD
btdm_deep_sleep_mem_deinit();
#endif
@ -1200,17 +1295,39 @@ esp_err_t esp_bt_controller_deinit(void)
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
esp_bt_power_domain_off();
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
#endif
esp_phy_pd_mem_deinit();
free(osi_funcs_p);
osi_funcs_p = NULL;
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}

View File

@ -803,6 +803,13 @@ if BLE_MESH
help
Maximum number of groups to which the LPN can subscribe.
config BLE_MESH_LPN_SUB_ALL_NODES_ADDR
bool "Automatically subscribe all nodes address"
default n
help
Automatically subscribe all nodes address when friendship
established.
endif # BLE_MESH_LOW_POWER
config BLE_MESH_FRIEND
@ -1094,6 +1101,13 @@ if BLE_MESH
lets the state to be changed at any time.
If IV Update test mode is going to be used, this option should be enabled.
config BLE_MESH_DISCARD_OLD_SEQ_AUTH
bool
default y
help
This option is used to decide whether discarding the old SeqAuth when
receiving a segmented message.
menu "BLE Mesh specific test option"
config BLE_MESH_SELF_TEST

View File

@ -1,16 +1,8 @@
// Copyright 2017-2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <string.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <string.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <string.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <string.h>

View File

@ -1,16 +1,8 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <string.h>

Some files were not shown because too many files have changed in this diff Show More