Compare commits

...

2362 Commits

Author SHA1 Message Date
d1503315de versions: Update version to 4.2.5 2023-06-29 10:06:42 +02:00
058fd7396b Merge branch 'bugfix/fix_chip_broken_bug_in_monitor_mode_S2_v4.2' into 'release/v4.2'
pm: fix RTC IO and MEM issues under high temperature(v4.2)

See merge request espressif/esp-idf!24252
2023-06-16 18:22:09 +08:00
e2c08f3a73 pm: fix RTC IO and MEM issues under high temperature(v4.2) 2023-06-16 18:22:09 +08:00
b2c9d3d0f3 Merge branch 'bugfix/call_missing_disconnected_cb_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs(Backport v4.2)

See merge request espressif/esp-idf!24245
2023-06-16 18:18:29 +08:00
985cca4afd Merge branch 'bugfix/fix_wps_with_sae_enabled_ap_v4.2' into 'release/v4.2'
esp_wifi: Fix WPS issue for WPA3+WPA2 mode(v4.2)

See merge request espressif/esp-idf!24158
2023-06-16 11:34:55 +08:00
e532cc81ef esp_wifi: fix some wifi bugs
1. verify if country start channel is valid
2. fix missing disconnected callback and update some log prints
2023-06-14 20:42:14 +08:00
26533e07a3 esp_wifi: Fix WPS issue for WPA3+WPA2 mode 2023-06-09 18:15:54 +05:30
129286d207 Merge branch 'bugfix/fix_some_wifi_bugs_230605_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs(Backport v4.2)

See merge request espressif/esp-idf!24051
2023-06-06 13:50:52 +08:00
e3d9d5df0d esp_wifi: fix some wifi bugs
1. send null data when state change from association to run
2. fix sta auth failed but softAP shows it connected issue
3. mesh: layer2 node will scan all channels when root leave in fixed root network
2023-06-05 20:46:22 +08:00
a9cac7605b Merge branch 'bufix/Backport_some_lwip_bugs_for_4.2_0417' into 'release/v4.2'
lwip: Add security fixes and other features and bufixes to v4.2

See merge request espressif/esp-idf!23238
2023-06-05 17:15:19 +08:00
00096a3433 lwip: Add security fixes and other features and bufixes to v4.2
* Update submodule: git log --oneline 2195f7416fb3136831babf3e96c027a73075bd4f..6bb132e3797d5449a923804c75c57d458920f8ac

Detailed description of the changes:
  - tcp_in/ooseq: Fix incorrect segment trim when FIN moved (espressif/esp-lwip@6bb132e3)
  - api_msg: fix tcp_abort thread safety (2.1.2-esp) (espressif/esp-lwip@53a6e019)
  - lwip:optimization dhcp coarse timer (espressif/esp-lwip@a7abf28e)
  - napt: Fix ip_portmap_add() to keep only one port mapping (espressif/esp-lwip@abab9fef)
  - reduce the DHCP Request timeout (espressif/esp-lwip@6fa02bd3)
  - lwip timer:optimization dhcp fine timer (espressif/esp-lwip@79182163)
  - optimization lwip ip4 reassembly timer (espressif/esp-lwip@17f41c9f)
  - optimization lwip ip6 reassembly timer (espressif/esp-lwip@c943fc5a)
  - optimization lwip dns timer (espressif/esp-lwip@7f5ab42c)
  - napt: Fix clean compilation (espressif/esp-lwip@6132c975)
  - Lwip:add TCP Fin2 timeout configuration (espressif/esp-lwip@15b4400e)
  - napt: Fix IP forwarding when forward netif enable NAPT (espressif/esp-lwip@c950063f)
  - napt/stats: Move some napt counters to stats module (espressif/esp-lwip@475d658a)
  - ip_napt_maint: Fix timestamp overflow handling (espressif/esp-lwip@2e904508)
  - napt: Fixes and improvements (espressif/esp-lwip@fb1f3552)
  - 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)
  - add function for deinit lwip timers (espressif/esp-lwip@2749568f)
  - dhcp: Fix build issue that set ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER to true will build fail (espressif/esp-lwip@d827dbf7)
  - Document that sntp_setservername doesn't copy the string (espressif/esp-lwip@54acdb59)
  - Closes https://github.com/espressif/esp-idf/issues/6786
  - lwip/dhcp: add 60 option for vendor class identify (espressif/esp-lwip@ae7edc2a)
  - Closes https://github.com/espressif/esp-lwip/issues/32
  - dhcp: Restore dhcp_cb on restart after dhcp_release_and_stop() (espressif/esp-lwip@55ea9d9c)
  - Closes https://github.com/espressif/esp-idf/issues/7217
  - napt: Fix disbale IPv6 and enable NAPT will build error (espressif/esp-lwip@74cf7f9f)
  - napt: fix checksum of UDP (espressif/esp-lwip@bb63eed1)
  - sntp: Fix client receive KOD packet that make pool MEMP_SYS_TIMEOUT not be freed (espressif/esp-lwip@1c1642fe)
  - test case: add tcp state and reset test cases. (espressif/esp-lwip@67deb805)
2023-06-05 06:08:45 +00:00
92a03d6241 Merge branch 'bugfix/nvs_softap_pmk_v4.2' into 'release/v4.2'
esp_wifi: fix softap nvs <ssid,password,pmk> not matching issue(v4.2)

See merge request espressif/esp-idf!23818
2023-06-05 12:06:08 +08:00
da80b63f3f Merge branch 'contrib/github_pr_11215_v4.2' into 'release/v4.2'
improve thread safety in esp_timer (GitHub PR) (v4.2)

See merge request espressif/esp-idf!23543
2023-05-29 10:19:41 +08:00
457b71f1a3 improve thread safety in esp_timer
Inadequate locking in the esp_timer component allowed corruption
of the s_timers linked list:

1. timer_armed(timer) returns false
2. another task arms the timer and adds it to s_timers
3. the list is locked
4. the timer is inserted into s_timers again

The last step results in a loop in the s_timers list, which causes
an infinite loop when iterated. This change always locks the
list before checking if the timer is already armed avoiding
the data race.
2023-05-18 15:41:53 +08:00
54a4d20bd2 esp_wifi: fix softap nvs <ssid,password,pmk> not matching issue 2023-05-18 15:40:10 +08:00
fe907a6c39 Merge branch 'bugfix/esp32s2_startup_garbled_output_v4.2' into 'release/v4.2'
esp_system: fix garbled UART output on startup on esp32s2 (v4.2)

See merge request espressif/esp-idf!18752
2023-05-18 13:05:57 +08:00
65331f6ce1 Merge branch 'bugfix/fix_some_ble_bug_v4.2' into 'release/v4.2'
Fixed some BLE bugs (backport v4.2)

See merge request espressif/esp-idf!23701
2023-05-18 10:52:37 +08:00
dc07c9e110 esp_system: fix garbled UART output on startup on esp32s2
Closes https://github.com/espressif/esp-idf/issues/9168
2023-05-18 02:14:31 +00:00
c28f5a5cd2 Merge branch 'bugfix/fix_esp32_bugs_230511_v4.2' into 'release/v4.2'
Fixed some esp32 bugs(backport v4.2)

See merge request espressif/esp-idf!23706
2023-05-17 17:08:44 +08:00
af6dafe01e Merge branch 'bugfix/psram_newlib_time_rom_v4.2' into 'release/v4.2'
rom: fix newlib time ROM functions being regardless of CONFIG_SPIRAM_CACHE_WORKAROUND (v4.2)

See merge request espressif/esp-idf!23392
2023-05-15 18:46:22 +08:00
20de428632 Fixed blufi doc error 2023-05-11 20:29:24 +08:00
b9d062ef16 Fixed BLE disconnection failure on ESP32 2023-05-11 20:26:39 +08:00
zwj
0b8b26ec49 Fixed disconnection due to consecutive CRC errors in first 6 intervals 2023-05-11 20:26:29 +08:00
f563a1e3cc Fixed battery profile wrong condition 2023-05-11 20:25:57 +08:00
747daffc28 bluedroid: fix ble adv data construct for device name 2023-05-11 15:28:39 +08:00
dfe7cffd09 bluedroid: fix ble smp key distribution setting 2023-05-11 15:28:26 +08:00
cb658fefb3 bluedroid: report disconnect event after BLE link closed 2023-05-11 15:28:05 +08:00
6a3bd9e22b rom: fix newlib time ROM functions being regardless of CONFIG_SPIRAM_CACHE_WORKAROUND
On ESP32 ROM functions are not compatible with CONFIG_SPIRAM_CACHE_WORKAROUND.
This were handled correctly in cmake, but not in make.
2023-05-11 07:22:33 +00:00
3d0cfc8cc3 Merge branch 'bugfix/hf_cind_ind_index_v4.2' into 'release/v4.2'
bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator(v4.2)

See merge request espressif/esp-idf!23564
2023-05-09 19:54:52 +08:00
1b459301d6 bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator.
Closes https://github.com/espressif/esp-idf/issues/6486
2023-05-04 14:24:42 +08:00
4a52b7845c Merge branch 'bugfix/bt_diable_enbale_crash_v4.2' into 'release/v4.2'
bt:Fixed esp32 controller bug (v4.2)

See merge request espressif/esp-idf!23176
2023-04-24 11:03:08 +08:00
f97a8a2a2d Merge branch 'bugfix/fix_some_ble_bug_v4.2' into 'release/v4.2'
Fixed some BLE bugs (backport v4.2)

See merge request espressif/esp-idf!23305
2023-04-24 10:46:13 +08:00
zwj
45a3c35d65 Fixed duplicate scan refresh cycle is not accurate after restarting scan on ESP32 2023-04-23 12:21:20 +00:00
873856fdf3 bt: added coex adapter operation to get version of coexist module to ESP32 Bluetooth Controller 2023-04-23 12:21:20 +00:00
37aa555611 bt:Fixed esp32 controller bug
1. Fixed crash after controller disable and re-enable
2. Fixed the crash caused by processing the HCI_Read_Remote_Extented_Features command in the non-connected state
3. Fixed disconnection due to not handling lmp_unsniff_req in LC_WAIT_SNIFF_SUB_RSP state
4. Fixed crash caused by supervision timeout greater than sniff interval

Closes https://github.com/espressif/esp-idf/issues/11164
Closes https://github.com/espressif/esp-idf/issues/10835
2023-04-23 12:21:20 +00:00
93360655cf bluedroid: report status after clearing the BLE white list 2023-04-21 16:01:09 +08:00
b242e0e602 bluedroid: fix GATTC cache address save 2023-04-21 15:58:11 +08:00
1d7317b401 bluedroid: fix adv and scan state conflict 2023-04-21 15:57:58 +08:00
564c4b644d bluedroid: support get bluetooth device name 2023-04-21 15:57:41 +08:00
527a23d63f Merge branch 'bugfix/fix_systimer_stall_issue_in_lightsleep_v4.2' into 'release/v4.2'
esp_wifi: fix failed to sleep after scan, coex: fix wifi connecting interrupted by ble

See merge request espressif/esp-idf!23214
2023-04-17 19:42:47 +08:00
cebf0acaee esp_wifi: fix failed to sleep after scan, coex: fix wifi connecting interrupted by ble 2023-04-14 18:53:13 +08:00
f06c39e9a6 Merge branch 'bugfix/espnow_config_channel_v4.2' into 'release/v4.2'
esp_wifi: fix espnow example add peer fail when config channel(v4.2)

See merge request espressif/esp-idf!23181
2023-04-13 18:08:10 +08:00
d71832b0c3 esp_wifi: fix espnow example add peer fail when config channel
Closes https://github.com/espressif/esp-idf/issues/9592
2023-04-13 10:55:10 +08:00
148f4c62a9 Merge branch 'mesh/bugfix_fix_heap_corrupt_issue_v4.2' into 'release/v4.2'
esp_wifi: fix bugs in wifi mesh (backport v4.2)

See merge request espressif/esp-idf!23131
2023-04-11 17:42:01 +08:00
504e83c856 Update the ESP-NOW frame length in docs 2023-04-10 17:21:59 +08:00
a7ba067c2e wifi_mesh: update mesh doc 2023-04-10 17:21:51 +08:00
a42b845cab esp_wifi:
1. wifi_mesh: fix the heap corrupt issue in MTXON task
2. wifi_mesh: Fix several bugs on mesh network
2023-04-10 17:20:59 +08:00
25e130a833 Merge branch 'bugfix/fix_blufi_frag_pkt_vulnerability_4.2' into 'release/v4.2'
Fixed vulnerability attacks that could cause heap overflow in fragmented Blufi packet processing (back port v4.2)

See merge request espressif/esp-idf!23063
2023-04-06 10:57:19 +08:00
3a7dd3c0de Fixed vulnerability attacks that could cause heap overflow in fragmented Blufi packet processing 2023-04-04 15:42:34 +08:00
9dfbf27857 Merge branch 'bugfix/fix_some_ble_bugs_for_4.2' into 'release/v4.2'
Bluedroid: fix some ble bugs (backport 4.2)

See merge request espressif/esp-idf!22704
2023-03-20 14:02:59 +08:00
8e8ef2b469 Merge branch 'bugfix/close_rf_in_deep_sleep_backport_v4.2' into 'release/v4.2'
deep sleep: further optimize sleep current if RF is enabled (backport v4.2)

See merge request espressif/esp-idf!22735
2023-03-20 14:02:17 +08:00
03ad2abdee Merge branch 'feature/esp32_ulp_allow_8kb_v4.2' into 'release/v4.2'
esp32: allow up to 8 kB of ULP program size (v4.2)

See merge request espressif/esp-idf!22707
2023-03-20 14:00:59 +08:00
b158a891fe deep sleep: close rf to optimize sleep current 2023-03-19 18:37:58 +08:00
0270f9d435 Revert "deep sleep: optimize sleep current in wifi softap mode"
This reverts commit f16e8cb48e.
2023-03-17 12:06:55 +08:00
f558578958 Merge branch 'refactor/nvs_allocatable_objects_v4.2' into 'release/v4.2'
refactor(nvs): custom allocator for all objects allocated in NVS (v4.2)

See merge request espressif/esp-idf!21796
2023-03-14 03:58:03 +08:00
3ccd1ae6e2 esp32: allow up to 8 kB of ULP program size
The remaining 4 kB had been reserved for storing RF calibration and
BT stack state since 4e092be6. However, these features never got
implemented. If we ever need to place RF related data into RTC slow
memory, we can do this by creating a variable with RTC_NOINIT_ATTR
instead.

https://github.com/espressif/esp-idf/issues/6515
2023-03-10 18:08:14 +08:00
c912fcba45 fix ble adv tx power map 2023-03-10 17:15:24 +08:00
c5dc8389ed bluedroid: fix ble rpa generate and update by host 2023-03-10 17:15:24 +08:00
763143a89a fix esp hid crash when auth failed 2023-03-10 17:15:24 +08:00
3705e39db9 refactor(nvs): custom allocator for all objects allocated in NVS 2023-03-04 14:07:10 +00:00
45a488f9e1 Merge branch 'bugfix/twai_listen_only_errata_v4.2' into 'release/v4.2'
twai: Add errata workaround for listen only mode (v4.2)

See merge request espressif/esp-idf!22517
2023-03-01 16:13:31 +08:00
129c4f5b62 Merge branch 'fix/gdbgui_v4.2' into 'release/v4.2'
Tools: gdbgui is not supported on Python 3.11 (v4.2)

See merge request espressif/esp-idf!22549
2023-03-01 16:01:03 +08:00
9e9cbd541b Tools: gdbgui is not supported on Python 3.11
Closes https://github.com/espressif/esp-idf/issues/10116
2023-02-28 16:15:22 +01:00
f3a8a911c0 twai: Add errata workaround for listen only mode
This commit adds a workaround for the TWAI listen only mode errata which is
present on the ESP32, ESP32-S2, ESP32-S3, and ESP32-C3. twai_get_status_info()
has also been updated to account for the fact that TEC/REC are frozen in
listen only mode.

Errata Description:

When the TWAI controller is put into listen only mode, it should not influence
the TWAI bus in any way (i.e., should never send a dominant bit). However,
on the targets listed above, the TWAI controller will send dominant bits in an
error frame (i.e., active error frame), even if the controller is set to listen
only mode.

Workaround:

We can force the TWAI controller into the error passive state on startup (by
setting the REC to >= 128). Since the TEC/REC are frozen in listen only mode,
the TWAI controller will remain error passive and only send recessive bits
(i.e., passive error frames), thus will not influence the TWAI bus.

Closes https://github.com/espressif/esp-idf/issues/9157
2023-02-24 20:38:37 +08:00
ab0ae8733f Merge branch 'bugfix/build_err_with_ssr_enabled_v4.2' into 'release/v4.2'
bt: Fixed build errors when sniff subrating is enabled (v4.2)

See merge request espressif/esp-idf!22353
2023-02-17 13:51:55 +08:00
c25d227280 Fixed build errors when sniff subrating is enabled. 2023-02-16 15:25:41 +08:00
30af2e87f5 Merge branch 'fix/long_assoc_comeback_time_v4.2' into 'release/v4.2'
esp_wifi: reject AP when assoc comeback time given is greater than 5 seconds (Backport v4.2)

See merge request espressif/esp-idf!21814
2023-01-12 13:56:57 +08:00
3bc7626603 esp_wifi: Update wifi libs
Update wifi libs with below changes -
1. reject AP when assoc comeback time given is greater than 5 seconds
2023-01-11 14:39:24 +05:30
034d954cd2 Merge branch 'bugfix/sae_auth_and_pmk_issues_v4.2' into 'release/v4.2'
Fix SAE open auth and PMK issues (Backport v4.2)

See merge request espressif/esp-idf!21921
2023-01-10 22:16:21 +08:00
a858328f3b wpa_supplicant: Set PMK from PMKSA incase of caching 2023-01-09 10:22:15 +05:30
7d70759991 esp_wifi: Fix open auth issue after commit message exchange 2023-01-09 10:22:15 +05:30
8da3f6ec7f Merge branch 'bugfix/fix_softap_beacon_memory_leak_issue_v4.2' into 'release/v4.2'
esp_wifi: fix softap beacon memory leak issue(Backport v4.2)

See merge request espressif/esp-idf!21813
2023-01-06 12:03:53 +08:00
6012cda1fe Merge branch 'bugfix/change_position_of_vendor_model_and_gen_onoff_model_callback_forv4.2' into 'release/v4.2'
ble_mesh:example:change position of vendor model and generic onoff model callback(v4.2)

See merge request espressif/esp-idf!21801
2022-12-30 10:16:43 +08:00
76e254cfb0 ble_mesh:example:change position of vendor model and generic onoff model callback(v4.2) 2022-12-30 10:16:42 +08:00
cb47c3fbc1 Merge branch 'bugfix/backport_wifi_fixes_v4.2' into 'release/v4.2'
backported some wifi fixes (backport v4.2)

See merge request espressif/esp-idf!21812
2022-12-27 23:51:46 +08:00
d6722f1ae1 esp_wifi: fix softap beacon memory leak issue
1. fix softap beacon memory leak issue.
2. fix esp wifi sta get ap info does not return connected ssid issue.
3. update inactive timer when recv ps-poll or success send data.
2022-12-27 19:34:13 +08:00
a519f63740 esp_wifi: Add changes to skip SAE handshake during WPS connection 2022-12-27 15:33:33 +05:30
81a0c6a27d esp_wifi: Flush PMK caching if bss akm has changed 2022-12-27 15:32:46 +05:30
4a5f26d7fc Correct SSID copy length during WPS scan 2022-12-27 15:32:35 +05:30
c135695a18 Merge branch 'bugfix/fix_ble_some_bugs_20221219_v4.2' into 'release/v4.2'
backport some BLE bugs 20221219 (backport v4.2)

See merge request espressif/esp-idf!21720
2022-12-21 12:00:08 +08:00
7c9bdca900 Merge branch 'bugfix/spp_vfs_memory_leak_v4.2' into 'release/v4.2'
Component_bt/fix esp_spp_vfs_register memory leak(v4.2)

See merge request espressif/esp-idf!21717
2022-12-21 11:59:58 +08:00
6617cee1b2 Merge branch 'bugfix/fix_some_ble_bugs_by_cjh_v4.2' into 'release/v4.2'
Fixed some BLE bugs (backport v4.2)

See merge request espressif/esp-idf!21696
2022-12-20 18:56:46 +08:00
zwj
18d0ba010d Update bt lib for ESP32
- Add config to set duplicate scan list refresh period
- overwrite the oldest device infor if the list is full
- Fixed duplicate scan period is not accurate
- Change default TX power to 9 dBm
- Fixed disconnect reason 0x1f (unspecified error)
- Fixed connection timeout due to terminate ind has not been acknowledged
- Fixed some memory was not released after bluetooth controller initialization failed on ESP32
2022-12-20 17:21:21 +08:00
7f371f7864 bt: Fixed repeated register of vfs_id causing memory leaks 2022-12-20 15:13:44 +08:00
1d43c9103c Assert when malloc user_data fail 2022-12-20 15:13:25 +08:00
41d064578f Fixed memory leak when SPP initialization failed 2022-12-20 15:12:48 +08:00
2fd6fa2773 bluedroid: fix ble connection update with same params 2022-12-19 20:05:50 +08:00
4ea33bbdba examples: fix ble hid led output report 2022-12-19 20:05:50 +08:00
310be0d052 bluedroid: fix encrypt keysize of GATT characteristic permission 2022-12-19 20:05:50 +08:00
b24bc2482b bluedroid: correct the length of att read by type pdu 2022-12-19 20:05:50 +08:00
79f74f8f76 Merge branch 'bugfix/change_the_level_of_nimble_log_forv4.2' into 'release/v4.2'
ble_mesh:example:change the level of nimble host log(v4.2)

See merge request espressif/esp-idf!21631
2022-12-16 14:13:11 +08:00
41ed43cc51 ble_mesh:example:change the level of nimble host log 2022-12-15 18:07:44 +08:00
698aae95cf Merge branch 'contrib/github_pr_9529_v4.2' into 'release/v4.2'
component_bt: Fixed memory leak due to not freeing memory if posting a message to a thread fails(v4.2)

See merge request espressif/esp-idf!21474
2022-12-13 13:56:24 +08:00
083483effc Merge branch 'bugfix/fix_slave_gpio_cs_mixed_with_iomux_bus_v4.2' into 'release/v4.2'
spi_slave: fix slave can't use iomux bus mixed with gpio cs_pin (v4.2)

See merge request espressif/esp-idf!21379
2022-12-12 15:50:41 +08:00
24de51437b Merge branch 'bugfix/correct_the_default_SR_mode_v4.2' into 'release/v4.2'
bugfix/correct the SR_mode selection when konw nothing about Peripheral's SR_mode (v4.2)

See merge request espressif/esp-idf!21522
2022-12-12 14:57:37 +08:00
e5e225adaa bt: Fixed incorrect parameters in switching to BTC context 2022-12-09 16:27:36 +08:00
b5a959f11d bt:Modify the member variable *arg in struct btc_msg to arg[0] 2022-12-09 16:27:36 +08:00
bd9fddf174 correct the SR_mode selection when konw nothing about Peripheral 2022-12-09 10:39:59 +08:00
0b0f2eeb01 bt: Fixed memory leak due to not freeing memory if posting a message to a thread fails 2022-12-08 18:47:31 +08:00
ff4d3224aa Merge branch 'bugfix/Fix_exceptional_list_params_check_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix exceptional list parameters check issue(v4.2)

See merge request espressif/esp-idf!21444
2022-12-06 20:40:45 +08:00
c281ef1f43 ble_mesh: stack: Fix exceptional list parameters check issue 2022-12-05 20:35:54 +08:00
8c6057db9d Merge branch 'bugfix/unprot_sa_query_issue_v4.2' into 'release/v4.2'
Fix unprotected SA Query issue (Backport v4.2)

See merge request espressif/esp-idf!21316
2022-12-05 10:59:10 +08:00
e08bbd311f spi_slave: fix slave can't use iomux bus mixed with gpio cs_pin 2022-12-01 20:36:14 +08:00
9ff6e4492e Merge branch 'bufix/a2dp_fail_connect_again_after_disconnect_v4.2' into 'release/v4.2'
component_bt: Fixed a2dp failing to connect again after disconnect(v4.2)

See merge request espressif/esp-idf!21345
2022-12-01 10:30:30 +08:00
b924092320 esp_wifi: Update wifi libs
Fix unprotected SA Query issue
2022-11-30 17:39:55 +05:30
1e09841bd1 bt: Fixed a2dp failing to connect again after disconnect 2022-11-30 19:19:18 +08:00
e6c736b1d7 Merge branch 'bugfix/security_params_overwrite_v4.2' into 'release/v4.2'
Add changes to prevent security params overwritten in full scan (backport v4.2)

See merge request espressif/esp-idf!21290
2022-11-30 14:35:34 +08:00
49e15e942c Merge branch 'bugfix/fix_hfp_clcc_parser_bug_4.2' into 'release/v4.2'
Bugfix/Fix HFP client parse CLCC command response bug[backport 4.2]

See merge request espressif/esp-idf!21160
2022-11-30 10:59:47 +08:00
1bdb0a14fd Add changes to prevent security params overwritten in full scan (backport v4.2) 2022-11-28 11:14:15 +05:30
4c8e97304a Merge branch 'bugfix/fix_iram_end_redefined_backportv4.2' into 'release/v4.2'
bugfix:  fix redefined _iram_end (backport v4.2)

See merge request espressif/esp-idf!21153
2022-11-28 10:19:48 +08:00
f730580a2d Merge branch 'bugfix/fix_softap_not_send_null_data_issue_v4.2' into 'release/v4.2'
esp_wifi: fix some softap issues(Backport v4.2)

See merge request espressif/esp-idf!21218
2022-11-25 11:16:28 +08:00
bdcc61ce3f esp_wifi: fix some softap issues 2022-11-24 11:20:15 +08:00
78cebd6c0b Merge branch 'bugfix/fixed_HIDH_connection_failure_v4.2' into 'release/v4.2'
bugfix/fixed connection failure and build errors of HID host (v4.2)

See merge request espressif/esp-idf!21208
2022-11-24 11:05:33 +08:00
0f3c7470d7 1. changed pin_type of Legacy Paring from FIXED to VARIABLE to avoid authentication failure
2. provide compatibilities with devices that do not support Secure Simple Paring

Closes https://github.com/espressif/esp-idf/issues/10069
Closes https://github.com/espressif/esp-idf/issues/10005
2022-11-23 21:05:13 +08:00
f161c867c7 fixed build errors with Secure Simple Paring disabled 2022-11-23 21:04:19 +08:00
1fa4e7dd9c fix HFP client parse CLCC command response bug 2022-11-23 03:10:36 +00:00
633e3ae00b Merge branch 'bugfix/wpa_enterprise_reauth_v4.2' into 'release/v4.2'
esp_wifi: Fix WiFi Enterprise Reauthentication issue (v4.2)

See merge request espressif/esp-idf!21074
2022-11-23 10:42:17 +08:00
28d791fac5 esp_wifi: Fix WiFi Enterprise Reauthentication issue (v4.2) 2022-11-23 10:42:17 +08:00
2d6395ffd2 Merge branch 'bugfix/change_log_print_forv4.2' into 'release/v4.2'
ble_mesh:example:Add command to test the function of duplicate exceptional list(v4.2)

See merge request espressif/esp-idf!21123
2022-11-23 10:25:56 +08:00
918151a983 ble_mesh:example:Add command to test the function of duplicate exceptional list(v4.2) 2022-11-23 10:25:56 +08:00
2455a073d6 Merge branch 'bugfix/fixing_memory_leak_wps_scan_v4.2' into 'release/v4.2'
(wpa_supplicant) : Fixed a memory leak issue created when parsing scan results

See merge request espressif/esp-idf!20989
2022-11-22 10:34:13 +08:00
423dec275b Merge branch 'fix/bitstring_4_v4.2' into 'release/v4.2'
Tools: Use bitstring package compatible with supported Python versions (v4.2)

See merge request espressif/esp-idf!21181
2022-11-22 03:48:51 +08:00
460ebc115d Tools: Use bitstring package compatible with supported Python versions
Bitstring>=4 supports Python 3.7+ only. See:
https://github.com/scott-griffiths/bitstring/releases/tag/bitstring-4.0.1
2022-11-21 15:15:25 +01:00
831a97a3db (wpa_supplicant) : Fixed a memory leak issue created when parsing scan results 2022-11-21 18:04:32 +05:30
e973d46045 bugfix: fix redefined _iram_end 2022-11-18 19:49:16 +08:00
30eff41e9d Merge branch 'feature/remove_psram_cs_clk_pin_settings_config_s2_s3_v4.2' into 'release/v4.2'
psram: remove CS/CLK pin settings in kconfig on ESP32S2 (v4.2)

See merge request espressif/esp-idf!21049
2022-11-14 18:07:25 +08:00
8fcfcdda77 Merge branch 'bugfix/a2dp_can_not_connect_after_ble_connected_v4.2' into 'release/v4.2'
fixed the issue iOS devices cannot initiate connection (v4.2)

See merge request espressif/esp-idf!21060
2022-11-14 15:28:05 +08:00
e974410092 fixed the issue iOS devices cannot initiate connection
to ESP32 while there is a BLE connection to this ESP32

Closes https://github.com/espressif/esp-idf/issues/6557
2022-11-14 09:51:02 +08:00
0121b27a37 psram: remove CS/CLK pin settings in kconfig on ESP32S2 2022-11-11 18:20:06 +08:00
8c6e7089f5 Merge branch 'bugfix/fix_trans_optional_info_using_group_addr_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix can't trans optional info to group address(v4.2)

See merge request espressif/esp-idf!20961
2022-11-11 16:46:12 +08:00
1cf785d3f5 ble_mesh: stack: Fix can't trans optional info to group address 2022-11-07 15:52:15 +08:00
a0281fc4c7 Merge branch 'bugfix/eapol_drop_issue_v4.2' into 'release/v4.2'
esp_wifi: Clear old keys before going for new connection

See merge request espressif/esp-idf!20903
2022-11-04 14:15:05 +08:00
74b82595e3 esp_wifi: Clear old keys before going for new connection 2022-11-02 14:31:02 +05:30
cb65890aaf Merge branch 'bugfix/fix_sta_scan_when_already_connected_v4.2' into 'release/v4.2'
esp-wifi: Restores station status to connected when no other AP is found for roam

See merge request espressif/esp-idf!20387
2022-11-01 11:02:49 +08:00
7db88d56c9 Merge branch 'bugfix/use_nonblocking_coex_callback_v4.2' into 'release/v4.2'
bluetooth: use non-blocking coexistence callback functions so that Wi-Fi task is not blocked by Bluetooth(backport v4.2)

See merge request espressif/esp-idf!20811
2022-11-01 10:48:57 +08:00
91ac2dc121 Merge branch 'bugfix/fix_esp32_psram_cs_hold_time_issue_when_under_80m_v4.2' into 'release/v4.2'
esp_psram: fix esp32 psram cs hold time issue when under 40m (v4.2)

See merge request espressif/esp-idf!19650
2022-11-01 10:19:13 +08:00
fe1677e311 Merge branch 'bugfix/spi2_add_device_cs_more_than_3_v4.2' into 'release/v4.2'
spi_master:fix error when use `spi_bus_add_device` more than 3 device(v4.2)

See merge request espressif/esp-idf!20141
2022-11-01 10:17:12 +08:00
76bb98355d Merge branch 'bugfix/esp_spp_write_len_0_v4.2' into 'release/v4.2'
bt: Fixed esp_spp_write() crash when len is 0 (v4.2)

See merge request espressif/esp-idf!20708
2022-10-31 19:51:15 +08:00
934f99710b Merge branch 'bugfix/fix_uart_fake_tx_done_v4.2' into 'release/v4.2'
uart: Fix unwanted processing of TX_DONE interrupt immediately after calling uart_wait_tx_done() (backport v4.2)

See merge request espressif/esp-idf!20315
2022-10-31 16:16:46 +08:00
fe16a6fcf0 Merge branch 'bugfix/handle_issue_of_malloc_fail_v4.2' into 'release/v4.2'
bugfix/avoid unexpected free when malloc failed (v4.2)

See merge request espressif/esp-idf!20725
2022-10-31 10:47:42 +08:00
713d058c61 Merge branch 'bugfix/ble_mesh_console_memory_leak_test_forv4.2' into 'release/v4.2'
ble_mesh:example:fix memory leak(v4.2)

See merge request espressif/esp-idf!20040
2022-10-28 16:12:47 +08:00
9d50c47e10 Merge branch 'bugfix/fix_mdns_example_v4.2' into 'release/v4.2'
mDNS: Fix example test in CI using retries (v4.2)

See merge request espressif/esp-idf!19450
2022-10-27 16:36:38 +08:00
a2bbe0918f esp-wifi: Restores station status to connected when no other AP is found for roam 2022-10-27 10:57:56 +05:30
e4d21b2781 bt: use non-blocking coexistence callback functions so that Wi-Fi task is not blocked by Bluetooth on ESP32 2022-10-26 19:04:06 +08:00
c528942f0d bt: Fixed SPP VFS mode not being able to send data 2022-10-26 16:46:11 +08:00
404d2be6f2 bt: Fixed esp_spp_write() crash when len is 0
Closes https://github.com/espressif/esp-idf/issues/9977
2022-10-26 16:45:50 +08:00
321481b459 mDNS: Fix example test in CI using retries 2022-10-26 06:06:14 +00:00
d33ce3ce52 Merge branch 'bugfix/fix_esp32_some_bugs_v4.2' into 'release/v4.2'
Fixed BLE ASSERT_PARAM(32 0) in rwble.c at line 384 on ESP32(backport v4.2)

See merge request espressif/esp-idf!20762
2022-10-26 10:56:12 +08:00
39f3ab13ce Merge branch 'bugfix/update_ctrl_init_config_macro_v4.2' into 'release/v4.2'
Bugfix/update ctrl init config macro (v4.2)

See merge request espressif/esp-idf!20714
2022-10-25 17:41:42 +08:00
78fd81c0d3 Fixed ESP32 BLE assert(32 0) 2022-10-25 17:33:17 +08:00
zwj
a2dfa5c86b allow bluedroid host to report adv_ind separately 2022-10-25 17:33:17 +08:00
45a2695b87 Merge branch 'bugfix/build_wifi_lib_with_Os_v4.2' into 'release/v4.2'
esp_wifi: build wifi lib with -Os optimization (Backport v4.2)

See merge request espressif/esp-idf!20751
2022-10-25 16:50:25 +08:00
9de1ce057a ble_mesh:example:fix memory leak 2022-10-25 03:48:30 +00:00
0021c6d14f Merge branch 'bugfix/remove_get_modle_and_get_comp_api_forv4.2' into 'release/v4.2'
ble_mesh:example:change the method of get model(for v4.2)

See merge request espressif/esp-idf!20395
2022-10-24 19:42:55 +08:00
f32a3ad5b0 esp_wifi: build wifi lib with -Os optimization
Closes WIFI-4710
2022-10-24 15:24:06 +08:00
509e708a96 Merge branch 'bugfix/fix_some_wifi_bugs_1019_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs(Backport v4.2)

See merge request espressif/esp-idf!20729
2022-10-24 12:25:27 +08:00
1a31c85f89 Merge branch 'ci/force_based_on_commit_v4.2' into 'release/v4.2'
ci: support one pipeline must based on commmits (v4.2)

See merge request espressif/esp-idf!17924
2022-10-24 08:57:30 +08:00
329d978c89 docs: update wifi country code docs. 2022-10-21 21:01:11 +08:00
73912c07ce esp_wifi: fix fail to scan after recv disassoc/deauth for esp32s2 2022-10-21 19:59:27 +08:00
234a45b2b3 esp_wifi: fix some wifi bugs:
1. fix sta reset beacon timeout timer issue
2. fix pairwise cipher tkip pmf compability issue
3. fix country policy issue
4. fix deinit return wrong status issue
5. fix get wrong channel value use esp_wifi_get_config
6. fix bug of missing unlock when wifi stop
7. fix error of esp_wifi_start_scan in api esp_wifi_connect
8. fix fail to scan after recv disassoc/deauth for esp32s2
2022-10-21 19:59:09 +08:00
04bf991178 Merge branch 'bugfix/fix_legacy_pair_not_send_link_key_host_v4.2' into 'release/v4.2'
component_bt: fix legacy pair controller does not send the link key to the host (v4.2)

See merge request espressif/esp-idf!19322
2022-10-21 16:06:58 +08:00
b37b8f163b [bt] fix if allocation fails
If osi_malloc fails for work_queues or osi_work_queue_create fails, osi_work_queue_delete in _err may release unallocated memory.
2022-10-21 14:57:19 +08:00
bb2f66843c Corrects header names in string from "bt.h" to "esp_bt.h". 2022-10-21 13:14:38 +08:00
f4ee9a97dc ci: support one pipeline must based on commmits 2022-10-20 12:42:23 +00:00
eb8316394c Merge branch 'bugfix/revert_commit_da44fc9c_v4.2' into 'release/v4.2'
Revert "fixed the issue iOS devices cannot initiate connection" (v4.2)

See merge request espressif/esp-idf!20668
2022-10-20 19:18:54 +08:00
2a3ab6accf fix legacy pair controller does not send the link key to the host
Closes https://github.com/espressif/esp-idf/issues/5850
2022-10-20 11:07:24 +00:00
f17dce2c3b Merge branch 'feature/Add_IVI_recovery_option_v4.2' into 'release/v4.2'
ble_mesh: stack: Add IV index recovery option when device missed the whole IV update(v4.2)

See merge request espressif/esp-idf!20644
2022-10-20 16:42:51 +08:00
25e80452ab Merge branch 'bugfix/fix_fast_interval_prov_adv_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix send fast interval prov_adv failed(v4.2)

See merge request espressif/esp-idf!20638
2022-10-20 16:41:58 +08:00
5158f347cd Merge branch 'bugfix/fix_connect_fail_when_enable_SPIRAM_v4.2' into 'release/v4.2'
esp_wifi: fix connect fail when enable SPIRAM and ESPNOW send (backport v4.2)

See merge request espressif/esp-idf!20606
2022-10-20 12:02:48 +08:00
e28977a884 esp_wifi:
1. fix connect fail when enable SPIRAM and ESPNOW send
2. refactor WiFi ioctl function
2022-10-19 10:20:26 +08:00
15f49d5848 Revert "fixed the issue iOS devices cannot initiate connection"
This reverts commit da44fc9cbe.
2022-10-18 19:45:49 +08:00
b8e47cc6a9 Merge branch 'contrib/github_pr_9529_mr_v4.2' into 'release/v4.2'
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.2)

See merge request espressif/esp-idf!19694
2022-10-18 16:10:25 +08:00
7162617e65 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-10-18 06:15:46 +00:00
2b70fe2531 update code to use osi_free() 2022-10-18 06:15:46 +00:00
59e36c445d 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-10-18 06:15:46 +00:00
f56c9da3d7 ble_mesh: stack: Add IV index recovery option when device missed the whole IV update 2022-10-17 16:54:47 +08:00
b467ab61a1 ble_mesh: stack: Fix send fast interval prov_adv failed when PB-ADV and PB-GATT enable simultaneously 2022-10-17 16:40:38 +08:00
b89f55d74a Merge branch 'fix/virtualenv_dir_v4.2' into 'release/v4.2'
Tools: Keep making virtual environments with python in the bin directory (v4.2)

See merge request espressif/esp-idf!20621
2022-10-17 01:04:41 +08:00
158df60dce Tools: Keep making virtual environments with python in the bin directory
On Ubuntu 22.04 virtualenv with the latest setuptools produces
environments with Python in "local/bin" instead of "bin" (see
https://github.com/pypa/virtualenv/issues/2350).

Closes https://github.com/espressif/esp-idf/issues/9931
2022-10-14 15:37:46 +02:00
6e42e604b2 Merge branch 'bugfix/fix_rtc8m_calibration_fail_after_cpu_core_reset_v4.2' into 'release/v4.2'
rtc_clk: Fix rtc8m calibration failure after cpu/core reset (backport v4.2)

See merge request espressif/esp-idf!20555
2022-10-14 14:06:52 +08:00
3b5ce456e2 rtc_clk: Fix rtc8m calibration failure after cpu/core reset
Explicitly guarantee 8md256 clk is enabled before calibration
2022-10-12 12:44:48 +08:00
2900d0da2e Merge branch 'bugfix/i2c_timeout_issue_v4.2' into 'release/v4.2'
I2C: patch for solving watchdog timeout issue(backport v4.2)

See merge request espressif/esp-idf!18135
2022-10-11 15:21:49 +08:00
2451047a7b Merge branch 'feat/spi_flash_qio_test_v4.2' into 'release/v4.2'
spi_flash: add unit tests for qio mode (v4.2)

See merge request espressif/esp-idf!17696
2022-10-10 18:22:49 +08:00
db75db5509 Merge branch 'bugfix/remove_bt_dft_init_semicolon_v4.2' into 'release/v4.2'
bt: Remove trailing semicolon from bt dft initializer(v4.2)

See merge request espressif/esp-idf!19917
2022-10-10 17:32:57 +08:00
9c5127d0e4 Merge branch 'feature/sink_support_mono_v4.2' into 'release/v4.2'
bt: Fixed sink not being able to output mono audio because it can only decode dual channel audio data(v4.2)

See merge request espressif/esp-idf!20080
2022-10-10 17:32:35 +08:00
82890eee6c Merge branch 'bugfix/a2dp_can_not_connect_after_ble_connected_v4.2' into 'release/v4.2'
fixed the issue iOS devices cannot initiate connection (v4.2)

See merge request espressif/esp-idf!20406
2022-10-10 17:25:25 +08:00
9a59ed4b7a I2C: patch for solving watchdog timeout issue 2022-10-10 11:05:25 +08:00
bd4b68167d Merge branch 'bugfix/fix_ble_get_cur_pkt_num_crash_sometimes_when_bluetooth_is_disconnecting_v4.2' into 'release/v4.2'
Fixed calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting(backport v4.2)

See merge request espressif/esp-idf!20379
2022-10-08 16:35:45 +08:00
e5f6cd9cc5 Merge branch 'feat/essl_extra_component_v4.2' into 'release/v4.2'
sdio/example: fixed the essl return value issue (v4.2)

See merge request espressif/esp-idf!20347
2022-10-08 14:07:19 +08:00
05830cb46d Merge branch 'bugfix/missing_idfSelectedId_v4.2' into 'release/v4.2'
Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' (v4.2)

See merge request espressif/esp-idf!20382
2022-09-29 01:31:01 +08:00
5976dcc006 Merge branch 'bugfix/fix_send_eapol_key_request_frame_when_wpa_group_handshake_issue_v4.2' into 'release/v4.2'
wpa_supplicant: try install gtk before send group key handshake message 2(Backport v4.2)

See merge request espressif/esp-idf!20199
2022-09-28 17:50:35 +08:00
396dc28ca9 fixed the issue iOS devices cannot initiate connection
to ESP32 while there is a BLE connection to this ESP32

Closes https://github.com/espressif/esp-idf/issues/6557
2022-09-28 16:16:05 +08:00
8f01785e2f ble_mesh:example:change the method of get model 2022-09-28 15:34:08 +08:00
91874c837c Merge branch 'bugfix/hfp_examples_not_work_with_default_sdkconfig_v4.2' into 'release/v4.2'
bugfix/set default number of sco connection to 1 (v4.2)

See merge request espressif/esp-idf!19589
2022-09-28 15:28:01 +08:00
ec05def4cd Merge branch 'bugfix/ble_mesh_console_support_nimble_host_for_v4.2' into 'release/v4.2'
ble_mesh:ble mesh console support nimble(v4.2)

See merge request espressif/esp-idf!19606
2022-09-28 12:32:31 +08:00
77569c24b9 Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId'
Closes https://github.com/espressif/esp-idf/issues/9837
2022-09-27 22:42:10 +02:00
1659c3460a fix on data len change cmd malfunction 2022-09-27 21:47:39 +08:00
9d9b08ff10 fix err using rpa for confirmation calculation 2022-09-27 21:47:25 +08:00
zwj
4c3a48edea fix calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting 2022-09-27 21:46:57 +08:00
cff557ce07 sdio/example: fixed the essl return type issue 2022-09-26 19:42:24 +08:00
0b92a1b40d Merge branch 'fix/ci_macos_idf_env_json_v4.2' into 'release/v4.2'
CI: Clean-up idf-env.json which might not be compatible with newer versions (v4.2)

See merge request espressif/esp-idf!20322
2022-09-23 21:47:12 +08:00
b3a80b4229 CI: Clean-up idf-env.json which might not compatible with newer versions 2022-09-23 12:26:23 +02:00
0f051a5e3b 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 239e56541c
2022-09-23 16:24:30 +08:00
e81c5be7d8 Merge branch 'ci/optimize_ats_ci_flow_v4.2' into 'release/v4.2'
CI: optimize ATS ci flow (v4.2)

See merge request espressif/esp-idf!20179
2022-09-22 14:12:17 +08:00
04f2766b3e Merge branch 'bugfix/fix_spi_bus_lock_concurrency_issue_v4.2' into 'release/v4.2'
spi_bus_lock: fix a concurrency issue (v4.2)

See merge request espressif/esp-idf!20140
2022-09-22 13:30:47 +08:00
d1f4406718 Merge branch 'bugfix/lpn_not_recv_message_to_all_node_4.2' into 'release/v4.2'
ble_mesh: stack: Add option for lpn auto sub all-nodes(v4.2)

See merge request espressif/esp-idf!20262
2022-09-21 11:31:29 +08:00
514e896462 ble_mesh: stack: Add option for lpn auto sub all-nodes. 2022-09-20 20:32:37 +08:00
faf4fd233a wpa_supplicant: try install gtk before send group key handshake message 2 2022-09-19 08:15:15 +00:00
138bbec8ab Merge branch 'bugfix/relay_friend_cred_message_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix friend relay lpn message when relay disable(v4.2)

See merge request espressif/esp-idf!20206
2022-09-19 14:03:31 +08:00
c78efa5fa4 ble_mesh: stack: Fix friend relay lpn message when relay disable. 2022-09-18 09:51:31 +00:00
13b05ca6ba Merge branch 'bugfix/adapt_new_btc_v4.2' into 'release/v4.2'
ble_mesh: stack: Corrected parameter size when the btc_transfer_context is used (v4.2)

See merge request espressif/esp-idf!20168
2022-09-18 14:35:49 +08:00
c2bb3afafa Merge branch 'bugfix/fix_some_wifi_bugs_0805_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs(Backport v4.2)

See merge request espressif/esp-idf!19402
2022-09-16 14:16:11 +08:00
9d5275375a CI: optimize ATS ci flow 2022-09-16 13:53:15 +08:00
98d90cd216 Merge branch 'bugfix/friend_and_lpn_issues_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix friend and lpn issues(v4.2)

See merge request espressif/esp-idf!19477
2022-09-15 18:42:41 +08:00
0b03533594 Merge branch 'bugfix/mesh_bqb_test_issues_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix mesh v1.0 BQB test issues(v4.2)

See merge request espressif/esp-idf!19504
2022-09-15 18:42:30 +08:00
3052096ab1 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 17:02:24 +08:00
949d7da779 Merge branch 'bugfix/driver_rs485_fix_test_sync_issues_v42' into 'release/v4.2'
driver: uart rs485 fix test sync issues and fail threshold (backport v4.2)

See merge request espressif/esp-idf!19615
2022-09-15 15:23:21 +08:00
3c67e26dce driver: uart rs485 fix test sync issues and fail threshold (backport v4.2) 2022-09-15 15:23:21 +08:00
d7e3f3fb64 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 14:20:16 +08:00
19098d3eb0 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:15:06 +08:00
ed22f22632 Merge branch 'bugfix/spi_slave_intr_iram_v4.2' into 'release/v4.2'
driver: spi_slave: make sure CS helpers are in IRAM if the ISR is (v4.2)

See merge request espressif/esp-idf!17833
2022-09-13 16:28:14 +08:00
b32ae67f10 Merge branch 'bugfix/fix_disassembler_interpreting_padding_v4.2' into 'release/v4.2'
(Xtensa) Build: add .xt.prop and .xt.lit to the compiled ELF file (backport v4.2)

See merge request espressif/esp-idf!19613
2022-09-13 16:27:52 +08:00
eb128229a9 Merge branch 'bugfix/i2c_notify_task_in_ISR_v4.2' into 'release/v4.2'
I2C: Fix a bug making the I2C task wait too long on an event

See merge request espressif/esp-idf!19619
2022-09-13 16:27:40 +08:00
691c4ddeb5 Merge branch 'feature/oocd_ver_upgrade_v4.2' into 'release/v4.2'
tools: Updates OpenOCD version to 'v0.11.0-esp32-20220706' (v4.2)

See merge request espressif/esp-idf!19492
2022-09-12 16:54:19 +08:00
afbfcbaef1 ci: add job num 2022-09-12 00:52:20 +08:00
75ff8d7ff8 spi_flash: add unit tests for qio mode 2022-09-11 02:39:59 +08:00
7f0c35dd32 bt:Fixed sink not being able to output mono audio because it can only decode dual channel audio data 2022-09-09 17:45:03 +08:00
1ec5e249b6 Merge branch 'update/version_4_2_4' into 'release/v4.2'
Update version to 4.2.4

See merge request espressif/esp-idf!19867
2022-09-08 12:25:02 +08:00
ef23935993 Remove trailing semicolon from bt dft initializer
Similar to espressif#6554
2022-09-02 11:14:16 +08:00
f5e484fc79 versions: Update version to 4.2.4 2022-08-31 00:18:44 +02:00
ea78cd1116 esp_psram: fixed 40mhz cs signal glitch issue 2022-08-18 20:39:56 +08:00
ebd63c499c (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-18 10:44:31 +08:00
17a5d4aff7 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-17 17:39:10 +08:00
db99a12578 ble_mesh:ble mesh console support nimble 2022-08-17 14:39:53 +08:00
c92e55cb4a 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:15:34 +08:00
d42d181f27 test/examples: Fixes expected GDB message upon thread hit breakpoint 2022-08-15 19:06:19 +03:00
4d9aed7511 tools: Updates OpenOCD version to 'v0.11.0-esp32-20220706' 2022-08-12 14:11:40 +03:00
2850d7ca59 ble_mesh: stack: Fix kr from non-primary subnet shouldn't ignore
For case MESH/NODE/KR/BV-02-C
2022-08-11 14:17:46 +08:00
f14a13b887 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:17:41 +08:00
5df2e036df 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:17:35 +08:00
929f931b88 ble_mesh: stack: The Heartbeat Publication Period Log value can set to 0x11, range: [0, 0x11] 2022-08-11 14:17:29 +08:00
892b9b9def 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:17:22 +08:00
6a88790a74 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:17:13 +08:00
80630b1e6a ble_mesh: stack: Fix PB-GATT not check invalid link flag
For case MESH/NODE/PROV/BI-03-C
2022-08-11 14:17:05 +08:00
386da9df0c ble_mesh: stack: Fix invalid provisioning pdu type check
For case MESH/NODE/PROV/BI-15-C
2022-08-11 14:17:01 +08:00
2e190452b8 ble_mesh: stack: Fix add continuously secure update into friend queue.
For MESH/NODE/FRND/FN/BV-20-C
2022-08-09 21:50:24 +08:00
a6b2103948 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:50:20 +08:00
5a65ac50e0 driver: spi_slave: make sure CS helpers are in IRAM if the ISR is
Closes https://github.com/espressif/esp-idf/issues/3870
2022-08-08 10:34:09 +02:00
997844bbc3 Merge branch 'bugfix/vendor_model_send_message_no_memory_forv4.2' into 'release/v4.2'
ble_mesh:example: free the memory of malloc (v4.2)

See merge request espressif/esp-idf!19187
2022-08-08 12:25:38 +08:00
10f0879fdb ble_mesh:the memory requested by malloc has not benn released 2022-08-05 12:13:47 +00:00
d016f69ffc Merge branch 'feat/make_property_idf_component_manager_root_level_v4.2' into 'release/v4.2'
Feat/make property idf component manager root level (v4.2)

See merge request espressif/esp-idf!19084
2022-08-05 19:58:57 +08:00
847d9631b9 Merge branch 'bugfix/restore_missing_ble_mesh_videos_v4.2' into 'release/v4.2'
ble_mesh: doc: Restore missing ble mesh videos(v4.2)

See merge request espressif/esp-idf!19405
2022-08-05 19:58:42 +08:00
3c5eb41914 ble_mesh: doc: Restore missing ble mesh videos 2022-08-05 13:57:25 +08:00
647526af47 esp_wifi: fix some wifi bugs
1. fix not update phy according to country code.
2. sync peripheral device reg base.
3. fix for default ap ssid not set.
4. do not recv unencrypted unicaset ESPNOW packets when local encrypted.
2022-08-05 13:29:52 +08:00
be26894259 Merge branch 'bugfix/install_key_refactor_v4.2' into 'release/v4.2'
esp_wifi: backported some wifi fixes (19472381)

See merge request espressif/esp-idf!19385
2022-08-05 10:42:26 +08:00
bdc671aee3 esp_wifi: backported some wifi fixes (19472381)
1. G1 rx drop from key install code refactoring
2. Remove group cipher check for PMF connection
2022-08-04 12:21:20 +05:30
ca1628b310 Merge branch 'bugfix/freertos_event_group_unblock_race_condition_v4.2' into 'release/v4.2'
FreeRTOS: Fix event group task list race condition (v4.2)

See merge request espressif/esp-idf!19105
2022-08-04 13:14:26 +08:00
2f634a82d5 Merge branch 'bugfix/wlan_fixes_backports_v4.2' into 'release/v4.2'
esp_wifi: Fix some wlan issues(backport v4.2)

See merge request espressif/esp-idf!19362
2022-08-04 11:33:57 +08:00
a46d166c49 Merge branch 'bugfix/combined_softap_pmf_fixes_v4.2' into 'release/v4.2'
Combined bugfixes for SoftAP and PMF (Backport v4.2)

See merge request espressif/esp-idf!19121
2022-08-04 11:05:10 +08:00
0c88beb9c4 esp_wifi: Update wifi libs
Update wifi libs with below fixes -
1. Improved error handling in SoftAP Rx path, fixed LoRa IE length
2. Handle low memory scenario, re-enabling PMF Capable flag in STA PMF
2022-08-03 18:16:37 +05:30
c5875e64b1 Merge branch 'docs/update_wifi_api_doc_v4.2' into 'release/v4.2'
DOC: update wifi api docs ( backport v4.2)

See merge request espressif/esp-idf!18083
2022-08-03 20:12:06 +08:00
0efba69571 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-08-03 14:47:07 +05:30
ec70ed86e0 esp_wifi: Changes to not use pmkid caching when SSID is changed 2022-08-03 14:38:05 +05:30
064474fca6 wpa_supplicant: Fix issues reported by coverity 2022-08-03 14:37:43 +05:30
d98e2a3d5f Merge branch 'bugfix/fix_write_to_null_pointer_if_malloc_failed_issue_v4.2' into 'release/v4.2'
fix write to null pointer if malloc failed(Backport v4.2)

See merge request espressif/esp-idf!19350
2022-08-03 10:59:10 +08:00
8e8cf08d2d Merge branch 'bugfix/update_gpio_intr_enable_note_v4.2' into 'release/v4.2'
Update the note of the gpio_intr_enable function(v4.2)

See merge request espressif/esp-idf!18544
2022-08-03 10:58:42 +08:00
3ffcb03f60 bugfix for backport wifi bugs to 4.2
- Bugfix for close sniffer mode when wifi stop

  - Bugfix for qos null update ba ssn

  - Bugfix for wrong configuration of static txbuf

  - Fix deep sleep can't reconnect to ap when pmf enable.

  - Fix some ap will ignore auth when rx deauth for a while.

  - update wifi header file
2022-08-03 10:45:36 +08:00
0a0ad4309f fix write to null pointer if malloc failed 2022-08-02 20:30:30 +08:00
63324950fa modify API-reference using Sphinx directives 2022-08-02 20:23:37 +08:00
0a7fedcbbd update wifi api docs 2022-08-02 20:23:37 +08:00
9d854cd6b0 Merge branch 'bugfix/set_ipv6_dns_error_v4.2' into 'release/v4.2'
lw ip: Fixed that ipv6 dns cannot work (v4.2)

See merge request espressif/esp-idf!19064
2022-08-02 20:21:39 +08:00
eddee33f98 Merge branch 'bugfix/fix_bluedroid_host_memory_overflow_v4.2' into 'release/v4.2'
Fixed bluedroid host memory overflow for v4.2

See merge request espressif/esp-idf!18905
2022-08-02 19:47:41 +08:00
510f86d451 Merge branch 'bugfix/memory_debug_not_work_v4.2' into 'release/v4.2'
bugfix/fix the dependency error of macro for memory debug (v4.2)

See merge request espressif/esp-idf!19234
2022-08-02 15:49:36 +08:00
4bdc7853cf Merge branch 'bugfix/put_sempher_and_queue_used_in_isr_into_DRAM_v4.2' into 'release/v4.2'
Make sure semphr/queue used in interrupt is in DRAM

See merge request espressif/esp-idf!18990
2022-08-02 11:32:18 +08:00
7718c60d81 Merge branch 'bugfix/reserve_dma_ram_in_segments_v4.2' into 'release/v4.2'
psram: reserve dma pool in the step of heap max block (v4.2)

See merge request espressif/esp-idf!18861
2022-08-01 17:14:46 +08:00
8b09f2f01f ci: pip install idf-component-manager inside CI 2022-08-01 10:44:50 +08:00
ac8b720880 docs: Add IDF_COMPONENT_MANAGER build property 2022-08-01 10:44:50 +08:00
fdc70f5b7f docs: Enable the component manager by default in CMake 2022-08-01 10:44:50 +08:00
5d1864b7d7 build&config: lift property IDF_COMPONENT_MANAGER to root level 2022-08-01 10:44:50 +08:00
9003e6d1eb Merge branch 'bugfix/cxx_exception_pool_4.2' into 'release/v4.2'
startup: Make __cxx_eh_arena_size_get return 0 if exceptions disabled (v4.2)

See merge request espressif/esp-idf!18800
2022-07-29 13:14:45 +08:00
029ed39579 Fixed bluedroid host memory overflow 2022-07-28 09:47:03 +00:00
da340c02cc 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:17:17 +08:00
06d169e518 Update the note of the gpio_intr_enable function 2022-07-26 12:39:42 +00:00
1af2a470dc 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 13:50:43 +08:00
6842dc1d2d components/bt: Make sure sempher and queue used in isr is in DRAM 2022-07-25 11:45:45 +08:00
1801a10828 Merge branch 'bugfix/schm_process_in_active_crash_v4.2' into 'release/v4.2'
Coex: fixed crash when calculating end transfer time(v4.2)

See merge request espressif/esp-idf!19192
2022-07-22 21:24:16 +08:00
b7fe47292f fix the dependency error of macro for memory debug 2022-07-22 16:21:57 +08:00
61af5f66a4 coex: fixed crash when calculating end transfer time 2022-07-22 16:15:58 +08:00
ad9395f74a Merge branch 'mesh/non_mesh_connections_access_v4.2' into 'release/v4.2'
esp_wifi_mesh: add non mesh connections access(v4.2)

See merge request espressif/esp-idf!18785
2022-07-21 19:19:14 +08:00
c7c07c5fb2 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 cleaned up by the main task
2022-07-19 12:19:42 +08:00
5e15bafd26 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:13:54 +08:00
43f1c37458 lwip: Fixed that ipv6 dns cannot work 2022-07-15 16:20:37 +08:00
611493af37 Merge branch 'docs/update_wifi_multiple_antennas_doc_v4.2' into 'release/v4.2'
docs: update wifi multiple antennas docs (v4.2)

See merge request espressif/esp-idf!19048
2022-07-15 10:48:10 +08:00
23a3f97af1 Merge branch 'bugfix/print_ready_after_init_transaction_forv4.2' into 'release/v4.2'
ble_mesh:change the location of print ready(v4.2)

See merge request espressif/esp-idf!19030
2022-07-14 17:28:19 +08:00
15480c49e3 Apply 1 suggestion(s) to 1 file(s) 2022-07-14 16:44:00 +08:00
6ceabe794e Apply 2 suggestions by Marius Vikhammer 2022-07-14 16:42:55 +08:00
758e185090 docs: update wifi multiple antennas docs 2022-07-14 16:36:46 +08:00
770075609f ble_mesh:change the location of print ready 2022-07-13 18:13:08 +08:00
bef5f431d9 Merge branch 'bugfix/eth_icmp_dest_localhost_v4.2' into 'release/v4.2'
ci/esp_eth: Make the ICMP destination localhost (v4.2)

See merge request espressif/esp-idf!18753
2022-07-13 16:06:53 +08:00
7a1df44319 Merge branch 'bugfix/modbus_allow_master_slave_work_simultaneously_v42' into 'release/v4.2'
freemodbus: fix issues when modbus master and slave work simultaneously (backport v4.2)

See merge request espressif/esp-idf!14949
2022-07-13 15:37:20 +08:00
bfac558b6f freemodbus: fix issues when modbus master and slave work simultaneously (backport v4.2) 2022-07-13 15:37:19 +08:00
e040cd1a68 Merge branch 'bugfix/fix_esp32_ke_mem_c_assert_v4.2' into 'release/v4.2'
Fixed ESP32 BLE ke_mem.c assert for v4.2

See merge request espressif/esp-idf!19004
2022-07-13 14:06:47 +08:00
zwj
6c4351908c Fixed ESP32 BLE ke_mem.c assert 2022-07-13 03:08:09 +00:00
d69e42348f Merge branch 'bugfix/no_proxy_beacon_send_after_deinit_v4.2' into 'release/v4.2'
ble_mesh: stack: Bugfix for proxy beacon send after reinit mesh(v4.2)

See merge request espressif/esp-idf!18793
2022-07-13 10:51:36 +08:00
221993edd4 Merge branch 'bugfix/not_use_malloc_in_bluedroid_v4.2' into 'release/v4.2'
component/bt: use osi_malloc instead of malloc in bluedroid

See merge request espressif/esp-idf!18845
2022-07-12 10:43:44 +08:00
989a390798 Merge branch 'bugfix/enterprise_certs_ca_expired_v4.2' into 'release/v4.2'
esp_wifi: Fix issue of ca certificate expired.

See merge request espressif/esp-idf!18524
2022-07-11 16:45:50 +08:00
8f2659e2ad Merge branch 'bugfix/eap_method_selection_release_v4.2' into 'release/v4.2'
esp_wifi: Fix the negotiation of method with eap server.

See merge request espressif/esp-idf!18509
2022-07-11 16:45:22 +08:00
a07f18ff9f Merge branch 'bugfix/cpu_reset_perip_clk_disable_v4.2' into 'release/v4.2'
esp_system: Peripheral clocks faulty become disabled during cpu reset (backport v4.2)

See merge request espressif/esp-idf!15486
2022-07-11 16:44:32 +08:00
443d8a187b Merge branch 'bugfix/fix_esp_restart_does_not_reset_timer_groups_periph_v42' into 'release/v4.2'
modbus: fix esp restart does not reset timer groups periph (backport v4.2)

See merge request espressif/esp-idf!15506
2022-07-11 16:42:42 +08:00
eaf03e06d5 modbus: fix esp restart does not reset timer groups periph (backport v4.2) 2022-07-11 16:42:42 +08:00
034c05c82e Merge branch 'bugfix/usb_hal_and_clk_v4.2' into 'release/v4.2'
Fix USB with swapped pins not working (backport v4.2)

See merge request espressif/esp-idf!17104
2022-07-11 16:42:13 +08:00
94fd4ffa2e Merge branch 'bugfix/fix_osi_men_dbg_xxx_not_defined_when_enable_mem_dbg_v4.2' into 'release/v4.2'
bugfix/fix the issue of functions not defined when enable memory debug (v4.2)

See merge request espressif/esp-idf!18817
2022-07-11 15:37:54 +08:00
c9bc1943fa ci/esp_eth: Make the ICMP destination localhost
Original commit: 9fa06719fa
global: enable build uinit test for esp32-s3
2022-07-11 04:53:40 +00:00
68612afa09 component/bt: use osi_malloc instead of malloc in bluedroid 2022-07-11 02:48:10 +00:00
25253b22cc Merge branch 'bugfix/do_not_allow_unauthenticated_encrypted_key_data_release_v4.2' into 'release/v4.2'
esp_wifi: Ignore unauthenticated encrypted EAPOL-Key data and fix

See merge request espressif/esp-idf!18316
2022-07-10 15:59:53 +08:00
c2090fc962 Merge branch 'bugfix/a2dp_source_not_stop_discovery_correctly_v4.2' into 'release/v4.2'
bugfix/avoid wrongly restart discovery in a2dp_source (v4.2)

See merge request espressif/esp-idf!18712
2022-07-10 15:52:21 +08:00
c811a2c2f4 Merge branch 'bugfix/restore_edr_en_and_protect_for_vhci_env_v4.2' into 'release/v4.2'
bugfix/restore edr_en and add protect for vhci_env (v4.2)

See merge request espressif/esp-idf!18813
2022-07-10 15:49:27 +08:00
3266c6a2d4 Merge branch 'bugfix/lower_a2dp_appT_prio_v4.2' into 'release/v4.2'
bugfix/lower the priority of application task of a2dp demo (v4.2)

See merge request espressif/esp-idf!18822
2022-07-10 15:48:03 +08:00
02c3414fc0 Merge branch 'bugfix/resolve_redefinition_in_spp_and_hid_v4.2' into 'release/v4.2'
bugfix/resolve redefinition in btc_spp.h and btc_hd.h/btc_hh.h (v4.2)

See merge request espressif/esp-idf!18826
2022-07-10 15:47:02 +08:00
6afad65ecb Merge branch 'bugfix/xtensa_sol_frame_saves_extra_registers_v4.2' into 'release/v4.2'
freertos: Xtensa solicited stack frame should save threadptr register (v4.2)

See merge request espressif/esp-idf!18855
2022-07-10 15:45:06 +08:00
f735dfa617 Merge branch 'docs/update_wifi_csi_sub_carrier_index_doc_v4.2' into 'release/v4.2'
docs:update wifi sci subcarrier index docs (v4.2)

See merge request espressif/esp-idf!18943
2022-07-10 15:40:14 +08:00
496b27eb0a docs:update wifi sci subcarrier index docs 2022-07-08 14:51:48 +08:00
aeeb255d35 resolve redefinition in btc_spp.h and btc_hd.h/btc_hh.h
Closes https://github.com/espressif/esp-idf/issues/9199
2022-07-08 14:23:09 +08:00
e2c29bf4db avoid wrongly restart discovery 2022-07-08 14:19:54 +08:00
aae7b6e1ae 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-08 14:13:08 +08:00
37b9d3f886 lower the priority of application task of a2dp demo 2022-07-08 14:03:26 +08:00
5f5a2d9c5a Merge branch 'bugfix/auto_test_script_only_use_given_branch_v4.2' into 'release/v4.2'
CI: limit switching branches for auto_test_script (v4.2)

See merge request espressif/esp-idf!11144
2022-07-08 11:26:07 +08:00
24fc73c4e0 fix the issue of functions not defined when enable memory debug 2022-07-08 11:00:59 +08:00
b85c0ec352 Merge branch 'bugfix/efuse_esp_efuse_utility_burn_efuses_v4.2' into 'release/v4.2'
efuse: Fix burn operation when data was written directly to regs (v4.2)

See merge request espressif/esp-idf!18887
2022-07-07 22:30:33 +08:00
4620826c83 ci: limit switching branches for auto_test_script 2022-07-06 11:55:33 +08:00
404979d71a efuse: Fix burn operation when data was written directly to regs
Closes https://github.com/espressif/esp-idf/issues/9290
2022-07-05 18:29:27 +08:00
0a894c2b30 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:26:16 +08:00
2bcfeb612f startup: Make __cxx_eh_arena_size_get return 0 if exceptions disabled
This function is necessary to provide the emergency exception
memory pool size for C++ code.
Since our libstdc++ always has exceptions enabled, this function
must exist here even if -fno-exception is set for user code.
2022-07-01 08:32:37 +02:00
3facb2dcfa ble_mesh: stack: Bugfix for proxy beacon send after reinit mesh 2022-07-01 11:50:43 +08:00
b408043d7e esp_wifi_mesh: add non mesh connections access 2022-06-30 21:19:23 +08:00
42ea9b7cb1 Merge branch 'feature/add_filter_seq_auth_config_v4.2' into 'release/v4.2'
ble_mesh: stack: Add filter old seq_auth packet menuconfig(v4.2)

See merge request espressif/esp-idf!18651
2022-06-24 11:15:22 +08:00
aa42bb3355 ble_mesh: stack: Add filter old seq_auth packet menuconfig 2022-06-23 16:22:08 +08:00
372ae83fde Merge branch 'bugfix/avdtp_genreal_reject_format_error_v4.2' into 'release/v4.2'
component_bt: Fix AVDTP general reject format error(v4.2)

See merge request espressif/esp-idf!18558
2022-06-21 20:54:34 +08:00
46f777a254 Merge branch 'feature/update_hfp_ag_version_v4.2' into 'release/v4.2'
component_bt: update hfp_ag version to 1.7.2(v4.2)

See merge request espressif/esp-idf!18605
2022-06-21 19:40:59 +08:00
90f464c671 update hfp_ag version to 1.7.2 2022-06-21 14:50:44 +08:00
32aa2ab24e Merge branch 'feat/epi_flash_api_iram_save_4.2' into 'release/v4.2'
spi_flash: partially move API functions out of IRAM (v4.2)

See merge request espressif/esp-idf!18304
2022-06-19 23:22:48 +08:00
8f9a3d508e Merge branch 'bugfix/idle_task_skipped_light_sleep_backport_v4.2' into 'release/v4.2'
pm_impl: fix neither enter light sleep nor enter waiti state in idle task(backport v4.2)

See merge request espressif/esp-idf!17849
2022-06-19 23:21:57 +08:00
cec2713416 Fix AVDTP general reject format error. 2022-06-17 10:28:50 +08:00
d8d32d71c9 esp_wifi: Fix issue of ca certificate expired. 2022-06-15 17:23:20 +05:30
f66638c360 esp_wifi: Fix the negotiation of method with eap server. 2022-06-15 05:57:15 +00:00
14b204e201 Merge branch 'bugfix/pm_enabled_bt_build_fail_v4.2' into 'release/v4.2'
Bluetooth build fail when power management is enabled(v4.2)

See merge request espressif/esp-idf!18383
2022-06-15 11:07:08 +08:00
8eb3c959dc esp_wifi: Ignore unauthenticated encrypted EAPOL-Key data and fix handling of key RSC.
Closes https://github.com/espressif/esp-idf/issues/8401
2022-06-14 18:33:27 +05:30
ac6f45d290 bootloader: support unlock MXIC flash chips 2022-06-09 12:41:56 +08:00
168880fe7b spi_flash: move the unlock patch to bootloader and add support for GD 2022-06-09 12:41:56 +08:00
e5ac1eb83f spi_flash: fix the corruption of ROM after calling bootloader_execute_flash_command
The user register, especially dummy related ones, needs to be restored, otherwise the ROM function will not work.

Introduced in dd40123129.
2022-06-09 12:41:56 +08:00
33a8c60b2c bootloader: add xmc spi_flash startup flow to improve reliability 2022-06-09 12:41:56 +08:00
e1bd7b9d8f bootloader: create public bootloader_flash.h header
Move non-public functions into bootloader_flash_priv.h header
2022-06-09 12:41:56 +08:00
9582cbe5b8 bootloader: fix the WRSR format for ISSI flash chips
1. The 2nd bootloader always call `rom_spiflash_unlock()`, but never help to clear the WEL bit when exit. This may cause system unstability.

   This commit helps to clear WEL when flash configuration is done.

   **RISK:** When the app starts, it didn't have to clear the WEL before it actually write/erase. But now the very first write/erase operation should be done after a WEL clear. Though the risk is little (all the following write/erase also need to clear the WEL), we still have to test this carefully, especially for those functions used by the OTA.

2. The `rom_spiflash_unlock()` function in the patch of ESP32 may (1) trigger the QPI, (2) clear the QE or (3) fail to unlock the ISSI chips.

   Status register bitmap of ISSI chip and GD chip:

| SR | ISSI | GD25LQ32C |
| -- | ---- | --------- |
| 0  | WIP  | WIP       |
| 1  | WEL  | WEL       |
| 2  | BP0  | BP0       |
| 3  | BP1  | BP1       |
| 4  | BP2  | BP2       |
| 5  | BP3  | BP3       |
| 6  | QE   | BP4       |
| 7  | SRWD | SRP0      |
| 8  |      | SRP1      |
| 9  |      | QE        |
| 10 |      | SUS2      |
| 11 |      | LB1       |
| 12 |      | LB2       |
| 13 |      | LB3       |
| 14 |      | CMP       |
| 15 |      | SUS1      |

   QE bit of other chips are at the bit 9 of the status register (i.e. bit 1 of SR2), which should be read by RDSR2 command.

   However, the RDSR2 (35H, Read Status 2) command for chip of other vendors happens to be the QIOEN (Enter QPI mode) command of ISSI chips. When the `rom_spiflash_unlock()` function trys to read SR2, it may trigger the QPI of ISSI chips.

   Moreover, when `rom_spiflash_unlock()` try to clear the BP4 bit in the status register, QE (bit 6) of ISSI chip may be cleared by accident. Or if the ISSI chip doesn't accept WRSR command with argument of two bytes (since it only have status register of one byte), it may fail to clear the other protect bits (BP0~BP3) as expected.

   This commit makes the `rom_spiflash_unlock()` check whether the vendor is issi. if so, `rom_spiflash_unlock()` only send RDSR to read the status register, send WRSR with only 1 byte argument, and also avoid clearing the QE bit (bit 6).

3. `rom_spiflash_unlock()` always send WRSR command to clear protection bits even when there is no protection bit active. And the execution of clearing status registers, which takes about 700us, will also happen even when there's no bits cleared.

   This commit skips the clearing of status register if there is no protection bits active.

Also move the execute_flash_command to be a bootloader API; move
implementation of spi_flash_wrap_set to the bootloader
2022-06-09 12:41:56 +08:00
a130dcd5ec test_spiffs: increase test case stack size 2022-06-09 12:41:56 +08:00
51584d4f2a spi_flash: partially move API functions out of IRAM 2022-06-09 12:41:56 +08:00
a3374b2d2f Merge branch 'bugfix/fix_cannot_lslp_again_after_ulp_wakeup_backport_v4.2' into 'release/v4.2'
sleep: fix cannot lightsleep again after a wakeup from ULP(backport v4.2)

See merge request espressif/esp-idf!18218
2022-06-07 11:21:42 +08:00
0cb13d47cc Bluetooth build fail when power management is enabled 2022-06-06 20:28:25 +08:00
087c72e8ea Merge branch 'bugfix/disable_extensions_idfpy_tests_v4.2' into 'release/v4.2'
Tools: Make idf.py tests independent on extra extensions (v4.2)

See merge request espressif/esp-idf!18284
2022-06-03 19:05:26 +08:00
2e8e620d94 Tools: Make idf.py tests independent on extra extensions 2022-06-02 17:56:38 +02:00
59a66f90c7 Merge branch 'bugfix/add_bda_to_read_rmt_name_param_v4.2' into 'release/v4.2'
Bugfix/add bda to read rmt name param v4.2

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

See merge request espressif/esp-idf!18289
2022-06-02 11:45:20 +08:00
c670dc6d14 assign value to uninitialized bt_addr field 2022-05-29 18:04:53 -07:00
2bf87b0a53 add address field to read_rmt_name_param 2022-05-29 18:04:41 -07:00
7d9aff3913 tools/docker: add README.md file to be displayed on Docker Hub
Closes https://github.com/espressif/esp-idf/issues/7933
2022-05-27 14:15:51 +02:00
cf44cbfdc9 ci: build and push Docker images in Github actions
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-05-27 14:15:47 +02:00
a1eb5c77e9 docs: document build arguments of the Docker image 2022-05-27 14:01:34 +02:00
1e64f241f9 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-05-27 14:01:22 +02:00
57975000fe 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-23 01:00:28 +08:00
b6b7a59958 Merge branch 'bugfix/twai_esp32_errata_workarounds_backport_v4.2' into 'release/v4.2'
TWAI: Add FIFO overrun handling and ESP32 hardware errata workarounds + Refactor TWAI HAL to store state information  (backport v4.2)

See merge request espressif/esp-idf!17106
2022-05-19 10:55:59 +08:00
b74fc002f1 Merge branch 'bugfix/driver_uart_fix_tx_bytes_rts_assert_failure_v42' into 'release/v4.2'
driver: fixes context switch while sending cause rts reset before send (backport v4.2)

See merge request espressif/esp-idf!17942
2022-05-19 10:55:36 +08:00
721e26019e driver: fixes context switch while sending cause rts reset before send (backport v4.2) 2022-05-19 10:55:35 +08:00
9cb1729107 Merge branch 'bugfix/fix_adc_calibration_light_sleep_issue_v4.2' into 'release/v4.2'
adc: fix calibration error when waking up from light sleep (v4.2)

See merge request espressif/esp-idf!16931
2022-05-19 10:55:10 +08:00
ea173fc189 Merge branch 'bugfix/ble_mesh_console_correct_repl_config_prompt_forv4.2' into 'release/v4.2'
ble mesh:example:correct repl config prompt in ble mesh console(v4.2)

See merge request espressif/esp-idf!17185
2022-05-19 10:54:52 +08:00
886e846dc0 ble mesh:example:correct repl config prompt in ble mesh console(v4.2) 2022-05-19 10:54:51 +08:00
0fba64486a Merge branch 'bugfix/spi_lose_last_3_bytes_v4.2' into 'release/v4.2'
spi_master: fix an issue where master cannot correctly receive data when using DMA in halfduplex mode (v4.2)

See merge request espressif/esp-idf!17379
2022-05-19 10:54:36 +08:00
c71a9e5704 Merge branch 'feature/check_block_after_burn_v4.2' into 'release/v4.2'
efuse: Validates data after burning and re-burnes it if necessary (v4.2)

See merge request espressif/esp-idf!17704
2022-05-19 10:54:19 +08:00
6c66b39221 Merge branch 'feature/modbus_master_fix_check_uart_set_pin_v42' into 'release/v4.2'
example/modbus_master: fix the assert for uart_set_pin (backport v4.2)

See merge request espressif/esp-idf!17626
2022-05-10 18:30:03 +08:00
07c8e86987 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-05-10 08:05:22 +00:00
d6a975f6b2 Merge branch 'bugfix/_rtc_slow_length_incorrectly_optimized_backport_v4.2' into 'release/v4.2'
sleep_power_domain: fix _rtc_slow_length being incorrectly optimized by compiler(backport v4.2)

See merge request espressif/esp-idf!17976
2022-05-10 01:04:37 +08:00
d0db75899d Merge branch 'bugfix/ledc_consecutive_fade_v4.2' into 'release/v4.2'
ledc: Bugfixes for issues related to fade protection (backport v4.2)

See merge request espressif/esp-idf!16955
2022-05-07 18:24:45 +08:00
05b7db9cd8 fix _rtc_slow_length being incorrectly optimized by compiler 2022-05-01 23:26:52 +08:00
667f3dfbad Merge branch 'bugfix/ignore_pmf_capable_flag_v4.2' into 'release/v4.2'
Always connect Station in PMF mode if possible (Backport v4.2)

See merge request espressif/esp-idf!17538
2022-05-01 20:10:58 +08:00
bf7b430f55 Merge branch 'contrib/github_pr_8779_v4.2' into 'release/v4.2'
esp_wifi: fix clearing default wifi netif procedure(v4.2)

See merge request espressif/esp-idf!17940
2022-04-28 16:17:14 +08:00
00d2c3037a Merge branch 'bugfix/fix_disable_bt_log_ci_fail_v4.2' into 'release/v4.2'
component_bt: Fix CI failure when disable bluetooth debug log(v4.2)

See merge request espressif/esp-idf!17905
2022-04-27 18:20:27 +08:00
5c1d1c0f45 Merge branch 'bugfix/spp_crash_after_call_spp_deinit_v4.2' into 'release/v4.2'
Component_bt/Fix spp crash after call esp_spp_deinit(v4.2)

See merge request espressif/esp-idf!17933
2022-04-27 18:06:57 +08:00
55b6ff6fbd 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-27 03:23:20 -04:00
d59d373edc Fix spp initialization failure without free mutex 2022-04-27 14:49:39 +08:00
9e2ae1271d Fix spp crash after calling esp_spp_deinit 2022-04-27 14:43:42 +08:00
0825981026 Fix CI failure when disable bluetooth debug log 2022-04-26 15:06:50 +08:00
83728f3832 efuse: fix 2022-04-26 00:08:51 +08:00
8b422cd8b1 Merge branch 'bugfix/oversized_SegN_as_valid_v4.2' into 'release/v4.2'
ble_mesh: stack: Bugfix for oversized SegN as valid(v4.2)

See merge request espressif/esp-idf!17774
2022-04-25 18:52:04 +08:00
7691b8effb ble_mesh: stack: Bugfix for oversized SegN as valid 2022-04-25 11:53:35 +08:00
c35cd9d0fe Merge branch 'bugfix/rrm_dpp_task_delete_v4.2' into 'release/v4.2'
Bugfix/rrm dpp task delete v4.2

See merge request espressif/esp-idf!17880
2022-04-25 10:52:26 +08:00
be2779818b fix build error 2022-04-23 01:11:29 +08:00
fdf79ce300 ESP_WIFI: Remove static analysis warnings 2022-04-23 00:54:30 +08:00
dc87416df0 wpa_supplicant: static analysis fixes 2022-04-23 00:33:34 +08:00
a26b0dbaab wpa_supplicant: Add BTM security checks 2022-04-23 00:26:08 +08:00
06837c7efa Merge branch 'bugfix/fix_phy_i2c_crash_v4.2' into 'release/v4.2'
esp_phy: Add IRAM_ATTR for phy i2c spinlock (v4.2)

See merge request espressif/esp-idf!17844
2022-04-21 15:47:04 +08:00
5516dc7d0c pm_impl: fix neither enter light sleep nor enter waiti state in idle task 2022-04-21 14:40:57 +08:00
d976bbec08 esp_phy: Add IRAM_ATTR for phy i2c spinlock 2022-04-21 02:57:08 +08:00
d8105a565e Merge branch 'bugfix/fix_spp_initiator_connect_failed_v4.2' into 'release/v4.2'
Component_bt/Fix SPP initiator can not free resource when connection is failed[backport 4.2]

See merge request espressif/esp-idf!17746
2022-04-19 15:49:12 +08:00
7cb3e99740 Merge branch 'fix/spi_master_use_data_flag_v4.2' into 'release/v4.2'
spi_master: fix the error log when use tx/rx_data with larger data (v4.2)

See merge request espressif/esp-idf!17800
2022-04-18 23:22:02 +08:00
5edd6a4ddf spi_master: fix the error log when use tx/rx_data with larger data 2022-04-18 15:15:06 +08:00
396159299c Merge branch 'bugfix/gpio_pin_num_fix_v4.2' into 'release/v4.2'
gpio: Fix some gpio pin num errors on esp32s2 (backport v4.2)

See merge request espressif/esp-idf!17110
2022-04-18 14:49:52 +08:00
34a326130a Merge branch 'bugfix/nvs_coverity_issues_4.2' into 'release/v4.2'
bugfix (nvs): Fixed issues found by Coverity (backport v4.2)

See merge request espressif/esp-idf!17764
2022-04-14 17:44:51 +08:00
e5eccb409e bugfix (nvs): Fixed issues found by Coverity
*  Fixed potential memory leak
*  Fixed wrong strncpy usage
*  Fixed potential out of bounds access
2022-04-13 18:02:47 +08:00
154e579cfc 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.
Additionally add API esp_wifi_disable_pmf_config to disable PMF for
debug purposes or to avoid PMF issues on AP side.
2022-04-12 18:40:51 +05:30
0c2c192013 add missing unlock in btc_spp_cb_handler of BTA_JV_RFCOMM_WRITE_EVT 2022-04-12 15:37:07 +08:00
95ad53153f fix SPP initiator can not free resource when connection is failed 2022-04-12 15:36:47 +08:00
43ee24a52e Merge branch 'bugfix/bt_add_some_debug_log_v4.2' into 'release/v4.2'
component_bt: Add some bluetooth debug log(v4.2)

See merge request espressif/esp-idf!17616
2022-04-11 10:53:40 +08:00
dffcb3d0fb efuse: Fix 3/4 coding scheme UTs 2022-04-08 17:13:23 +08:00
ffe304268d Merge branch 'bugfix/modbus_add_task_affinity_and_callbacks_v42' into 'release/v4.2'
freemodbus: add task affinity and callbacks (backport v4.2)

See merge request espressif/esp-idf!14542
2022-04-08 15:59:33 +08:00
3a4cf61318 efuse: Improve messages during burn operation 2022-04-07 22:25:06 +08:00
2ec7449c37 Merge branch 'bugfix/phy_regi2c_critical_section_v4.2' into 'release/v4.2'
esp_phy: use spinlock to avoid regi2c access conflicts (v4.2)

See merge request espressif/esp-idf!17693
2022-04-07 20:19:33 +08:00
c226560f6b Merge branch 'bugfix/flash_mmap_output_psram_arg_v4.2' into 'release/v4.2'
mmap: fixed the issue mmap cannot be called with pointers to psram (v4.2)

See merge request espressif/esp-idf!17699
2022-04-07 10:54:08 +08:00
08a06865ec efuse: Burn func can return an error
esp_efuse_utility_burn_chip()
2022-04-06 23:42:26 +08:00
26619521fb efuse: Validates data after burning and re-burnes it if necessary
It checks the content of the written data and encoding errors.
2022-04-06 20:02:46 +08:00
50b87ff953 mmap: fixed the issue mmap cannot be called with pointers to psram 2022-04-06 17:23:42 +08:00
66d65e66fd Merge branch 'feature/add_component_manager_python_dependency_v4.2' into 'release/v4.2'
Build System: Add idf-component-manager python dependency (v4.2)

See merge request espressif/esp-idf!15986
2022-04-06 16:31:26 +08:00
cb0b143cb3 esp_phy: use spinlock to avoid regi2c access conflicts 2022-04-06 15:01:35 +08:00
171096e856 regi2c: use safe version of spinlock, instead of ISR ver 2022-04-06 14:47:10 +08:00
69c95bf983 Merge branch 'bugfix/spi_free_crash_uninitialized_v4.2' into 'release/v4.2'
spi: fixed crash when calling spi_bus_free when not initialized (v4.2)

See merge request espressif/esp-idf!17610
2022-04-01 11:17:54 +08:00
e7d95dc787 Merge branch 'bugfix/gpio_example_config_struct_zero_init_v4.2' into 'release/v4.2'
example: fixed the issue that config struct is not properly initialized (v4.2)

See merge request espressif/esp-idf!17589
2022-04-01 11:17:17 +08:00
c7c7d5d01d Merge branch 'bugfix/fix_x32k_startup_slow_bug_v4.2' into 'release/v4.2'
bugfix: Fix xtal 32k not oscillate or oscillate too slowly issue for esp32 (v4.2)

See merge request espressif/esp-idf!17591
2022-03-30 17:54:41 +08:00
b2e08332e3 ESP32: Fix xtal 32k not oscillate or oscillate too slowly issue
ESP32 in revision0 and revision1 uses touchpad to provide
current to oscillate xtal 32k. But revision2 and revision3
do not need to do that.
Note: touchpad can not work and toupad/ULP wakeup sources
are not available when toupad provides current to xtal 32k
2022-03-30 15:27:03 +08:00
affb956da5 esp_system: fix the bug that some peripheral clocks are being disabled during cpu reset for esp32s2 2022-03-29 03:42:34 +00:00
9e79d0e06f 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-03-29 03:42:06 +00:00
01547c4bd8 ledc: 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-03-29 03:42:06 +00:00
198ce9095a Fix USB with swapped pins not working
(cherry picked from commit 0aa1c13027)
2022-03-29 03:41:28 +00:00
4c267ef0a6 gpio: Fix some gpio pin num errors on esp32s2 2022-03-29 03:40:54 +00:00
b8c9bb4247 Add some bluetooth debug log 2022-03-28 11:28:50 +08:00
49231ae961 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:41:09 +08:00
75f856ac37 example: fixed the issue that config struct is not properly initialized 2022-03-25 01:11:55 +08:00
680710df2f Merge branch 'test/remove_spi_flash_perf_thr_v4.2' into 'release/v4.2'
spi_flash_test: remove threshold from unit test (v4.2)

See merge request espressif/esp-idf!16824
2022-03-19 02:36:18 +08:00
84effb1708 Merge branch 'bugfix/sleep_wrong_log_lvl_v4.2' into 'release/v4.2'
Sleep: fix wrong debug level (backport v4.2)

See merge request espressif/esp-idf!17300
2022-03-16 17:10:53 +08:00
16629eaf99 Merge branch 'bugfix/bootloader_uart_custom_gpio_v4.2' into 'release/v4.2'
bootloader: fixed the issue custom_uart_gpio doesn't take effect (v4.2)

See merge request espressif/esp-idf!17309
2022-03-16 11:39:36 +08:00
550872d629 Merge branch 'bugfix/assoc_comeback_fail_issue_v4.2' into 'release/v4.2'
Fix assoc comeback causing invalid state (Backport v4.2)

See merge request espressif/esp-idf!17174
2022-03-16 10:47:48 +08:00
ebee6f3c3f Merge branch 'bugfix/dual_core_pm_lock_issue_backport_v4.2' into 'release/v4.2'
System: fix pm lock issue in dual core mode(backport v4.2)

See merge request espressif/esp-idf!17263
2022-03-16 10:33:29 +08:00
26cf75cb44 spi_flash_test: remove threshold from unit test 2022-03-15 15:22:55 +00:00
67fea1b6bf test_utils: allow printint multiple argument in the performance log 2022-03-15 15:22:55 +00:00
c2d2d58ff1 Merge branch 'bugfix/esp_flash_write_temp_buffer_lifetime_v4.2' into 'release/v4.2'
esp_flash: fix write issue using buffer on stack out of lifetime (v4.2)

See merge request espressif/esp-idf!17206
2022-03-15 22:14:57 +08:00
6c21202065 Merge branch 'fix/sdio_slave_recv_intr_unhandled_v4.2' into 'release/v4.2'
sdio_slave: fixed the issue that interrupt may be cleared with finished trans unhandled (v4.2)

See merge request espressif/esp-idf!17150
2022-03-15 22:06:19 +08:00
608e189a53 Merge branch 'ci/enable_default_ut_s2' into 'release/v4.2'
ci: enable unit test for S2 by default

See merge request espressif/esp-idf!17114
2022-03-15 22:03:07 +08:00
ba3266e2ec Sleep: fix wrong debug level
Fix usage of ESP_LOGD in sleep_modes.c which triggers a panic when
used in debug log level.
2022-03-15 11:18:42 +00:00
cc230188ea Merge branch 'bugfix/flash_from_monitor_on_windows_v4.2' into 'release/v4.2'
Tools: IDF Monitor should flash with the unmodified port (v4.2)

See merge request espressif/esp-idf!17259
2022-03-12 23:19:06 +08:00
09a8221d31 Merge branch 'feature/update_hfp_hf_version_v4.2' into 'release/v4.2'
component_bt: Update HFP_HF version to 1.7.2(v4.2)

See merge request espressif/esp-idf!17393
2022-03-10 20:20:08 +08:00
093fc90b92 Merge branch 'bugfix/a2dp_sniff_v4.2' into 'release/v4.2'
Fix crash when host exit sniff mode(v4.2)

See merge request espressif/esp-idf!17342
2022-03-10 14:09:03 +08:00
219c579084 Merge branch 'docs/fix_broken_links_4.2' into 'release/v4.2'
docs: fix broken links in queue.h file (v4.2)

See merge request espressif/esp-idf!17182
2022-03-09 19:12:40 +08:00
cc518c3d05 Merge branch 'bugfix/i2s_write_failed_in_32bit_slave_mode_v4.2' into 'release/v4.2'
i2s: fix write failure issue in slave mode (backport v4.2)

See merge request espressif/esp-idf!15082
2022-03-09 19:10:56 +08:00
5e8b07bdea Update HFP_HF version to 1.7.2 2022-03-08 11:11:58 +08:00
e9bbe44d19 spi_master: fix master HD mode cannot correctly receive data issue when using DMA 2022-03-07 13:54:25 +08:00
e6c97308b9 sleep: restore analog calibration registers after waking up from light sleep 2022-03-07 11:18:21 +08:00
3c9cc070dd Merge branch 'update/version_4_2_3' into 'release/v4.2'
Update version to 4.2.3

See merge request espressif/esp-idf!17349
2022-03-04 19:00:02 +08:00
bb29e93ddf versions: Update version to 4.2.3 2022-03-03 14:44:57 +01:00
306df682cc Fix crash when host exit sniff mode 2022-03-03 16:31:43 +08:00
0c71604b80 i2s: fix write failure issue in slave mode (backport v4.2) 2022-03-03 15:16:53 +08:00
3d13370968 uart: fixed incorrect channel number on ESP32S2, S3 and C3 2022-03-02 10:53:30 +08:00
d87d385e6f bootloader: fixed the issue custom_uart_gpio doesn't take effect 2022-03-02 10:53:30 +08:00
8dd7662696 fix pm lock issue in dual core mode 2022-02-23 22:00:36 +08:00
95eb9626a4 Tools: IDF Monitor should flash with the unmodified port
Closes https://github.com/espressif/esp-idf/issues/8432
2022-02-23 13:50:18 +01:00
d503c23d7a Merge branch 'bugfix/update_stack_init_check_4.2' into 'release/v4.2'
Nimble: Updated checks of stack initialization status before executing stack command

See merge request espressif/esp-idf!17198
2022-02-22 09:12:00 +00:00
147f37d6a2 Merge branch 'bugfix/fix_ble_adv_underrun_error_v4.2' into 'release/v4.2'
components/bt: Fix ble adv_underrun issue(backport v4.2)

See merge request espressif/esp-idf!17166
2022-02-22 09:11:16 +00:00
ea6f4fd2ff esp_flash: fix write issue using buffer on stack out of lifetime 2022-02-20 03:24:59 +08:00
05f7dd1d28 Merge branch 'bugfix/update_stack_init_check_4.2' into 'release/v4.2'
Nimble: Updated checks of stack initialization status before executing stack command
2022-02-17 15:09:52 +05:30
e954c47abd docs: fix broken links 2022-02-16 14:24:22 +08:00
e39a101aaa components/bt: Fix ble adv_underrun issue
components/bt: Fix LLCP collision for channel map update
2022-02-16 00:28:45 +08:00
9f85fb2843 esp_wifi: Update wifi lib
Fix assoc comeback causing invalid state
2022-02-15 18:11:41 +05:30
473d39e6e6 Merge branch 'feature/refactor_phy_access_v4.2' into 'release/v4.2'
esp_wifi: refactor PHY access (Backport v4.2)

See merge request espressif/esp-idf!16975
2022-02-15 10:36:56 +00:00
a0666b9be8 TWAI: FIFO overrun handling and errata workarounds
This commit adds handling for FIFO overruns and
adds workarounds for HW erratas on the ESP32.

Closes https://github.com/espressif/esp-idf/issues/2519
Closes https://github.com/espressif/esp-idf/issues/4276
2022-02-15 14:16:53 +08:00
90ee294139 TWAI: Track HW state in HAL
This commit refactors the TWAI HAL such that it now tracks
the harwdare's state instead of at the driver layer.
Some HAL and LL cleanup was also done.
2022-02-15 14:16:53 +08:00
c4ae443171 esp_wifi: refactor modem sleep access phy 2022-02-15 11:48:03 +08:00
cf2093be03 esp_wifi: store PHY digital registers before disabling PHY and load
them after enabling PHY
2022-02-15 11:43:10 +08:00
8920361ff3 make esp32 same to esp32s2 in esp_phy_enable() 2022-02-15 11:43:10 +08:00
d472641430 esp_wifi: refactor PHY access
- Simplify PHY access API
- Move coexist initializing and deinitializing out from PHY API
  to Wi-Fi and Bluetooth
- Remove coexist pause and resume for they are no longer needed.
2022-02-15 11:43:10 +08:00
e70c238be0 Merge branch 'bugfix/enterprise_certs_weak_md_v4.2' into 'release/v4.2'
esp_wifi: Fixed issue of weak md for certificates in wifi_enterprise example.(v4.2)

See merge request espressif/esp-idf!16990
2022-02-15 03:39:45 +00:00
15a20d8100 Merge branch 'bugfix/sdio_slave_dma_desc_int_v4.2' into 'release/v4.2'
sdio_slave: Fixed the issue that DMA descriptors allocated to non-DMA capable area (v4.2)

See merge request espressif/esp-idf!17139
2022-02-15 03:38:38 +00:00
6f2d77ed2c Merge branch 'bugfix/mdns_null_deref_fuzzer_v4.2' into 'release/v4.2'
mdns: Fix potential null deref reported by fuzzer test(v4.2)

See merge request espressif/esp-idf!17145
2022-02-15 03:37:55 +00:00
3055474491 Merge branch 'bugfix/usb_device_struct_cleanup_v4.2' into 'release/v4.2'
USB: Cleanup device side struct and fix incorrect DM pulldown configuration (v4.2)

See merge request espressif/esp-idf!17102
2022-02-15 03:28:01 +00:00
128f228169 Merge branch 'bugfix/rmt_s2_doesnt_support_rx_wrap_v4.2' into 'release/v4.2'
rmt: do not support rx wrap on esp32s2 (v4.2)

See merge request espressif/esp-idf!17081
2022-02-15 03:07:16 +00:00
95f7e51af0 Merge branch 'bugfix/eap_client_crash_v4.2' into 'release/v4.2'
wpa_supplicant: Fix memory corruption (v4.2)

See merge request espressif/esp-idf!17130
2022-02-15 03:06:40 +00:00
aed907c728 sdio_slave: fixed the issue that interrupt may be cleared with finished trans unhandled 2022-02-15 00:01:46 +08:00
3e9eec1ebf Fix incorrect D- pulldown and cleanup USB device struct
This commit fixes the incorrect setting of the D- pulldown resistor in the USB LL.
The usb_struct.h used by USB device mode has also been cleaned up.
2022-02-14 23:51:32 +08:00
3efd220463 mdns: Fix potential null deref reported by fuzzer test 2022-02-14 22:52:26 +08:00
7482ad5139 Merge branch 'bugfix/support_esp32s2_eco1_v4.2' into 'release/v4.2'
esp_phy: Update ESP32S2 phy lib to support eco1 chip(v4.2)

See merge request espressif/esp-idf!16722
2022-02-14 12:40:55 +00:00
faba034955 Merge branch 'bugfix/clear_whitelist_v4.2' into 'release/v4.2'
Nimble : Modify `ble_gap_wl_set` to support clearing complete whitelist

See merge request espressif/esp-idf!16942
2022-02-14 10:47:02 +00:00
7d376a36f0 Merge branch 'feature/pro_recv_hb_forv4.2' into 'release/v4.2'
provisioner receive heartbeat message(v4.2)

See merge request espressif/esp-idf!16640
2022-02-14 06:10:15 +00:00
9150716570 Merge branch 'bugfix/filter_repeated_packages_forv4.2' into 'release/v4.2'
filter repeated packages then send response(v4.2)

See merge request espressif/esp-idf!16820
2022-02-14 06:09:45 +00:00
6f7badf942 filter repeated packages then send response(v4.2) 2022-02-14 06:09:44 +00:00
a5ce5002c0 Merge branch 'bugfix/modbus_fix_invalid_error_handling_for_duplicate_param_key_v42' into 'release/v4.2'
freemodbus: fix invalid error handling for duplicate param key (backport v4.2)

See merge request espressif/esp-idf!14787
2022-02-14 06:09:03 +00:00
a609fb0f02 Merge branch 'fix/gitlab_404_local_mirror_v4.2' into 'release/v4.2'
Handle gitlab 404 error (v4.2)

See merge request espressif/esp-idf!16960
2022-02-14 06:08:38 +00:00
893fae229c Merge branch 'bugfix/task_wdt_timeout_uint32_overflow_v4.2' into 'release/v4.2'
Task WDT: Fix overflow issue during timeout calculation (v4.2.3)

See merge request espressif/esp-idf!16983
2022-02-14 06:08:10 +00:00
82c529a773 Merge branch 'bugfix/mcpwm-deadtime-preset-config-backport_v4.2' into 'release/v4.2'
MCPWM/deadtime: fix and sync preset deadtime modes with well-known definition (backport v4.2)

See merge request espressif/esp-idf!14623
2022-02-14 06:02:37 +00:00
54251cfada MCPWM/deadtime: fix and sync preset deadtime modes with well-known definition (backport v4.2) 2022-02-14 06:02:36 +00:00
dbf33d7947 sdio_slave: fixed the issue DMA desc not capable 2022-02-14 12:57:57 +08:00
4d9a68e091 Merge branch 'flash/add_th_support_v4.2' into 'release/v4.2'
spi_flash: add support for th 1M flash(backport v4.2)

See merge request espressif/esp-idf!16717
2022-02-14 04:45:59 +00:00
b4862d1ba2 Merge branch 'feature/support_new_psram_v4.2' into 'release/v4.2'
psram: add ESP32-D0WD-R2-V3 support(backport v4.2)

See merge request espressif/esp-idf!16709
2022-02-13 14:45:30 +00:00
c7b5d3494c rmt: do not support rx wrap on esp32s2
Closes https://github.com/espressif/esp-idf/issues/8354
2022-02-13 12:20:20 +08:00
a7c053c28d Merge branch 'bugfix/add_hw_flow_ctrl_for_uart_test_v4.2' into 'release/v4.2'
driver: add diagnostic information into UART test, enable flow control (v4.2)

See merge request espressif/esp-idf!17115
2022-02-12 20:03:30 +00:00
eec9d6db94 wpa_supplicant: Fix invalid memory dereference 2022-02-12 10:36:00 +05:30
9c81bceb0e Task WDT: Fix overflow issue during timeout calculation
Closes https://github.com/espressif/esp-idf/issues/8239
2022-02-11 15:57:33 +08:00
dd67f769d9 driver: add diagnostic information into UART test, enable flow control 2022-02-11 13:47:06 +08:00
3e1efffd8a Nimble : Modify ble_gap_wl_set to support clearing complete whitelist 2022-02-11 10:35:01 +05:30
067678bdf9 ci: enable unit test for S2 by default 2022-02-11 04:09:17 +00:00
9e7811b95e Merge branch 'bugfix/rd_rem_ext_feats_delayed_cs_4.2' into 'release/v4.2'
bugfix/fix cs event for rd_rem_ext_feats delayed issue (v4.2)

See merge request espressif/esp-idf!16892
2022-02-11 02:59:01 +00:00
8fed5801f7 Merge branch 'bugfix/add_dummy_to_total_size_v4.2' into 'release/v4.2'
Tools: fix bug with total size calculation issue (v4.2)

See merge request espressif/esp-idf!16862
2022-02-10 14:04:35 +00:00
d090020409 Merge branch 'bugfix/rm_copyright_ignore_list_v4.2' into 'release/v4.2'
CI: Remove unused copyright ignore list (v4.2)

See merge request espressif/esp-idf!16967
2022-02-10 14:03:58 +00:00
14038003be Merge branch 'bugfix/win_rename_delay_v4.2' into 'release/v4.2'
Tools: Use delay between rename attempts on Windows in the installer (v4.2)

See merge request espressif/esp-idf!17058
2022-02-10 14:03:42 +00:00
dc50f0e828 Merge branch 'bugfix/fix_spi_cs_hold_time_issue_v4.2' into 'release/v4.2'
spi_master: fix spi cs_ena_posttrans issue (v4.2)

See merge request espressif/esp-idf!16688
2022-02-10 09:37:34 +00:00
d1ada53a7d Merge branch 'bugfix/wps_fixes_v4.2' into 'release/v4.2'
wpa_supplicant: Add WPS Fixes (backport V4.2)

See merge request espressif/esp-idf!17062
2022-02-10 08:14:23 +00:00
17b8fbfc1b fix cs evt for rd_rem_ext_feats delayed issue 2022-02-10 15:28:26 +08:00
10c604475d esp_phy: Update ESP32S2 phy lib to support eco1 chip 2022-02-10 14:00:53 +08:00
eb90d9bf18 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:13:01 +05:30
6a2255a18b Tools: Use delay between rename attempts on Windows in the installer 2022-02-08 11:09:15 +01:00
018524ec7e examples: Add the component manager example 2022-02-02 16:44:44 +01:00
3a4218156c docs: Add component manager documentation 2022-02-02 16:44:43 +01:00
5594a511c9 Build System: Don't track dependencies.lock 2022-02-02 16:44:43 +01:00
d955043aea Add idf-component-manager python dependency 2022-02-02 16:44:43 +01:00
ef8a76c667 esp_wifi: Fixed issue of weak md for certificates in wifi_enterprise example. 2022-01-28 15:31:18 +05:30
ddb8c8ddfd add test for checking memory segments with esptool.py 2022-01-27 15:07:38 +01:00
69e04fc263 CI: Remove unused copyright ignore list 2022-01-27 12:51:58 +01:00
7c3878b288 Handle gitlab 404 error
ci: do not retry on 404 when LOCAL_GITLAB_HTTPS_HOST not set
2022-01-27 11:44:44 +01:00
d72fa4e62a tools/idf_size: Fixed bug with wrong memory calculation 2022-01-19 18:13:32 +01:00
fcce82ea53 Merge branch 'bugfix/modbus_port_fix_lgpl_licensed_files_v4.2' into 'release/v4.2'
freemodbus: fix port contains lgpl licensed files (v4.2)

See merge request espressif/esp-idf!16551
2022-01-19 08:23:42 +00:00
0e42db7ca8 Merge branch 'bugfix/fix_tbtt_and_phy_issues_v4.2' into 'release/v4.2'
esp_wifi: fix tbtt and phy issues (Backport v4.2)

See merge request espressif/esp-idf!16829
2022-01-19 05:01:12 +00:00
2df406b6ce esp_wifi:
1. fix the issue that no tbtt is generated in station+softap mode when maximum modem sleep is enabled
2. store PHY digital registers before disabling PHY and load them after enabling PHY
3. update libphy.a to V4670 719f9f6_20210218 for esp32
4. update libphy.a to V1500 20210225_0a54a2f for esp32s2
2022-01-18 13:18:36 +08:00
c98745a5aa esp_wifi: store PHY digital registers before disabling PHY and load
them after enabling PHY
2022-01-18 13:18:36 +08:00
615ba73c4e Merge branch 'bugfix/fix_wifi_bugs_20220114_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs (Backport v4.2)

See merge request espressif/esp-idf!16795
2022-01-18 05:16:34 +00:00
459674c444 esp_wifi: Fixed null pointer dereference 2022-01-14 15:00:52 +08:00
c01c7acdab esp_wifi:
1. Fixed sniffer fcs error crash issue
2. Added support of SHA256 AKM without PMF enabled
3. Added station based check for auth frame formation
2022-01-14 14:57:51 +08:00
69b8e2af84 example: Fix espnow stuck issue 2022-01-14 14:26:02 +08:00
f70ac4e529 fix phy init memory leak 2022-01-14 14:26:02 +08:00
28a340af37 Init phy data to default if invalid in flash partition to avoid bootloops
Signed-off-by: ronghulin <ronghulin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6610
2022-01-14 14:26:02 +08:00
fa0edda538 Bugfix: Connect example to add scan mode config 2022-01-14 14:26:02 +08:00
909db7cd91 Merge branch 'mesh/bugfix_fix_layer2_node_connection_issue_v4.2' into 'release/v4.2'
esp_wifi_mesh: fix the issue that layer2 node connect to lower-layer node when FIXED-ROOT root disappeared(backport_v4.2)

See merge request espressif/esp-idf!15730
2022-01-14 05:32:46 +00:00
0336c5f525 Merge branch 'bugfix/wpa3_memory_leak_v4.2' into 'release/v4.2'
esp_wifi: Fixes memory leak in wpa3 connection.(v4.2)

See merge request espressif/esp-idf!16561
2022-01-14 04:42:53 +00:00
cf5d7befaf Merge branch 'bugfix/PRs_on_esp_hid_v4.2' into 'release/v4.2'
bugfix/handle_2_esp_hid_PRs (v4.2)

See merge request espressif/esp-idf!16710
2022-01-14 03:12:41 +00:00
9b53301b4d Merge branch 'bugfix/fix_spp_open_err_bda_v4.2' into 'release/v4.2'
Component_bt/Fix SPP acceptor open with wrong remote address[backport 4.2]

See merge request espressif/esp-idf!16615
2022-01-14 03:12:03 +00:00
85a36b86d0 Merge branch 'bugfix/touch_ll_get_sleep_time_v4.2' into 'release/v4.2'
Fixed error in "touch_ll_get_sleep_time" function for ESP32 (v4.2)

See merge request espressif/esp-idf!16249
2022-01-14 03:05:00 +00:00
9bf6cf5ed4 Merge branch 'bugfix/alarm_update_invalid_v4.2' into 'release/v4.2'
timer: stop alarm if alarm value doesn't change in ISR callback (v4.2)

See merge request espressif/esp-idf!16534
2022-01-14 03:04:36 +00:00
6683751579 Merge branch 'bugfix/gpio_uninstall_isr_service_intr_wdt_crash_v4.2' into 'release/v4.2'
gpio: Bugfix - Move esp_intr_free() out of the critical section in gpio_uninstall_isr_service() (backport v4.2)

See merge request espressif/esp-idf!16597
2022-01-14 03:04:15 +00:00
8f836882d4 Merge branch 'bugfix/fix_smartconfig_setopt_fail_v4.2' into 'release/v4.2'
smartconfig: Fix smartconfig set socket option fail (backport v4.2)

See merge request espressif/esp-idf!16773
2022-01-14 03:03:37 +00:00
7ad199d14a Merge branch 'feature/oocd_ver_upgrade_v4.2' into 'release/v4.2'
tools: Updates OpenOCD version to 'v0.11.0-esp32-20211220' (v4.2)

See merge request espressif/esp-idf!16767
2022-01-13 16:23:16 +00:00
1ebd52f36a smartconfig: Fix smartconfig set socket option fail 2022-01-13 11:00:13 +08:00
698efba393 Merge branch 'bugfix/fix_modbus_rs485_rts_en_fail_v42' into 'release/v4.2'
Bugfix/fix modbus rs485 rts en fail (backport v4.2)

See merge request espressif/esp-idf!11566
2022-01-12 08:44:05 +00:00
5f2f1c013a Merge branch 'bugfix/app_compatible_with_3_1_bootloader_v4.2' into 'release/v4.2'
esp_system: Fix RTC_WDT protection in esp_restart_noos (v4.2)

See merge request espressif/esp-idf!16742
2022-01-12 08:37:55 +00:00
57c429e618 tools: Updates OpenOCD version to 'v0.11.0-esp32-20211220' 2022-01-12 09:30:24 +01:00
476a0eb26d Merge branch 'fix/remove_deprecated_macro_SPI_TRANS_SET_CD_v4.2' into 'release/v4.2'
Remove a deprecated macro: SPI_TRANS_SET_CD (v4.2)

See merge request espressif/esp-idf!16690
2022-01-12 05:50:53 +00:00
aa445dceeb Merge branch 'bugfix/adc_power_issue_4.2' into 'release/v4.2'
adc: fix adc power issue (4.2)

See merge request espressif/esp-idf!14280
2022-01-12 03:38:19 +00:00
9b5e0fb672 Merge branch 'bugfix/a2dp_source_congest_v4.2' into 'release/v4.2'
component_bt: Fixed a2dp source audio data packet congestion causing choppy audio in a2dp sink(v4.2)

See merge request espressif/esp-idf!16708
2022-01-11 02:41:55 +00:00
3516d536ca Merge branch 'bugfix/config_parse_crash_after_flash_erase_v4.2' into 'release/v4.2'
component_bt: fixed config parse crash after flash_erase(v4.2)

See merge request espressif/esp-idf!16696
2022-01-11 02:39:23 +00:00
18f2078c5c 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:58:01 +08:00
ddb7d6c4a0 Merge branch 'docs/fixed_typos_in_esp32-s2-saola-1_user_guide' into 'release/v4.2'
Docs: Fixed typos in ESP32-S2-Saola-1 user guide (backport v4.2)

See merge request espressif/esp-idf!16695
2022-01-10 09:54:42 +00:00
e59e7e1432 spi_flash: add support for th 1M flash 2022-01-10 11:53:37 +08:00
dfa736b0e3 psram: add ESP32-D0WD-R2-V3 support 2022-01-10 11:06:25 +08:00
f41d77cce9 btc_a2dp_control_set_datachnl_stat is only used by a2dp sink 2022-01-10 11:01:41 +08:00
45b9b12c04 remove btc_a2dp_dispatch_datapath_evt and event 2022-01-10 11:00:59 +08:00
cf2f2a44c7 Fixed the crash caused by calling esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_START) after stream started 2022-01-10 11:00:03 +08:00
190bd80f3d Fixed a2dp source audio data packet congestion causing choppy audio in a2dp sink 2022-01-10 10:59:43 +08:00
239e56541c freemodbus: fix uart_wait_tx_done() reenable tx_done interrupt 2022-01-07 16:45:47 +00:00
9ac8205208 freemodbus: fix rts enable fail when transmit frame 2022-01-07 16:45:47 +00:00
4c5099d194 freemodbus: fix modbus rs485 rts enable fail v42 2022-01-07 16:45:47 +00:00
bf8bff9870 freemodbus: fix invalid error handling for duplicate param_key 2022-01-07 16:09:25 +00:00
ae676e3491 fixed config parse crash after flash_erase
Closes https://github.com/espressif/esp-idf/issues/6170
2022-01-07 17:13:03 +08:00
a30cfb2ef3 docs/fixed_typos_in_esp32-s2-saola-1_user_guide 2022-01-07 17:01:53 +08:00
fec6e140fb fix: remove a deprecated macro: SPI_TRANS_SET_CD 2022-01-07 16:39:31 +08:00
9f0c9ff2f0 Merge branch 'doc/target_specifc_doxygen_header_v4.2' into 'release/v4.2'
docs: change some header path to use IDF_TARGET (v4.2)

See merge request espressif/esp-idf!15804
2022-01-07 07:49:26 +00:00
ca6636c33e spi_master: fix spi cs_ena_posttrans issue 2022-01-07 14:28:57 +08:00
2f02a80d31 docs: change some header path to use IDF_TARGET
Some header path were using hardcoded esp32 paths, when they should be
target dependent.
2022-01-07 11:16:30 +08:00
2b95a627be Merge branch 'bugfix/set_authmode_by_switching_number_to_string_v4.2' into 'release/v4.2'
CI: set authmode by switching number to string (backport v4.2)

See merge request espressif/esp-idf!16555
2022-01-06 10:09:30 +00:00
a129933ccd adc: apply adc power API to adc driver 2022-01-06 11:42:55 +08:00
56cfd0b86b Merge branch 'bugfix/idf_tools_test_without_versions_v4.2' into 'release/v4.2'
Tools: Load tool versions automatically for IDF Tools tests (v4.2)

See merge request espressif/esp-idf!16512
2022-01-04 09:48:09 +00:00
8a47cdeb2d add cmd to publish and recv heartbeat message 2022-01-04 15:56:45 +08:00
dca26e3fe9 Merge branch 'bugfix/psram_fix_bootloader_v4.2' into 'release/v4.2'
bootloader: disable psram cache bug fix for bootloader (v4.2)

See merge request espressif/esp-idf!15806
2022-01-02 06:13:12 +00:00
4b3b77e4e8 fix SPP open with wrong remote bd_addr 2021-12-31 15:46:15 +08:00
7ef8012019 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)
2021-12-30 14:45:13 +08:00
000599986f Fixed left right key confusion in comments.
"Left" and "Right" were swapped in some comments.
2021-12-30 11:02:54 +08:00
e9714eaaa5 spacing styling correction 2021-12-30 11:02:54 +08:00
c115194e88 minor styling changes 2021-12-30 11:02:54 +08:00
77c3a113bf 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 11:02:54 +08:00
5f137204b1 Merge branch 'bugfix/ringbuf_read_pointer_wrap_v4.2' into 'release/v4.2'
ringbuf: Fix bug where comparision between a signed and unsigned operand resulted in incorrect free size for no-split/allow-split buffers (v4.2)

See merge request espressif/esp-idf!15883
2021-12-30 02:22:05 +00:00
f94ce9f51d Merge branch 'bugfix/fix_select_timeout_v4.2' into 'release/v4.2'
VFS: `select` function's timeout is now POSIX compliant (backport v4.2)

See merge request espressif/esp-idf!16191
2021-12-30 02:20:31 +00:00
0b98671385 esp_wifi: Fixes memory leak in wpa3 connection. 2021-12-28 11:37:23 +05:30
fac6a5af5b bugfix: set authmode by switching number to string (backport v4.2) 2021-12-27 20:00:33 +08:00
394c2c100f 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.
2021-12-27 11:12:32 +01:00
c6134337a6 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-12-27 15:14:17 +08:00
31327caaf5 Merge branch 'bugfix/ringbuf_send_semaphore_release_order_v4.2' into 'release/v4.2'
esp_ringbuf: Fix order of semaphore release in xRingbufferSend (v4.2)

See merge request espressif/esp-idf!16231
2021-12-24 06:16:47 +00:00
93c784e1c8 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-24 13:08:33 +08:00
775701d610 Merge branch 'feature/mbedtls-2.16.12-integration_v4.2' into 'release/v4.2'
mbedtls: upgrade to release v2.16.12 (v4.2)

See merge request espressif/esp-idf!16485
2021-12-24 03:20:34 +00:00
6df7b049a3 esp_ringbuf: Fix assertion xQueueGenericSend queue.c
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-23 15:53:48 +08:00
5ed4a3dbfb esp_wifi_mesh: fix the device can not receive IP_EVENT_STA_GOT_IP when the router restarted
1. fix the device can not receive IP_EVENT_STA_GOT_IP when the router restarted
2. fix the issue that layer2 node connect to lower-layer node when FIXED-ROOT root disappeared
2021-12-23 11:19:19 +08:00
9273f5045e Merge branch 'bugfix/fix_rx_fragment_error_issue_v4.2' into 'release/v4.2'
esp_wifi: fix fragment issue and PMF compatible for faulty APs(Backport v4.2)

See merge request espressif/esp-idf!16398
2021-12-22 17:33:54 +00:00
1699624dff Tools: Load tool versions automatically for IDF Tools tests 2021-12-22 10:37:01 +01:00
1319034019 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 14:03:30 +05:30
50df004292 mbedtls: small documentation update 2021-12-21 14:03:30 +05:30
e7687c7688 Merge branch 'bugfix/fix_spp_listen_err_v4.2' into 'release/v4.2'
Component_bt/Fix SPP cannot malloc slot bugs[backport v4.2]

See merge request espressif/esp-idf!16385
2021-12-21 05:28:25 +00:00
0c15051452 Merge branch 'bugfix/wpa_supplicant_logs_release_v4.2' into 'release/v4.2'
esp_wifi: Change the verbosity of wpa_supplicant logs. (Backport v4.2)

See merge request espressif/esp-idf!16347
2021-12-21 03:36:28 +00:00
b4d4cbdd41 Merge branch 'bugfix/address_already_used_exception_in_ota_tests_v4.2' into 'release/v4.2'
Fix 'address already in use' exception in OTA tests (v4.2)

See merge request espressif/esp-idf!16418
2021-12-20 07:11:53 +00:00
db669217ac Merge branch 'feature/support_ble_direct_ind_low_adv_v4.2' into 'release/v4.2'
components/bt: Support low duty cycle directed advertising(backport release/v4.2)

See merge request espressif/esp-idf!16379
2021-12-20 03:11:22 +00:00
46b58b5934 Fix for advanced_ota_redirect_url example failure in CI 2021-12-16 12:26:17 +05:30
769099dd64 Merge branch 'bugfix/lwip_config_dhcp_client_id_v4.2' into 'release/v4.2'
lw-ip: Add config for DHCP client id; Fix DNS server idx assert issue (v4.2)

See merge request espressif/esp-idf!16174
2021-12-16 06:43:41 +00:00
a687c3413e 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
2021-12-16 10:33:27 +05:30
33a6effd3e Merge branch 'feature/support_eap_fast_release_v4.2' into 'release/v4.2'
Feature/support eap fast release v4.2

See merge request espressif/esp-idf!16142
2021-12-16 03:37:49 +00:00
0204aea35b Merge branch 'bugfix/fix_blufi_encryption_fail_v4.2' into 'release/v4.2'
components/bt: fix blufi encryption fail(backport release/v4.2)

See merge request espressif/esp-idf!16316
2021-12-16 03:33:51 +00:00
0eb18951be lwip: Add config for DHCP client id; Fix DNS server idx assert issue
This commit brings two esp-lwip fixes to IDF:

1) Add configuration to disable DHCP client identification
2195f7416f
This config could be used to disable option 61 in DHCP packets, so that
clients will be identified by their  chaddr only.
(This is the lwip upstream original behaviour)

2) Fix server_idx increasing to DNS_MAX_SERVERS and trigger the LWIP_ASSERT
5a567d52f7
When lwip doesn't have DNS server and resolve a domain address, the server_idx
will increase to DNS_MAX_SERVERS, which will trigger the LWIP_ASSERT and make device crash.

Closes https://github.com/espressif/esp-idf/issues/7912
2021-12-15 13:17:03 +01:00
0877949237 Merge branch 'bugfix/fix_esp32h2_efuse_get_ext_mac_v4.2' into 'release/v4.2'
efuse_table_gen: Fixes wrong joining fields with omitted names  (v4.2)

See merge request espressif/esp-idf!15739
2021-12-14 14:07:39 +00:00
8c3b358abf 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 19:44:31 +08:00
6f8ad7eb5e docs: Update miswritten and abbreviated words and syntax errors for initialize WiFi section in esp_wifi.h header file 2021-12-14 19:43:54 +08:00
6baac84d4a 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 19:28:31 +08:00
bab60d20af esp_wifi: Add an example for EAP-FAST. 2021-12-14 12:45:04 +05:30
69ca323a74 esp_wifi: Add support for EAP-FAST authentication method 2021-12-14 12:37:26 +05:30
146bbe95be components/bt: Fix high duty cycle directed advertising will not be stopped when timeout 2021-12-14 14:10:29 +08:00
b3adae9b40 components/bt: Support low duty cycle directed advertising 2021-12-14 14:10:29 +08:00
6c2d8ea653 fix SPP server bugs when the BTC layer can not allocate a slot for the listen port 2021-12-14 11:16:42 +08:00
c327a0016e Merge branch 'feature/local_control_sec1_v4.2' into 'release/v4.2'
Added support for security1 in local control (backport v4.2)

See merge request espressif/esp-idf!15280
2021-12-09 16:55:22 +00:00
01ebb72f0a Merge branch 'bugfix/remove_PIP_USER_v4.2' into 'release/v4.2'
tools: Add check for PIP_USER variable (backport v4.2)

See merge request espressif/esp-idf!16336
2021-12-09 08:10:10 +00:00
f278db260e esp_local_ctrl: Added documentation to chose protocom security
Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-12-09 15:26:14 +08:00
3af5f20da1 Added support for security1 in local control
1. Added config options to chose from protocom security.
    It can be chosen 0/1 or custom.
    Possible to set POP as well

2. Added support in `esp_local_ctrl.py` test script for sec_ver selection

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-12-09 15:26:14 +08:00
c3e66a4ba2 esp_wifi: Change the verbosity of wpa_supplicant logs. 2021-12-09 12:55:32 +05:30
2fa5cee80d Merge branch 'bugfix/fix_some_wifi_bugs_20211202_v4.2' into 'release/v4.2'
fix wifi bugs 20211202 (backport v4.2)

See merge request espressif/esp-idf!16256
2021-12-09 06:19:06 +00:00
a43a21a761 tools: Add check for PIP_USER variable
Closes https://github.com/espressif/esp-idf/issues/7910
2021-12-08 16:18:39 +01:00
ab7ad4e771 components/bt: fix blufi encryption fail 2021-12-08 14:09:29 +08:00
5cc2eb15c9 Merge branch 'bugfix/bootloader_debug_buffers_v4.2' into 'release/v4.2'
bootloader_support: Fix and re-enable bootloader_debug_buffer function (v4.2)

See merge request espressif/esp-idf!16075
2021-12-07 02:34:42 +00:00
e694ffd5af Merge branch 'bugfix/link_spi_flash_rom_func_in_bootloader_stage_v4.2' into 'release/v4.2'
esp_rom: link rom spi flash functions in bootloader stage (v4.2)

See merge request espressif/esp-idf!15258
2021-12-06 03:57:55 +00:00
6317335174 Merge branch 'feature/add_coex_hci_command_v4.2' into 'release/v4.2'
Add hci command to set coexistence status (v4.2)

See merge request espressif/esp-idf!16055
2021-12-06 03:57:11 +00:00
38714c37d1 Merge branch 'feature/adds_fault_injection_protection_for_check_anti_rollback_v4.2' into 'release/v4.2'
bootloader_support: Adds fault injection protection for check_anti_rollback (v4.2)

See merge request espressif/esp-idf!16181
2021-12-06 03:56:33 +00:00
36574af3c9 Merge branch 'reduce_bootup_time_when_using_usb-serial-jtag_v4.2' into 'release/v4.2'
rtc_clk: reduce bootup time when using usb-serial-jtag(backport v4.2)

See merge request espressif/esp-idf!16262
2021-12-06 03:55:21 +00:00
06db6f510f Merge branch 'feature/add_dhcp_option_v4.2' into 'release/v4.2'
lw-ip: Add macro to disable vendor class option(backport v4.2)

See merge request espressif/esp-idf!15982
2021-12-06 03:54:59 +00:00
417711c390 reduce bootup time when using usb-serial-jtag 2021-12-03 21:01:02 +08:00
aa5e034c52 eps_wifi:
1. Fix airkiss and esptouch find channel crash issue
2. Fix RF singal test without 9M rate issue
3. Fix issue of setting invalid size to nvs misc log even after erasing it
4. Fix WEP connection and crash issue
2021-12-03 17:59:31 +08:00
a249794640 esp_wifi: Add beacon timeout event 2021-12-03 15:37:06 +08:00
721fe216e7 wpa_supplicant: Fix wps_free_pins to remove all pins
Current code does not correctly free all pins in wps_free_pins due to the
semicolon at the end of dl_list_for_each_safe(). Fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
2021-12-03 14:35:55 +08:00
f74b5accf3 Fixed error in "touch_ll_get_sleep_time" function for ESP32
Merges https://github.com/espressif/esp-idf/pull/6895
2021-12-03 12:41:31 +08:00
37634f09b2 Merge branch 'fix/remove_warning_when_disabling_rom_dl_mode_v4.2' into 'release/v4.2'
secure_boot: Fix warning when UART ROM DL mode is disabled (v4.2)

See merge request espressif/esp-idf!16239
2021-12-03 04:27:14 +00:00
b656c406bf Merge branch 'bugfix/enable_gpio_20_v4.2' into 'release/v4.2'
gpio: Enable IO20 on ESP32 (backport v4.2)

See merge request espressif/esp-idf!15023
2021-12-03 03:39:47 +00:00
19643f715c Merge branch 'bugfix/fix_memory_leak_controller_deinit_v4.2' into 'release/v4.2'
ESP32: Fix memory leak in controller deinit function v4.2

See merge request espressif/esp-idf!15970
2021-12-03 03:32:18 +00:00
c3eb64ef85 Merge branch 'feature/oocd_ver_upgrade_v4.2' into 'release/v4.2'
tools: Updates OpenOCD version to 'v0.10.0-esp32-20211111' (v4.2)

See merge request espressif/esp-idf!16001
2021-12-02 17:28:37 +00:00
3c3711dcc3 idf_tools: Adds 'linux-armhf' platform support 2021-12-02 16:53:28 +03:00
c2ffbaf683 tools: Updates OpenOCD version to 'v0.10.0-esp32-20211111' 2021-12-02 16:53:23 +03:00
bffa30785b secure_boot: Fix warning when UART ROM DL mode is disabled
*Additionally use updated calls to enable rom secure download mode
2021-12-02 21:40:49 +08:00
adda59cc97 bootloader: add anti-FI checks around secure version in anti-rollback scheme 2021-12-02 21:17:27 +08:00
392a126b05 Merge branch 'bugfix/ci_fix_clean_dir' into 'release/v4.2'
ci: Fix build system tests to clean the dir

See merge request espressif/esp-idf!16221
2021-12-02 12:08:49 +00:00
b5d459ee05 ci: Fix build system tests to clean the dir 2021-12-01 18:29:42 +01:00
8ffd02be29 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-30 21:02:23 +08:00
53daf3dbbf 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 12:22:55 +08:00
a4ced2bf55 Merge branch 'bugfix/coredump_esp_panic_reason_v4.2' into 'release/v4.2'
coredump: Fixes ESP-specific panic reasons handling (v4.2)

See merge request espressif/esp-idf!16069
2021-11-26 11:00:41 +00:00
77a46fd122 Merge branch 'bugfix/doskey_v4.2' into 'release/v4.2'
tools: fix export.bat /tools/idf.py not found issue (v4.2)

See merge request espressif/esp-idf!16050
2021-11-26 10:09:04 +00:00
d8f9e53504 Merge branch 'feature/remove_component_manager_tests_v4.2' into 'release/v4.2'
ci: Remove component manager test from build system tests (v4.2)

See merge request espressif/esp-idf!16108
2021-11-26 05:17:43 +00:00
fccaf93a87 Merge branch 'feature/docker_build_use_git_mirror_v4.2' into 'release/v4.2'
ci: use LOCAL_GIT_MIRROR in docker build job, if set (v4.2)

See merge request espressif/esp-idf!16112
2021-11-25 05:33:45 +00:00
ccb1afa97a 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:45:02 +01:00
eee3af33d6 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 15:13:14 +01:00
792bc9a587 Merge branch 'feature/json_schema_for_idf_size_v4.2' into 'release/v4.2'
tools: add json schema for idf_size (v4.2)

See merge request espressif/esp-idf!15961
2021-11-24 09:00:43 +00:00
3cfcf2b4fd lwip: Add macro to disable vendor class option 2021-11-23 19:37:50 +08:00
6d7aa57177 coredump: Fixes core dump private header inclusion guard 2021-11-23 13:06:18 +03:00
0473ddffa7 coredump: Fixes ESP-specific panic reasons handling 2021-11-23 13:06:03 +03:00
d4c247dac6 Merge branch 'bugfix/fix_static_check_error_mr_4.2' into 'release/v4.2'
Fix the high-impact issues from the code analysis report from customer.

See merge request espressif/esp-idf!16046
2021-11-23 07:27:18 +00:00
440d1aeb25 Merge branch 'bugfix/leedarson_v4.2' into 'release/v4.2'
component_bt: Fix some code logic errors (v4.2)

See merge request espressif/esp-idf!16030
2021-11-23 07:26:55 +00:00
c1f7f216e3 Merge branch 'bugfix/register_non_32bit_access_v4.2' into 'release/v4.2'
hal: avoid non-32bit access to registers (v4.2)

See merge request espressif/esp-idf!15617
2021-11-23 07:26:31 +00:00
3beae7c8ef Add hci command to set coexistence status 2021-11-23 11:48:39 +08:00
999abf403e tools: {install, export}.bat: fix path quoting
Also includes fix for DOSKEY definitions.
Closes https://github.com/espressif/esp-idf/issues/7605
Closes https://github.com/espressif/esp-idf/issues/7927
2021-11-22 23:08:49 +01:00
4200865dd1 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:55:03 +08:00
6ab925eaa0 Missing break in switch 2021-11-22 11:48:21 +08:00
163dfb1091 already defined in bt_target.h 2021-11-22 11:47:00 +08:00
028a4c93ff Merge branch 'bugfix/fix_modem_sleep_hw_error_mr_4.2' into 'release/v4.2'
fix modem sleep hw error

See merge request espressif/esp-idf!16019
2021-11-22 03:46:30 +00:00
1733159b08 Dereference after null check 2021-11-22 11:46:30 +08:00
a8c653b094 Dereference before null check 2021-11-22 11:43:35 +08:00
0ef796bfc2 Logically dead code 2021-11-22 11:43:05 +08:00
14cdcae482 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 16:17:31 +08:00
e74f0665fc Merge branch 'feature/ci_runner_failure_retries_v4.2' into 'release/v4.2'
ci: runner system failure retries (v4.2)

See merge request espressif/esp-idf!15724
2021-11-19 08:02:26 +00:00
05b1f873bd Merge branch 'bugfix/fix_custmoer_issues_v4.2' into 'release/v4.2'
bugfix/fix_3_controller_issues_v4.2

See merge request espressif/esp-idf!15978
2021-11-19 03:36:07 +00:00
c2a94ba1aa 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.
2021-11-17 20:42:29 +08:00
88e3ec6f03 Merge branch 'bugfix/create_dir_idf_env_v4.2' into 'release/v4.2'
tools: Create the ".espressif" directory on the first run on clean system (v4.2)

See merge request espressif/esp-idf!15857
2021-11-16 15:47:47 +00:00
160afee96c - fix HCI_Read_Clock error
- fix HCI_Create_Connection_Cancel error
- fix ASSERT_WARN during epr
2021-11-16 17:10:30 +08:00
3c69e6c990 tools: add json schema for idf_size 2021-11-15 18:45:08 +01:00
a1b16acf7a Merge branch 'bugfix/efuse_stdbool_v4.2' into 'release/v4.2'
efuse: Add missing stdbool.h include file (v4.2)

See merge request espressif/esp-idf!15937
2021-11-15 15:39:03 +00:00
ccef7c1712 Merge branch 'bugfix/fix_ota_crash_backport_v4.2' into 'release/v4.2'
spi_flash: fix app crash when OTA because the OTA task's stack is in rtc fast memory(backport v4.2)

See merge request espressif/esp-idf!15861
2021-11-15 02:32:54 +00:00
f84e55bea2 Merge branch 'bugfix/LAN8720_reset_assertion_v4.2' into 'release/v4.2'
Increased LAN8720 ETH-PHY reset assertion time (v4.2)

See merge request espressif/esp-idf!15827
2021-11-14 21:49:08 +00:00
32d7f8e6f1 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:30:24 -03:00
d2da4598f5 efuse: Add missing stdbool.h include file
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-12 13:30:24 -03:00
047a5bf2f7 Merge branch 'bugfix/aes_unaligned_access_v4.2' into 'release/v4.2'
aes: fix unaligned access (v4.2)

See merge request espressif/esp-idf!15803
2021-11-12 04:27:17 +00:00
ed6f72142f Merge branch 'bugfix/archive_details_always_run_like_diff_v4.2' into 'release/v4.2'
tools: fix bug with idf_size argument archive_details (v4.2)

See merge request espressif/esp-idf!15776
2021-11-11 12:34:14 +00:00
a8ed7f44bb 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-10 21:59:00 +01:00
08c79908fb Merge branch 'bugfix/fix_crash_when_shutdown_bt_v4.2' into 'release/v4.2'
component/bt: fix crash when shutdown bt(backport v4.2)

See merge request espressif/esp-idf!15710
2021-11-10 06:31:40 +00:00
b6b227e6cc fix: app crash when OTA because the OTA task's stack is in rtc fast memory 2021-11-10 14:05:54 +08:00
a7a495f796 aes: fix potential unaligned access of buffers
https://github.com/espressif/esp-idf/issues/7236
2021-11-10 10:01:45 +08:00
97873dbedc change --archive_details output 2021-11-09 14:30:11 +01:00
719207446f 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:03:20 +01:00
fab8e9d1bc Merge branch 'bugfix/hfp_demo_audio_not_sine_v4.2' into 'release/v4.2'
Bugfix/hfp demo audio not sine v4.2

See merge request espressif/esp-idf!15750
2021-11-09 03:05:25 +00:00
0fe219a3f3 fix bootloader build with rom flash driver
Closes https://github.com/espressif/esp-idf/pull/7508
Closes https://github.com/espressif/esp-idf/issues/6849
2021-11-08 14:14:39 +08:00
6ee20240ed component/bt: fix crash when shutdown bt(backport v4.2) 2021-11-08 10:37:31 +08:00
125cf671e7 Merge branch 'bugfix/ble_mesh_host_init_v4.2' into 'release/v4.2'
ble_mesh: nimble: return error if init host twice (v4.2)

See merge request espressif/esp-idf!15789
2021-11-05 03:10:46 +00:00
78fc16d1d3 Merge branch 'bugfix/sig_ble_mesh_errata_e16350_v4.2' into 'release/v4.2'
ble_mesh: stack: Apply the errata E16350 from Bluetooth SIG (v4.2)

See merge request espressif/esp-idf!15785
2021-11-05 03:09:15 +00:00
890114733f Merge branch 'bugfix/ble_conn_latency_max_value_v4.2' into 'release/v4.2'
BLE: Set connection max latency value to 499.

See merge request espressif/esp-idf!15756
2021-11-04 08:55:15 +00:00
49c1dc43f1 Merge branch 'bugfix/define__DOXYGEN___v4.2' into 'release/v4.2'
docs: define __DOXYGEN__ for doxygen builds (v4.2)

See merge request espressif/esp-idf!15681
2021-11-04 05:57:07 +00:00
2f511cfaef bootloader: disable psram cache bug fix for bootloader
The psram cache bug fix was also being applied to the bootloader binary (for cmake),
which doesnt do any psram access.

Applying this fix would increase the binary size, as much as 300 bytes in worst case scenarios
2021-11-04 11:32:15 +08:00
86c5d3136e docs: define __DOXYGEN__ for doxygen builds
Some docs depended on __DOXYGEN__ but this was never defined anywhere.
2021-11-04 10:22:21 +08:00
lly
8106a823bd ble_mesh: nimble: return error if init host twice 2021-11-03 19:22:12 +08:00
lly
b32d6c355a ble_mesh: stack: Apply the errata E16350 from Bluetooth SIG 2021-11-03 19:06:49 +08:00
fbf1df22b7 tools: fix bug with idf_size argument archive_details 2021-11-02 14:24:02 +01:00
e0ea44fa46 BLE: Set connection max latency value to 499. 2021-11-01 16:37:46 +05:30
c0fc6500cf fix hfp_ag demo audio not sine_v4.1 2021-11-01 12:26:40 +08:00
f370d5089f Merge branch 'bugfix/fix_cplusplus_miss_in_dhcp_v4.2' into 'release/v4.2'
dhcpserver: support cplusplus (backport v4.2)

See merge request espressif/esp-idf!15447
2021-10-30 06:21:43 +00:00
939f4dfbc0 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:37:21 +08:00
7097d3c2f4 Merge branch 'bugfix/sdcard_example_format_timeout_v4.2' into 'release/v4.2'
CI: [Examples/Storage] provide sufficient timeout for SD card formatting (v4.2)

See merge request espressif/esp-idf!14912
2021-10-29 09:44:04 +00:00
4f1b5cdb8a Merge branch 'bugfix/fix_http_head_request_v4.2' into 'release/v4.2'
esp_http_client: Fix HEAD request will affect the all next HTTP requests unless we close the HTTP request(backport v4.2)

See merge request espressif/esp-idf!15713
2021-10-29 07:53:49 +00:00
51e00ec105 Examples/Storage: provide sufficient timeout for SD card formatting
Large SD cards (16GB+) require significant amount of time for FS formatting.
Added FS mount checkpoint in example test python, timeout set to 60 sec

Closes IDFCI-706
2021-10-29 15:44:53 +08:00
f97fd4e04e ci: Add retries on runner system failures 2021-10-29 13:50:47 +07:00
fe505c5d1b Merge branch 'bugfix/eap_client_iot_issues_v4.2' into 'release/v4.2'
ESP_WiFi: Fix some wpa enterprise issue (backport V4.2)

See merge request espressif/esp-idf!15573
2021-10-29 04:44:45 +00:00
cb343db4c9 ci: Remove public headers check exceptions for dhcp 2021-10-29 10:34:08 +08:00
40b28a958c dhcpserver: support cplusplus
Closes https://github.com/espressif/esp-idf/issues/7494

Merges https://github.com/espressif/esp-idf/pull/7526
2021-10-29 10:34:08 +08:00
f2347ff434 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:20:04 +08:00
345fe24460 wpa_supplicant: Add missing cflag for legacy makefile 2021-10-28 17:03:06 +05:30
7c402bd790 wpa_supplicant: Update internal tls client with sha384/sha512 support 2021-10-28 17:02:51 +05:30
73933d50e8 esp_wifi: Fix interoperability issue with windows 2008 2021-10-28 16:07:33 +08:00
a790d96441 Merge branch 'bugfix/select_boot_app_v4.2' into 'release/v4.2'
partition_table: Fix case when a few similar to otadata partitions in the table (v4.2)

See merge request espressif/esp-idf!15649
2021-10-28 05:38:28 +00:00
f9c75d82e2 Merge branch 'bugfix/heartbeat_filter_with_acceptlist_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix heartbeat filter with accept list (v4.2)

See merge request espressif/esp-idf!15677
2021-10-28 02:58:36 +00:00
016b848caf Merge branch 'bugfix/remove_assert_when_inq_done_4.2' into 'release/v4.2'
component_bt: fix crash after inquiry has finished (v4.2)

See merge request espressif/esp-idf!15671
2021-10-27 11:28:02 +00:00
41c0ba2ed0 ble_mesh: stack: Fix heartbeat filter with accept list 2021-10-27 16:39:24 +08:00
5a4d4a01db Remove assert when inq done
Closes https://github.com/espressif/esp-idf/issues/6759
Closes https://github.com/espressif/esp-idf/issues/7551
2021-10-27 14:26:43 +08:00
5f46abd281 Merge branch 'bugfix/support_py34-35_cffi_v4.2' into 'release/v4.2'
Tools: Constrain the cffi package for older pythons (v4.2)

See merge request espressif/esp-idf!15608
2021-10-26 13:48:03 +00:00
fc0f90e8aa partition_table: Fix case when a few similar to otadata partitions in the table
It was when in the partition table there is a partition with type="data" and suptype=""(empty),
in this case type=1, suptype=0. It is similar to otadata partition.

This commit fixes it, now it will handle it as type=1, suptype=6 (ESP_PARTITION_SUBTYPE_DATA_UNDEFINED).
2021-10-26 16:48:25 +08:00
7f7bc4078a Tools: Constrain the cffi package for older pythons 2021-10-25 20:14:19 +08:00
eaf738fae9 Merge branch 'feature/add_README_for_controller_hci_uart_demo_v4.2' into 'release/v4.2'
[document] add README.md for demo controller_hci_uart_demo for v4.2

See merge request espressif/esp-idf!15563
2021-10-25 08:13:37 +00:00
78e345debc Merge branch 'bugfix/fix_ble_scan_failed_issue_master_4.2' into 'release/v4.2'
[Bluetooth] Fix the ble scan failed issue

See merge request espressif/esp-idf!15589
2021-10-25 07:55:14 +00:00
30355d3c0c hal: avoid non-32bit access to registers 2021-10-25 12:05:55 +08:00
3a9a2bcfc3 Merge branch 'bugfix/fix_stuck_in_rtc_clk_calibration_backport_v4.2' into 'release/v4.2'
[bugfix] Fix stuck in rtc clk calibration (backport v4.2)

See merge request espressif/esp-idf!15525
2021-10-21 13:22:20 +00:00
fe1d3401d9 fix stuck in rtc_clk_cal 2021-10-21 19:15:33 +08:00
c1edb161e7 1.Fix the ble scan failed issue, this may happen in coexit environment
2.Fix connection failed with LG 5.0 phone
3.Check only for same X component of public key in BR/EDR
2021-10-21 10:59:57 +08:00
10c0bb1bc0 Merge branch 'bugfix/retry_download_submodule_v4.2' into 'release/v4.2'
ci: retry download from Gitlab on error 500 (v4.2)

See merge request espressif/esp-idf!15533
2021-10-20 03:35:11 +00:00
75789bef8b add README.md for demo controller_hci_uart_demo 2021-10-19 22:00:46 +08:00
3e9f15b12d Merge branch 'ci/fix_deploy_docs_preview_url_v4.2' into 'release/v4.2'
ci: update docs preview url (v4.2)

See merge request espressif/esp-idf!15509
2021-10-19 11:52:55 +00:00
cb58226c5e Merge branch 'bugfix/fix_touch_sensor_measure_start_wait_time_backport_v4.2' into 'release/v4.2'
Bugfix(Touch): fix the touch sensor wait cycle after wakeup from sleep (backport v4.2)

See merge request espressif/esp-idf!13641
2021-10-18 16:58:30 +00:00
4498749f38 Merge branch 'backport/v4.2/dockerfile_multiarch' into 'release/v4.2'
Dockerfile working on x64/ARM (v4.2)

See merge request espressif/esp-idf!15520
2021-10-18 14:17:16 +00:00
672d112395 ci: revert type annotations in gitlab_api.py to python2 compatible 2021-10-18 14:42:35 +07:00
3b957bb67e ci: retry Gitlab operations on error 500 2021-10-18 14:42:35 +07:00
46ef92abee ci: retry download artifacts 2021-10-18 14:42:35 +07:00
6b3f2ea744 ci: fetch submodules from mirror, if enabled 2021-10-18 14:42:35 +07:00
1418efe7a4 ci: retry download if catched IOError/EOFError 2021-10-18 14:42:35 +07:00
de22cc8ca7 Merge branch 'bugfix/btdm_ble_data_length_update_fail_v4.2' into 'release/v4.2'
Fix data length update failed(release v4.2)

See merge request espressif/esp-idf!15503
2021-10-18 03:08:04 +00:00
8f8a88d5ec Merge branch 'bugfix/fix_efuse_err_address_backport4.2' into 'release/v4.2'
fix efuse err address in block0 (backport v4.2)

See merge request espressif/esp-idf!14813
2021-10-15 05:44:10 +00:00
7e663430ea Dockerfile working on x64/ARM 2021-10-14 13:11:25 +02:00
c72ab6944e ci: update docs preview url 2021-10-14 14:23:54 +08:00
5cee2b34d6 Merge branch 'backport/v4.2/8_16bits_periph_access' into 'release/v4.2'
avoid generating 8/16 bits instructions for register accessing (backport v4.2)

See merge request espressif/esp-idf!15455
2021-10-13 17:55:09 +00:00
0dbd8701b5 component/bt: fix data length update failed 2021-10-13 19:43:47 +08:00
db956cdeca twai: update register struct file 2021-10-12 11:10:40 +08:00
72bb572df1 hal: avoid generate 8/16 bits intruction for register access 2021-10-12 11:06:55 +08:00
5595042c16 Merge branch 'feature/windows_installer_moved_to_github_backport_4.2' into 'release/v4.2'
tools: Windows Installer project moved to github.com/espressif/idf-installer - backport v4.2

See merge request espressif/esp-idf!15475
2021-10-11 13:50:51 +00:00
85427a8110 tools: remove dependency on Windows installer - backport 2021-10-11 12:26:55 +02:00
bf62154b18 Merge branch 'bugfix/constrain_cryptography_v4.2' into 'release/v4.2'
Tools: Constrain the cryptography package version in order to avoid breaking changes (v4.2)

See merge request espressif/esp-idf!15462
2021-10-11 07:19:10 +00:00
1a50ddc2a3 Merge branch 'fix/update_https_example_root_certificate_v4.2' into 'release/v4.2'
Updated the root certificate of https examples (v4.2)

See merge request espressif/esp-idf!15438
2021-10-11 04:00:46 +00:00
600ef45abe Merge branch 'feature/sync_bt_lib_with_hli_v4.2' into 'release/v4.2'
components/bt: Sync bt lib with the high level interrupt version

See merge request espressif/esp-idf!15328
2021-10-11 03:15:09 +00:00
0f2d385a5a Tools: Constrain the cryptography package for avoiding breaking changes
The cryptography 35 release causes breaking changes. Some of
certificates are rendered invalid and the package cannot be build
without rust. See
https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst#3500---2021-09-29
for more details.
2021-10-10 19:26:11 +02:00
8269fb23d7 Merge branch 'feature/github-7632_v4.2' into 'release/v4.2'
esp_crt_bundle: remove EC-ACC certificate (v4.2)

See merge request espressif/esp-idf!15435
2021-10-10 11:35:08 +00:00
4a80c40c0c components/bt: Sync bt lib with the high level interrupt version 2021-10-08 14:17:49 +08:00
9b0132387e Update example test for esp_http_client 2021-10-07 17:58:51 +05:30
1aac3c64b5 Updated the root certificate of https examples 2021-10-07 17:54:06 +05:30
b41f432262 esp_crt_bundle: remove EC-ACC certificate
Fixes bug #7631
2021-10-07 13:14:38 +05:30
7caff8d13c Merge branch 'feature/upgrade_nghttp2_component_v4.2' into 'release/v4.2'
nghttp2: upgrade to v1.41.0 release (v4.2)

See merge request espressif/esp-idf!15343
2021-09-30 04:08:04 +00:00
fa6a77a5dc Merge branch 'cherry-pick-e8360fe0-3' into 'release/v4.2'
wpa_supplicant: clean tls client state machine (backport v4.2)

See merge request espressif/esp-idf!15039
2021-09-29 11:47:22 +00:00
8eca11af23 Merge branch 'docs/update_esp32-s2_devkit_user_guide_backport_v4.2' into 'release/v4.2'
Docs/Update two ESP32-S2 devkit user guides (backport v4.2)

See merge request espressif/esp-idf!15306
2021-09-29 07:26:21 +00:00
6f77c529ac Merge branch 'bugfix/idf_size_nan_in_json_v4.2' into 'release/v4.2'
Tools: fix appearing NaN value when calling idf_size.py --json (v4.2)

See merge request espressif/esp-idf!15353
2021-09-27 12:37:09 +00:00
4b469fb5e4 Merge branch 'bugfix/idf_tools_virtualenv_seeder_v4.2' into 'release/v4.2'
tools/idf_tools.py: Changed default AppData seeder to seeder pip (backport v4.2)

See merge request espressif/esp-idf!15350
2021-09-27 12:33:33 +00:00
0e10bf11e3 Merge branch 'bugfix/uart_driver_obj_into_sram_v4.2' into 'release/v4.2'
uart: put driver object into sram(v4.2)

See merge request espressif/esp-idf!14753
2021-09-26 01:33:52 +00:00
c00e51b11a Merge branch 'bugfix/wavegen_disable_iram_isr_backport4.2' into 'release/v4.2'
Bugfix/wavegen disable iram isr (backport v4.2)

See merge request espressif/esp-idf!15335
2021-09-26 01:21:10 +00:00
df016b17f0 Tools: fix appearing NaN value when calling idf_size.py --json 2021-09-24 18:28:05 +02:00
513c558f13 tools/idf_tools.py: Changed default AppData seeder to seeder pip 2021-09-24 15:00:04 +02:00
385a299069 nghttp2: upgrade to v1.41.0 release
Detailed changelog:
https://github.com/nghttp2/nghttp2/releases/tag/v1.41.0

Closes: https://github.com/espressif/esp-idf/issues/4883
Closes IDFGH-2821
2021-09-24 17:47:02 +05:30
017b30bcee Merge branch 'bugfix/ping_iface_v4.2' into 'release/v4.2'
lw ip: Fix ICMP Ping on specific iface (GitHub PR) (v4.2)

See merge request espressif/esp-idf!15146
2021-09-24 06:54:42 +00:00
1ed132bf87 Merge branch 'docs/update_getStarted_CN_trans_V4.2' into 'release/v4.2'
docs: update CN translation for get-started V4.2

See merge request espressif/esp-idf!15308
2021-09-24 04:58:06 +00:00
6d3bd3a48e bugfix by disabling IRAM attr on ISR 2021-09-24 11:00:26 +08:00
6501045d80 Merge branch 'feature/esp32c3_support_brownout_v4.2' into 'release/v4.2'
esp32c3: Adds support BROWNOUT reset (v4.2)

See merge request espressif/esp-idf!14963
2021-09-23 15:16:23 +00:00
f8e2eadc51 esp32c3: Adds support BROWNOUT reset (v4.2) 2021-09-23 23:16:16 +08:00
2453447940 Merge branch 'bugfix/stack_init_check_v4.2' into 'release/v4.2'
NimBLE: Check stack status before executing stack command

See merge request espressif/esp-idf!15026
2021-09-23 04:32:25 +00:00
41ff381a72 Merge branch 'feature/btdm_add_clear_white_list_API_v4.2' into 'release/v4.2'
component/bt: add clear white list API(backport v4.2)

See merge request espressif/esp-idf!15299
2021-09-23 03:21:46 +00:00
d5eea66bbb docs/update_esp32-s2_devkit_user_guides 2021-09-22 19:12:28 +08:00
65540b991e docs: update CN translation and keep line number consistent for all documents in get-started section 2021-09-22 17:44:03 +08:00
cc8ef6b8d2 component/bt: add clear white list API 2021-09-22 15:59:45 +08:00
9b6d4c4015 uart: support alloc driver object in SRAM
If CONFIG_UART_ISR_IN_IRAM is on, which means user hope the uart
interrupt can still be serviced even when cache is diabled (e.g.
writing to flash). In that case, the driver should make sure to
put the all related objects into SRAM, avoid putting them in the PSRAM.

Closes https://github.com/espressif/esp-idf/issues/7044
Closes https://github.com/espressif/esp-idf/pull/7355
2021-09-22 12:01:04 +08:00
5253a6c916 uart: format driver code by astyle 2021-09-22 12:01:04 +08:00
61d5e5a93e Merge branch 'bugfix/http_client_eagain_v4.2' into 'release/v4.2'
esp_http_client: Fixed handling of EAGAIN return (backport v4.2)

See merge request espressif/esp-idf!15274
2021-09-21 11:50:56 +00:00
718d2e5f19 esp_http_client: Fixed handling of EAGAIN return
For https connection `ESP_TLS_ERR_SSL_WANT_READ` of esp_transport_read was getting treated as error.
Treated this as a timeout to fix connection abort issue!

Also handled http connection EAGAIN with `errno == EAGAIN` check.

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-09-20 17:49:11 +05:30
295624d5a3 Merge branch 'fix/esp_mbedtls_write_api_v4.2' into 'release/v4.2'
Fix esp_mbedtls_write API (v4.2)

See merge request espressif/esp-idf!15215
2021-09-20 11:34:23 +00:00
4ccfbf5138 Merge branch 'feature/gcov_dump_in_thread_v4.2' into 'release/v4.2'
backport/gcov dump in thread to v4.2

See merge request espressif/esp-idf!15207
2021-09-20 09:37:20 +00:00
0dea76b299 Merge branch 'docs/flash_enc_only_s2_v4.2' into 'release/v4.2'
docs: fix S2 specific flash encryption cmds in ESP32 docs

See merge request espressif/esp-idf!15139
2021-09-16 14:31:38 +00:00
1d63988db2 fix s2 efuse err address in block0 2021-09-16 20:16:52 +08:00
33663461c0 docs: fix S2 specific flash encryption cmds in ESP32 docs
Closes https://github.com/espressif/esp-idf/issues/7537
2021-09-16 19:39:16 +08:00
a0b107fe3d Fix esp_mbedtls_write API
Fix esp_wolfssl_write API
Closes https://github.com/espressif/esp-idf/issues/7461
2021-09-16 09:02:34 +05:30
e4fdf07acb esp_ipc: fix race condition in ipc task 2021-09-15 22:57:02 +03:00
e662d90e9f gcov: enable single core tests 2021-09-15 22:57:02 +03:00
dc25973825 ipc: enable ipc task at single core for gcov dump 2021-09-15 22:57:02 +03:00
5ad1e020ce gcov: add stub table size entry 2021-09-15 22:57:02 +03:00
886ea8d33b gcov: add gcov callback into the ipc task 2021-09-15 22:57:02 +03:00
d63ff8cb7a gcov: readme update for ESP32-S2 2021-09-15 22:57:02 +03:00
67fc5183dc gcov: dump in a special thread 2021-09-15 22:57:02 +03:00
e43fedb3f4 gcov: added dbg stub capabilites and magic number entry to keep backward compatible 2021-09-15 22:57:02 +03:00
87e9a54f63 Merge branch 'docs/fix_adc_pad_typo_MOSI_typo_and_broken_link_v4.2' into 'release/v4.2'
Fix ADC pad and MOSI typo, update esp32c3 rom elf link (v4.2)

See merge request espressif/esp-idf!15188
2021-09-14 08:46:26 +00:00
9814e9afd7 docs: Fix ADC pad and MOSI typo, update esp32c3 rom elf link 2021-09-14 11:28:58 +08:00
78ff78c789 Merge branch 'bugfix/config_data_interface_early_v4.2' into 'release/v4.2'
initialize data interface early (v4.2)

See merge request espressif/esp-idf!15090
2021-09-09 08:45:54 +00:00
4f319f26f9 Merge branch 'feature/oocd_ver_upgrade_v4.2' into 'release/v4.2'
tools: Updates OpenOCD version to 'v0.10.0-esp32-20210902' (v4.2)

See merge request espressif/esp-idf!15133
2021-09-09 07:40:43 +00:00
4b8492d46f lwip: Fix ICMP Ping on specific iface
Fix broken parentheses in setsockopt call

Merges https://github.com/espressif/esp-idf/pull/7397
2021-09-09 07:43:00 +02:00
4e6c12bf30 Merge branch 'bugfix/switch_icmp_unit_test_from_baidu_to_taobao_v4.2' into 'release/v4.2'
unit_test: increase icmp unit test timeout configuration (v4.2)

See merge request espressif/esp-idf!14937
2021-09-09 01:38:00 +00:00
ae21087d7e CI: Fix idf_tools.py tests with the updated openocd version 2021-09-08 21:01:22 +03:00
35bdf4bee8 CI: Check the number of detected cores of apptrace 2021-09-08 21:00:14 +03:00
046626de9a tools: Updates OpenOCD version to 'v0.10.0-esp32-20210902' 2021-09-08 20:56:25 +03:00
6f4d973f13 Merge branch 'bugfix/idf_size_wrong_memory_calculations_v4.2' into 'release/v4.2'
Tools: Fix memory calculations of idf_size.py (v4.2)

See merge request espressif/esp-idf!14934
2021-09-08 11:51:17 +00:00
d221750223 Merge branch 'feature/installing_tools_for_IDF_TARGET_v4.2' into 'release/v4.2'
tools: Installing tools for given IDF_TARGET (v4.2)

See merge request espressif/esp-idf!14709
2021-09-08 10:31:39 +00:00
a5984fd939 Merge branch 'bugfix/controller_hci_uart_sdkconfig_v4.2' into 'release/v4.2'
controller_hci_uart: fixed the sdkconfig.defaults in the example(backport v4.2)

See merge request espressif/esp-idf!14808
2021-09-08 06:05:52 +00:00
f9632200fb Merge branch 'bugfix/hf_disc_acl_no_disc_v4.2' into 'release/v4.2'
bugfix/acl can't disconnect when hfp_client disconnect [release/v4.2]

See merge request espressif/esp-idf!15057
2021-09-07 10:13:57 +00:00
afc74ae36a Merge branch 'bugfix/fix_ws_handle_big_messages_v4.2' into 'release/v4.2'
esp_http_server: Fix ws server handle length over 1440(MTU) messages incorrectly(backport v4.2)

See merge request espressif/esp-idf!15014
2021-09-07 08:21:40 +00:00
3ca7a2220f Merge branch 'feature/update_expat_v4.2' into 'release/v4.2'
expat: Update library from 2.2.9 to 2.4.1(backport v4.2)

See merge request espressif/esp-idf!15068
2021-09-07 08:18:13 +00:00
be4b8e547a expat: Update library from 2.2.9 to 2.4.1 2021-09-06 19:59:55 +08:00
2e0f907656 eth: dont warn nego timeout if link is down 2021-09-06 18:45:15 +08:00
83018bf05f emac: configure data interface early 2021-09-06 18:44:37 +08:00
d933aba6a1 Merge branch 'bugfix/bt_spp_timer_collision_v4.2' into 'release/v4.2'
fix timer collision in role switch(v4.2)

See merge request espressif/esp-idf!14819
2021-09-06 08:23:26 +00:00
8dcf216034 Merge branch 'feature/update_cjson_submodule_v4.2' into 'release/v4.2'
cJSON: Update submodule to v1.7.15 (v4.2)

See merge request espressif/esp-idf!15075
2021-09-06 06:37:52 +00:00
f65845ef51 Merge branch 'bugfix/add_critical_section_in_uart_driver_v4.2' into 'release/v4.2'
UART: add missing critical section wrappers around rx_buffered_len (backport v4.2)

See merge request espressif/esp-idf!14775
2021-09-06 02:26:17 +00:00
6da584270c fix timer collision in role switch
Closes https://github.com/espressif/esp-idf/issues/7203
2021-09-06 10:15:10 +08:00
87a4f82d73 cJSON: Update submodule to latest release.
This update fixes NULL pointer dereference issues in previous release

Closes https://github.com/espressif/esp-idf/issues/7317
2021-09-06 07:42:32 +05:30
60ce887308 uart: cleaner way of handling error in a critical section
Some critical sections have also been added, making the code more
symetric accross the similar functions.

Closes https://github.com/espressif/esp-idf/pull/6396
2021-09-03 15:20:33 +08:00
3691fb9f48 uart: Add missing critical section wrappers around rx_buffered_len
The missing barriers caused uart_get_buffered_data_len() to (very rarely)
return a garbage value. When used in MicroPython, though, this caused
select() to return and a subsequent read() to stall indefinitely until
a char was actually available.

Signed-off-by: Chen Yi Qun <chenyiqun@espressif.com>

Closes https://github.com/espressif/esp-idf/issues/6397
Merges https://github.com/espressif/esp-idf/pull/6396
2021-09-03 15:20:33 +08:00
1dcde9c74f fix acl can not disconnect when hf_client disconnect 2021-09-03 10:58:55 +08:00
b132b61181 Merge branch 'bugfix/btdm_fix_some_Document_Description_Error_v4.2' into 'release/v4.2'
component/bt: fix some ble document description error(backport v4.2)

See merge request espressif/esp-idf!14824
2021-09-03 01:40:16 +00:00
8de953e7b9 Tools: Fix memory calculations of idf_size.py 2021-09-01 16:33:42 +02:00
7ea602838f component/bt: fix some ble document description error 2021-09-01 20:44:20 +08:00
80a4d20462 Merge branch 'bugfix/eap_client_windows' into 'master'
wpa_supplicant: clean tls client state machine

Closes IDFGH-5702, IDFGH-5662, and IDFGH-119

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

See merge request espressif/esp-idf!14968

(cherry picked from commit e8360fe075)

d3a42d78 wpa_supplicant: clean tls client state machine
2021-09-01 19:16:31 +08:00
c7320b2d1d NimBLE: Check stack status before executing stack command 2021-08-31 18:30:06 +05:30
e2c35ca35b Enable IO20 on ESP32
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

Fixes #6016
Fixes #6837

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

(cherry picked from commit 6deaefde69)
2021-08-31 20:33:13 +08:00
420aedbe3d esp_http_server: Fix ws server handle length over 1440(MTU) messages incorrectly.
Closes https://github.com/espressif/esp-idf/issues/7457
2021-08-31 14:23:10 +08:00
f6d2932953 Revert "Merge branch 'bugfix/fix_ws_handle_big_messages_error_v4.2' into 'release/v4.2'"
This reverts commit 5ca91eb54e, reversing
changes made to 192d42c8b8.
2021-08-31 14:12:24 +08:00
cf457bce0d idf_size.py: fixed diram counted twice issue, and improve display
Currently static RAM usage are listed under corresponding physical
memory.

ld: fix linker script for C3 and S3
2021-08-27 18:32:33 +02:00
436517fb7f Merge branch 'docfix/eth_events_4.2' into 'release/v4.2'
Added warning when to init user Eth handlers (release/v4.2)

See merge request espressif/esp-idf!14952
2021-08-27 09:15:40 +00:00
df213946c6 Merge branch 'fixes/secure_boot_v4.2' into 'release/v4.2'
secure_boot/esp32s2: Disable read protecting of efuses (v4.2)

See merge request espressif/esp-idf!14961
2021-08-26 10:11:26 +00:00
527e5abae0 secure_boot/esp32s2: Disable read protecting of efuses
When secure boot is enabled, disable the ability to read protect
efuses that contain the digest.
2021-08-26 12:05:39 +05:30
933567d440 Added warning when to init user Eth handlers 2021-08-25 11:27:05 +02:00
bfa51a9a68 unit_test: switch icmp test server to taobao 2021-08-25 08:34:14 +02:00
e5da87933c Merge branch 'bugfix/fix_deep_sleep_miss_bug_mr_v4.2' into 'release/v4.2'
Fix controller may miss the sleep time

See merge request espressif/esp-idf!14738
2021-08-24 08:01:10 +00:00
6bb35ddf85 Merge branch 'bugfix/fix_ping_sock_return_error_v4.2' into 'release/v4.2'
ping_sock: Fix esp_ping_new_session may return ESP_OK when the error occured(backport v4.2)

See merge request espressif/esp-idf!14846
2021-08-23 06:30:54 +00:00
94cdecde30 Merge branch 'component_bt/add_spp_faq_v4.2' into 'release/v4.2'
Component_bt/Add FAQ in SPP Demo README[backport v4.2]

See merge request espressif/esp-idf!14797
2021-08-23 05:16:29 +00:00
78a08714ba Merge branch 'docs/add_ESP32-S2-DevKitC-1_user_guide_backport_v4.2' into 'release/v4.2'
Docs: Add ESP32-S2-DevKitC-1 user guide (backport v4.2)

See merge request espressif/esp-idf!14876
2021-08-20 08:27:35 +00:00
d81bd941ff docs/add_esp32-s2-devkitc-1_user_guide 2021-08-20 14:16:31 +08:00
7c3acadabe Merge branch 'bugfix/spp_memory_leak_v4.2' into 'release/v4.2'
Fix spp memory leak(v4.2)

See merge request espressif/esp-idf!14861
2021-08-20 02:50:19 +00:00
5abc5f6748 components/bt: fix spp memory leak
Closes https://github.com/espressif/esp-idf/issues/7238
2021-08-19 14:35:53 +08:00
f075275cd1 Merge branch 'feature/update_efuses_for_esp32s2_v4.2' into 'release/v4.2'
efuse(esp32s2): Added flash_ver, psram_ver, pkg_ver efuses (v4.2)

See merge request espressif/esp-idf!14771
2021-08-19 06:28:50 +00:00
48c9f47247 Merge branch 'fix/warning_in_wifi_prov_mgr_v4.2' into 'release/v4.2'
provisioning: fix wifi warning in wifi_prov_mgr application (v4.2)

See merge request espressif/esp-idf!14764
2021-08-19 04:09:18 +00:00
16be7d056d Merge branch 'bugfix/cmake_compiler_warn_write_string_v4.2' into 'release/v4.2'
Build: Fix CMake to pass -Wwrite-string compiler flag if enabled (v4.2)

See merge request espressif/esp-idf!14427
2021-08-18 16:02:28 +00:00
2b2c1f5e65 Merge branch 'bugfix/ble_mesh_cve_recommendation_v4.2' into 'release/v4.2'
ble_mesh: Update the SIG recommendations for CVE issues (v4.2)

See merge request espressif/esp-idf!14842
2021-08-18 12:41:17 +00:00
1c59050209 panic/memprot: Fix minor const string correction on panic print 2021-08-18 19:29:32 +08:00
9b23491339 wpa_supplicant: Temporarily disable write-string warning
Since some assignment of a string literal to `char *` variables were
added and not caught by the CI.
2021-08-18 19:29:32 +08:00
fcf1419626 Build: Fix CMake to pass -Wwrite-string compiler flag if enabled 2021-08-18 19:29:32 +08:00
d96dd2c002 provisioning: fix wifi warning in wifi_prov_mgr application
Scan configuration parameters should not modify in co-existence mode.
2021-08-18 18:34:46 +08:00
e3df8293a9 Merge branch 'bugfix/remove_bt_get_mac_v4.2' into 'release/v4.2'
bt: Remove unused function esp_bt_get_mac. (v4.2)

See merge request espressif/esp-idf!14836
2021-08-18 05:05:07 +00:00
e821df501e Merge branch 'bugfix/libsodium_build_with_gnu_make_v4.2' into 'release/v4.2'
libsodium: fix build issues with GNU Make (v4.2)

See merge request espressif/esp-idf!14759
2021-08-18 04:38:31 +00:00
04be80124c ping_sock: Fix esp_ping_new_session may return ESP_OK when the error occured
Closes https://github.com/espressif/esp-idf/issues/7363
2021-08-18 11:53:09 +08:00
lly
06196f347a ble_mesh: Update the SIG recommendations for CVE issues 2021-08-18 10:58:18 +08:00
fce11704f0 Merge branch 'test/update_ble_mesh_console_files_for4.2' into 'release/v4.2'
test: fix ble mesh send problem (v4.2)

See merge request espressif/esp-idf!14274
2021-08-18 02:20:40 +00:00
afe3f26fca bt: Remove unused function esp_bt_get_mac. 2021-08-17 18:53:05 +05:30
cda9fc98e7 add FAQ in SPP demo README 2021-08-17 15:17:31 +08:00
1472bf8780 libsodium: fix source directory names to address build issues with Make 2021-08-17 11:10:34 +05:30
bb0dbab859 Merge branch 'bugfix/btdm_auto_update_PPCP_attribute_value_v4.2' into 'release/v4.2'
component/bt: fix bluedroid host auto update PPCP attribute value(backport v4.2)

See merge request espressif/esp-idf!14749
2021-08-17 02:08:01 +00:00
ace5ba77f4 Fix install.fish
install.fish script didn't catch error exit code from idf_tools.py. Now it does.

Signed-off-by: Marek Fiala <marek.fiala@espressif.com>

Closes: https://github.com/espressif/esp-idf/pull/7325
2021-08-16 16:27:35 +02:00
8b31c7d576 tools: Installing tools for given IDF_TARGET
Allow user to select specific ESP_TARGET while setting up ESD_IDF.
Only necessary tools for given target will be downloaded and installed.

Closes https://github.com/espressif/esp-idf/issues/5113
2021-08-16 16:27:35 +02:00
cbfbc705eb controller_hci_uart: fixed the sdkconfig.defaults in the example 2021-08-16 16:56:10 +08:00
cb9391a1cc Merge branch 'ci/change_perf_key_v4.2' into 'release/v4.2'
ci: update performance test key to db compatible format (v4.2)

See merge request espressif/esp-idf!14655
2021-08-16 06:13:21 +00:00
6f0ad5662a efuse(esp32s2): Added flash_ver, psram_ver, pkg_ver efuses 2021-08-12 18:45:45 +05:00
921ec124ee component/bt: fix bluedroid host auto update PPCP attribute value 2021-08-11 18:04:53 +08:00
33f2bcec4c The controller may miss the sleep time caculated before. So it will stuck
in the loop to get the deep sleep HW flag. Then the watchdog issue happen.
2021-08-11 14:23:16 +08:00
de7fd4e93e Merge branch 'bugfix/spi_master_crash_cache_disabled_v4.2' into 'release/v4.2'
spi_master: fix the crash when using interrupt mode when cache is disabled (v4.2)

See merge request espressif/esp-idf!14682
2021-08-10 02:39:39 +00:00
059a3fa1be Merge branch 'feature/skip_known_failure_cases_v4.2' into 'release/v4.2'
CI: Ignore Known Failure Cases Result (v4.2)

See merge request espressif/esp-idf!14649
2021-08-10 02:23:31 +00:00
7089f62dab feat(tiny_test_fw): ignore known failure cases result
py
2021-08-10 10:23:26 +08:00
e1d33a7fa1 Merge branch 'bugfix/xtensa_extra_info_register_values_v4.2' into 'release/v4.2'
espcoredump.py: Parse EPS and EPC register values using register index (v4.2)

See merge request espressif/esp-idf!14565
2021-08-06 05:10:33 +00:00
d91d6945d7 spi_master: fix the crash when using interrupt mode when cache is disabled
Closes https://github.com/espressif/esp-idf/issues/6529
Closes https://github.com/espressif/esp-idf/issues/6781
Closes https://github.com/espressif/esp-idf/issues/7368
2021-08-06 12:22:15 +08:00
e1af4a398b update ble mesh console files 2021-08-05 17:52:28 +08:00
45330303d6 Merge branch 'bugfix/freertos_ut_suspend_v4.2' into 'release/v4.2'
freertos: Increases delta for UT - Test suspend-resume CPU. The number of... (v4.2)

See merge request espressif/esp-idf!14631
2021-08-05 05:13:24 +00:00
6b95f3bddd ci: update performance test key to db compatible format 2021-08-04 12:28:42 +08:00
57eeeef433 Merge branch 'feature/change_factory_reset_pin_range_v4.2' into 'release/v4.2'
bootloader: Change range of the factory reset pin in Kconfig for ESP32-S2 (v4.2)

See merge request espressif/esp-idf!14638
2021-08-03 14:24:14 +00:00
5893641482 freertos: Increases delta for UT - Test suspend-resume CPU. The number of tick_hook should be the same for both CPUs 2021-08-03 16:07:03 +05:00
f5897efa4f bootloader: Change range of the factory reset pin in Kconfig
Closes: https://github.com/espressif/esp-idf/issues/5489
2021-08-03 14:40:29 +05:00
a9a917b8d7 Merge branch 'doc/fix_secure_boot_v4.2' into 'release/v4.2'
doc/secure_boot_v2: Fix the steps mentioned for enabling secure boot (v4.2)

See merge request espressif/esp-idf!14589
2021-08-03 07:47:09 +00:00
f9af4a66f0 Merge branch 'bugfix/uart_sw_sw_flow_error_typo_v4.2' into 'release/v4.2'
uart: fix typo in error message (v4.2)

See merge request espressif/esp-idf!14614
2021-08-03 02:42:46 +00:00
2f02863fff uart: fix typo in error message
Closes https://github.com/espressif/esp-idf/issues/7360
2021-08-03 09:28:39 +08:00
f4a2c5b520 Merge branch 'mesh/bugfix_fix_esp_mesh_send_block_issue_v4.2' into 'release/v4.2'
mesh/ps: esp_mesh_send is blocked in nodes(layer>=3), when a FIXED-ROOT root is duty master(backport_v4.2)

See merge request espressif/esp-idf!14086
2021-07-31 02:52:26 +00:00
8a516aadae doc/secure_boot_v2: Fix the steps mentioned for enabling secure boot 2021-07-30 19:50:37 +05:30
4dc431b87b Merge branch 'bugfix/fix_eth2ap_example_crash_v4.2' into 'release/v4.2'
eth2ap: Fix eth2ap example crash issue (backport v4.2)

See merge request espressif/esp-idf!14561
2021-07-30 05:14:25 +00:00
c06d8f8521 espcoredump.py: Parse EPS and EPC register values using register index 2021-07-29 10:46:02 +05:30
d0d7fbf6b1 eth2ap: Fix eth2ap example crash issue
Closes https://github.com/espressif/esp-idf/issues/7260
2021-07-29 11:12:40 +08:00
68e7ecec67 freemodbus: add affinity option for modbus stack tasks 2021-07-28 08:46:52 +02:00
764f0db002 Merge branch 'bugfix/freemodbus_change_max_task_prio_v42' into 'release/v4.2'
Bugfix/freemodbus change max task prio (backport v4.2)

See merge request espressif/esp-idf!13731
2021-07-27 21:19:14 +00:00
2b42d78a3f Merge branch 'bugfix/smtp_client_attachment_newline_v4.2' into 'release/v4.2'
Add newline separator to fix wrong attachment sent (v4.2)

See merge request espressif/esp-idf!13729
2021-07-27 16:12:59 +00:00
87e9908506 Merge branch 'bugfix/fix_supplicant_log_v4.2' into 'release/v4.2'
wpa_supplicant: Fix compilation when debug prints are enabled

See merge request espressif/esp-idf!14227
2021-07-27 12:04:50 +00:00
bc8d2ebcbf Merge branch 'bugfix/wps_wfa_cert_fixes_v4.2' into 'release/v4.2'
wpa_supplicant: Add WPS strict in config option(backport v4.2)

See merge request espressif/esp-idf!14230
2021-07-27 10:44:12 +00:00
4a12179e0c Merge branch 'bugfix/ttfw_fix_flush_index_error_v4.2' into 'release/v4.2'
test: TTFW fix flush index error (v4.2)

See merge request espressif/esp-idf!14261
2021-07-27 10:44:00 +00:00
def7fd7611 Merge branch 'feature/idf_tools_darwin_arm64_v4.2' into 'release/v4.2'
tools: idf_tools.py: allow macOS x86_64 tools to be installed on arm64 (v4.2)

See merge request espressif/esp-idf!14072
2021-07-27 08:16:21 +00:00
b2be91d98b Merge branch 'feature/regi2c_add_lock_v4.2' into 'release/v4.2'
regi2c: add a spinlock for accessing (reg)I2C devices (backport v4.2)

See merge request espressif/esp-idf!13713
2021-07-27 07:32:35 +00:00
0d0d31bcf3 Merge branch 'bugfix/esp_netif_dhcps_state_v4.2' into 'release/v4.2'
esp_netif: Fix dhcps state transitions (v4.2)

See merge request espressif/esp-idf!14424
2021-07-27 07:23:45 +00:00
325eee68e4 Merge branch 'enhance/update-vscode-setup-docs-v4.2' into 'release/v4.2'
docs: Fix vscode extension setup links (backport v4.2)

See merge request espressif/esp-idf!13323
2021-07-27 03:53:42 +00:00
728f3eab6c docs: Fix vscode extension setup links (backport v4.2) 2021-07-27 11:53:38 +08:00
60e4bfae90 Merge branch 'bugfix/fatfs_alloc_extram_first_v4.2' into 'release/v4.2'
fatfs: fix SPIRAM allocation not used due to Kconfig option name error (v4.2)

See merge request espressif/esp-idf!14049
2021-07-26 07:59:16 +00:00
5c82ebce35 Merge branch 'bugfix/fix_esp32s2_deep_sleep_timer_wake_up_fail_backport_v4.2' into 'release/v4.2'
rtc: fix esp32s2 fall into sleep forever when deep-sleep time is set to 0(backport v4.2)

See merge request espressif/esp-idf!13562
2021-07-26 07:39:16 +00:00
6fba03f681 Merge branch 'fix/memory_leaks_identified_by_cppcheck_v4.2' into 'release/v4.2'
Fix/memory leaks identified by cppcheck (v4.2)

See merge request espressif/esp-idf!14502
2021-07-26 06:43:27 +00:00
e5b4d5f348 Fix memory leak on error path in register_select
And remove dead error handling code from unregister_select.

Closes https://github.com/espressif/esp-idf/pull/7296
2021-07-26 14:43:21 +08:00
f39dc35d92 tools: idf_tools.py: allow macOS x86_64 tools to be installed on arm64
Until arm64 tool binaries are available, we can run existing x86_64
ones under emulation.

Suggested in https://github.com/espressif/esp-idf/issues/6113.
2021-07-26 14:35:47 +08:00
e9198247a0 Merge branch 'bugfix/ci_fix_test_build_system_cmake_v4.2' into 'release/v4.2'
ci: Fix concurrency issues for macOS build system tests (v4.2)

See merge request espressif/esp-idf!14400
2021-07-26 06:30:25 +00:00
416dc98ed8 mesh/ps: esp_mesh_send is blocked in nodes(layer>=3), when a FIXED-ROOT root is duty master 2021-07-26 14:14:08 +08:00
15b8981f48 ttfw: fix incorrect length when flush data cache after expect:
data cache is unicode. while we use bytes in RegEx expect. The index of
matched pattern is calculated with bytes, could be different from
unicode. Now we fix this issue by using unicode in expect.
2021-07-26 11:30:35 +08:00
458dbaf0f1 Fixed content type of attachment
Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-07-26 10:15:47 +08:00
81de14b505 Add newline separator to fix wrong attachment sent
Issue:

Missing newline between header and attachment

Issue seen with email clients viz., AppleMail and YahooMail. Attachment is not renderable.
Some clients like Google mail, Samsung mail tolerate the issue.

Fix:
Added newline between header and attachment.

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

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-07-26 10:15:47 +08:00
0832580661 Merge branch 'bugfix/spp_connect_20_fail_v4.2' into 'release/v4.2'
component_bt: fix spp acceptor deadlock

See merge request espressif/esp-idf!14106
2021-07-26 01:43:06 +00:00
cc366cc3c7 fatfs: fix SPIRAM allocation not used due to Kconfig option name error
Closes https://github.com/espressif/esp-idf/issues/5756
2021-07-26 09:40:39 +08:00
6f016def84 wpa_supplicant: Fix compilation when debug prints are enabled. 2021-07-26 09:38:21 +08:00
71b9121c7d wpa_supplicant: Add WPS strict in config option
WPS strict disables workarounds with different APs and may cause
IOT issues. Remove this as default and introduce as a config option.

Also declare esp device as single band mobile device otherwise
WFA sniffer was not able to identify it in the certification setup.
2021-07-26 09:37:28 +08:00
2b65b82bd6 esp_netif: Fix dhcps state transitions
When the DHCP server is stopped before starting the netif,
it should remain stopped -- as per compatibility with previous tcpip_adapter behavior
2021-07-26 09:33:32 +08:00
d18793f695 ci: Fix concurrency issues for macos buildsystem tests 2021-07-26 09:07:17 +08:00
ac5443b68a Merge branch 'doc/power_management_esp32s2_v4.2' into 'release/v4.2'
docs: describe power management logic for ESP32-S2, fix translation (v4.2)

See merge request espressif/esp-idf!14048
2021-07-26 00:49:30 +00:00
ea101ecb38 freemodbus: increase max priority of modbus tasks
allows to avoid issues with modbus processing when higher priority tasks are used in user application
2021-07-26 08:46:25 +08:00
d7687ce6fa regi2c: add a spinlock for accessing (reg)I2C devices
When not compiling bootloader, a spinlock will be used for reading or writing
I2C internal devices/registers.
When compiling for bootloader, no need to use any lock.
2021-07-26 06:46:21 +08:00
ec196ae74b Merge branch 'bugfix/ci_move_udp_socket_tests_to_eth_runners_v4.2' into 'release/v4.2'
CI: Adjust UDP socket tests to be more reliable (v4.2)

See merge request espressif/esp-idf!14421
2021-07-23 15:01:46 +00:00
473194039d Merge branch 'docs/fix_UART_default_pin_error_and_provide_a_link_to_ESP_PROG_v4.2' into 'release/v4.2'
docs: fix uart default pin error and provide more information about ESP-Prog board (v4.2)

See merge request espressif/esp-idf!13969
2021-07-23 11:18:55 +00:00
12ce70a583 Merge branch 'bugfix/a2dp_deint_crash_v4.2' into 'release/v4.2'
component_bt: fix a2dp deinit crash(v4.2)

See merge request espressif/esp-idf!14418
2021-07-23 07:26:22 +00:00
7f2da36c33 Merge branch 'bugfix/setjmp_longjmp_4.2' into 'release/v4.2'
[system]: Made longjmp save for context switch (backport v4.2)

See merge request espressif/esp-idf!13501
2021-07-23 03:52:55 +00:00
9e9efc4d92 Merge branch 'bugfix/fix_idf_monitor_unicode_path_crash_v4.2' into 'release/v4.2'
tools: handle exception in case of logging Unicode characters (v4.2)

See merge request espressif/esp-idf!13042
2021-07-23 01:09:44 +00:00
ea2b6898fb Merge branch 'feature/gcov_extest_improvements_v4.2' into 'release/v4.2'
Follow-up improvements for the gcov example test (v4.2)

See merge request espressif/esp-idf!14463
2021-07-22 19:11:52 +00:00
b717a0d3e1 Follow-up improvements for the gcov example test 2021-07-22 15:23:27 +02:00
c0ad291dc4 Merge branch 'ci/rename_test_log_path_v4.2' into 'release/v4.2'
CI: rename log path of IT jobs (v4.2)

See merge request espressif/esp-idf!14453
2021-07-22 13:21:14 +00:00
1bd6c102a4 Merge branch 'docs/fix_readme_links_v4.2' into 'release/v4.2'
docs: fixed dead readme links (v4.2)

See merge request espressif/esp-idf!14465
2021-07-22 02:44:44 +00:00
bcb1086410 docs: fixed dead readme link 2021-07-21 17:35:47 +08:00
4722c36926 Merge branch 'feature/upgrade_mbedtls_to_v4.2' into 'release/v4.2'
mbedtls: upgrade to release v2.16.11 (v4.2)

See merge request espressif/esp-idf!14438
2021-07-21 06:55:14 +00:00
754e742344 mbedtls: upgrade to release v2.16.11
For detailed release notes please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.11
2021-07-21 14:55:09 +08:00
39a8dc30ea Merge branch 'bugfix/esp_event_any_id_unregister_4.2' into 'release/v4.2'
ESP Event: fix unregister documentation (backport 4.2)

See merge request espressif/esp-idf!14436
2021-07-21 04:07:34 +00:00
9f3cf98d4e Merge branch 'bugfix/fix_scan_timeout_mr_4.2' into 'release/v4.2'
Fix the scan timeout report

See merge request espressif/esp-idf!14446
2021-07-21 04:00:40 +00:00
59d0da0b33 CI: rename log path of IT jobs 2021-07-21 10:24:52 +08:00
aabdb2c7a1 [system]: Made longjmp save for context switch
* Patched longjmp to be context-switch safe
  longjmp modifies the windowbase and windowstart
  registers, which isn't safe if a context switch
  occurs during the modification. After a context
  switch, windowstart and windowbase will be
  different, leading to a wrongly set windowstart
  bit due to longjmp writing it based on the
  windowbase before the context switch. This
  corrupts the registers at the next window
  overflow reaching that wrongly set bit.

  The solution is to disable interrupts during
  this code. It is only 6 instructions long,
  the impact shouldn't be significant.

  The fix is implemented as a wrapper which
  replaces the original first instructions of
  longjmp which are buggy. Then, it jumps back
  to execute the rest of the original longjmp
  function.

  Added a comparably reliable test to the
  test apps.
2021-07-21 09:48:48 +08:00
0fe0bea65a This is to fix the hardware bug. The device may report scan event
timeout when scaning.If check this error,then reset the rwble core.
2021-07-20 20:37:08 +08:00
88b3e0d8d8 Merge branch 'bugfix/fix_truncated_headers_for_esp_http_client_v4.2' into 'release/v4.2'
esp_http_client: Fix header truncated when responded header length over buffer_size (backport v4.2)

See merge request espressif/esp-idf!14384
2021-07-20 12:17:11 +00:00
5ca91eb54e Merge branch 'bugfix/fix_ws_handle_big_messages_error_v4.2' into 'release/v4.2'
esp_http_server: Fix ws server handle length over 1440(MTU) messages incorrectly(backport v4.2).

See merge request espressif/esp-idf!14345
2021-07-20 11:55:08 +00:00
192d42c8b8 Merge branch 'feature/protocomm_mfg_data_v4.2' into 'release/v4.2'
Provisioning BLE: Add API to set manufacturer data in advertisement (scan response) packets (v4.2)

See merge request espressif/esp-idf!14367
2021-07-20 10:50:21 +00:00
d3ffdc79fd [esp_event]: fixed and improved docs
* Description of unregistering was incorrect
* Made clear that event loop arg mustn't be NULL
* Added parameter check in create function

Closes https://github.com/espressif/esp-idf/issues/6761
Closes IDFGH-4969
2021-07-20 15:47:37 +08:00
1b87cfc565 Merge branch 'bugfix/esp32s2_disable_bss_extram_v4.2' into 'release/v4.2'
esp32s2: disable bss extram option, clean up spiram init code a bit (v4.2)

See merge request espressif/esp-idf!13735
2021-07-20 07:24:38 +00:00
1d64638333 esp_common: Correctly disable ".bss segment placed in external memory" for ESP32-S2 & ESP32-S3
Support for this feature is still pending.

As reported by https://github.com/espressif/esp-idf/issues/6162
2021-07-20 15:24:32 +08:00
fc937e257b esp_http_server: Fix ws server handle length over 1440(MTU) messages incorrectly.
Closes https://github.com/espressif/esp-idf/issues/7202
2021-07-20 14:27:10 +08:00
c106151cc6 Merge branch 'docs/update_docs_for_doc_751_v4.2' into 'release/v4.2'
docs: update the documents based on customer feedbacks (v4.2)

See merge request espressif/esp-idf!13959
2021-07-20 06:25:52 +00:00
86f808ef2b Merge branch 'bugfix/twai_low_speed_bit_rates_v4.2' into 'release/v4.2'
TWAI: Fix incorrect configuration initializers for low speed bit rates (backport v4.2)

See merge request espressif/esp-idf!14413
2021-07-20 05:12:59 +00:00
9896fc0aef Merge branch 'bugfix/otatool_imported_as_lib_v4.2' into 'release/v4.2'
otatool: Fix a crash when imported as external python lib (v4.2)

See merge request espressif/esp-idf!13667
2021-07-20 03:25:20 +00:00
8eb2ec4fb5 docs: update the documents based on customer feedbacks 2021-07-20 11:07:50 +08:00
2d83369184 Merge branch 'bugfix/missing_extern_c_4.2' into 'release/v4.2'
[test_utils]: added extern C decl to ccomp (backport 4.2)

See merge request espressif/esp-idf!14327
2021-07-20 02:33:26 +00:00
90ff580de5 Merge branch 'bugfix/read_ota_partition_required_output_arg_v4.2' into 'release/v4.2'
otatool: Fixes read_ota_partition cmd, required output arg (v4.2)

See merge request espressif/esp-idf!13673
2021-07-19 14:01:16 +00:00
07596559dd CI/socket examples: Add UDP operation retries, wait until server is up 2021-07-19 14:58:20 +02:00
f83bacd2b5 Not initialized or in the process of de-initialization, calling API will return ERR 2021-07-19 20:13:32 +08:00
3ba13749d3 fix a2dp deinit crash 2021-07-19 20:12:57 +08:00
7ca2688378 TWAI: Fix incorrect configuration initializers for low speed bit rates
This commit fixes the timing configuration initializers for the
1K, 5K, and 10K bit rates.
2021-07-19 17:33:58 +08:00
1e2d7ea792 Merge branch 'bugfix/SCO_connect_fail_after_peer_not_accept_sniff_v4.2' into 'release/v4.2'
bugfix/unable to initiate SCO connection when peer device not accept sniff mode (v4.2)

See merge request espressif/esp-idf!14394
2021-07-19 07:24:58 +00:00
a45146c87d Merge branch 'bugfix/delete_i2c_cmd_mux_semaphore_more_cleanly_v4.2' into 'release/v4.2'
dreiver/i2c: delete i2c cmd mux semaphore more cleanly (backport 4.2)

See merge request espressif/esp-idf!13401
2021-07-19 04:54:44 +00:00
dd06800d7b otatool: Fix a crash when imported as external python lib
Closes: https://github.com/espressif/esp-idf/issues/6733
2021-07-19 12:41:17 +08:00
12f666f303 otatool: Fixes read_ota_partition cmd, required output arg
Closes: https://github.com/espressif/esp-idf/issues/6559
2021-07-19 12:40:32 +08:00
469be5f7be Merge branch 'bugfix/newlib_FD_ISSET_v4.2' into 'release/v4.2'
newlib: Fix a case in FD_ISSET macro when n==-1 (v4.2)

See merge request espressif/esp-idf!13691
2021-07-19 04:32:55 +00:00
9ba590cd47 [test_utils]: added extern C decl to ccomp
Closes https://github.com/espressif/esp-idf/issues/7121
2021-07-19 10:52:32 +08:00
036a045b86 component/bt: fix some bugs in bluetooth controller(2fcbe897)
1. Fixed the crash when using scan parameter: window = 4 slots, interval = 5 slots
2. Fixed BLE ACL tx flush issue during reset
3. Added remove sniff when peer not accepted sniff mode
2021-07-19 08:12:48 +08:00
5bb0706083 Merge branch 'bugfix/update_ota_cert_v4.2' into 'release/v4.2'
OTA examples: Update server certificate (v4.2)

See merge request espressif/esp-idf!14355
2021-07-18 14:17:50 +00:00
8872c6a3ac driver/i2c: add notes to i2c deleteing function 2021-07-16 14:26:48 +08:00
59d08d4467 dreiver/i2c: delete i2c cmd_mux semaphore more cleanly
Merges https://github.com/espressif/esp-idf/pull/6847
2021-07-16 14:26:48 +08:00
4663d3ec11 Merge branch 'docs/spi_max_transfer_sz_limit_v4.2' into 'release/v4.2'
spi_docs: Fixed the default value of max_transfer_sz_limit (backport v4.2)

See merge request espressif/esp-idf!14253
2021-07-16 06:24:15 +00:00
77b12f0659 Merge branch 'nimble/fix_broadcaster_role_v4.2' into 'release/v4.2'
NimBLE: Fix build error for broadcaster role and bug in peer_dev_record (v4.2)

See merge request espressif/esp-idf!14301
2021-07-16 06:18:18 +00:00
e8a09a0135 OTA examples: Updated server certificate 2021-07-16 13:47:46 +08:00
c764c59893 esp_http_client: Optimize code structure 2021-07-15 16:26:43 +08:00
7188eaaebf esp_http_client: fix truncated headers
Signed-off-by: yuanjm <yuanjianmin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6370
2021-07-15 16:26:39 +08:00
1214dcea3a newlib: Fix a case in FD_ISSET macro when n==-1 2021-07-15 11:18:45 +08:00
bcdedf5501 Provisioning BLE: Add API to set manufacturer data in scan response
- Add `wifi_prov_scheme_ble_set_mfg_data` API to set custom manufacturer data
  in BLE advertisements.
- Run format.sh script on modified files.
- Fix few typos in `protocomm_nimble.c`.

- Incorporate suggestion to remove extra check on protocomm_ble_mfg_data_len

- Remove few unnecessary comments.
2021-07-14 18:25:20 +05:30
20e41d6265 fix esp32s2 fall into sleep forever when deep-sleep time is set to 0(backport v4.2) 2021-07-14 17:46:20 +08:00
21f4f460ca Merge branch 'bugfix/panic_handler_disable_wdts_early_v4.2' into 'release/v4.2'
esp_system: Reconfigure the WDTs at the start of the panic handler (v4.2)

See merge request espressif/esp-idf!14231
2021-07-14 08:47:15 +00:00
0679862de2 Driver(Touch sensor): fix the touch sensor wait cycle after wakeup from sleep 2021-07-14 14:47:07 +08:00
68b6bc661b Merge branch 'bugfix/idf_tools_not_found_issue_v4.2' into 'release/v4.2'
tools: Catch OSError which is raised when the tool is not available (v4.2)

See merge request espressif/esp-idf!14134
2021-07-13 15:42:46 +00:00
b50711eec1 NimBLE: Fix build error for broadcaster role and bug in peer_dev_record (v4.2)
* Fix bug in nvs deletion of `ble_dev_record`.
* Update NimBLE submodule to nimble-1.2.0-idf.
2021-07-13 13:58:06 +08:00
4e0b8678e4 Merge branch 'bugfix/broken_virtualenv_v4.2' into 'release/v4.2'
tools: Reinstall virtualenv if it is broken (v4.2)

See merge request espressif/esp-idf!12952
2021-07-12 15:28:50 +00:00
b3e2c714a7 Merge branch 'bugfix/pthread_join_debug_log_v4.2' into 'release/v4.2'
pthread: Fix possible deadlock when using pthread_join() and Debug log level (v4.2)

See merge request espressif/esp-idf!13777
2021-07-12 11:34:53 +00:00
96406ea6a5 Merge branch 'bugfix/prefetch_invalid_v4.2' into 'release/v4.2'
soc: add dummy bytes to ensure instr prefetch always valid (v4.2)

See merge request espressif/esp-idf!12994
2021-07-09 08:09:48 +00:00
0f095e4732 Merge branch 'bugfix/cmake_export_ver_during_reqs_expansion_v4.2' into 'release/v4.2'
cmake: set IDF_VERSION_* variables at requirement expansion stage (v4.2)

See merge request espressif/esp-idf!14044
2021-07-09 05:41:11 +00:00
49d1dc0fd3 Merge branch 'bugfix/timer_example_crashed_not_calling_timer_group_set_alarm_value_in_isr_v4.2' into 'release/v4.2'
driver/timer: fixed auto reload problem in default isr callback  (backport to 4.2)

See merge request espressif/esp-idf!13530
2021-07-06 12:44:07 +00:00
d685449314 esp_system: Reconfigure the WDTs at the start of the panic handler
This is mostly important on ESP32 ECO3 with the
ESP32_ECO3_CACHE_LOCK_FIX, because when we stall the other CPU core
before we disable the TG1 WDT then the first CPU can get stuck
in WDT ISR handle_livelock_int routine waiting for the other CPU.
2021-07-06 11:55:08 +10:00
45984aceb3 spi_docs: Fixed the default value of max_transfer_sz.
(cherry picked from commit e89fabb963)
2021-07-05 14:05:04 +08:00
1fe9b428f5 Merge branch 'bugfix/fix_bit_error_in_ledc_struct_backport_v4.2' into 'release/v4.2'
LEDC: fix bit error in ledc_struct.h(backport v4.2)

See merge request espressif/esp-idf!14163
2021-07-04 07:49:23 +00:00
884b8d319f Merge branch 'bugfix/attack_crash_for_release_v4.2' into 'release/v4.2'
bugfix/fix crash when lmp flooding

See merge request espressif/esp-idf!13825
2021-07-02 13:05:03 +00:00
5684196707 Merge branch 'bugfix/i2s_apll_disable_issue_v4.2' into 'release/v4.2'
i2s: fix driver uninstall issue (backport v4.2)

See merge request espressif/esp-idf!14000
2021-07-02 10:55:47 +00:00
65e19c0d1a bugfix/fix crash when lmp flooding 2021-07-01 20:07:45 +08:00
8ee8dcb3c5 Merge branch 'docs/windows_installer_2.9_backport_4.2' into 'release/v4.2'
docs: update Windows Tools 2.9 installation - backport 4.2

See merge request espressif/esp-idf!14190
2021-07-01 11:08:50 +00:00
2bea91d089 docs: update Windows Tools 2.9 installation 2021-06-30 12:45:19 +02:00
f8470e8336 Merge branch 'bugfix/fix_data_length_callback_param_err_v4.2' into 'release/v4.2'
Fixed data length update callback parameters error (backport v4.2)

See merge request espressif/esp-idf!14172
2021-06-30 05:58:01 +00:00
e3100dbecf Merge branch 'bugfix/gdbstub_threads_and_tests_v4.2' into 'release/v4.2'
gdbstub: fix thread list generation, add tests (v4.2)

See merge request espressif/esp-idf!14053
2021-06-30 04:28:22 +00:00
fbd2b60f52 Merge branch 'test/flash_perf_thr_update_by_grafana_avg_v4.2' into 'release/v4.2'
ci: adjust spi_flash performance value according to more test data (v4.2)

See merge request espressif/esp-idf!14117
2021-06-30 02:34:20 +00:00
1d19a237b4 Update components/idf_test/include/esp32/idf_performance_target.h 2021-06-29 16:42:11 +08:00
f7755f4175 ci: adjust spi_flash performance value according to more test data
After we have the performance dashboard, we have more data and no longer depend on the threshold to ensure performance.
Set looser performance thresholds to avoid CI failure.
2021-06-29 16:42:11 +08:00
zwj
a8e8eead70 - fix data length update failed
- fix no callback when the value being used is the same as the value to be set
2021-06-28 14:59:17 +08:00
bd9a6f32dd Merge branch 'bugfix/esp32s2_rom_address_range_backport_v4.2' into 'release/v4.2'
soc: Fix SOC_IROM_MASK_HIGH address (backport v4.2)

See merge request espressif/esp-idf!13662
2021-06-28 05:57:32 +00:00
54383f684f soc: add dummy bytes to ensure instr prefetch always valid
The CPU might prefetch instructions, which means it in some cases
will try to fetch instruction located after the last instruction in
flash.text.

Add dummy bytes to ensure fetching these wont result in an error,
 e.g. MMU exceptions
2021-06-26 08:54:46 +08:00
23c7a2c628 LEDC: fix bit error in ledc_struct.h(backport v4.2) 2021-06-25 20:51:04 +08:00
efa6eca8b8 Merge branch 'bugfix/update_esp32_phy_max_tx_power_v4.2' into 'release/v4.2'
esp_wifi: update esp32 phy max tx power(v4.2)

See merge request espressif/esp-idf!14140
2021-06-25 02:49:05 +00:00
cdb8690e63 Merge branch 'feature/ci_release_zips_v4.2' into 'release/v4.2'
ci: Use GitHub Actions to generate recursive source code zips for releases (v4.2)

See merge request espressif/esp-idf!13199
2021-06-24 23:42:56 +00:00
93921e042c Merge branch 'bugfix/mdns_one_shot_multicast_v4.2' into 'release/v4.2'
mdns: Support for One-Shot mDNS queries (v4.2)

See merge request espressif/esp-idf!14131
2021-06-24 18:48:23 +00:00
fa05924bc2 Merge branch 'bugfix/mqtt_examples_certificates_update_v4.2' into 'release/v4.2'
bugfix/mqtt examples: Updates the CA certificates used. (v4.2)

See merge request espressif/esp-idf!13126
2021-06-24 18:11:08 +00:00
0f5628a63d Merge branch 'bugfix/mdns_interface_del_crash_v4.2' into 'release/v4.2'
mdns: Fix of crash when wifi interface get deleted and mdns receives the packets(Backport v4.2)

See merge request espressif/esp-idf!13856
2021-06-24 16:23:53 +00:00
b694d36b7e Merge branch 'feature/mqtt_intro_new_modes_v4.2' into 'release/v4.2'
MQTT:  Update submodule reference to support new config modes (v4.2)

See merge request espressif/esp-idf!13708
2021-06-24 15:08:11 +00:00
54da845d7c tools: Reinstall virtualenv if it is broken
Closes https://github.com/espressif/esp-idf/issues/6656
2021-06-24 09:26:43 +02:00
68c1999df3 tools: Catch OSError which is raised when the tool is not available
Closes https://github.com/espressif/esp-idf/issues/7140
2021-06-24 09:16:56 +02:00
96736a1cbd esp_wifi: update esp32 phy max tx power 2021-06-24 14:41:19 +08:00
c23a132698 Merge branch 'test/wifi_connect_with_full_scan_in_examples_v4.2' into 'release/v4.2'
example: set example wifi scan method to all channel (v4.2)

See merge request espressif/esp-idf!13913
2021-06-24 06:13:44 +00:00
60ccb3fecc Merge branch 'bugfix/fix_amsdu_fragment_vulnerability_v4.2' into 'release/v4.2'
esp_wifi: fix amsdu & fragment vulnerabilities(v4.2)

See merge request espressif/esp-idf!14099
2021-06-24 06:02:48 +00:00
af7f75268c MQTT: Update submodule reference to support new config modes
* Queueing publish messages to outbox when the client is not connected (default=off -> messages are queued if disconnected)
* Use of incremental msg-id instead of random id (default=off -> msg-id uses platform_random())
* Posting a new event-id if a queued message gets deleted from the outbox (default=off -> events are not posted)

Detailed description of included `esp-mqtt` changes
(da850b0add1e71b3659bfac5d797cc834dc3e89b...9ea804e0ab5368d5ab53ae2301a5fec9d1f12f1a)
* mqtt: Remove unused mqtt_header_state_t
  - esp-mqtt commit: b7158a4aea
  - esp-mqtt MR: espressif/esp-mqtt!84
  - Merges https://github.com/espressif/esp-mqtt/pull/180
* Cleanup public include dirs
  - esp-mqtt commit: f65d5d05db
  - esp-mqtt MR: espressif/esp-mqtt!85
* Config: Add a new option to use incremental message id
  - esp-mqtt commit: 8bb4a26f46
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Closes https://github.com/espressif/esp-mqtt/issues/176
* Publish: Add new API to enqueue qos>0 messages
  - esp-mqtt commit: dc7fd5c0b1
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Closes https://github.com/espressif/esp-mqtt/issues/155
* Config: Add a new option to disable publishing when disconnected
  - esp-mqtt commit: f44dcb1c26
  - esp-mqtt MR: espressif/esp-mqtt!85
  - Related https://github.com/espressif/esp-mqtt/issues/177
* Events: Add new event to report deleted messages from outbox
  - esp-mqtt commit: 2e35d4d4d5
  - esp-mqtt MR: espressif/esp-mqtt!85
* Publish: Allow for qos=0 messages to be stored using esp_mqtt_client_enqueue()
  - esp-mqtt commit: e2de0f3e3e
  - esp-mqtt MR: espressif/esp-mqtt!85
2021-06-24 14:01:35 +08:00
33416006d3 bugfix/mqtt examples: Updates the CA certificates used.
- Updates the CA certificates.
- Updates the URI names to reflect the new URI in the service used in
  the examples.

Closes IDFGH-4986
Closes https://github.com/espressif/esp-idf/issues/6776
2021-06-24 13:57:49 +08:00
131ab4b92b Merge branch 'bugfix/http_client_test_memcorupt_v4.2' into 'release/v4.2'
ci/test: Fix esp_http_client test not to use pointer after free (v4.2)

See merge request espressif/esp-idf!13701
2021-06-24 05:52:27 +00:00
df752f4c46 mdns: Support for One-Shot mDNS queries 2021-06-24 06:59:11 +02:00
c6e0decf0a Merge branch 'bugfix/lwip_docs_delete_while_select_v4.2' into 'release/v4.2'
lw-IP: Add docs about not supported delete of task while blocked on select (v4.2)

See merge request espressif/esp-idf!13677
2021-06-24 04:04:07 +00:00
3810be0df5 ci/test: Fix esp_http_client test not to use pointer after free 2021-06-23 20:31:37 +02:00
b71752f41b lwip: Add docs about not supported delete of task while blocked on select 2021-06-24 02:00:39 +08:00
f4b556fdf9 Merge branch 'bugfix/mqtt_test_publish_less_data_v4.2' into 'release/v4.2'
ci: Make the mqtt example test to send only portion of the partition (v4.2)

See merge request espressif/esp-idf!14112
2021-06-23 15:18:23 +00:00
0a387f98de mdns: Fix of crash when wifi interface get deleted and mdns receives the packets
Closes https://github.com/espressif/esp-idf/issues/6973
2021-06-23 22:52:26 +08:00
afaff3bca3 ci: Make the mqtt example test to send only portion of the partition
This makes the test faster and more robust in very a busy WiFi environment
(our CI) and still exercises the scenario of fragmenting the message on
both mqtt and ssl levels (binary size to send > mqtt buffer size)
2021-06-23 08:27:44 +02:00
b20c5e3756 Merge branch 'feature/codeowners_v4.2' into 'release/v4.2'
add simplified CODEOWNERS file for older release branches (v4.2)

See merge request espressif/esp-idf!14091
2021-06-23 05:39:11 +00:00
54ac548cd4 Merge branch 'bugfix/esp32_u4wdh_quad_io_v4.2' into 'release/v4.2'
bootloader: Fix selection of Quad I/O modes on ESP32-U4WDH chip (v4.2)

See merge request espressif/esp-idf!13877
2021-06-23 05:37:51 +00:00
007bb3f9ed Merge branch 'bugfix/ble_set_scan_param_error' into 'release/v4.2'
Fix the bug when ble setting scan param

See merge request espressif/esp-idf!13973
2021-06-23 05:10:08 +00:00
77f880ff2b fix spp acceptor deadlock 2021-06-23 11:01:17 +08:00
de2baf098b example: set example wifi scan method to all channel:
in CI example test we could have runners with same SSID in the same lab.
Use scan on all channel will let DUT connect to the AP with best RSSI.
2021-06-23 10:17:48 +08:00
ebbc093fd2 Merge branch 'bugfix/fix_a2dp_sink_blocked_v4.2' into 'release/v4.2'
Bugfix/Fix a2dp Sink Blocked Bugs[backport v4.2]

See merge request espressif/esp-idf!14011
2021-06-22 13:12:03 +00:00
12ed1b2ab5 esp_wifi: fix amsdu & fragment vulnerabilities 2021-06-22 20:42:09 +08:00
036356ccba Merge branch 'bugfix/override_cmake_python_v4.2' into 'release/v4.2'
cmake: Minor Python CMake build fixes (v4.2)

See merge request espressif/esp-idf!13195
2021-06-22 07:45:17 +00:00
6f382600e4 add simplified CODEOWNERS file for older release branches 2021-06-22 09:21:51 +02:00
23a0ecedbf Merge branch 'feature/prevent_unwind_code_linking_4.2' into 'release/v4.2'
[C++]: prevent unwind code linking (backport 4.2)

See merge request espressif/esp-idf!13801
2021-06-22 04:48:45 +00:00
d938ab8fd4 Merge branch 'feature/update_libsodium_submodule_v4.2' into 'release/v4.2'
libsodium: Update library to v1.0.18 (v4.2)

See merge request espressif/esp-idf!13082
2021-06-22 03:06:44 +00:00
3c4cfdfcd6 Merge branch 'bugfix/ci_socket_tests_v4.2' into 'release/v4.2'
ci: Made socket example tests more robust (v4.2)

See merge request espressif/esp-idf!13707
2021-06-22 02:05:01 +00:00
d8b921c438 Merge branch 'bugfix/link_gcov_rtio_backport_v4.2' into 'release/v4.2'
Bugfix/link gcov rtio backport v4.2

See merge request espressif/esp-idf!13832
2021-06-22 00:43:01 +00:00
0b45e84e2a Merge branch 'bugfix/ldgen_ignore_nonexistent_archives_and_obj_v4.2' into 'release/v4.2'
ldgen: Check mappings (v4.2)

See merge request espressif/esp-idf!13994
2021-06-21 23:20:59 +00:00
90b6780b1e ci: Made socket tests more robust
Added common timeout
Added debug logs for both addr families
Renamed example tests to have different names
2021-06-22 01:10:42 +08:00
cb1a2642b6 Merge branch 'bugfix/spi_flash_cs_setup_v4.2' into 'release/v4.2'
spi_flash: fix cs line setup to make the flash driver more stable(backport v4.2)

See merge request espressif/esp-idf!13965
2021-06-21 14:33:02 +00:00
a4f6af013c fix a2dp sink RxSbcQ bugs
Closes https://github.com/espressif/esp-idf/issues/6712
Closes https://github.com/espressif/esp-idf/issues/7100
2021-06-21 20:14:34 +08:00
9ac6689a5d Merge branch 'feat/ble_mesh_make_unprov_beacon_interval_configurable_v4.2' into 'release/v4.2'
Feat/ble mesh make unprov beacon interval configurable (v4.2)

See merge request espressif/esp-idf!14062
2021-06-21 11:39:41 +00:00
dcf4d1fa8c Merge branch 'bugfix/loadable_elf_test_eco3_v4.2' into 'release/v4.2'
tests: gdb_loadable_elf: adjust the breakpoint location for ESP32 ECO3 (v4.2)

See merge request espressif/esp-idf!14040
2021-06-21 04:39:04 +00:00
00008a3bf5 ble_mesh: stack: Fix crash for net_key_del when subnet is NULL 2021-06-21 11:24:13 +08:00
f227f0ebe6 ble_mesh: stack: Make unprovisioned beacon interval configurable.
Closes https://github.com/espressif/esp-idf/issues/6722
2021-06-21 11:24:00 +08:00
ea7b487807 Merge branch 'bugfix/AuthValue_leak_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix AuthValue Leak and Predictable AuthValue in Bluetooth... (v4.2)

See merge request espressif/esp-idf!14023
2021-06-21 03:08:53 +00:00
0adf0f85dd gdbstub: fix thread list generation
This commit fixes an issue with gdbstub, where it would list threads
with TIDs 1 to N in qfThreadInfo/qsThreadInfo responses, and then
would tell GDB that the current TID is 0 in the qC response. This
caused an assertion failure in GDB, because it couldn't find the
thread structure corresponding to TID 0:

src/gdb/gdb/thread.c:93: internal-error: thread_info* inferior_thread(): Assertion `tp' failed.

The issue was caused by the logic of qfThreadInfo/qsThreadInfo.
If the "paniced" task index was 1, the code would report it in the
response to qfThreadInfo, and then mistakenly skip task with index 0
in qsThreadInfo, due to the use of pre-increment instead of a
post-increment.

With that issue fixed, GDB assertion doesn't happen anymore. However
the code contained a deeper problem, which manifested itself in the
fact that GDB would incorrectly show task index 0 as the current task,
after the above fix.

Previous version of the code assumed that when GDB requests the thread
list, it uses the first thread returned by the target as the "default"
thread, and subsequently shows the user that the program is stopped
in that thread. This assumption was incorrect. In fact, after
connecting to a remote target, GDB obtains information about the
"default" or "current" thread from two sources:
1. the 'thread' special register indicated in the status response
   ($T00thread;00000001#ee)
2. if the target has only sent the plain stop response ($T00#ee), GDB
   would ask for the current thread using a qC packet.
With that in mind, it is not necessary to report the paniced task as
the first task in qfThreadInfo response. We can simply returns the
tasks in their natural order, and then indicate the current task in
the qS packet response.

However even that change does not fully resolve the issues with task
list. The previous version of this code also incorrectly interpreted
the meaning of GDB TIDs -1 and 0. When GDB sends an "Hg0" command
early in the connection process, it doesn't expect the server to set
task 0 as the current task, as the code assumed. Rather, it tells the
server to "set any (arbitrary) task as the current one", and the most
logical thing to do for the server that is already in "stopped" state
is to keep the current task selection.

Since TID 0 has a special meaning in GDB remote protocol, gdbstub code
is now modified to map task indices (which start from 0) to GDB TIDs.
GDB TIDs are arbitrary, and for simplicity we keep the same order and
start counting them from 1.

The summary of all the above changes is:

1. Use "task index + 1" as the TID reported to GDB
2. Report the tasks in natural order; don't complicate the code to
   make the paniced task first in the list.
3. Centralize modification of 'current_task_index' and 'regfile'
   in the new 'set_active_task' function, to improve encapsulation.
2021-06-18 16:02:10 +02:00
55f233b945 docs: describe power management logic for ESP32-S2, fix translation 2021-06-18 15:40:35 +02:00
19121e2f6f cmake: set IDF_VERSION_* variables at requirement expansion stage
Currently IDF_VERSION_* variables are not available to the component
CMakeLists.txt files at the requirements expansion stage. This makes
it harder to write component CMakeLists files compatible with
different IDF versions.

Include version.cmake from the requirements expansion script, add a
build system test.
2021-06-18 15:27:33 +02:00
2a81167470 tests: gdb_loadable_elf: adjust the breakpoint location for ESP32 ECO3
The previous location was the return from the first ets_printf call
that prints ROM sign-on message. Since the main function was patched
in ECO3, the new address no longer works — there is no instruction at
0x40007901 in ECO3 ROM. This could be solved by setting two
breakpoints (one would work for ECO <=2, the other for ECO3), but we
would need to remove the unused breakpoint later.
Fix this by setting the breakpoint at ets_printf. This means that when
debugging a loadable ELF the ROM sign-on message will no longer be
shown, but this doesn't seem to be an issue.
2021-06-18 15:09:47 +02:00
d7acee288d Merge branch 'feature/link_idf_common_docs_v4.2' into 'release/v4.2'
docs: Linking to a page to help navigate to documentation for specific ESP32-x chip (v4.2)

See merge request espressif/esp-idf!13843
2021-06-18 10:06:12 +00:00
1cdf60c914 libsodium: Update library to v1.0.18 2021-06-18 16:40:15 +08:00
681e71cb10 Merge branch 'bugfix/elf_sha256_first_byte_skip_v4.2' into 'release/v4.2'
app_update: fix incorrect first byte from esp_ota_get_app_elf_sha256 (v4.2)

See merge request espressif/esp-idf!13663
2021-06-18 08:00:18 +00:00
3212d62b2b ble_mesh: stack: Fix AuthValue Leak and Predictable AuthValue in Bluetooth Mesh Provisioning Leads to MITM 2021-06-18 14:21:02 +08:00
7166428ac0 Merge branch 'bugfix/impersonation_attacks_and_AuthValue_disclosure_v4.2' into 'release/v4.2'
ble_mesh: stack: Add check the value of Provisioning Random & Confirmation... (v4.2)

See merge request espressif/esp-idf!13923
2021-06-18 06:11:46 +00:00
333b9d7873 Merge branch 'bugfix/example_test_socket_issue_4.2' into 'release/v4.2'
CI: example test socket issue (4.2)

See merge request espressif/esp-idf!13905
2021-06-18 06:04:42 +00:00
b0a51f30bb Merge branch 'docs/add_esp32-s2-devkitm-1_user_guide_backport' into 'release/v4.2'
Add ESP32-S2-DevKitM-1 User Guide (backport master)

See merge request espressif/esp-idf!13860
2021-06-18 06:01:03 +00:00
dd27b49891 Merge branch 'doc/nvs_get_used_entry_count__clarify_4.2' into 'release/v4.2'
[doc]: NVS documentation updates (backport 4.2)

See merge request espressif/esp-idf!13824
2021-06-18 05:59:08 +00:00
9b48e5a024 Merge branch 'bugfix/ci_ble_wifi_example_test_v4.2' into 'release/v4.2'
Fix for ble and wifi example test (v4.2)

See merge request espressif/esp-idf!13803
2021-06-18 05:39:38 +00:00
cd8173bc13 pthread: Fix possible deadlock when using pthread_join() and Debug log level
Possible for a joined task to be deleted at the moment it is logging,
meaning it might hold the stdout lock. In that case the lock isn't
released and the next task to try and take it (i.e. call printf)
will block indefinitely.
2021-06-18 13:37:31 +08:00
a637d6f3d7 Merge branch 'ci/unify_all_target_test_artifacts_paths_v4.2' into 'release/v4.2'
ci: unify target test artifacts to all .log file and $LOG_PATH (v4.2)

See merge request espressif/esp-idf!13849
2021-06-18 05:37:30 +00:00
2d72e916ac Merge branch 'update/version_4_2_2' into 'release/v4.2'
Update version to 4.2.2

See merge request espressif/esp-idf!13984
2021-06-18 05:23:04 +00:00
881909ecda app_update: fix incorrect first byte from esp_ota_get_app_elf_sha256
At -O2 optimization level, GCC seems to optimize out the copying of the
first byte of the checksum, assuming it is zero. This "miscompilation"
happens because the esp_app_desc struct is declared const, but then modified
post-compilation. Casting to volatile disables the optimization.

Closes: https://github.com/espressif/esp-idf/pull/6389
2021-06-17 17:32:31 +08:00
813931720e i2s: fix driver uninstall issue 2021-06-17 14:18:21 +08:00
eed6eed909 components: fix ldgen check errors 2021-06-17 12:36:34 +10:00
9a14cf083f driver/timer: only re-enable alarm in callback when auto reload is true
closes https://github.com/espressif/esp-idf/issues/7001
2021-06-17 10:30:44 +08:00
ea7d9c6368 ci: exempt upstream libmbedtls mapping for sha256 2021-06-17 12:21:53 +10:00
711048bce0 ldgen: fix sections info parsing
Fixes an issure where the first part of an object file name is not
included, due to matching the rule for a section entry previously.

Reduce depedency on matching literal strings in sections which might
change depending on toolchain (ex. matching 'elf32-xtensa-le')

Make sure parsing rule succeeds for the entirety of the sections info
string by adding 'parseAll=True'.

Add test for sections info parsing.
2021-06-17 12:21:53 +10:00
2c1c4999f5 ci: enabled ldgen mapping check in ci 2021-06-17 12:20:58 +10:00
5aa09271d8 ldgen: allow checking mappings 2021-06-17 12:18:02 +10:00
34bfff424a ble_mesh: stack: Add check the value of Provisioning Random & Confirmation sent and received by provisioner 2021-06-16 21:29:02 +08:00
7ab8f793ca versions: Update version to 4.2.2 2021-06-16 14:49:39 +08:00
24578ac17b bugfix:Set address resolution enable. If not set enable and the filter
policy is 2 or 3, the controller will reply with invalid param error.
2021-06-15 16:14:23 +08:00
1bb087d6af docs: Correct uart default pin names and provid more information about ESP-Prog board 2021-06-15 15:37:05 +08:00
8c16b4bcb3 spi_flash: fix cs line setup to make the flash driver more stable 2021-06-15 15:24:35 +08:00
1e36383909 Merge branch 'bugfix/handling_public_action_frame_v4.2' into 'release/v4.2'
esp_wifi: Fix SoftAP crash by handling public action frames.

See merge request espressif/esp-idf!13927
2021-06-11 05:19:05 +00:00
1e8fca74f2 esp_wifi: Fix SoftAP crash by adding NULL check for handling publc action frames.
Closes https://github.com/espressif/esp-idf/issues/7109
2021-06-10 18:47:27 +05:30
32c63fca90 Merge branch 'bugfix/fix_pmf_ba_issue_v4.2' into 'release/v4.2'
fix pmf ba issue ( v4.2)

See merge request espressif/esp-idf!13901
2021-06-10 12:20:49 +00:00
f23c9d94ae bootloader: Fix selection of Quad I/O modes on ESP32-U4WDH chip
Closes https://github.com/espressif/esp-idf/issues/6191
2021-06-09 05:10:21 +00:00
4921446d3d Merge branch 'bugfix/btdm_enable_gattc_cache_will_crash_v4.2' into 'release/v4.2'
component/bt: fix enable gattc nvs cache lead to crash

See merge request espressif/esp-idf!13889
2021-06-09 03:46:27 +00:00
443c9ff276 test: fix socket issue in iperf example test 2021-06-08 17:11:38 +08:00
06c7cde836 test: fix iperf example errors:
1. fix TypeError when running with python3
2. fix throughput chart x/y axis label error
3. make test case compatibile with iperf bin on earlier release branches
2021-06-08 17:08:29 +08:00
c26317ac90 CI: fix connection failures in asio example tests 2021-06-08 17:05:04 +08:00
96a00e59f4 example: set PMF capable to connect to PMF required APs 2021-06-08 16:07:09 +08:00
36c2ef2828 esp_wifi: fix Block Ack issue when pmf enable 2021-06-08 16:06:24 +08:00
8491705b63 component/bt: fix enable gattc nvs cache lead to crash 2021-06-07 17:34:47 +08:00
2c5f35fa8a Merge branch 'bugfix/bt_impersonation_passkey_fix_v4.2' into 'release/v4.2'
Bluedroid: Check only x component of passkey to avoid passkey impersonation attack. (v4.2)

See merge request espressif/esp-idf!13759
2021-06-07 07:24:00 +00:00
e632f2b366 Merge branch 'feature/IDF-2612_human_readable_error_v4.2' into 'release/v4.2'
export.bat/install.bat: print human-readable error message if Git or Python are not in PATH (v4.2)

See merge request espressif/esp-idf!13227
2021-06-07 06:08:15 +00:00
72f4f9542c Merge branch 'feature/installed_tool_failed_v4.2' into 'release/v4.2'
tools: Warning about tool being installed but failed to run. (v4.2)

See merge request espressif/esp-idf!13231
2021-06-07 06:07:54 +00:00
cbe42f1132 Merge branch 'bugfix/gdbgui_v4.2' into 'release/v4.2'
tools: Add various fixes for idf.py gdbgui (v4.2)

See merge request espressif/esp-idf!13417
2021-06-07 06:07:13 +00:00
8aa7eaa646 Merge branch 'bugfix/idfpy_global_action_callbacks_order_v4.2' into 'release/v4.2'
idf.py: Run global_action_callbacks in predictable order (v4.2)

See merge request espressif/esp-idf!13682
2021-06-07 06:06:54 +00:00
d21e948381 Merge branch 'feature/idf_tools_github_mirror_v4.2' into 'release/v4.2'
Add GitHub mirror option for IDF tools installs (v4.2)

See merge request espressif/esp-idf!13765
2021-06-07 06:06:31 +00:00
b50a8e0878 Merge branch 'bugfix/dfu_split_large_bins_v4.2' into 'release/v4.2'
tools: Split up large binaries into smaller chunks in the DFU binary (v4.2)

See merge request espressif/esp-idf!13794
2021-06-07 06:05:46 +00:00
a5ffdaa962 Add ESP32-S2-DevKitM-1 User Guide
Update 1 based on comments

Fix typo

Add annotation to UFL connector

Add UFL connector to description table
2021-06-04 11:01:29 +08:00
95f4bba736 ci: unify target test artifacts to all .log file and $LOG_PATH 2021-06-03 17:34:03 +08:00
a954243875 docs: Linking to a page that helps navigate to documentation for specific ESP32-x chip 2021-06-03 08:13:03 +02:00
fa734e6af8 Merge branch 'bugfix/partition_table_integrity_check_v4.2' into 'release/v4.2'
paritition_table: Verify the partition table md5sum when loading in the app (v4.2)

See merge request espressif/esp-idf!13583
2021-06-03 02:19:11 +00:00
ca44fb1528 Merge branch 'bugfix/rtc_retain_mem_addr_v4.2' into 'release/v4.2'
bootloader: Fix "skip validate in deep sleep" on ESP32 & ESP32-S2 (v4.2)

See merge request espressif/esp-idf!13813
2021-06-03 02:18:59 +00:00
0a5fbc1b8c gcov: Fixes not linked gcov rtio functions 2021-06-02 21:48:29 +03:00
5dbca18324 [doc]: NVS documentation updates
* Better comment of nvs_get_used_entry_count()
* Mention C++ example in API reference
* WIP: Used target instead of hard code ESP32
* Note that strings can only span one page
* Reflect that item types have been moved
* Some clarification about nvs_commit()
* Improved reference to the ESP Partition API
* fixed little mistake in documenting-code.rst
* Change of nvs_open_from_part() to
  nvs_open_from_partition() reflected in docs
* Corrected documentation of
  NVSHandle::get_string(), NVSHandle::get_blob()
  and NVSHandle::get_item_size().

* Closes IDF-1563
* Closes IDF-859
* Closes https://github.com/espressif/esp-idf/issues/6123
2021-06-02 15:46:13 +08:00
f8b9cb2864 paritition_table: Verify the partition table md5sum when loading the app
Additionally, always enable the partition MD5 check if flash encryption is on in
Release mode. This ensures the partition table ciphertext has not been modified
(CVE-2021-27926).

The exception is pre-V3.1 ESP-IDF bootloaders and partition tables, which
don't have support for the MD5 entry.
2021-06-02 06:35:45 +00:00
7b70154566 tools: Split up large binaries into smaller chunks in the DFU binary
ROM will erase the region a partition is in as soon as it receives the
first bit of the data that is in the partition. For large partitions it
takes more than 5 seconds to erase which is a hard-coded limit in
dfu-utils.

This splits large binaries and adds them by chunks which should avoid
timing-out during flashing.

Closes https://github.com/espressif/esp-idf/issues/6999
2021-06-01 15:11:12 +02:00
fd50bcf704 bootloader: Fix "skip validate in deep sleep" on ESP32 & ESP32-S2
Regression in 83bf2e1ac1, this memory region was shifted from fast to slow RTC
memory (no change on ESP32-C3 as no RTC fast memory on this chip.)
2021-06-01 19:07:15 +10:00
be960bc3dc ble-wifi-example-tests: Add fixes and cleanups to ble and wifi tests
(cherry picked from commit 2d22374460)
2021-06-01 12:43:59 +05:30
dd08575c29 [C++]: wrapper functions around unwind code
* Replaced all C++ exception related
  functions with wrappers if -fno-exception
  is used. This prevents linking of the
  corresponding code in libgcc. The code
  size will decrease by around 7-9 KB when
  building with -fno-exception.
* added no except test app

Closes https://github.com/espressif/esp-idf/pull/5380
Closes https://github.com/espressif/esp-idf/issues/5363
Closes https://github.com/espressif/esp-idf/issues/5224
Closes IDFGH-3153
Closes IDF-2577
2021-06-01 15:09:46 +08:00
c1e204634f Bluedroid: Check only x component of passkey to avoid passkey impersonation attack. 2021-05-31 05:10:59 +00:00
96d00c5fa5 add CN translation for index.rst in get started section for MR10616 2021-05-31 11:05:04 +10:00
054d3b81a6 tools: windows installer: Modify IDF's archive mirror link 2021-05-31 11:05:04 +10:00
daeaa8092b tools: windows installer: add support for IDF_GITHUB_ASSETS
Adds a checkbox to download tools from dl.espressif.com mirror.
2021-05-31 11:05:04 +10:00
56b4596b53 tools: Use GitHub download URLs for all files that can be downloaded from GitHub 2021-05-31 11:05:04 +10:00
bebc75af48 idf_tools: Add option to replace all GitHub tools download URLs with dl.espressif.com
Via new IDF_GITHUB_ASSETS environment variable.
2021-05-31 11:04:00 +10:00
71cf821659 Merge branch 'bugfix/calc_8m_freq_test_v4.2' into 'release/v4.2'
rtc: increase CI acceptance range for calc 8M test (v4.2)

See merge request espressif/esp-idf!13086
2021-05-30 23:46:14 +00:00
652e214f55 Merge branch 'mesh/esp_mesh_send_block_time_v4.2' into 'release/v4.2'
esp_wifi_mesh: add esp_mesh_send_block_time to set blocking time of esp_mesh_send(backport v4.2)

See merge request espressif/esp-idf!13409
2021-05-27 10:50:28 +00:00
345e6acf80 esp_wifi_mesh: add esp_mesh_send_block_time
1. Ignore dirtyBuf check when buffer size is larger than 4092
2. Add esp_mesh_send_block_time to set blocking time of esp_mesh_send
2021-05-27 08:27:39 +00:00
e8e6021ada Merge branch 'docs/add_rf_calib_docs_v4.2' into 'release/v4.2'
docs: add RF calibration docs for ESP32-S2(v4.2)

See merge request espressif/esp-idf!13723
2021-05-27 08:06:12 +00:00
df0ca79bdb Merge branch 'bugfix/btdm_set_discoverable_after_create_server_v4.2' into 'release/v4.2'
components/bt: Set discoverable after create server

See merge request espressif/esp-idf!13726
2021-05-26 08:26:30 +00:00
ca77bdddbf Merge branch 'bugfix/fix_uart_handler_call_inline_func_v42' into 'release/v4.2'
Bugfix/fix uart handler call inline func (backport v4.2)

See merge request espressif/esp-idf!13005
2021-05-26 03:45:29 +00:00
e459f7b498 Merge branch 'bugfix/cmake_ulp_reserved_size_v4.2' into 'release/v4.2'
ulp: Fix bug where ULP linker script not regenerated for new config (v4.2)

See merge request espressif/esp-idf!13629
2021-05-26 03:43:55 +00:00
841aca897c Merge branch 'feature/extmem_alloc_for_s2_v4.2' into 'release/v4.2'
External memory allocation policy support  for ESP32-S2 (GitHub PR) (v4.2)

See merge request espressif/esp-idf!13620
2021-05-26 03:43:13 +00:00
b860069c10 Merge branch 'bugfix/start_emac_after_phy_reset_v4.2' into 'release/v4.2'
esp_eth: restart negotiation in esp_eth_start (v4.2)

See merge request espressif/esp-idf!13699
2021-05-26 03:36:38 +00:00
bb1aa0ed5e components/bt: Set discoverable after create server 2021-05-26 11:35:07 +08:00
481da3143d Merge branch 'bugfix/ds_invalidate_assert_v4.2' into 'release/v4.2'
esp32s2 ds: Fix invalidating Digital Signature key from HMAC peripheral if assertions are disabled (v4.2)

See merge request espressif/esp-idf!12906
2021-05-26 03:30:45 +00:00
536d6eea61 Merge branch 'bugfix/aes_dma_completion_v4.2' into 'release/v4.2'
mbedtls: Fix AES dma completion race condition (v4.2)

See merge request espressif/esp-idf!12904
2021-05-26 03:30:18 +00:00
176ea97dd0 Merge branch 'test/support_multiple_targets_for_iperf_example_test_v4.2' into 'release/v4.2'
test: support multiple targets for iperf example test (v4.2)

See merge request espressif/esp-idf!13618
2021-05-26 03:11:56 +00:00
ca2a15dca7 Merge branch 'ci/ttfw_fix_dut_exception_not_added_to_junit_report_v4.2' into 'release/v4.2'
ttfw: fix DUT exception not added to junit report (v4.2)

See merge request espressif/esp-idf!12142
2021-05-26 03:11:26 +00:00
5d88861dba docs: add RF calibration docs for ESP32-S2 2021-05-26 10:58:38 +08:00
f8e633a352 Merge branch 'ajust_espnow_channel_config_range_v4.2' into 'release/v4.2'
adjust espnow channel range

See merge request espressif/esp-idf!13689
2021-05-25 15:41:16 +00:00
9e40c13d4e Merge branch 'bugfix/invalid_feat_page_exec_v4.2' into 'release/v4.2'
bt controller: Fixed handling for invalid feature page.

See merge request espressif/esp-idf!13572
2021-05-25 14:51:24 +00:00
6e0c046bd9 mbedtls tests: Add optional debug log output to AES stream tests 2021-05-25 14:36:47 +00:00
9e1324fbbb mbedtls aes dma: Fix bug where DMA would complete when the first output descriptor was done, not the last 2021-05-25 14:36:47 +00:00
95c118171a Merge branch 'bugfix/backport_some_lwip_bugs_0428_v4.2' into 'release/v4.2'
lw-ip:backport bugfix lwip for v4.2(backport v4.2)

See merge request espressif/esp-idf!13378
2021-05-25 14:27:42 +00:00
2af8fac1d9 esp32s2 ds: Fix invalidating Digital Signature key from HMAC peripheral if assertions are disabled 2021-05-25 14:22:55 +00:00
93c28d1fac Merge branch 'bugfix/phy_calib_data_to_nvs_for_c3_s3_v4.2' into 'release/v4.2'
esp_wifi: re-enable phy calibration data to nvs for esp32s2

See merge request espressif/esp-idf!13626
2021-05-25 14:19:54 +00:00
97ed80f415 Merge branch 'nimble/fix_ble_sm_sc_pub_key_v4.2' into 'release/v4.2'
NimBLE: Fix MITM vulnerability and free AES context (v4.2)

See merge request espressif/esp-idf!13597
2021-05-25 14:17:55 +00:00
b18f37b2e2 Merge branch 'bugfix/ag_use_dynamic_memory_error_v4.2' into 'release/v4.2'
Fix ag use dynamic memory error

See merge request espressif/esp-idf!13551
2021-05-25 14:17:18 +00:00
0ca5134d5f NimBLE: Fix MITM vulnerability and free AES context (v4.2) 2021-05-25 09:21:12 +00:00
a7c17edc8a backport bugfix lwip for v4.2 2021-05-25 09:06:28 +00:00
bab80796ca Merge branch 'bugfix/remove_redundant_other_core_cache_disable_v4.2' into 'release/v4.2'
[system]: Remove redundant othercore cache disable (backport v4.2)

See merge request espressif/esp-idf!13357
2021-05-25 09:05:33 +00:00
c219c9dcb2 Merge branch 'bugfix/fix_set_channel_error_after_wifi_stop_v4.2' into 'release/v4.2'
esp_wifi: Fix setting channel error after WiFi stop (backport v4.2)

See merge request espressif/esp-idf!13447
2021-05-25 08:09:39 +00:00
e892fed593 esp_eth: restart negotiation in esp_eth_start 2021-05-25 15:17:48 +08:00
18a262a6fa Merge branch 'ci/decrease_flash_performance_thr_4.2' into 'release/v4.2'
ci: decrease the flash performance threshold (4.2)

See merge request espressif/esp-idf!13632
2021-05-25 07:11:14 +00:00
7988705558 components/bt: Delete BLE ADV priority high 2021-05-25 15:10:49 +08:00
8e7f7dfe59 Remove btc_hf_idx_by_bdaddr in both btc_hf_init and btc_hf_deinit functions 2021-05-25 07:06:22 +00:00
b257ad7d9e fix ag use dynamic memory error 2021-05-25 07:06:22 +00:00
4d95ffcca2 bt controller: Fixed handling for invalid feature page. 2021-05-25 10:39:25 +05:30
adb20fb2f3 components/bt: fix PATH of libbtdm_app.a in build script 2021-05-25 10:39:25 +05:30
a8227a1d13 adjust espnow channel range 2021-05-25 11:21:53 +08:00
d2715324e5 Merge branch 'bugfix/fix_touch_sensor_power_source_v4.2' into 'release/v4.2'
touch_sensor: fix esp32s2 touch sensor default power source (Backport v4.2)

See merge request espressif/esp-idf!13485
2021-05-25 03:13:32 +00:00
2deea3b1b0 Run global_action_callbacks in predictable order 2021-05-24 18:14:44 +02:00
f837b298e6 soc: Fix SOC_IROM_MASK_HIGH address
The high address limit IROM on the esp32s2 is incorrect, thus
causing backtrace printing to think valid function PCs are invalid.
2021-05-24 15:22:16 +08:00
e60640ab04 ttfw: fix DUT exception not added to junit report 2021-05-21 08:37:28 +00:00
899c7852a4 ci: decrease the flash performance threshold 2021-05-21 13:03:36 +08:00
be74e06e50 ulp: Fix bug where ULP linker script not regenerated for new config
ULP linker script relies on value of CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM,
when this value changes in config then it should be regenerated.
2021-05-21 10:56:05 +10:00
d3e730ff57 esp_wifi: re-enable phy calibration data to nvs for esp32s2 2021-05-20 22:13:39 +08:00
06bf491f13 mbedtls: Allow external mem alloc for ESP32-S2
Closes https://github.com/espressif/esp-idf/pull/6998
Closes IDFGH-5226
2021-05-20 15:22:07 +05:30
54bf4dccfa test: support multiple targets for iperf example test 2021-05-20 17:09:53 +08:00
d9ec7df393 Merge branch 'nimble/fix_host_flow_ctrl_v4.2' into 'release/v4.2'
NimBLE: Fix host flow control in NimBLE porting layer and host (release/v4.2)

See merge request espressif/esp-idf!13571
2021-05-19 08:52:23 +00:00
71cddbdf8f Merge branch 'bugfix/fe_example_test_args' into 'release/v4.2'
ci: fix flash encryption example test esptool args (4.2)

See merge request espressif/esp-idf!13539
2021-05-19 06:58:48 +00:00
a699475df2 Merge branch 'bugfix/fix_ppos_ci_python3' into 'release/v4.2'
CI: fix ppos test app python3 error (v4.2)

See merge request espressif/esp-idf!13592
2021-05-19 06:58:41 +00:00
b5976a7167 CI: fix error when running pppos test app with python3
Socket.sendall expects bytes in python3, not strings
2021-05-19 11:42:42 +08:00
1c7340d229 NimBLE: Update submodule to fix host flow control bugs. 2021-05-18 18:10:19 +05:30
b3e1829f10 NimBLE: Fix host flow control in NimBLE porting layer.
- Register `ble_hs_flow_acl_free` callback in NimBLE porting layer.
2021-05-17 14:16:19 +05:30
2515cd72c1 touch_sensor: fix esp32s2 touch sensor default power source 2021-05-15 13:52:37 +08:00
8a841d7cdf Merge branch 'bugfix/gtk_reinstallation_fix_v4.2' into 'release/v4.2'
wpa_supplicant: Prevent reinstallation of an already in-use group key (v4.2)

See merge request espressif/esp-idf!13182
2021-05-13 04:30:53 +00:00
31d05a5072 wpa_supplicant: Group key reinstallation fixes
This commit reverts previous commit for GTK reinstallation fix
and corrects original fix.
2021-05-13 12:30:44 +08:00
bfb7c66a9f Merge branch 'bugfix/timer_spinlock_iram_v4.2' into 'release/v4.2'
timer: add IRAM_ATTR to spinlock give/take API (v4.2)

See merge request espressif/esp-idf!13512
2021-05-13 04:30:02 +00:00
3bb84e7738 ci: fix flash encryption example test esptool args
Esptool submodule got updated which changed the function signature for EncryptFlashDataArgs.

Update example test script to reflect the new function signature
2021-05-13 11:05:32 +08:00
ff4ca61cc6 timer: add IRAM_ATTR to spinlock give/take API
Closes https://github.com/espressif/esp-idf/issues/6824
2021-05-11 15:32:37 +08:00
f195a1d8ae Merge branch 'bugfix/otatool_wrong_switch_ota_partition_slots_v4.2' into 'release/v4.2'
otatool: Fix incorrect using otadata.seq&crc in switch_ota_partition cmd (v4.2)

See merge request espressif/esp-idf!13368
2021-05-11 01:27:53 +00:00
d52331849e Merge branch 'bugfix/flash_rodata_any_alignement_v4.2' into 'release/v4.2'
build: Fix cache issue and add dedicated section for (Custom) App version info (backport v4.2)

See merge request espressif/esp-idf!13465
2021-05-11 01:03:12 +00:00
d29cce7f0a Merge branch 'bugfix/fix_some_pm_issue_v4.2' into 'release/v4.2'
esp_pm: add an interface to get pm configuration (backport to v4.2)

See merge request espressif/esp-idf!13124
2021-05-10 03:45:55 +00:00
6b47fcdbdc Merge branch 'bugfix/correct_cod_check_v4.2' into 'release/v4.2'
esp-idf: Corrected check of Class of Device for discovered devices (v4.2)

See merge request espressif/esp-idf!13020
2021-05-10 03:45:35 +00:00
9a2362b5c7 Merge branch 'nimble/add_error_prints_acl_buf_v4.2' into 'release/v4.2'
NimBLE: Add error prints for ACL buffer exhaustion in NPL (v4.2)

See merge request espressif/esp-idf!12969
2021-05-10 03:45:08 +00:00
abe7a9d020 Merge branch 'bugfix/wifi_softap_deep_sleep_current_opt_v4.2' into 'release/v4.2'
backport v4.2: optimize deep sleep current in wifi softap mode

See merge request espressif/esp-idf!13393
2021-05-10 03:44:29 +00:00
9f63baf061 Merge branch 'bugfix/generate_value_0_when_prov_auth_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix provisioning input or output count number should be at least 1 (v4.2)

See merge request espressif/esp-idf!13479
2021-05-10 03:42:24 +00:00
bf4320ba68 ci: fix flasher_args.json parser (iterate over dictionary)
Closes IDFCI-347
2021-05-10 11:18:09 +08:00
5c175721e9 ci: use "encrypted" information in flasher_args.json
Take into account the new field "encrypted" that is part of the
partition entries in flasher_args.json file
Closes IDF-2231
2021-05-10 11:18:09 +08:00
78ea042e7d esptool: Update esptool to have merge adjacent sections feature 2021-05-10 11:18:09 +08:00
af7b21851e freertos: fix TLS run-time address calculation
Since dd849ffc, _rodata_start label has been moved to a different
linker output section from where the TLS templates (.tdata, .tbss)
are located. Since link-time addresses of thread-local variables are
calculated relative to the section start address, this resulted in
incorrect calculation of THREADPTR/$tp registers.

Fix by introducing new linker label, _flash_rodata_start, which points
to the .flash.rodata output section where TLS variables are located,
and use it when calculating THREADPTR/$tp.

Also remove the hardcoded rodata section alignment for Xtensa targets.
Alignment of rodata can be affected by the user application, which is
the issue dd849ffc was fixing. To accommodate any possible alignment,
save it in a linker label (_flash_rodata_align) and then use when
calculating THREADPTR. Note that this is not required on RISC-V, since
this target doesn't use TPOFF.
2021-05-10 11:18:09 +08:00
974b8dd4c4 build: (Custom) App version info is now on a dedicated section, independent of the rodata alignment
It is now possible to have any alignment restriction on rodata in the user
applicaiton. It will not affect the first section which must be aligned
on a 16-byte bound.

Closes https://github.com/espressif/esp-idf/issues/6719
Closes https://github.com/espressif/esp-idf/issues/6976
2021-05-10 11:17:58 +08:00
87da4bccd4 Merge branch 'bugfix/btdm_fix_multi-con_pair_failed_and_cancle_con_state_err_v4.2' into 'release/v4.2'
fix multi con pair failed and cancel con state err (backport v4.2)

See merge request espressif/esp-idf!13475
2021-05-08 12:53:35 +00:00
c68f520389 ble_mesh: stack: Fix provisioning input or output count number should be at least 1
Closes https://github.com/espressif/esp-idf/issues/6863
2021-05-08 11:49:25 +08:00
232786235b Merge branch 'docs/update_CN_buildsystem_v4.2' into 'release/v4.2'
update CN translation for build-system for v4.2

See merge request espressif/esp-idf!13291
2021-05-08 03:36:01 +00:00
61fdb62c54 update CN translation for build-system for v4.2 2021-05-08 11:35:56 +08:00
c4155d4b47 Merge branch 'bugfix/endianness_in_output_or_input_oob_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix endianness error in output or input oob data of number (v4.2)

See merge request espressif/esp-idf!13255
2021-05-07 13:45:15 +00:00
zwj
34e8265821 update con state when getting connection cancle complete 2021-05-07 20:47:34 +08:00
zwj
3ebcb25fb1 fix multi-connection pair failed 2021-05-07 20:46:50 +08:00
7223c8db5b Merge branch 'bugfix/btdm_incorrectly_spelled_v4.2' into 'release/v4.2'
component/bt: fix Spelling mistakes (release v4.2)

See merge request espressif/esp-idf!12816
2021-05-07 08:10:02 +00:00
fc7bf950f3 Merge branch 'bugfix/freertos_addition_overflow_v4.2' into 'release/v4.2'
freertos: Fix addition overflow (v4.2)

See merge request espressif/esp-idf!13423
2021-05-07 07:52:31 +00:00
c37b15fa22 ble_mesh: stack: Fix endianness error in output or input oob data of number
Closes https://github.com/espressif/esp-idf/issues/6862
2021-05-07 03:33:59 +00:00
e3fd4b097b Merge branch 'bugfix/spi_fix_duplex_switch_v4.2' into 'release/v4.2'
spi_master: fix duplex mode switch issue for multi devices (4.2)

See merge request espressif/esp-idf!11233
2021-05-06 07:43:40 +00:00
86141ad01c esp_wifi: Fix setting channel error after WiFi stop 2021-05-06 11:40:57 +08:00
223cf48c26 Merge branch 'bugfix/python3_target_test_4.2' into 'release/v4.2'
ci: run target test with python3

See merge request espressif/esp-idf!12755
2021-05-06 02:19:19 +00:00
6d9d40e888 Merge branch 'bugfix/fix_bootloader_time_too_long_bug_v4.2' into 'release/v4.2'
esp32s2: decrease boot up and cpu start up time (backport v4.2)

See merge request espressif/esp-idf!12729
2021-05-06 02:03:10 +00:00
45c90be913 Merge branch 'update/version_4_2_1' into 'release/v4.2'
Update version to 4.2.1

See merge request espressif/esp-idf!13390
2021-05-05 23:12:32 +00:00
e7dc6eb8da Merge branch 'bugfix/doxygen_input_file_bug_v4.2' into 'release/v4.2'
docs: fix doxygen compile warnings for doxygen 1.9.1 (v4.2)

See merge request espressif/esp-idf!13076
2021-05-05 10:14:19 +00:00
56e7cb0c70 docs: fix doxygen compile warnings for doxygen 1.9.1
Newer versions of doxygen will give warnings for comments in
INPUT lists

Delete all comment lines to fix these warnings, our folder structure
stil gives an OK overview of what we are including
2021-05-05 18:14:19 +08:00
ad095f555b Merge branch 'docs/update_ESP32-S2-Kaluga-Kit_user_guide' into 'release/v4.2'
Update kaluga user guides for v1.3

See merge request espressif/esp-idf!12895
2021-05-05 10:11:36 +00:00
e349f1b484 esp32s2: Decrease boot up time by delete useless slow clock calibration 2021-05-05 06:57:05 +00:00
be8295a918 Merge branch 'bugfix/ttfw_example_test_fails_port_remains_open_v4.2' into 'release/v4.2'
ci: Fix CI issue if one example test fails, and if serial port returns some noise (v4.2)

See merge request espressif/esp-idf!12381
2021-05-04 23:25:45 +00:00
c8912b79a6 freertos: Check for arithmetic overflows on queue creation
Addition overflow check is from FreeRTOS kernel commit 47338393f1f79558f6144213409f09f81d7c4837
2021-05-04 18:35:04 +10:00
5b932aa144 cmake: Improve the error message if the Python interpreter fails to run
RESULT_VARIABLE will return a string not a number in this case, so display it
for the user.
2021-05-04 07:54:20 +00:00
c52417eaba cmake: Set IDFTOOL variable using the correct PYTHON interpreter variable 2021-05-04 07:54:20 +00:00
48d075f87b cmake: Fix passing PYTHON path via CMake variable if using IDF as library
Closes https://github.com/espressif/esp-idf/issues/6285
2021-05-04 07:54:20 +00:00
ec510fdf18 Merge branch 'bugfix/deep_sleep_skip_verify_rtc_mem_heap_v4.2' into 'release/v4.2'
Fix bootloader "skip validate on exiting deep sleep" option if "use RTC memory as heap" is enabled (v4.2)

See merge request espressif/esp-idf!13097
2021-05-03 13:44:06 +00:00
e8f5b76112 Merge branch 'bugfix/fix_mbedtls_send_alert_crash_v4.2' into 'release/v4.2'
mbedtls: fix mbedtls dynamic resource memory leaks and mbedtls_ssl_send_alert_message crash due to ssl->out_iv is NULL[backport v4.2]

See merge request espressif/esp-idf!13301
2021-05-03 13:37:36 +00:00
0f0cfb2cbc Merge branch 'bugfix/esp_http_client_read_v4.2' into 'release/v4.2'
Fix esp_http_client_read for file size aligned to 289 bytes (v4.2)

See merge request espressif/esp-idf!13306
2021-05-03 13:36:51 +00:00
62589fa251 tools: Add various fixes for idf.py gdbgui
Closes https://github.com/espressif/esp-idf/issues/5968
2021-05-03 11:43:36 +02:00
1cffa733a5 ci: Use GitHub Actions to generate recursive source code zips for releases
We do this for all ESP-IDF releases, this step automates it.

Uses action added in https://github.com/espressif/github-actions/pull/10
2021-05-03 04:19:49 +00:00
f16e8cb48e deep sleep: optimize sleep current in wifi softap mode 2021-04-29 10:51:42 +08:00
21ecef5c56 versions: Update version to 4.2.1 2021-04-29 10:13:07 +08:00
532912b025 mbedtls: Fix mbedtls_ssl_send_alert_message crash due to ssl->out_iv is NULL 2021-04-28 09:11:15 +00:00
176d6fa4d0 fix(mbedtls): fix mbedtls dynamic resource memory leaks and RSA cert drop earlier
RX process caches the session information in "ssl->in_ctr" not in "ssl->in_buf".
So when freeing the SSL, can't free the "ssl->in_ctr", because the "ssl->in_buf"
is empty.

Make the RX process like TX process, and cache the session information in
"ssl->in_buf", so that the cache buffer can be freed when freeing the SSL.

Closes https://github.com/espressif/esp-idf/issues/6104
2021-04-28 09:11:15 +00:00
7ad3837244 esp_http_client_read: Add check for esp_http_client_is_complete_data_received before returning ESP_FAIL
Closes: https://github.com/espressif/esp-idf/issues/6772
2021-04-28 05:01:11 +00:00
e7f75e6559 otatool: Fix incorrect using otadata.seq&crc in switch_ota_partition cmd
Closes: https://github.com/espressif/esp-idf/issues/6773
2021-04-27 19:39:50 +08:00
03e6d07b50 remove othercore cache disable 2021-04-27 14:39:49 +08:00
c71b1f6d4d Human-readable error if Git or Python are missing.
When user forgot to add git.exe or python to the PATH, there was a not
very helpful error message.
This improves the error with which tool is misssing and shows a link to
the espressif installer tool.
2021-04-26 14:12:07 +02:00
40b7ea1f95 tools: Warning about tool beiing installed but failed to run.
idf_tool.py runs "<tool> --version" which returns the error message but it is not used
This improves the error printing.
2021-04-26 13:57:45 +02:00
48d3badc0f update kaluga user guides for v1.3 2021-04-26 07:07:54 +00:00
fa270d72c7 ci: using python3 to tun target test 2021-04-26 06:35:42 +00:00
baaf4de703 ci: Fix missing sys.stdout.encoding in python2 runners
Regression in fed98cd6ad
2021-04-23 23:09:58 +00:00
34a84c829c ci: ttfw: Encode serial port data to whatever the console encoding is
This is a bit of a hack, but gives us a way to always log it
2021-04-23 23:09:58 +00:00
340e2dff12 ci: Log failure to close any DUT 2021-04-23 23:09:58 +00:00
c8d15588e5 Merge branch 'bugfix/rtc_fast_memory_force_on_in_use_for_heap_backport_v4.2' into 'release/v4.2'
Bugfix/rtc fast memory force on in use for heap (backport v4.2)

See merge request espressif/esp-idf!12873
2021-04-23 09:06:40 +00:00
deaad551c4 Merge branch 'bugfix/mdns_configure_strict_mode_v4.2' into 'release/v4.2'
mdns: Fix mdns to correctly answer non-strict queries (+ additional fixes) (v4.2)

See merge request espressif/esp-idf!13122
2021-04-22 11:09:58 +00:00
19634e34e9 mdns: Fixed the ip header TTL to be correctly set to 255
Defined in https://tools.ietf.org/html/rfc6762#section-11: All Multicast DNS responses (including responses sent via unicast)
   SHOULD be sent with IP TTL set to 255
2021-04-22 08:32:43 +00:00
4f4640b1df mdns: Fix parsing answers with questions when instance name not set
mdns resolver didn't correctly resolved queries when host name wasn't
assigned. Fixed by allowing processing also if some answer present
(non-strict mode)

Closes https://github.com/espressif/esp-idf/issues/6598
2021-04-22 08:32:43 +00:00
92e511a5b6 mdns: Fix the resolver to correctly parse it's own non-strict answers
The resolver was able to respond correctly, but would also resolve its
own queries and cause issues with BCT 1.5.2, specifically
* MULTIPLE QUESTIONS - DUPLICATE SUPPRESSION
* MULTIPLE QUESTIONS - DISTRIBUTED DUPLICATE SUPPRESSION
tests failed.
2021-04-22 08:32:43 +00:00
7064eb9729 mdns: Add MDNS_STRICT_MODE config option
Strict mode was hardcoded in private header file, but it's useful for
users to enable/disable it depending on the mdns library they are using.
e.g. Avahi might not resolve the non-strict answers.
2021-04-22 08:32:43 +00:00
a7b419b652 Merge branch 'bugfix/e8192_and_assert_param_v4.2' into 'release/v4.2'
Modify E8192 ELx200 ELx40 log level to LOGD

See merge request espressif/esp-idf!13148
2021-04-21 08:48:00 +00:00
6ed64c2a2d Synchronize multiple branch of bt lib(release/v4.1 ~ master) 2021-04-21 04:07:59 +00:00
ac179dcd99 Modify E8192 ELx200 ELx40 log level to LOGD 2021-04-21 04:07:59 +00:00
82801321e8 Merge branch 'bugfix/secure_boot_v2_had_zeros_blk2_after_en' into 'release/v4.2'
secure_boot_v2: Fix case when BLOCK2 is left blank

See merge request espressif/esp-idf!13243
2021-04-21 01:15:40 +00:00
4200af3e26 secure_boot_v2: Fix case when BLOCK2 is left blank
Closes: https://github.com/espressif/esp-idf/issues/6886
2021-04-20 23:23:32 +00:00
46560be284 Merge branch 'bugfix/ci/ci_fetch_submodule_fully_match_return_first_v4.2' into 'release/v4.2'
fix(ci): ci_fetch_submodule return full match name first (v4.2)

See merge request espressif/esp-idf!13211
2021-04-20 23:22:21 +00:00
bbc05c5095 fix(ci): ci_fetch_submodule return full match name first 2021-04-19 20:21:07 +08:00
8de16142a5 bootloader: Fix "skip validate on exit deep sleep" when "Use RTC fast memory as heap" is enabled
RTC region used to store boot partition needs to remain reserved in the app.
2021-04-16 10:50:55 +10:00
e378ecd6cf esp_pm: add an interface to get pm configuration (backport to v4.2) 2021-04-13 17:15:35 +08:00
d20b442af2 rtc: increase CI acceptance range for calc 8M test 2021-04-09 15:06:20 +08:00
e74fbf6608 tools: handle exception in case of logging Unicode characters 2021-04-06 19:16:39 +02:00
726ce37b14 esp-idf: Corrected check of Class of Device for discovered devices
Current code stopped inquiry if major class is not Phone. Modified the
condition to consider for both Phone and Audio to cover majority of real
world devices.

Closes https://github.com/espressif/esp-idf/issues/6548
2021-04-05 15:29:31 +05:30
df079d4ca9 soc/uart: update uart low level functions used in isr with force inline attribute 2021-03-31 17:46:17 +02:00
2ec1b7434e NimBLE: Add error prints for ACL buffer exhaustion in NPL 2021-03-31 10:43:19 +05:30
cf53feff6f Merge branch 'bugfix/touch_sensor_reading_error_in_light_sleep_process_backport_v4.2' into 'release/v4.2'
Bugfix/touch sensor reading error in light sleep process (backport v4.2)

See merge request espressif/esp-idf!12880
2021-03-26 16:01:47 +00:00
2f5eba9263 driver(touch): fix touch sensor false trigger in sleep mode 2021-03-26 10:57:50 +08:00
f4e11dce34 Merge branch 'bugfix/clear_interrupt_in_touch_sensor_initialization_backport_v4.2' into 'release/v4.2'
Bugfix/clear interrupt in touch sensor initialization (backport v4.2)

See merge request espressif/esp-idf!12883
2021-03-25 11:04:44 +00:00
a866f0d8f6 fix: clear interrupt in touch sensor initialization 2021-03-25 11:14:24 +08:00
dd56e9523b Merge branch 'bugfix/fix_driver_dac_ci_fail_backport_v4.2' into 'release/v4.2'
bugfix(dac): fix testcase fail for dac (backport v4.2)

See merge request espressif/esp-idf!12882
2021-03-25 01:21:54 +00:00
e66ac8b2e5 Merge branch 'bugfix/freemodbus_fix_mbm_event_processing_v42' into 'release/v4.2'
Bugfix/freemodbus fix mbm event processing (backport v4.2)

See merge request espressif/esp-idf!12823
2021-03-25 01:18:45 +00:00
a607e0651c Merge branch 'bugfix/uart_read_o2_v4.2' into 'release/v4.2'
hal: workaround for UART FIFO read on ESP32 with -O2 optimization (backport v4.2)

See merge request espressif/esp-idf!12658
2021-03-25 01:17:14 +00:00
b06b8273ee Merge branch 'bugfix/fix_rtc_wdt_in_light_sleep_process_backport_v4.2' into 'release/v4.2'
bugfix: rtc: compile the regi2c_ctrl.c code to iram (backport v4.2)

See merge request espressif/esp-idf!12881
2021-03-24 16:06:50 +00:00
7dbd5e1855 Merge branch 'bugfix/fix_uart_module_enable_issue_v4.2' into 'release/v4.2'
driver(uart): fix uart module reset issue (release V4.2)

See merge request espressif/esp-idf!11969
2021-03-24 11:05:00 +00:00
dbaee379ba Merge branch 'bugfix/fix_coex_reset_last_wait_lose_iram_attr_4_2' into 'release/v4.2'
bugfix/btdm:Fix IRAM_ATTR missing. Backports v4.2

See merge request espressif/esp-idf!12073
2021-03-24 10:27:24 +00:00
4fb18da50b bugfix(dac): fix testcase fail for dac 2021-03-24 15:50:31 +08:00
60b604ae6d rtc: compile the regi2c_ctrl.c code to iram 2021-03-24 15:43:47 +08:00
f2f42c4bfc Merge branch 'bugfix/fix_some_wifi_bugs_0323_v4.2' into 'release/v4.2'
esp_wifi: Fix some WiFi bugs (backport v4.2)

See merge request espressif/esp-idf!12859
2021-03-24 07:39:29 +00:00
74649219f4 Merge branch 'bugfix/adc_full_scale_voltages_v4.2' into 'release/v4.2'
docs: Update full-scale voltages for ESP32-S2 chip (v4.2)

See merge request espressif/esp-idf!12208
2021-03-24 04:14:44 +00:00
1c6ab10a70 hal: workaround for UART FIFO read on ESP32 with -O2 optimization 2021-03-24 04:12:42 +00:00
c8ef66abad driver(uart): fix uart module reset issue (release V4.2) 2021-03-24 04:10:39 +00:00
c04489cede Merge branch 'bugfix/dport_init_min_stack_size_v4.2' into 'release/v4.2'
freertos: Increase minimum task stack size when stack smashing checker is enabled (v4.2)

See merge request espressif/esp-idf!12799
2021-03-24 04:06:45 +00:00
9cb875949c fix: RTC_FAST_MEM always power on if used for heap 2021-03-24 11:52:55 +08:00
8507f1f777 esp_wifi: Fix some WiFi bugs
1. Unlock mutex for esp_wifi_80211_tx when out of memory.
2. Fix issue that esp_wifi_80211_tx can't be used in ap mode.
3. Clear hotspot bss when auth timeout happens.
4. Fix PMK not saved in NVS for SoftAP for PSK mode.
5. Fix the bug for esptouch find hidden AP fail.
6. Fix not connect to open AP when WPA3 auth fail.
7. Fix issue with hidden AP scans after connecting AP.
8. Fix the watchdog issue when receiving action frame.
9. Fix the issue that the parameters obtained form RAM cannot be saved to NVS.
10.Modify not to store the default value in NVS.
11.Delete interface STATIONAP_IF.
12.Modify the _do_wifi_start and _do_wifi_stop parameters to mode.
13.Fixed issue of reason code change from 15 to 204 when provide wrong password.
14.Fix set config return value error.
15.Fix ampdu age timer memory leak.
2021-03-24 03:40:01 +00:00
bb067c0883 Merge branch 'bugfix/btdm_assert_without_sw_coex_enable_v4.2' into 'release/v4.2'
components/bt: Fix assert without sw coexist enabled

See merge request espressif/esp-idf!12527
2021-03-24 03:23:58 +00:00
0c1ff94823 Merge branch 'bugfix/wpa_supplicant_coverity_issue_fixes_v4.2' into 'release/v4.2'
Bugfix/wpa supplicant coverity issue fixes v4.2

See merge request espressif/esp-idf!12849
2021-03-23 16:04:03 +00:00
def9153200 Merge branch 'mesh/ps_duty_signaling_backport_v4.2' into 'release/v4.2'
mesh/ps: network duty signaling (backport v4.2)

See merge request espressif/esp-idf!12810
2021-03-23 16:02:56 +00:00
bfa07bb9d8 component/bt: Modify some ambiguous descriptions (release v4.2) 2021-03-23 23:10:51 +08:00
f8307bcd4e Merge branch 'bugfix/spp_data_send_delay_v4.2' into 'release/v4.2'
Bugfix/spp data send delay v4.2

See merge request espressif/esp-idf!11772
2021-03-23 08:42:05 +00:00
1d227bbb2e Merge branch 'bugfix/crash_on_enabling_verbose_logs_v4.2' into 'release/v4.2'
Fixes issue of crashing when verbose logs are enabled.(v4.2)

See merge request espressif/esp-idf!12845
2021-03-23 08:41:41 +00:00
d7ea6266b7 Fix coex IRAM missing and Fix C2H flow control issue 2021-03-23 15:47:50 +08:00
ad5ef10343 mesh/ps: network duty signaling 2021-03-23 14:57:17 +08:00
20256c5dfd Merge branch 'bugfix/btdm_controller_task_watchdog_in_wifi_test_v4.2' into 'release/v4.2'
Fix controller task watchdog in Wi-Fi test

See merge request espressif/esp-idf!12708
2021-03-23 06:54:00 +00:00
c083d7278d esp_http_client: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:11:20 +05:30
d417ba0c11 esp_local_ctrl: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:10:58 +05:30
d734c533a5 wifi_provisioning: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:10:36 +05:30
c9f2790474 wpa_supplicant: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:09:52 +05:30
98d19efe6f tcp_transport: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:09:21 +05:30
4407c9eb83 fatfs: Fix some memory leak issues by coverity static analyzer. 2021-03-23 11:08:12 +05:30
f8c691faaf esp_wifi: Fixes issue of crashing when verbose logs are enabled. 2021-03-23 10:30:32 +05:30
5151fb52ec Merge branch 'bugfix/test_sha_psram' into 'release/v4.2'
CI: disable performance check for PSRAM config

See merge request espressif/esp-idf!12829
2021-03-23 03:53:59 +00:00
399ab25967 Merge branch 'bugfix/fix_wifi_interface_use_v4.2' into 'release/v4.2'
esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA (backport v4.2)

See merge request espressif/esp-idf!12166
2021-03-22 14:34:24 +00:00
f90b14175c esp_wifi: Modify ESP_IF_WIFI_AP to WIFI_IF_AP 2021-03-22 09:09:58 +00:00
1ef10dc284 esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA 2021-03-22 09:09:58 +00:00
59d3116e41 Merge branch 'bufix/ag_deep_copy_crash_v_4_2' into 'release/v4.2'
components/bt: Fix crash in btc_hf_arg_deep_copy when name or number is NULL

See merge request espressif/esp-idf!12789
2021-03-22 08:01:23 +00:00
b58d888b77 Merge branch 'bugfix/ping_zero_interval_cause_to_assert_reset_v4.2' into 'release/v4.2'
lw-ip: Fixed ping assert reset when ping interval is 0 (v4.2)

See merge request espressif/esp-idf!12174
2021-03-22 07:59:16 +00:00
e4c021757c Merge branch 'ci/ignore_check_link_result_v4.2' into 'release/v4.2'
CI: ignore result from check_doc_links (v4.2)

See merge request espressif/esp-idf!12783
2021-03-22 03:40:17 +00:00
fa62dfd5f9 CI: disable performance check for PSRAM config
The cache compensated timer performance check ocasionally
wrong result for psram_2 config. Disabled CI test for now.
2021-03-22 11:39:49 +08:00
fd032425f1 Merge branch 'mesh/support_for_chain_topology_backport_v4.2' into 'release/v4.2'
mesh: support for chain topology (backport v4.2)

See merge request espressif/esp-idf!12806
2021-03-22 03:27:49 +00:00
c8f8def780 lwip: Fixed ping assert reset when ping interval is 0 2021-03-22 03:26:42 +00:00
d340fa68aa freemodbus: fix event processing after merge 2021-03-19 15:05:27 +01:00
c9cf7bcb0e Merge branch 'bugfix/fix_some_wifi_bugs_0105_v4.2' into 'release/v4.2'
Bugfix/fix some wifi bugs 0105 v4.2 (backport v4.2)

See merge request espressif/esp-idf!11921
2021-03-19 12:09:01 +00:00
98e703340b Merge branch 'feature/update_wifi_provisioning_readme_v4.2' into 'release/v4.2'
provisioning: Update README.md to explain QR code format [backport v4.2]

See merge request espressif/esp-idf!12803
2021-03-19 10:33:56 +00:00
9ca4799b20 provisioning: update README.md 2021-03-19 06:08:12 +00:00
66c533b3d5 provisioning: Update README.md to explain QR code format
Add examples of how to create a QR code that will be recognised by the iOS or Android app

Signed-off-by: yuanjm <yuanjianmin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6629
2021-03-19 06:08:12 +00:00
9bd9e939ba freertos: Add a small additional stack when optimization set to None
Fix for occasional crash on startup when DPORT task overwrites its stack during
context switch, otherwise.
2021-03-19 12:21:14 +08:00
7fc2f91841 freertos: Increase minimum task stack size when stack smashing checker is enabled
Fixes issue with DPORT init task, this task uses minimum stack size and may not be
enough if stack smashing detection is set to Overall mode.

Also reworks the way we calculate minimum stack to allow for adding multiple
contributing factors.

Closes https://github.com/espressif/esp-idf/issues/6403
2021-03-19 12:19:58 +08:00
eedcb8c97f Merge branch 'bugfix/fix_iperf_example_exception_handling_for_no_ap_found_v4.2' into 'release/v4.2'
bugfix/fix_iperf_example_exception_handling_for_no_ap_found_v4.2

See merge request espressif/esp-idf!12268
2021-03-19 04:04:00 +00:00
e305c09b12 Merge branch 'bugfix/pm_dump_format_v4.2' into 'release/v4.2'
esp_pm: fix formatting issues in esp_pm_dump_locks (backport v4.2)

See merge request espressif/esp-idf!12022
2021-03-19 04:01:46 +00:00
0d5286471a Merge branch 'component_bt/optimize_spp_stop_server_v4.2' into 'release/v4.2'
component_bt/Optimize SPP Stop Server API[backport v4.2]

See merge request espressif/esp-idf!12620
2021-03-19 04:01:17 +00:00
42fc36ef17 mesh: support for chain topology 2021-03-19 11:37:20 +08:00
50bc7db63a esp_wifi: Update WiFi lib
1. Change wifi scan duration from 120ms to 100ms
2. Using deport reg instead of ahb
3. Revert to report specific reason code when receiving deauth during 4-way-handshark
4. Fix the bug that tx ampdu parameter is not from peer device
5. Faster WiFi station connect improvement, avoid 100ms passive scan
6. Add FCS failed packets filter
7. Fix country code last byte to space instead of NULL
8. Fix softap cannot forward A-MSDU
9. Fix max tx power to 20dBm
10. Fix the issue that the esp_wifi_sta_get_ap_info can't get country
11. Update esp32 phy lib to v4660
12. Update esp32s2 phy lib to v1300
13. Fix the bug that esp32s2 can't get CSI info
2021-03-19 03:02:26 +00:00
07ca98b5f0 esp_wifi: ESP32 phy add [sections:phy_iram] 2021-03-19 03:02:26 +00:00
4650db0841 esp_wifi: optimize phy version log 2021-03-19 03:02:26 +00:00
349b0b5ec5 bugfix: fix some wifi bugs
1. fix max tx power to 20dBm
2. fix the issue that the esp_wifi_sta_get_ap_info can't get country

Closes https://github.com/espressif/esp-idf/issues/6267
2021-03-19 03:02:26 +00:00
f6f644bf81 components/bt: Fix crash in btc_hf_arg_deep_copy when name or number is NULL 2021-03-18 20:20:19 +08:00
8b0ac7f81e Merge branch 'bugfix/extern_c_decl_4.2' into 'release/v4.2'
[cxx]: fixed extern "C" declarations (backport v4.2)

See merge request espressif/esp-idf!12742
2021-03-18 07:29:20 +00:00
7aeaf604c2 CI: ignore result from check_doc_links
check_doc_links will always fail due to:
 * No rate limitation for requests
 * Not being able to handle github links with anchors
2021-03-18 13:17:46 +08:00
747ecb27d0 Merge branch 'bugfix/idf_size_total_size_without_bss_v4.2' into 'release/v4.2'
tools: Don't count BSS into the total image size (v4.2)

See merge request espressif/esp-idf!12576
2021-03-18 04:32:42 +00:00
359784f0b6 Merge branch 'bugfix/fix_arp_buffer_error_in_smart_config_v4.2' into 'release/v4.2'
bugfix/fix_arp_buffer_error_in_smart_config_v4.2

See merge request espressif/esp-idf!12254
2021-03-18 04:17:36 +00:00
1e1fc92fc2 Merge branch 'bugfix/fatfs_v4.2' into 'release/v4.2'
spi_flash: fix the issue of ext_flash_fatfs_example(backport v4.2)

See merge request espressif/esp-idf!12667
2021-03-18 04:15:35 +00:00
8a26bc72be Merge branch 'bugfix/ip_mesh_transmit_wrap_v4.2' into 'release/v4.2'
esp_mesh: Fix internal ip mesh example to use transmit wrap function (v4.2)

See merge request espressif/esp-idf!12530
2021-03-18 04:14:33 +00:00
caa7dc187d Merge branch 'bugfix/fix_i2s_pdm_config_4.2' into 'release/v4.2'
fix PDM Fp and Fs config error (4.2)

See merge request espressif/esp-idf!10687
2021-03-18 04:13:36 +00:00
2e03275406 Merge branch 'bugfix/freemodbus_fix_event_processing_after_destroy_v4.2' into 'release/v4.2'
freemodbus: fix event processing failure after destroy (backport v4.2)

See merge request espressif/esp-idf!9327
2021-03-18 04:12:03 +00:00
b517b64a30 Merge branch 'bugfix/fix_deepsleep_x32k_wakeup_bug_v4.2' into 'release/v4.2'
Fix esp_hw_support bug (backport v4.2)

See merge request espressif/esp-idf!11835
2021-03-18 04:11:18 +00:00
c4c500e241 Merge branch 'bugfix/deep_sleep_stub_heap_rtc_fast_mem_v4.2' into 'release/v4.2'
deep sleep: Calculate RTC CRC without using any stack or other RTC heap memory (v4.2)

See merge request espressif/esp-idf!10883
2021-03-18 04:09:50 +00:00
aafcc2ca60 Merge branch 'bugfix/flash_encryption_v4.2' into 'release/v4.2'
ota: fix ota with flash encryption(backport v4.2)

See merge request espressif/esp-idf!12701
2021-03-18 04:09:45 +00:00
e027f962df Merge branch 'bugfix/bta_hf_client_sco_co_out_data_v4.2' into 'release/v4.2'
bugfix/if bta_hf_client_sco_co_out_data is called, it will crash when sco disconnected [backport v4.2]

See merge request espressif/esp-idf!12560
2021-03-18 04:04:17 +00:00
4f4cd08aad Merge branch 'bugfix/avrc_set_player_value_cmd_event_unhandle_v_4_2' into 'release/v4.2'
bugfix/fix unhandle RC vendor PDU when tg receive set_player_app_value cmd[backport v4.2]

See merge request espressif/esp-idf!12099
2021-03-18 04:03:49 +00:00
9f3750cee7 Merge branch 'bugfix/btdm_backport_ble_bugs_21_01_29_v4.2' into 'release/v4.2'
Bugfix/btdm backport ble bugs  for v4.2

See merge request espressif/esp-idf!12197
2021-03-18 03:55:04 +00:00
f4c56216e5 Merge branch 'doc/embed_example_v4.2' into 'release/v4.2'
doc: Update the link to an example that embeds a file (v4.2)

See merge request espressif/esp-idf!12656
2021-03-16 08:31:47 +00:00
be3fc35533 [cxx]: fixed extern "C" declarations
* Moving #includes above
  #ifdef __cplusplus extern "C" { #endif
  So that we can compile with CPP.

Signed-off-by: Jakob Hasse <jakob.hasse@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6634
2021-03-15 18:42:19 +08:00
068dfcf1ba ota: fix ota with flash encryption 2021-03-12 16:45:43 +08:00
ce2c615bb3 Merge branch 'bugfix/deepsleep_disable_brownout_s2_v4.2' into 'release/v4.2'
deep_sleep: on S2 disable the brown out detector before deep sleeping (v4.2)

See merge request espressif/esp-idf!12500
2021-03-11 10:49:30 +00:00
6c2489682f Fix controller task watchdog in Wi-Fi test 2021-03-11 17:19:16 +08:00
f80f4cbf2d ci: move freerom/sdmmc repo to psram3 for saving ram 2021-03-11 13:54:15 +08:00
54b817a59e flash_encryption: Quick fixed the issue that block when flash_encryption_write, Related https://github.com/espressif/esp-idf/issues/6322, Related https://github.com/espressif/esp-idf/issues/6254 2021-03-11 13:52:28 +08:00
fa2c4fe622 Merge branch 'bugfix/fix_a2dp_underrun_issue_4_2' into 'release/v4.2'
Fix A2DP Underrun Issue [backport v4.2]

See merge request espressif/esp-idf!12277
2021-03-10 14:30:28 +00:00
00e2f2e880 Merge branch 'feat/spi_flash_override_size_v4.2' into 'release/v4.2'
spi_flash: add config option to override flash size in bootloader header (v4.2)

See merge request espressif/esp-idf!12452
2021-03-10 10:13:39 +00:00
e5830907ca spi_flash: fix flash issue of ext_flash_fatfs_example 2021-03-09 18:33:30 +08:00
32b0264529 Merge branch 'doc/flash_enc_update_v4.2' into 'release/v4.2'
docs: update flash encryption docs for S2

See merge request espressif/esp-idf!12324
2021-03-09 06:41:53 +00:00
5b6e62d2c4 update CN translation based on reviewers' comments 2021-03-09 10:34:29 +11:00
fdfef114ae api-guides: update CN translation for build-system and build-system-legacy,and fix line break in the EN version 2021-03-09 10:33:44 +11:00
c8900823d8 doc: Update the link to an example that embeds a file
Since we have the CA Certificate Store feature, https_request no longer needs to
embed any certs.
2021-03-09 10:33:44 +11:00
37a8c8ce6c Merge branch 'bugfix/btdm_crash_when_esp_restart_v4.2' into 'release/v4.2'
components/bt: Fix crash in Bluetooth when esp_restart

See merge request espressif/esp-idf!12567
2021-03-05 12:27:43 +00:00
2289d4fcc0 Merge branch 'bugfix/fix_csa_channel_crash_v4.2' into 'release/v4.2'
esp_wifi: fix CSA and BAR crash issue(v4.2)

See merge request espressif/esp-idf!12549
2021-03-05 12:24:33 +00:00
e1f1d11b76 Merge branch 'feature/add_init_and_deinit_evt_for_a2dp_4_2' into 'release/v4.2'
feature/ Add A2DP Init and Deinit Complete Evt [backport v4.2]

See merge request espressif/esp-idf!12150
2021-03-05 12:19:18 +00:00
24157cc60a Merge branch 'fix/esp_tls_prevent_freeing_global_CA_store_after_each_request_v4.2' into 'release/v4.2'
fix(esp_tls): prevent freeing global CA store after each request (v4.2)

See merge request espressif/esp-idf!12631
2021-03-05 08:52:38 +00:00
a2ccb3c0ac protocomm: Fixed NULL check of allocated memory
Fixes one part of - https://github.com/espressif/esp-idf/issues/6440
2021-03-05 10:06:18 +05:30
a2e6db19e6 esp_tls: Fix misplaced paranthesis in esp_tls_mbedtls.c
Fixes one part of -  https://github.com/espressif/esp-idf/issues/6440
2021-03-05 10:06:10 +05:30
d66ad18853 Fix esp_tls: Prevent freeing of global ca store after each connection
when dynamic ssl buffers are enabled
2021-03-05 09:55:10 +05:30
e7435a75f5 Merge branch 'bugfix/phy_xpd_v4.2' into 'release/v4.2'
wifi: add set_xpd_sar override(backport v4.2)

See merge request espressif/esp-idf!11540
2021-03-04 08:41:17 +00:00
10d40bd526 Merge branch 'bugfix/correct_logging_timestamp_format_v4.2' into 'release/v4.2'
log: correct timestamp formatting to unsigned integer type (v4.2)

See merge request espressif/esp-idf!12611
2021-03-04 07:39:33 +00:00
60b6968e80 add API esp_spp_stop_srv_scn to stop a specific server 2021-03-04 15:33:47 +08:00
a177897f4d log: correct timestamp formatting to unsigned integer type
Closes https://github.com/espressif/esp-idf/issues/6226

Closes IDFGH-4393
2021-03-04 11:54:30 +05:30
1f3b6b2e6d esp_wifi: fix CSA and BAR crash issue. 2021-03-02 11:51:01 +08:00
2c85d01603 tools: Don't count BSS into the total image size 2021-03-01 14:39:42 +01:00
33236c9593 doc: update S2 flash encryption & secure boot docs 2021-03-01 17:48:17 +08:00
70de8f5158 components/bt: Fix crash in Bluetooth when esp_restart 2021-03-01 14:43:45 +08:00
77a78a22f6 Merge branch 'bugfix/esp_wifi_deinit_v4.2' into 'release/v4.2'
esp_wifi_deinit: Return ESP_ERR_WIFI_NOT_STOPPED if wifi is not stopped (v4.2)

See merge request espressif/esp-idf!12540
2021-03-01 05:32:08 +00:00
8375bb94a4 bugfix/if bta_hf_client_sco_co_out_data is called, it will crash when sco disconnected 2021-03-01 11:34:15 +08:00
9689f87887 esp_wifi_deinit: Return ESP_ERR_WIFI_NOT_STOPPED if wifi is not stopped
Add test case to test this workflow
2021-02-26 14:53:59 +05:30
66c89f1093 examples, esp_mesh: Fix internal ip mesh example to use transmit wrap function
Fixed regression caused by recent refactoring of WiFi Tx. If  wasn't defined all transmits end up in a crash.

Closes https://github.com/espressif/esp-idf/issues/6067
2021-02-26 07:50:00 +01:00
76b0097103 components/bt: Fix assert without sw coexist enabled 2021-02-26 14:29:34 +08:00
da809e92b7 docs: update S2 flash encryption docs 2021-02-26 01:42:04 +08:00
cf87e114cb deep_sleep: on S2 disable the brown out detector before deep sleeping
On S2 the brown out detector would occasionally trigger erroneously during deep sleep.

Disable it before sleeping to circumvent this issue.

Closes https://github.com/espressif/esp-idf/issues/6179
2021-02-25 14:58:50 +08:00
af8bc4c436 Merge branch 'bugfix/SECURE_DISABLE_ROM_DL_MODE_does_not_work_v4.2' into 'release/v4.2'
bootloader: SECURE_ENABLE_SECURE_ROM_DL_MODE cannot be y when SECURE_DISABLE_ROM_DL_MODE=y (v4.2)

See merge request espressif/esp-idf!12341
2021-02-24 09:40:44 +00:00
bfb14130ac bugfix:unhandle event when tg receive set_player_app_value cmd 2021-02-24 07:47:08 +00:00
807e864d7d Merge branch 'revert-983220e2_v4.2' into 'release/v4.2'
ci: enable RS485 related tests again (v4.2)

See merge request espressif/esp-idf!12463
2021-02-24 06:45:58 +00:00
d960752cd9 Merge branch 'docs/remove_rtd_pdf_link_v4.2' into 'release/v4.2'
docs: remove rtd pdf link (v4.2)

See merge request espressif/esp-idf!12466
2021-02-23 10:45:37 +00:00
c0ae1f03a4 docs: remove RTD download PDF links
PDF download is available from the version selector menu.
Read the docs links are out of date.
2021-02-23 11:39:33 +08:00
c4fe55d42a Revert "ci: temporarily disable RS485 related tests"
This reverts commit 983220e216
2021-02-23 11:00:37 +08:00
15f406ddb7 spi_flash: add config option to override flash size in bootloader header
Sometimes the flash size read from bootloader is not correct. This may
forbid SPI Flash driver from reading the the area larger than the size
in bootloader header.

When the new config option is enabled, the latest configured
ESPTOOLPY_FLAHSIZE in the app header will be used to override the value
read from bootloader header.
2021-02-22 23:18:17 +08:00
e511dd58b3 Merge branch 'bugfix/freemodbus_fix_parity_propagation_issue_v42' into 'release/v4.2'
Bugfix/freemodbus fix parity propagation issue (Backport v4.2)

See merge request espressif/esp-idf!12389
2021-02-22 05:23:02 +00:00
af1ebd7e01 Merge branch 'bugfix/eclipse_make_decode_v4.2' into 'release/v4.2'
tools: Fix Eclipse build: “UnicodeDecodeError: 'ascii' codec can't decode byte” (v4.2)

See merge request espressif/esp-idf!12358
2021-02-19 15:55:37 +00:00
9ebdeea54e Merge branch 'feature/prefer_python3_in_installer_v4.2' into 'release/v4.2'
tools: Prefer python3 during install and export (v4.2)

See merge request espressif/esp-idf!12377
2021-02-19 15:52:45 +00:00
cbe966135e Merge branch 'bugfix/fix_enable_reset_provision_cause_device_crash_v4.2' into 'release/v4.2'
provisioning: Fix enable CONFIG_EXAMPLE_RESET_PROVISIONED will cause device crash [backport v4.2]

See merge request espressif/esp-idf!12352
2021-02-19 12:57:27 +00:00
9240750bf4 provisioning: Fix enable CONFIG_EXAMPLE_RESET_PROVISIONED will cause device crash 2021-02-19 11:31:51 +00:00
cd9237f871 Merge branch 'bugfix/ignore_null_valued_comb_key_4_2' into 'release/v4.2'
Bugfix/ignore null valued comb key 4 2

See merge request espressif/esp-idf!12346
2021-02-18 13:58:25 +00:00
zwj
1b1c917321 add connection parameter check 2021-02-18 09:39:01 +00:00
zwj
171e2c5b1e fix ble connection maximum latency is 499 2021-02-18 09:39:01 +00:00
zwj
6d8a3f0d94 disable bluedroid congest error log print 2021-02-18 09:39:01 +00:00
c759dade01 fix read multi char failed(GATT_27001) 2021-02-18 09:39:01 +00:00
2e949ca9ac fix add white list failed 2021-02-18 09:39:01 +00:00
zwj
5d514fdb35 fix bluedroid repair faild if the two most significant bits of public address is '01' 2021-02-18 09:39:01 +00:00
zwj
d5951d3c9e - fix congest return value
- fix system no rsp when doing disconnect
- fix no congest event when ssc do writing performance
2021-02-18 09:39:01 +00:00
zwj
70589fc49d fix ble read multi char err when the number of handles is more than 10 2021-02-18 09:39:01 +00:00
zwj
66b1f37c8b fix scan rsp length err 2021-02-18 09:39:01 +00:00
zwj
c5afe0ea2d fix vendor hci memory leak 2021-02-18 09:39:01 +00:00
8455518127 component/bt: Added check for NULL valued combination key. 2021-02-18 06:12:17 +00:00
24291f7a3b Bluedroid: Do not initiate/accept connection with device having same BDADDR.
Added BD_ADDR comparison in l2cu_lcp_allocate and removed check from
security connection request handler as it's handled in l2cu_lcp_allocate
for both connection request and create connection.
2021-02-18 06:12:17 +00:00
359509ccdc bt: removed esp_bt_get_mac()
There was no need for this function as there is already a way present to
fetch own mac address. Own mac addr can be fetched by calling
controller_get_interface().
2021-02-18 06:12:17 +00:00
ceb11fd543 Merge branch 'bugfix/cmake_example_sdkconfig_path_v4.2' into 'release/v4.2'
cmake/example: Move idf_as_lib sdkconfig path to project, document configuring project (v4.2)

See merge request espressif/esp-idf!10859
2021-02-17 22:45:21 +00:00
be68c0e8d8 freemodbus: fix mb controller parity propagation issues
Closes https://github.com/espressif/esp-idf/issues/6377
2021-02-17 12:40:34 +01:00
2c66dfc089 tools: Prefer python3 during install and export
Install and export script should work on systems without "python"
executable.

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

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

Related to https://github.com/espressif/esp-idf/issues/6421 and
https://github.com/espressif/arduino-esp32/issues/4717
2021-02-14 19:05:33 +01:00
391b2ebcf0 Merge branch 'bugfix/softap_prov_cookies_v4.2' into 'release/v4.2'
protocomm_httpd: Use HTTP cookies to track session (v4.2)

See merge request espressif/esp-idf!12265
2021-02-11 10:42:42 +08:00
3b5b61f402 Fix eclipse build: “UnicodeDecodeError: 'ascii' codec can't decode byte”
Closes https://github.com/espressif/esp-idf/pull/6505
2021-02-10 12:49:56 +01:00
d228fc826c protocomm security1: Restart security session if SESSION_STATE_CMD0 is received
With the introduction of cookies to track a session, it is possible that the
clients restart the provisioning on the same session, specifically when a user
cancels a current provisioning attempt. This can result in an error as the state
on the device side and client side will go out of sync.

This has now been changed such that if SESSION_STATE_CMD0 is received on
an existing session, the state is reset and flow allowed to continue.
2021-02-10 15:47:29 +05:30
328254c631 protocomm_httpd: Use HTTP cookies to track session
Earlier, a "socket connection" was being considered as a protocomm "session".
However, for HTTP, we cannot expect clients to necessarily use the same
socket for all requests of a given transaction. This was indeed causing
some failures for Wi-Fi provisioning from Android phones.

So, we have introduced http cookies to track a session even if the socket
connection does not stay intact throughout the transaction.
This change is backward compatible. If the client does not use cookies, the
socket connection will be considered as the session.

Closes: https://github.com/espressif/esp-idf/issues/6316
Reference: https://github.com/espressif/esp-idf/pull/6330
2021-02-10 15:47:28 +05:30
2dd5a87cf1 Merge branch 'bugfix/websocket_example_error_handling_v4.2' into 'release/v4.2'
ci: Fix websocket example test error handling

See merge request espressif/esp-idf!11657
2021-02-10 15:51:32 +08:00
4abc541d6f bootloader: SECURE_ENABLE_SECURE_ROM_DL_MODE cannot be y when SECURE_DISABLE_ROM_DL_MODE=y
Closes: https://github.com/espressif/esp-idf/pull/6442
2021-02-09 16:34:30 +08:00
1df0c17b98 Merge branch 'bugfix/ble_mesh_server_model_deinit_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix deinit server models with no matching id (v4.2)

See merge request espressif/esp-idf!12314
2021-02-09 16:25:39 +08:00
660f41772c ci: Fix websocket example test error handling
If connection fails for websocket test, a second exception was generated in
__exit__
2021-02-09 06:59:56 +00:00
ea476f1731 Merge branch 'bugfix/SECURE_ENABLE_SECURE_ROM_DL_MODE_v4.2' into 'release/v4.2'
bootloader: Fix warnings caused by security features (v4.2)

See merge request espressif/esp-idf!12286
2021-02-09 11:06:50 +08:00
6514009b8a soc esp32: Removes parentheses from RTC_MEM_xyz macros that expand directly to single numbers
Not necessary in these cases, and prevents parens from expanding into the
assembly code added in the parent commit - a pattern which is accepted
by GCC assembler but illegal syntax for LLVM assembler.
2021-02-08 09:59:22 +11:00
7c5afa262d deep sleep: Calculate RTC CRC immediately before deep sleep, without using RAM
Fix for issues where RTC FAST memory is updated as part of going into deep
sleep. Very high risk if heaps are in RTC memory - in particular task stacks
may be in RTC memory, but also other variables.

Also fixes potential concurrency problems as RTC FAST memory is not accessible
by CPU during the CRC calculation itself.

Method:
- Disable interrupts (currently for single core only, will need update for S3)
- Load all registers before calculating CRC or going to sleep
2021-02-08 09:59:22 +11:00
bf9b9c5a97 esp_system: Add test case for using deep sleep wake stub when stack is in RTC memory
This test currently fails on ESP32 & ESP32-S2, fix will be in next commit.
2021-02-08 09:59:22 +11:00
lly
4070a6dc70 ble_mesh: stack: Fix deinit server models with no matching id 2021-02-07 11:18:31 +08:00
0ab739f72c Merge branch 'bugfix/ble_mesh_wifi_coexit_example_v4.2' into 'release/v4.2'
bugfix: Delete local variables to avoid null global variables (backport v4.2)

See merge request espressif/esp-idf!11372
2021-02-05 20:21:58 +08:00
3f46cb9789 Merge branch 'bugfix/ble_mesh_mbedtls_aes_fix_v4.2' into 'release/v4.2'
Bugfix/ble mesh mbedtls aes fix (v4.2)

See merge request espressif/esp-idf!12270
2021-02-05 14:46:00 +08:00
lly
c74c7fdb5a ble_mesh: stack: Fix mbedtls aes ctx not deallocated 2021-02-05 03:26:26 +00:00
lly
02d3d358b5 ble_mesh: stack: Fix mbedtls aes ctx not initialized 2021-02-05 03:26:26 +00:00
74e1613b17 Merge branch 'bugfix/nvs_close_nukes_all_handles_v4.2' into 'release/v4.2'
NVS: fixed deinit other partition's handles (v4.2)

See merge request espressif/esp-idf!11497
2021-02-05 10:06:37 +08:00
89cab3140d Merge branch 'bugfix/idf_monitor_baudrate_arg_crash_v4.2' into 'release/v4.2'
idf monitor: fix crash when monitor baudrate argument set (Backport v4.2)

See merge request espressif/esp-idf!9758
2021-02-05 10:06:07 +08:00
040f5c8e0a Merge branch 'bugfix/reenable_encrypted_partition_write_v4.2' into 'release/v4.2'
Re-enable encrypted flash read/writes even if flash encryption is disabled (v4.2)

See merge request espressif/esp-idf!12190
2021-02-05 01:05:04 +08:00
aa3efa6cf1 Merge branch 'bugfix/protocomm_http_print_v4.2' into 'release/v4.2'
protocomm_httpd: Change an info print to debug print as it isn't really required in the logs (v4.2)

See merge request espressif/esp-idf!12261
2021-02-04 23:09:28 +08:00
a8df2af065 bootloader: Fix warnings caused by security features
Closes: https://github.com/espressif/esp-idf/issues/6198
2021-02-04 22:24:25 +08:00
d254804a62 Fix A2DP Underrun Issue 2021-02-04 19:33:14 +08:00
7da388e52a add exception handling for iperf example's scan when no ap was found 2021-02-04 17:37:43 +08:00
5c6b9d0625 protocomm_httpd: Change an info print to debug print as it isn't really required in the logs 2021-02-04 15:02:52 +05:30
024aaeb201 fix smartconfig issue when router reply arp late 2021-02-04 11:23:06 +08:00
79aa9636b9 unit-test-app: disable encrypted flash read/write in psram config to fix build failure 2021-02-03 09:07:36 +00:00
19b7705b8d spi_flash: add config option to enable encrypted partition read/write
This feature can be disabled to save some IRAM (approx 1KB) for cases
where flash encryption feature is not required.
2021-02-03 09:07:36 +00:00
294fe8238c Revert "esp_partition: disable encrypted reads/writes if flash encryption is disabled"
This reverts commit bf35ef1ce7.

It has been noticed that there are scenarios where even though firmware is not enabled
with flash encryption config feature, it should be able to write to encrypted partitions.

This revert adds the feature back which was removed around v4.0 timelines, and same
change will be backported to all releases (upto v4.0) for consistency.
2021-02-03 09:07:36 +00:00
0382c2e04e Merge branch 'bugfix/mcpwm_can_set_two_falut_signal_v4.2' into 'release/v4.2'
mcpwm: fix second fault line broken issue (v4.2)

See merge request espressif/esp-idf!12171
2021-02-03 14:49:16 +08:00
81680a633f Merge branch 'bugfix/ttfw_idf_find_artifacts_inaccurate_with_same_prefix_path_v4.2' into 'release/v4.2'
CI: fix the bug returns wrong artifact path when app_name is a subset of a longer one (v4.2)

See merge request espressif/esp-idf!12228
2021-02-03 11:34:34 +08:00
6fd3557d99 Merge branch 'feature/support_transport_keepalive_v4.2' into 'release/v4.2'
Feature/support transport keepalive v4.2 [backport v4.2]

See merge request espressif/esp-idf!12157
2021-02-03 03:46:24 +08:00
f697f475e5 Merge branch 'doc/uart_num_fix_v4.2' into 'release/v4.2'
docs: fix uart number naming error (v4.2)

See merge request espressif/esp-idf!12068
2021-02-02 16:08:33 +08:00
d9455d8587 CI: fix the bug returns wrong artifact path when app_name is a subset of a longer one 2021-02-02 11:14:06 +08:00
2ea3519964 Merge branch 'bugfix/update_howsmyssl_cert_v4.2' into 'release/v4.2'
examples/protocols: update www.howsmyssl.com certificate to fix test failures (v4.2)

See merge request espressif/esp-idf!12211
2021-02-01 20:25:00 +08:00
0dedf0e1f5 examples/protocols: update www.howsmyssl.com certificate to fix test failures 2021-02-01 11:01:35 +05:30
250805d991 docs: Update full-scale voltages for ESP32-S2 chip 2021-02-01 11:22:49 +08:00
48dc6e9347 mcpwm: fix second fault line broken
Closes: https://github.com/espressif/esp-idf/issues/6053
2021-01-27 14:56:33 +08:00
87b051c87a mcpwm: fix wrong capture edge 2021-01-27 14:56:33 +08:00
10f16c5d72 Merge branch 'bugfix/soc_caps_implicit_inc_v4.2' into 'release/v4.2'
HAL: explicitly include soc_caps.h  (v4.2)

See merge request espressif/esp-idf!11896
2021-01-27 10:33:42 +08:00
fd5f65a2d4 Make OTA example support keepalive 2021-01-26 14:09:13 +08:00
90218b4e9b Add options for esp_http_client and esp_websocket_client to support keepalive 2021-01-26 14:09:01 +08:00
cbca521e28 Modify esp-tls and tcp_transport to support keep alive for tcp and ssl connection 2021-01-26 14:08:45 +08:00
186ebc61e7 Add init & deinit event for a2dp 2021-01-26 10:51:47 +08:00
c4d0a384b0 Merge branch 'fix/esp_tls_fix_memory_leak_v4.2' into 'release/v4.2'
Fix/esp tls fix memory leak v4.2

See merge request espressif/esp-idf!12085
2021-01-22 21:37:58 +08:00
be26d45d78 Merge branch 'bugfix/httpd_session_close_lru_v4.2' into 'release/v4.2'
esp_http_server: Add flag in sock_db to identify httpd_sess_close is called from httpd_session_close_lru (v4.2)

See merge request espressif/esp-idf!12112
2021-01-22 21:22:11 +08:00
6b054fb4a6 Enable lru_purge_enable in simple HTTP server example 2021-01-22 15:33:57 +05:30
ecbf436de4 Merge branch 'bugfix/http_client_buffer_overread_v4.2' into 'release/v4.2'
esp_http_client: Fix buffer overread, update https_request example to use HTTP/1.1 (v4.2)

See merge request espressif/esp-idf!12108
2021-01-22 17:45:31 +08:00
4d1ada8ab5 Merge branch 'bugfix/misc_secure_boot_v4.2' into 'release/v4.2'
Bugfix/misc secure boot v2 (v4.2)

See merge request espressif/esp-idf!11743
2021-01-22 16:27:10 +08:00
1c732d7556 esp_http_server: Add lru_socket flag in sock_db to indicate httpd_sess_close is called from httpd_sess_close_lru 2021-01-22 11:16:10 +05:30
29feb17636 esp_http_client.c: Clear raw_len for response buffer after dispatching HTTP_EVENT_ON_FINISH event
Closes: https://github.com/espressif/esp-idf/issues/6146
2021-01-22 11:03:23 +05:30
7ceaac64bf Merge branch 'bugfix/secure_boot_sig_failed_crash_v4.2' into 'release/v4.2'
secure boot: Fix crash if signature verification fails in app (v4.2)

See merge request espressif/esp-idf!11924
2021-01-22 07:58:24 +08:00
84219fe844 esp_tls_wolfssl: Move order of crt_bundle check to match that in
esp_tls_mbedtls
2021-01-21 10:45:42 +05:30
a5cf243ea0 esp-tls: Fix mem leak when global_ca_store is freed 2021-01-21 10:45:18 +05:30
56de4bbc4d Merge branch 'bugfix/ble_mesh_node_set_name_status_check_v4.2' into 'release/v4.2'
ble_mesh: stack: Remove node set device name return status check (v4.2)

See merge request espressif/esp-idf!12081
2021-01-21 11:07:58 +08:00
7c9be015aa Merge branch 'bugfix/ble_mesh_proxy_client_net_resend_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix proxy client may fail to resend msg (v4.2)

See merge request espressif/esp-idf!12079
2021-01-21 11:07:27 +08:00
54d8a1f76b Merge branch 'bugfix/ble_mesh_prov_use_diff_rand_v4.2' into 'release/v4.2'
ble_mesh: stack: Use different random for each provisioning (v4.2)

See merge request espressif/esp-idf!12077
2021-01-21 11:07:02 +08:00
lly
4510332e96 ble_mesh: stack: Remove node set device name return status check 2021-01-20 21:11:21 +08:00
lly
370e65ec8a ble_mesh: stack: Fix proxy client may fail to resend msg 2021-01-20 21:10:18 +08:00
lly
962b14d653 ble_mesh: stack: Use different random for each provisioning 2021-01-20 21:09:09 +08:00
d8ba0f9b0e docs: fix uart number naming error 2021-01-20 17:55:07 +08:00
967c07b6ae Merge branch 'bugfix/nvs_check_external_partition' into 'release/v4.2'
NVS: ensuring default partition

See merge request espressif/esp-idf!8934
2021-01-20 07:44:28 +08:00
ad47ed5ef1 Merge branch 'bugfix/mdns_txt_length_collision_v4.2' into 'release/v4.2'
mDNS: Fix of text length calculation when detecting a collision(Backport v4.2)

See merge request espressif/esp-idf!12029
2021-01-19 22:15:05 +08:00
db2ddebc23 Merge branch 'bugfix/ble_mesh_log_macro_v4.2' into 'release/v4.2'
ble_mesh: stack: Add prefix for log macros (v4.2)

See merge request espressif/esp-idf!12052
2021-01-19 17:34:05 +08:00
lly
f56fe3f877 ble_mesh: stack: Fix compile warning when log is disabled 2021-01-19 14:04:45 +08:00
lly
571da869f5 ble_mesh: ci: Add disable log sdkconfig test files 2021-01-19 14:04:45 +08:00
lly
d545f1223f ble_mesh: stack: Add prefix BLE_MESH_ for log related macros 2021-01-19 14:04:44 +08:00
8cd16b60f5 Merge branch 'bugfix/ppp_deinit_failure_v4.2' into 'release/v4.2'
esp_modem: Fixed race condition on exiting PPP mode (v4.2)

See merge request espressif/esp-idf!11870
2021-01-19 02:42:50 +08:00
a4525284bd Merge branch 'update/ble_mesh_set_hsl_states_v4.2' into 'release/v4.2'
ble_mesh: stack: Enable updating lighting hsl state (v4.2)

See merge request espressif/esp-idf!12036
2021-01-18 19:10:31 +08:00
e36282787e Merge branch 'bugfix/ble_mesh_build_error_c3_merge_master_v4.2' into 'release/v4.2'
Bugfix/ble mesh build error merge master (v4.2)

See merge request espressif/esp-idf!12038
2021-01-18 19:10:21 +08:00
b24ccd8a20 Merge branch 'bugfix/fix_iperf_example_crash_issue_v4.2' into 'release/v4.2'
Bugfix/fix iperf example crash issue v4.2 (backport v4.2)

See merge request espressif/esp-idf!12024
2021-01-18 19:09:37 +08:00
lly
c44dc1f262 ble_mesh: stack: Fix compile warning with BIT macro 2021-01-18 14:07:30 +08:00
lly
de166facd7 ble_mesh: stack: Update mesh max conn macro when using bluedroid 2021-01-18 14:07:24 +08:00
lly
71f4c476cb ble_mesh: stack: Enable updating lighting hsl state 2021-01-18 14:01:39 +08:00
b4735859d6 Merge branch 'bugfix/bluedroid_avoid_same_bdaddr_conn_v4.2' into 'release/v4.2'
Bluedroid: Do not connect if peer BD_ADDR is same as own BD_ADDR. (v4.2)

See merge request espressif/esp-idf!11990
2021-01-18 14:01:31 +08:00
28371f45a4 Merge branch 'bugfix/ppp_netif_free_v4.2' into 'release/v4.2'
esp-modem: Remove esp-netif destroy from modem network glue code (v4.2)

See merge request espressif/esp-idf!11872
2021-01-16 00:57:15 +08:00
84039dc77d esp_modem: Fixed race condition on exiting PPP mode
esp_modem_stop_ppp() stops both ppp netif and switches the modem back to
command mode. IF these two actions are not synchronised, we might
experience issues of
* active PPP session trying to send/receive uart-data
* command mode already active before modem switched to it
both resulting in crashes.
Fixed by introducing the transition mode and running these actions in sequence
* set esp-modem to transition mode
* enter command mode, wait for the reply or re-sync
* close the PPP netif
* wait until the netif closes
Other fixes include ignoring certain events if modem component not ready
or not in appropriate mode:
* ignoring all UART events comming from DTE with no DCE attached
* ignore pattern detection in PPP mode
2021-01-15 17:38:30 +01:00
67a3ff8a4b Merge branch 'bugfix/esp_netif_ppp_event_data_v4.2' into 'release/v4.2'
esp-netif: Fix PPP netif event posting to include esp_netif data (v4.2)

See merge request espressif/esp-idf!11868
2021-01-15 23:48:27 +08:00
500edd412a mDNS: Fix of text length calculation when detecting a collision 2021-01-15 17:11:14 +04:00
cc0ad534e9 mDNS: Fix of collision detection during txt length calculation
Closes https://github.com/espressif/esp-idf/issues/6114
2021-01-15 17:10:35 +04:00
b78fbdab12 example: Scan failure should not cause system crash 2021-01-15 20:21:35 +08:00
30becdfaab example: do not check the return value of esp_wifi_connect() 2021-01-15 20:20:17 +08:00
95c360fcbd esp_pm: fix formatting issues in esp_pm_dump_locks
- line was truncated because 64 characters were not sufficient
- length passed to snprintf should be full buffer length, not -1
- make the width of lock name field fixed
- fix alignment of lock type column
2021-01-15 13:18:06 +01:00
7ff123562b Merge branch 'bugfix/mdns_resolve_nonstrict_answers_v4.2' into 'release/v4.2'
mdns: Allow resolve (it's own) non-strict answers (v4.2)

See merge request espressif/esp-idf!11818
2021-01-15 19:51:04 +08:00
53fc156adb esp-modem: Remove esp-netif destroy from modem network glue code
To be in line with other interfaces, when deleting the driver and it's glue layer to esp-netif, we DO NOT delete the related esp-netif (since is was allocated and created outside of the glue code and it works the same way in esp-eth and esp-wifi driver/glue layers).

Closes https://github.com/espressif/esp-idf/issues/5486
2021-01-15 11:48:26 +00:00
cf7bea6dff idf monitor: fix crash when monitor baudrate argument set
Closes IDF-1902
2021-01-15 09:09:49 +00:00
67fb958b8c Merge branch 'bugfix/ble_mesh_macro_OR_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix using wrong | for OR between macros (v4.2)

See merge request espressif/esp-idf!11997
2021-01-15 11:04:47 +08:00
lly
cd1fbfdee1 ble_mesh: stack: Fix using wrong | for OR between macros 2021-01-14 19:03:00 +08:00
8911c29122 Merge branch 'feat/ble_mesh_support_ble_scan_v4.2' into 'release/v4.2'
ble_mesh: stack: Add BLE scan callback when mesh is enabled (v4.2)

See merge request espressif/esp-idf!11963
2021-01-14 19:01:05 +08:00
lly
a3fa7dda33 ble_mesh: ci: Add ble & ble mesh coex sdkconfig test files 2021-01-14 07:30:47 +00:00
lly
c8890a40e4 ble_mesh: stack: Support reporting normal ble adv packets 2021-01-14 07:30:47 +00:00
lly
a91addb716 ble_mesh: stack: Add a btc file for ble coex functions
Previously if starting/stopping BLE advertising when BLE Mesh
is enabled, the corresponding events will be notified through
the callback registered by esp_ble_mesh_register_prov_callback().

With this commit, the func esp_ble_mesh_register_ble_callback()
needs to be invoked for resgitering the callback used for BLE
coexistence related functionalities (i.e. ADV/SCAN).
2021-01-14 07:30:47 +00:00
lly
396c6a3bc5 ble_mesh: stack: Move ble scan funcitons to a single file 2021-01-14 07:30:47 +00:00
lly
96182bdc43 ble_mesh: stack: Optimize handling received mesh adv packets 2021-01-14 07:30:47 +00:00
4cfece437d Bluedroid: Do not connect if peer BD_ADDR is same as own BD_ADDR. 2021-01-14 12:22:30 +05:30
73023f7ff7 Merge branch 'ci/increase_build_example_parallel_count' into 'release/v4.2'
ci: Add 1 parallel count for building example

See merge request espressif/esp-idf!11976
2021-01-14 14:33:26 +08:00
lly
bd0f520a95 ci: Add 1 parallel count for building example 2021-01-13 16:21:15 +08:00
e5553b964d Merge branch 'fix/esp_tls_add_warning_if_ca_chain_has_invalid_cert_v4.2' into 'release/v4.2'
esp_tls: Add warning if the CA chain provided contains invalid cert (v4.2)

See merge request espressif/esp-idf!11939
2021-01-12 23:26:32 +08:00
7453507d93 Secure boot v2: Fixes the issue of passing the flash calculated digest for ota verification. 2021-01-12 11:16:23 +00:00
b979dacc6c Secure Boot v2: Fix the double padding of the image length during flash encryption
Fixes https://github.com/espressif/esp-idf/issues/6236
2021-01-12 11:16:23 +00:00
21eac48ea0 Merge branch 'optimize/ble_mesh_miscellaneous_v4.2' into 'release/v4.2'
Optimize/ble mesh miscellaneous (v4.2)

See merge request espressif/esp-idf!11948
2021-01-12 19:13:08 +08:00
lly
fe6103c088 ble_mesh: stack: Move bt_mesh_rand to mesh_common.c 2021-01-11 19:26:49 +08:00
lly
f031dc6d29 ble_mesh: stack: Remove useless BT_DBG_ENABLED in a few files 2021-01-11 19:26:49 +08:00
lly
85de3a84e1 ble_mesh: Replace zephyr integer types with C99 types [Zephyr] 2021-01-11 19:26:46 +08:00
lly
3f361cc262 ble_mesh: stack: Update ARRAY_SIZE definition 2021-01-11 19:25:52 +08:00
8f20b9dc8a Merge branch 'feat/ble_mesh_multiple_nvs_namespace_v4.2' into 'release/v4.2'
ble_mesh: stack: Provisioner supports multiple nvs namespaces (v4.2)

See merge request espressif/esp-idf!11935
2021-01-11 18:55:22 +08:00
e33cfbaef9 esp_tls: Add warning if the CA chain provided contains one/more invalid
cert
2021-01-11 12:02:30 +05:30
60a808372e Merge branch 'feature/upgrade_mbedtls_to_v4.2' into 'release/v4.2'
mbedtls: upgrade to v2.16.9 release (v4.2)

See merge request espressif/esp-idf!11899
2021-01-11 14:01:11 +08:00
lly
3a1018f603 ble_mesh: ci: Add settings sdkconfig test files 2021-01-11 10:08:00 +08:00
lly
c5d9601e69 ble_mesh: stack: Provisioner supports multiple nvs namespaces
Now Provisioner can use different NVS namespaces to store
different instances of mesh information, for example, for
different user accounts.
2021-01-11 10:07:55 +08:00
2aafcd9b1f Merge branch 'feat/ble_mesh_provisioner_recv_hb_support_v4.2' into 'release/v4.2'
Feat/ble mesh provisioner recv hb support (v4.2)

See merge request espressif/esp-idf!11913
2021-01-08 18:30:35 +08:00
0e4f43ddde secure boot v2: Fix crash if signature verification fails in app
sha_handle is "finished" when verify_secure_boot_signature() returns and
should be nulled out.

Alternative version of fix submitted in https://github.com/espressif/esp-idf/pull/6210

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

Signed-off-by: Angus Gratton <angus@espressif.com>
2021-01-08 18:45:49 +11:00
0c3c09e7ef Merge branch 'bugfix/icmp_echo_test_v4.2' into 'release/v4.2'
CI: change icmp example test address to ci.espressif.cn (v4.2)

See merge request espressif/esp-idf!11903
2021-01-08 11:16:15 +08:00
lly
1efa401884 ble_mesh: ci: Add enabling hb recv sdkconfig file 2021-01-08 09:32:23 +08:00
lly
0432d11509 ble_mesh: stack: Provisioner supports receiving heartbeat 2021-01-08 09:32:23 +08:00
8c4839e9e6 CI: change icmp example test address
Use a server that is inside the great firewall of china for CI test.
This avoid issues due to proxies, network configs etc.
2021-01-07 14:49:29 +08:00
ce72deea7f mbedtls: upgrade to v2.16.9 release
For details release notes please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.9
2021-01-07 11:15:42 +05:30
929632739a spi: fix duplex mode switch issue for multi devices 2021-01-07 11:56:16 +08:00
5e9783f4a6 hal: include pcnt_caps.h
Some HAL files depend on x_caps.h, but didnt explicitly include it

Fixes issue where only 4 PCNT (out of 8) could be used on ESP32

Closes https://github.com/espressif/esp-idf/issues/6366
2021-01-07 03:01:55 +00:00
474224d668 Merge branch 'bugfix/ble_mesh_node_id_adv_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix Node ID adv with wrong timeout (v4.2)

See merge request espressif/esp-idf!11877
2021-01-06 17:08:21 +08:00
lly
53935d5933 ble_mesh: stack: Fix Node ID adv with wrong timeout 2021-01-06 05:33:41 +00:00
47aa7408f5 Merge branch 'bugfix/fix_tx_issue_after_esp_restart_v4.2' into 'release/v4.2'
components/bt: Shutdown Bluetooth before esp_restart. (V4.2)

See merge request espressif/esp-idf!11755
2021-01-06 12:32:33 +08:00
70ecd0e92c Merge branch 'bugfix/btdm_blufi_send_custom_data_will_congested_after_connection_is_broken_v4.2' into 'release/v4.2'
component/bt: fix Blufi sends customer data will congested when connection is broken(backport v4.2)

See merge request espressif/esp-idf!11847
2021-01-06 12:29:44 +08:00
caddd5d9fa Merge branch 'bugfix/fix_spp_vfs_dynamic_memory_bugs_v4.2' into 'release/v4.2'
component_bt/fix spp vfs demo crash when use dynamic memory[backport v4.2]

See merge request espressif/esp-idf!11726
2021-01-06 12:20:22 +08:00
c5b2252e03 esp-netif: Fix PPP netif event posting to include esp_netif data
Closes https://github.com/espressif/esp-idf/issues/6009
2021-01-04 16:41:25 +01:00
f3c9a71138 components/bt: Add API to config QoS 2021-01-04 11:53:04 +08:00
5da8c3f8de component/bt: fix Blufi sends customer data will congested when connection is broken 2020-12-31 15:38:49 +08:00
248857bf91 Merge branch 'fix/i2c_pm_lock_v4.2' into 'release/v4.2'
i2c: Acquire PM lock after acquiring mutex (v4.2)

See merge request espressif/esp-idf!11830
2020-12-31 12:33:36 +08:00
6216f99265 Merge branch 'fix/wolfssl_domain_name_check_v4.2' into 'release/v4.2'
esp_tls_wolfssl : Add domain name check (v4.2)

See merge request espressif/esp-idf!11816
2020-12-30 21:48:31 +08:00
6d6fbc3860 1. Optimize 32k xtal configure param to get optimal startup time for ESP32S2;
2. Solve bug of wakeup fail when pd peripheral for ESP32S2;
3. clear rtc force pu configuration when goto deepsleep after lightsleep.
2020-12-30 16:47:41 +08:00
14587e7e73 i2c: Acquire PM lock after acquiring mutex 2020-12-30 13:24:38 +05:30
9f9013c8c3 mdns: Allow resolve its own non-strict answers
the mDNS responder should not repeat questions when replying, however resolvers
must ignore these questions field if they are present. esp-idf mDNS
library does include questions in answering packets (thus not strictly
following the RFC6762) so the resolver did not correctly resolved
another instance host name.

Closes https://github.com/espressif/esp-idf/issues/6190
2020-12-29 19:05:11 +01:00
076ad543fb esp_tls_wolfssl : Add domain name check 2020-12-29 21:11:08 +05:30
24f98bf80b Merge branch 'bugfix/crt_bundle_bad_md_v4.2' into 'release/v4.2'
esp_crt_bundle: allow weak hash algorithm for trusted certificate (backport v4.2)

See merge request espressif/esp-idf!11655
2020-12-28 22:30:16 +08:00
4360410107 Merge branch 'bugfix/tools_python_subprocess_capture_output_v4.2' into 'release/v4.2'
tools: Avoid subprocess.run(capture_output) argument for Python <3.7 compatibility (v4.2)

See merge request espressif/esp-idf!11506
2020-12-28 07:45:51 +08:00
68095a65ac Merge branch 'bugfix/bt_bluedroid_same_public_key_attack_v4.2' into 'release/v4.2'
Bluedroid: Fixes for some Bluetooth vulnerabilities. (v4.2)

See merge request espressif/esp-idf!11763
2020-12-25 23:35:15 +08:00
235628355f Bluedroid: Fixes for some vulnerabilities.
This commit fixes 'Impersonation in Passkey entry protocol'
(CVE-2020-26558) and suggests fixes for other vulnerabilites like
'Impersonation in the Pin Pairing Protocol' (CVE-2020-26555) and
'Authentication of the LE Legacy Pairing Protocol'

CVE-2020-26558 can be easily implemented if the peer device can
impersonate our public key. This commit adds a check by comparing our
and received public key and returns failed pairing if keys are same.

This commit also adds comments suggesting to use secure connection when
supported by all devices.
2020-12-25 16:01:11 +05:30
567562a0fb components/bt: Add QOS for SPP, to decrease the delay from slave to master 2020-12-25 14:51:15 +08:00
d694036789 components/bt: Shutdown Bluetooth before esp_restart. 2020-12-25 14:06:22 +08:00
26ba5e1b51 nvs_flash: fixed deinit other partition's handles
* When deinitializing or erasing a partition,
  nvs used to close all handles instead of only
  the current partition's handles.
  This is fixed now
* Added a unit test for that case
* Unit tests clean up after each test case now

Closes FCS-533
2020-12-24 19:20:04 +08:00
ecc2dd4b23 Merge branch 'bugfix/ci_retries_when_download_v4.2' into 'release/v4.2'
CI: retry shell commands when download (v4.2)

See merge request espressif/esp-idf!9888
2020-12-24 16:20:12 +08:00
774fb48f9e Merge branch 'bugfix/spiram_reserve_size_pr5373_v4.2' into 'release/v4.2'
SPIRAM reserved memory size fixes (v4.2)

See merge request espressif/esp-idf!11516
2020-12-24 13:55:35 +08:00
40873d2026 fix spp vfs demo crash when use dynamic memory 2020-12-23 15:06:34 +08:00
ac5b7be7c2 Merge branch 'bugfix/fix_some_wifi_bugs_1222_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs 1222 (backport v4.2)

See merge request espressif/esp-idf!11711
2020-12-23 12:04:22 +08:00
c09a265f32 Merge branch 'bugfix/fix_crash_of_divide_zero_4_2' into 'release/v4.2'
Fix crash caused by dividing zero [backport v4.2]

See merge request espressif/esp-idf!11418
2020-12-23 11:20:48 +08:00
ef84e386e4 Fix divided by zero err & clear timer after remote reject when respond the parameters update 2020-12-22 16:37:31 +08:00
44b1c3b307 esp_wifi: update wifi lib 2020-12-22 16:05:39 +08:00
3acd9861bf wpa_supplicant: Use WPA3 flag to reduce code size
Flag ESP32_WIFI_ENABLE_WPA3_SAE from Menuconfig is used to
control the stack size required by WPA3. Use the same flag
to compile out the WPA3 code and control the code size.
With this flag disabled code footprint reduces by about 7.7kB
in libwpa_supplicant.a
Update WiFi libs with added checks to cleanly handle disabling
of WPA3 callbacks.
2020-12-22 15:50:52 +08:00
0bd758c0b1 WIFI: Iperf example's parameter opt was uninitialized, may leads setsockoption invalide if it equal to 0 2020-12-22 15:46:36 +08:00
12eb9d6d80 esp_wifi:
1. Add description for esp_wifi_set_inactive_time()
2. Add documentation to avoid using WiFi modem sleep for WiFi/BT coexistence
3. Remove description of unusable API esp_wifi_restart()
4. Update esp_now_fetch_peer discription
5. Update table format prblm for esp_wifi_set_max_tx_power()
6. Update description for ssid and password
2020-12-22 15:44:07 +08:00
33c296b78e wpa_supplicant: Replace internal RSA APIs by mbedtls APIs
Curretly wpa_supplicant uses internal APIs for RSA operations
which internally uses lots of big num operations.

Big num operations are CPU expensive and can take a lot of time
which can cause watchdog timer to tigger.

This can be optimize by using mbedtls APIs which uses
hardware blocks for big num operations.

To fix this, write new crypto_mbedtls-rsa.c which has APIs
similar to crypto_internal-rsa.c but uses mbedtls APIs.
2020-12-22 15:37:38 +08:00
e6d74b2d7e Merge branch 'ci/disable_dev_push_pipelines_v4.2' into 'release/v4.2'
CI: Disable pipelines generated by push on dev branches (v4.2)

See merge request espressif/esp-idf!11592
2020-12-22 13:11:49 +08:00
866399cbf7 Merge branch 'bugfix/pmf_tx_rx_routine_v4.2' into 'release/v4.2'
esp_wifi: Always register pmf tx/rx routines (backport v4.2)

See merge request espressif/esp-idf!11447
2020-12-22 00:02:31 +08:00
573708ea1e Merge branch 'fix/update_tls_sockfd_after_freeing_internally_v4.2' into 'release/v4.2'
esp-tls : (Fix) update tls->sockfd value after socket is freed internally (v4.2)

See merge request espressif/esp-idf!11695
2020-12-21 15:59:44 +08:00
4c66d146eb esp-tls : (Fix) update tls->sockfd value after socket is freed internally
Closes https://github.com/espressif/esp-idf/issues/6163
2020-12-21 11:23:22 +05:30
cfd234da3a Merge branch 'bugfix/exl200_reset_and_adv_v4.2' into 'release/v4.2'
Bugfix/exl200 reset and adv v4.2

See merge request espressif/esp-idf!11671
2020-12-18 21:54:06 +08:00
fd68c06824 Merge branch 'bugfix/doxygen_warnings_v4.2' into 'release/v4.2'
Docs: fix doxygen warnings (backport v4.2)

See merge request espressif/esp-idf!11674
2020-12-18 15:59:39 +08:00
d9cea5dfdb Docs: fix doxygen warnings 2020-12-18 14:27:17 +08:00
98a536894d components/bt:fix exl200, add btdm_disable_adv_delay, fix RPA addr update error. 2020-12-18 11:34:34 +08:00
9ca6aee845 components/bt: Fixed the problem of early release of pointer(p_ccb) in funcion 2020-12-18 11:32:31 +08:00
b1b673eaa2 Merge branch 'feature/lwip_tcp_isn_hook_v4.2' into 'release/v4.2'
lw-ip: enable TCP ISN hook (v4.2)

See merge request espressif/esp-idf!11062
2020-12-18 00:18:36 +08:00
a57576cec4 esp_netif: initialize TCP ISN hook if enabled in configuration 2020-12-17 13:42:01 +00:00
7d226ce542 lwip: provide configuration option to enable TCP ISN hook 2020-12-17 13:42:01 +00:00
4fb4178f06 tcp_isn: use ROM APIs for md5 calculations 2020-12-17 13:42:01 +00:00
aa416a377b lwip: add custom TCP ISN hook implementation
Source:
https://git.savannah.nongnu.org/cgit/lwip/lwip-contrib.git/
2020-12-17 13:42:01 +00:00
2b88ed8827 Merge branch 'bugfix/idf_gdb_no_openocd_crash_v4.2' into 'release/v4.2'
idf.py: Fixed gdb target to exit cleanly when no openocd watch task (v4.2)

See merge request espressif/esp-idf!10808
2020-12-17 18:40:31 +08:00
0386b19d8b Merge branch 'bugfix/mdns_query_id_v4.2' into 'release/v4.2'
mdns: Responding: Fix query ID, add questions if not strict mode (v4.2)

See merge request espressif/esp-idf!10806
2020-12-17 18:37:18 +08:00
683d0f4edb Merge branch 'nimble/fix_misc_coverity_issue_v4.2' into 'release/v4.2'
Nimble: Fix misc issues in NimBLE NVS, `ble_eddystone`, recursive call and  L2CAP CoC (v4.2)

See merge request espressif/esp-idf!11390
2020-12-17 16:53:46 +08:00
4bca971865 Merge branch 'bugfix/free_acl_rx_buf_in_em_4_2' into 'release/v4.2'
Free ACL RX Buf in EM when disconnection [backport v4.2]

See merge request espressif/esp-idf!11612
2020-12-17 16:47:46 +08:00
c1d5ad61b5 Free ACL RX Buf in EM when disconnection [backport v4.2] 2020-12-17 16:47:43 +08:00
d315bf722f Added missing MYNEWT_VAL_BLE_L2CAP_COC_MPS definition
Signed-off-by: Prasad Alatkar <prasad.alatkar@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/5825
2020-12-17 07:21:02 +00:00
210bd3787d NimBLE: Fix misc coverity issues in NimBLE host
- NimBLE NVS : Additional check to account for NVS operation failure
- NimBLE host: Fix minor bug in ble_eddystone_set_adv_data_gen
- NimBLE host: remove recursive call, upstream PR: https://github.com/apache/mynewt-nimble/pull/857
2020-12-17 07:21:02 +00:00
dceb9b4a22 esp_crt_bundle: add additional unit tests
Add unit test for:
 * Trusted certificate with weak hash algorithm signature
 * Certificate with wrong signature

Merges https://github.com/espressif/esp-idf/pull/6117
2020-12-17 02:41:59 +00:00
a1d5fcfece esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD 2020-12-17 02:41:59 +00:00
211a2a9957 Merge branch 'fixbug/baidu_tcp_recv_assert_for_4.2' into 'release/v4.2'
lw-ip:fix bug for tcp recv assert(backport 4.2)

See merge request espressif/esp-idf!11601
2020-12-16 17:31:42 +08:00
b1b19495a1 Merge branch 'test/disable_twai_example_ci_v4.2' into 'release/v4.2'
Temporarily disable TWAI network example test (backport v4.2)

See merge request espressif/esp-idf!11561
2020-12-16 04:20:26 +08:00
6a723ad1e7 Merge branch 'bugfix/lwip_netdb_cpp_guards_v4.2' into 'release/v4.2'
lw-IP: Changed to C linkage in netdb.h for fixing bug when using mixed C/C++ code (v4.2)

See merge request espressif/esp-idf!11089
2020-12-16 04:13:12 +08:00
a82d0cf9f1 Merge branch 'bugfix/panic_instr_fetch_prohibited_v4.2' into 'release/v4.2'
panic: don't interrupt the backtrace for InstrFetchProhibited exceptions (v4.2)

See merge request espressif/esp-idf!10293
2020-12-16 04:09:37 +08:00
8224c75211 Merge branch 'bugfix/parttool_example_test_fail_v4.2' into 'release/v4.2'
examples/parttool: fix the test to work on parallel test runner (backport v4.2)

See merge request espressif/esp-idf!10373
2020-12-16 04:09:03 +08:00
e64934be6b Merge branch 'bugfix/docker_gdb_python_v4.2' into 'release/v4.2'
tools/docker: Add libpython2.7 in order to satisfy GDB dependencies (backport v4.2)

See merge request espressif/esp-idf!10307
2020-12-16 04:07:40 +08:00
e95f97d40e mdns test: Add test to resolve esp32 hostname with DiG 2020-12-15 19:01:33 +00:00
05211963ee examples: Common connect component: Unregister shutdown handler on disconnection
To be able to connect smoothly after disconnecting, we have to unregister all handlers including shutdown handler on disconnection
2020-12-15 19:01:33 +00:00
e1e481f438 mdns: Support queries in responses in mDNS non-strict mode
By default adds original queries to responses in order to be resolved by some resolvers, such as lwIP mdns library. This functionality however is discouraged by the RFC6762, so it could be disabled in menuconfig if MDNS_STRICT_MODE configured

Closes https://github.com/espressif/esp-idf/issues/5521
2020-12-15 19:01:33 +00:00
faef936581 mdns: Fix include query ID in reponses
Closes https://github.com/espressif/esp-idf/issues/5574
2020-12-15 19:01:33 +00:00
26bca96029 Merge branch 'bugfix/fix_transport_ssl_blocking_v4.2' into 'release/v4.2'
transport: fix transport ssl blocking (v4.2)

See merge request espressif/esp-idf!10691
2020-12-16 02:59:03 +08:00
a1e1470447 Merge branch 'bugfix/fix_esp_modem_mode_switch_timeout_v4.2' into 'release/v4.2'
fix esp_modem switch mode timeout (v4.2)

See merge request espressif/esp-idf!11395
2020-12-16 02:57:44 +08:00
9fb05897db Merge branch 'bugfix/ci_py2_warnings_fix_v4.2' into 'release/v4.2'
ci: Python 2 warnings fix (v4.2)

See merge request espressif/esp-idf!11617
2020-12-15 19:06:33 +08:00
c8d1b18a3c Merge branch 'bugfix/py2_socketio_v4.2' into 'release/v4.2'
tools: Fix requirements incompatible with Python 2 (v4.2)

See merge request espressif/esp-idf!11604
2020-12-15 18:38:43 +08:00
99cb0f25eb Merge branch 'bugfix/pppos_ignored_modem_start_return_v4.2' into 'release/v4.2'
pppos client: modem netif fix ignoring potential modem-start error (v4.2)

See merge request espressif/esp-idf!11394
2020-12-15 16:15:27 +08:00
99be1aca73 Merge branch 'bugfix/fix_netsuite_tx_wrap_v4.2' into 'release/v4.2'
CI: esp_netif tests: Fix netsuite driver layer per wifi optimization changes (v4.2)

See merge request espressif/esp-idf!11388
2020-12-15 16:14:45 +08:00
7fcb8ffe0a Merge branch 'feature/mqtt_submodule_update_23c8e1ec_v4.2' into 'release/v4.2'
MQTT: Update submodule reference to da850b (config, error flags, minor fixes) (v4.2)

See merge request espressif/esp-idf!11312
2020-12-15 16:13:03 +08:00
cbd0af7217 Merge branch 'bugfix/mdns_src_addr_cpy_v4.2' into 'release/v4.2'
mdns: Fix wrong mdns source address if lwIP IPv6 zoning disabled (v4.2)

See merge request espressif/esp-idf!11310
2020-12-15 16:10:55 +08:00
3b63476e31 Merge branch 'bugfix/backport_v4.2_fix_websocket_issue' into 'release/v4.2'
websocket_client: fix some issues for websocket client (backport v4.2)

See merge request espressif/esp-idf!11276
2020-12-15 16:10:12 +08:00
440b5f6e7b lwip: Changed to C linkage for fixing bug when using mixed C/C++ code
Merges https://github.com/espressif/esp-idf/pull/5900
2020-12-15 08:09:14 +00:00
97cd07007d ci: define ESP_PLATFORM macro during public header check 2020-12-15 08:09:14 +00:00
c0e3aa1ef8 transport: fix transport ssl blocking
In SSL mode, if `esp_transport_poll_read` function is used, the cache data in mebdtls will be blocked
2020-12-15 08:07:18 +00:00
e1d62cda5f Merge branch 'feature/ci_fix_docker_build_v4.2' into 'release/v4.2'
ci: Use git mirror for docker image (v4.2)

See merge request espressif/esp-idf!10445
2020-12-15 14:55:07 +08:00
8c3526d91f Merge branch 'bugfix/build_docs_pdf_job_v4.2' into 'release/v4.2'
docs: seperate build_docs html and pdf CI jobs (Backport v4.2)

See merge request espressif/esp-idf!10549
2020-12-15 14:54:00 +08:00
f5f91a4d05 tools: Redirect some warnings to stderr 2020-12-15 13:16:50 +07:00
3a5de540f1 ci: Ignore Python 2 deprecation warning 2020-12-15 13:16:03 +07:00
48cd4d65e6 Merge branch 'bugfix/redirection_v4.2' into 'release/v4.2'
esp_http_client: Skip check for redirection counter if status code is success, fix issue with digest auth, configurable user agent string. (v4.2)

See merge request espressif/esp-idf!11597
2020-12-14 20:03:03 +08:00
12a0f93f87 adc_i2s: solve the i2s_adc issue when using wifi 2020-12-14 19:33:35 +08:00
9ff5f94233 tools: Fix requirements incompatible with Python 2 2020-12-14 10:48:00 +01:00
72dbf03b6c fix bug for tcp recv assert 2020-12-14 17:42:51 +08:00
fad8a27cf7 Make the UserAgent string in esp-http-client configurable
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6044
2020-12-14 14:02:50 +05:30
465d911052 http_auth.c: Fix crash when opaque field is not present in challenge string
Closes: https://github.com/espressif/esp-idf/issues/5888
2020-12-14 13:58:29 +05:30
b951b5adec esp_http_client: Skip check for redirection counter if status code is success.
Set disable_auto_redirect in esp_http_client example to validate this condition in CI
2020-12-14 13:58:28 +05:30
9fce81f9af esp_wifi: Update WiFi lib
1. Fixes the issue when PMF packets are not sent after mode change.
2. Add support for 802.1x sha256 auth key mode
2020-12-14 14:51:52 +08:00
4167401a00 CI: Disable pipelines generated by push on dev branches 2020-12-14 14:01:44 +08:00
18a1bc9e7f Merge branch 'bugfix/decouple_wifi_bt_with_coex_v4.2' into 'release/v4.2'
esp_wifi: decouple Wi-Fi and bluetooth with coexist to reduce binary file size(backport v4.2)

See merge request espressif/esp-idf!11542
2020-12-14 12:17:23 +08:00
a23449ee23 Merge branch 'optimize/ble_mesh_provision_dev_uuid_check_v4.2' into 'release/v4.2'
ble_mesh: stack: Need uuid when adding device for provisioning (v4.2)

See merge request espressif/esp-idf!11577
2020-12-14 10:15:44 +08:00
a46d8b2831 Merge branch 'bugfix/verify-directory-exists_v4.2' into 'release/v4.2'
Bugfix: add check for existence build directory (v4.2)

See merge request espressif/esp-idf!11581
2020-12-12 01:43:15 +08:00
lly
6510fbb66d ble_mesh: ci: Add PB-ADV & PB-GATT sdkconfig test files 2020-12-11 13:15:54 +00:00
lly
5f2a5cdcab ble_mesh: stack: Need uuid when adding device for provisioning 2020-12-11 13:15:54 +00:00
938b9f3098 Merge branch 'feat/ble_mesh_node_local_data_func_v4.2' into 'release/v4.2'
ble_mesh: stack: Add node local netkey/appkey func (v4.2)

See merge request espressif/esp-idf!11575
2020-12-11 21:13:57 +08:00
5bb0237860 Add checking if the build directory exists and move expression after docstring 2020-12-11 13:13:50 +01:00
c923c99f09 Merge branch 'feature/python2-deprecation-warn_v4.2' into 'release/v4.2'
Tools: Add Python 2 deprecation warning (v4.2)

See merge request espressif/esp-idf!11524
2020-12-11 17:26:06 +08:00
lly
7505e1458f ble_mesh: stack: Fix wrong declaration of node bind AppKey func 2020-12-11 17:19:02 +08:00
lly
d4575ccfe9 ble_mesh: stack: Add node local netkey/appkey func 2020-12-11 17:18:22 +08:00
71e7f000c4 Merge branch 'bugfix/log-error-run-esptool_v4.2' into 'release/v4.2'
parttool.py: Add file stream parameter and log stdout and stderr to same stream (v4.2)

See merge request espressif/esp-idf!10516
2020-12-11 16:51:48 +08:00
58afa32a1a Merge branch 'optimize/ble_mesh_reduce_code_size_v4.2' into 'release/v4.2'
Optimize/ble mesh reduce code size (v4.2)

See merge request espressif/esp-idf!11518
2020-12-11 16:50:51 +08:00
81eb9f280f add CN translation for adding python2 deprecation warning(MR 11115) 2020-12-11 09:16:18 +01:00
d0d7c53ee1 Tools: add Python 2 deprecation warning 2020-12-11 09:14:57 +01:00
19e6434f37 twai: Temporarily disable network example test
Disabling network example test due to issue with synchronizing the
start of each DUT
2020-12-10 21:27:46 +08:00
lly
6f104362c7 ble_mesh: example: Update sdkconfig test files for disabling Health Server model 2020-12-10 09:32:10 +00:00
lly
da8a577408 ble_mesh: stack: Add a Kconfig option to make Health Server model optional 2020-12-10 09:32:10 +00:00
lly
2b2abcd6f9 ble_mesh: stack: Split model Kconfig menu into foundation and others 2020-12-10 09:32:10 +00:00
lly
5fd4d53922 ble_mesh: example: Fix fast provisioning compile error 2020-12-10 09:32:10 +00:00
lly
7f1a0e1552 ble_mesh: ci: Add disabling mesh model sdkconfig test files 2020-12-10 09:32:10 +00:00
lly
e4451376f3 ble_mesh: stack: Add Kconfig options to make server models optional 2020-12-10 09:32:10 +00:00
lly
2602f26753 ble_mesh: stack: Use Kconfig option to make client models optional 2020-12-10 09:32:10 +00:00
lly
9c8c56f081 ble_mesh: stack: Make some internal static functions inline 2020-12-10 09:32:10 +00:00
lly
7e945e5fa8 ble_mesh: ci: Add disabling mesh deinit sdkconfig test files 2020-12-10 09:32:10 +00:00
lly
f27a151478 ble_mesh: stack: Add a Kconfig option to make deinit optional 2020-12-10 09:32:10 +00:00
lly
01d0843c4d ble_mesh: stack: Introduce a new header file mesh_config.h 2020-12-10 09:32:10 +00:00
1771aea076 Merge branch 'bugfix/increase_ci_build_example_parallel' into 'release/v4.2'
ci: Add 1 parallel count for building example

See merge request espressif/esp-idf!11554
2020-12-10 17:09:47 +08:00
lly
c3c0ca0aff ci: Add 1 parallel count for building example 2020-12-10 13:59:36 +08:00
22b33adb2f Merge branch 'optimization/AP_STAIPASSIGNED_passes_IP_send_through_event_data_for_4.2' into 'release/v4.2'
esp-event:AP_STAIPASSIGNED now passes the IP through 'event_data'(backport 4.2)

See merge request espressif/esp-idf!11241
2020-12-09 22:32:19 +08:00
e287e3ef9d Merge branch 'bugfix/backport_some_lwip_bugs_1120_v4.2' into 'release/v4.2'
lw-ip:backport bugfix lwip for v4.2(backport 4.2)

See merge request espressif/esp-idf!11307
2020-12-09 22:31:32 +08:00
f03d543139 Merge branch 'bugfix/blufi_config_potential_double_free_v4.2' into 'release/v4.2'
Bugfix/blufi config potential double free v4.2

See merge request espressif/esp-idf!11163
2020-12-09 22:26:19 +08:00
5a17387c3d esp_wifi: decouple Wi-Fi and bluetooth with coexist to reduce binary file size 2020-12-09 20:42:35 +08:00
996e270f90 Merge branch 'doc/update_CN_translation_for_relase/v4.2' into 'release/v4.2'
update CN translation for index.rst and vscode-setup.rst in get-started folder (v4.2)

See merge request espressif/esp-idf!11522
2020-12-09 19:13:25 +08:00
4ff9a93490 update CN translation for index.rst and add CN translation for vscode-setup.rst in get-started folder 2020-12-09 19:13:25 +08:00
f5c45576cf Merge branch 'feature/btdm_support_some_ble_new_features_v4.2' into 'release/v4.2'
components/bt: backport some new features for Bluedroid BLE(release v4.2)

See merge request espressif/esp-idf!11448
2020-12-09 10:28:56 +08:00
2532ddd9f4 Merge branch 'bugfix/ble_mesh_proxy_cfg_replay_v4.2' into 'release/v4.2'
Bugfix/ble mesh proxy cfg replay (v4.2)

See merge request espressif/esp-idf!11509
2020-12-08 15:00:51 +08:00
d1a9f9ec74 Fix reserved psram region
Closes https://github.com/espressif/esp-idf/pull/5373

Closes https://github.com/espressif/esp-idf/issues/5821
2020-12-08 17:42:36 +11:00
lly
e2cb5ee379 ble_mesh: stack: Store kr phase after value changed [Zephyr] 2020-12-08 11:51:28 +08:00
lly
0c8cf83131 ble_mesh: stack: Fix rpl not check by proxy cfg [Zephyr] 2020-12-08 11:51:23 +08:00
2ef417df5f Merge branch 'docs/update_rtc_clock_source_description_in_api_references_backport_v4.2' into 'release/v4.2'
docs: update the description for RTC Clock Sources for esp32 and esp32s2 (backport/v4.2)

See merge request espressif/esp-idf!11329
2020-12-08 10:47:42 +08:00
452992bcd5 Merge branch 'bugfix/remove_shortcut_to_build_instructions_v4.2' into 'release/v4.2'
doc: Getting Started Guide, remove shortcuts to 'build toolchain from scratch' instructions (v4.2)

See merge request espressif/esp-idf!10597
2020-12-08 10:46:42 +08:00
c2f08b3e35 Merge branch 'bugfix/ble_mesh_node_deinit_v4.2' into 'release/v4.2'
ble_mesh: stack: Persistent storage misc fixes (v4.2)

See merge request espressif/esp-idf!11503
2020-12-08 10:28:46 +08:00
49dde3ca91 Merge branch 'bugfix/cast_int_to_size_t_in_cpu_ll_v4.2' into 'release/v4.2'
soc: cast int to size_t in cpu_ll (v4.2)

See merge request espressif/esp-idf!11135
2020-12-08 09:10:19 +08:00
cf644d4de3 Merge branch 'bugfix/check_doc_links_no_deploy_v4.2' into 'release/v4.2'
CI: Only run check_doc_links if we actually deployed (v4.2)

See merge request espressif/esp-idf!10955
2020-12-08 09:08:03 +08:00
fb81c46999 Merge branch 'bugfix/esp_idf_version_v4.2' into 'release/v4.2'
Add __ASSEMBLER__ flag in esp_idf_version.h to fix build failure with assembly files (v4.2)

See merge request espressif/esp-idf!10899
2020-12-08 09:07:51 +08:00
addabc392d Merge branch 'bugfix/ldgen_unicode_path_v4.2' into 'release/v4.2'
tools/ldgen: Parse paths with Unicode characters in archives & fix parsing of section names on Windows (v4.2)

See merge request espressif/esp-idf!10964
2020-12-08 09:07:47 +08:00
8a47006b72 Merge branch 'bugfix/backport_v4.2_fix_pthread_priority_inheritance' into 'release/v4.2'
pthread: fix the priority inheritance (backport v4.2)

See merge request espressif/esp-idf!11260
2020-12-08 09:07:23 +08:00
1591141237 Merge branch 'bugfix/err_to_name_paths_windows_v4.2' into 'release/v4.2'
tools: fix path handling errors in gen_esp_err_to_name.py for Windows (v4.2)

See merge request espressif/esp-idf!10895
2020-12-08 09:06:59 +08:00
74c7a84c4c Merge branch 'bugfix/secure_boot_v2_manual_enablement_v4.2' into 'release/v4.2'
Secure Boot V2: Fix an issue leading to manual enablement of Secure Boot v2. (v4.2)

See merge request espressif/esp-idf!11228
2020-12-08 09:06:29 +08:00
5cc8660a32 Merge branch 'bugfix/rtc_clk_cal_cycles_add_default_vals_for_all_sources_v4.2' into 'release/v4.2'
esp32xx: Fix default values for all RTC sources in RTC_CLK_CAL_CYCLES option (v4.2)

See merge request espressif/esp-idf!11412
2020-12-08 09:06:21 +08:00
82bcdcaeaf Merge branch 'bugfix/fix_partition_table_in_flash_encryption_example_v4.2' into 'release/v4.2'
example/flash_encryption: Fix partition table (v4.2)

See merge request espressif/esp-idf!10851
2020-12-08 09:06:07 +08:00
117be7a870 Merge branch 'bugfix/blecent_example_test_4.2' into 'release/v4.2'
Fix CI blecent example test (backport v4.2)

See merge request espressif/esp-idf!11271
2020-12-08 09:01:45 +08:00
244922a3e3 tools: Avoid subprocess.run(capture_output) argument for Python <3.7 compatibility
In Python 3.5 and 3.6 the equivalent to capture_output=True is to set stdout
and stderr arguments to subprocess.PIPE
2020-12-08 09:44:31 +11:00
lly
922abdc51b ble_mesh: stack: Persistent storage misc fixes
* Fix the issue that deinit node with "erase_flash"
  set to true, but info is not erased from nvs
* Reuse bt_mesh_cfg_reset() when deinit node
* Optimize Provisioner related erase operations
* No store pending timeout will be used when Node
  is not provisioned OR Provisioner is disabled
  and erase operation is performed
* Change the default timeout for settings operation
  to 0, and rpl store rate to 0
2020-12-07 12:05:56 +00:00
59ad2b48ee Merge branch 'bugfix/fix_node_test_func_not_set_role_v4.2' into 'release/v4.2'
ble_mesh: test: Fix node test function not update role flag (v4.2)

See merge request espressif/esp-idf!11040
2020-12-07 19:56:55 +08:00
0c75a3a8e7 Merge branch 'bugfix/ble_mesh_autorsp_description_v4.2' into 'release/v4.2'
esp_ble_mesh: api: fixed comment about autoresp (v4.2)

See merge request espressif/esp-idf!10888
2020-12-07 19:56:52 +08:00
c667af2683 Merge branch 'optimize/ble_mesh_gattc_conn_param_v4.2' into 'release/v4.2'
ble_mesh: stack: Update connection parameters used by Central (v4.2)

See merge request espressif/esp-idf!11328
2020-12-07 19:55:51 +08:00
305bc4983f Merge branch 'fix/protocomm_simple_ble_v4.2' into 'release/v4.2'
Protocomm/simple_ble: Fix gatt table map size to number of handles received (v4.2)

See merge request espressif/esp-idf!11264
2020-12-07 16:18:07 +08:00
171eddcd01 Merge branch 'feature/esp_cryptoauthlib_sub_update_v4.2' into 'release/v4.2'
esp-cryptoauthlib: Update submodule pointer to add a new feature. (v4.2)

See merge request espressif/esp-idf!10830
2020-12-07 16:15:13 +08:00
7dc03f16e7 Merge branch 'bugfix/twai_backport_accumulated_fixes_v4.2' into 'release/v4.2'
TWAI backport accumulated fixes (backport v4.2)

See merge request espressif/esp-idf!11459
2020-12-07 15:52:04 +08:00
c40f2590bf Merge branch 'featrue/remove_esp32-S2_preview_v4.2' into 'release/v4.2'
docs: ESP-IDF v4.2 fully supports ESP32-S2, remove documentation that describe preview support (v4.2)

See merge request espressif/esp-idf!11467
2020-12-04 08:33:44 +08:00
1f3d8588ae docs: ESP-IDF v4.2 fully supports ESP32-S2, remove documentation that describe preview support 2020-12-04 10:09:07 +11:00
a0bb9b2f57 TWAI: ISR runs when cache is disabled
This commit adds the feature where the TWAI ISR will continue to
run even if the cache is disabled. Whilst cache is disabled, any
received messages will go into the RX queue, and any pending TX
messages in the TX queue will be transmitted. This feature should
be enabled using the CONFIG_TWAI_ISR_IN_IRAM option.
2020-12-03 19:41:59 +08:00
9dbf59af9c component/bt: support BLE Read Attribute value by UUID 2020-12-03 15:19:44 +08:00
4e8d383d01 component/bt: refactor ble random address setting 2020-12-03 15:19:35 +08:00
8533c452a1 component/bt: support BLE Application Layer Encryption key size check 2020-12-03 15:19:27 +08:00
82b65d5de0 component/bt: support BLE Authorization 2020-12-03 15:19:17 +08:00
0740090682 component/bt: fix incorrect encryption flag setting 2020-12-03 15:19:02 +08:00
901dce43d0 Merge branch 'bugfix/update_release_v4.2_bt_lib' into 'release/v4.2'
components/bt: backport requires commit to release v4.2

See merge request espressif/esp-idf!11426
2020-12-03 11:22:13 +08:00
fa7c5fcd42 TWAI: Fix BRP field initialization onf ESP32 ECO3
This commit zero initializes the brp_div field on ESP32 ECO3
to prevent incorrect timing configuration.
2020-12-02 21:27:12 +08:00
1160da7fdf TWAI: Fix ESP32-S2 register field name 2020-12-02 21:27:12 +08:00
e1b7a02786 TWAI: Simplify caps header
This commit simplifies the defines made in the _caps.h header. Kconfig
option dependencies were moved into the LL, and the check for a
valid BRP has bee simplified.
2020-12-02 21:26:33 +08:00
d780e5b31d components/bt: backport requires commit to release v4.2 2020-12-01 19:29:05 +08:00
4c533a1e53 ci: Fix blecent example test
(cherry picked from commit fc146a98e4)
2020-11-30 22:44:52 +05:30
3d03264b0a esp32xx: Fix default values for all RTC sources in RTC_CLK_CAL_CYCLES option
Closes: https://github.com/espressif/esp-idf/issues/6037
2020-11-30 23:09:13 +08:00
6270de58ad fix esp_modem switch mode timeout
Closes https://github.com/espressif/esp-idf/issues/3506
Closes https://github.com/espressif/esp-idf/issues/4324
2020-11-27 20:11:38 +01:00
99cb5a7c8d pppos client: modem netif fix ignoring potential modem-start error
esp-modem netif glue layer implements esp-netif attach callback to setup corresponding driver functions and start the modem. The error code of esp_modem_start_ppp() was ignored and ESP_OK returned in all cases. Fixed by passing esp_modem_start_ppp()'s error code to post_attach callback.

Closes https://github.com/espressif/esp-idf/issues/5430
2020-11-27 20:10:06 +01:00
bdc914bbf4 CI: esp_netif tests: Fix netsuite driver layer per wifi optimization changes
esp-wifi introcuded wifi tx optimization in !9147 . Update needed in netsuite to pass the tx data using  function

Closes https://github.com/espressif/esp-idf/issues/6161
2020-11-27 12:00:07 +01:00
cd045c60d9 bugfix: Delete local variables to avoid null global variables 2020-11-25 20:52:27 +08:00
1be101f342 component/bt: Add a macro to control the compilation of blufi. 2020-11-24 10:44:57 +08:00
7097ff286c component/bt: Fix a potential double free error. 2020-11-24 10:44:56 +08:00
65c5a57033 blufi: fix an error caused by incorrect conn_id parameters. 2020-11-24 10:44:54 +08:00
f3ff3b3073 Merge branch 'ci/fix_annotated_tag_check_v4.2' into 'release/v4.2'
ci: Fix annotated tag check (v4.2)

See merge request espressif/esp-idf!11331
2020-11-23 17:30:21 +08:00
19bc67e146 ci: Fix annotated tag check
Regression in 1612f84
2020-11-23 17:27:12 +11:00
e9dae152cd docs: update the description for RTC Clock Sources for esp32 and esp32s2 2020-11-23 11:37:15 +08:00
lly
e2b6ab00dc ble_mesh: stack: Update connection interval to 15ms 2020-11-23 08:59:23 +08:00
lly
92eebb885c ble_mesh: stack: Update connection parameters used by Central 2020-11-23 08:59:22 +08:00
c4e4a05002 MQTT: Update submodule reference: config, error handle, minor fixes
Updates esp-mqtt reference to include fixes below related mainly to:
* configuration update (disable keepalive, network timeout)
* minor fixes (size_t for all sizes, unbalanced lock, api for
  outbox-size)
* extended error handle to include socket's errno

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

Config: Added config value to disable keepalive mechanism
esp-mqtt commit: 8562437c8a
Related https://github.com/espressif/esp-mqtt/issues/179

Added esp_mqtt_client_get_outbox_size API
esp-mqtt commit: 0a1d9d0300
Related https://github.com/espressif/esp-mqtt/pull/178

mqtt_outbox: Removed unused retry_count field from outbox_item_t
esp-mqtt commit: 673086e13a

config: Fixed typo for configuring OUTBOX_EXPIRED_TIMEOUT_MS
esp-mqtt commit: 259baaec96

Fixed missing MQTT_API_UNLOCK in esp_mqtt_client_stop error path
esp-mqtt commit: 845c2a3a1e
Related https://github.com/espressif/esp-mqtt/issues/173
Related https://github.com/espressif/esp-mqtt/pull/174

Extended mqtt error handle to capture transport's socket errno (IDF
v4.3+)
esp-mqtt commit: 23c8e1ecf5

Config: Added configuration value to set network timeout
esp-mqtt commit: a03228ac46
Related https://github.com/espressif/esp-mqtt/pull/166

Used size_t for all lengths to allow for other architectures
esp-mqtt commit: b9db8d9020
2020-11-20 10:24:18 +01:00
405f2ee995 mdns: Fix wrong mdns source address if lwIP IPv6 zones disabled
The struct definition of ip6_addr_t in lwip and esp_ip6_addr_t
differs since zone could be possibly disabled in lwip. Using memcpy to copy the
address will cause wrong source address. Copy the entries manually
instead.

Merges https://github.com/espressif/esp-idf/pull/6055
2020-11-20 10:15:33 +01:00
501fce7fdd backport bugfix lwip for v4.2 2020-11-20 14:44:13 +08:00
3c2367d158 i2s: fix i2s ll layer pdm config 2020-11-19 11:42:53 +00:00
2a4c338ac4 websocket_client: fix some issues for websocket client
1. will post twice disconnect event when read error
    2. will block `timeout` times when set disable_auto_connect
    3. When `esp_websocket_client_stop` before `esp_websocket_client_send*`,
    if the `esp_websocket_client_send*` fails, the status will change to
     'WEBSOCKET_STATE_WAIT_TIMEOUT', and the next `esp_websocket_client_start` will fail forever
2020-11-19 15:59:47 +08:00
6928e6b5b0 Protocomm/simple_ble: Make gatt table map size equal to number of handles received (v4.2)
- Fixes memcpy failure observed while adding 2 or more endpoints in
  wifi_provisioning.

 Closes IDF-2250
2020-11-17 14:59:46 +05:30
511965b269 Merge branch 'fix/esp_local_ctrl_update_expired_cert_v4.2' into 'release/v4.2'
esp_local_ctrl: Updated the expired cacert.pem (v4.2)

See merge request espressif/esp-idf!11206
2020-11-17 15:14:57 +08:00
cc10f1943c pthread: fix the priority inheritance
When `pthread_mutex_destroy` is used to release mutex, `pthread_mutex_lock_internal` is used,
     which results in the increase of `uxmutexehold` and no recovery base priority
2020-11-17 14:48:43 +08:00
e0a02c1a7c AP_STAIPASSIGNED now passes the IP through 'event_data'
Signed-off-by: xueyunfei <xueyunfei@espressif.com>
2020-11-16 17:43:51 +08:00
eae8933b85 ci: use the retry script to download 2020-11-16 11:30:47 +07:00
dd6405fcef Secure Boot V2: Fix an issue leading to manual enablement of Secure Boot v2.
Fixes https://github.com/espressif/esp-idf/issues/6050
2020-11-13 11:33:29 +05:30
c2fbda0e6d esp_local_ctrl: Updated the expired cacert.pem 2020-11-12 10:16:22 +05:30
c688828362 Merge branch 'bugfix/efuse_change_burn_order_for_s2_s3_v4.2' into 'release/v4.2'
efuse: Fix the order of writing in batch mode (v4.2)

See merge request espressif/esp-idf!11123
2020-11-11 14:50:53 +08:00
9c239b9f77 Merge branch 'bugfix/fix_assert_in_passkey_reply_4_2' into 'release/v4.2'
Bugfix/fix assert in passkey reply [backport v4.2]

See merge request espressif/esp-idf!10974
2020-11-11 11:35:41 +08:00
5de9174ade Merge branch 'bugfix/fix_crash_caused_by_calling_deinit_directly_4_2' into 'release/v4.2'
Fix crash caused by calling a2dp_deinit directly [backport v4.2]

See merge request espressif/esp-idf!11130
2020-11-11 11:35:06 +08:00
abb7c529dc Merge branch 'bugfix/wpa3_pmkcache_expiry_workaround_v4.2' into 'release/v4.2'
wpa_supplicant: Increase PMK Lifetime to a very high value (Backport v4.2)

See merge request espressif/esp-idf!11170
2020-11-11 11:29:36 +08:00
fe78f2cf3b Merge branch 'bugfix/wifi_fix_beacon_dtim_count_error_v4.2' into 'release/v4.2'
Wi-Fi: set softap beacon DTIM count according to TSF timer(backport v4.2)

See merge request espressif/esp-idf!11155
2020-11-11 11:28:43 +08:00
ad31451594 Fix crash caused by calling deinit directly 2020-11-10 11:18:39 +00:00
0b51df615c Remove dummy assert when receive passkey request 2020-11-10 16:06:11 +08:00
bff3192080 Merge branch 'feature/update_key_name_of_secure_boot_v4.2' into 'release/v4.2'
bootloader: Secure_boot name replaced by secure_boot_v1 & secure_boot_v2 (v4.2)

See merge request espressif/esp-idf!10850
2020-11-10 15:56:26 +08:00
4e80dc2a77 Merge branch 'bugfix/fix_coex_ble_disconnect_issues_1105_v4_2' into 'release/v4.2'
bluetooth: Fix ble disconnect issue in coex mode backport v4.2

See merge request espressif/esp-idf!11146
2020-11-10 15:21:39 +08:00
8e4b919391 Merge branch 'bugfix/fix_spp_read_flow_control_v4.2' into 'release/v4.2'
component_bt/fix spp flow control and vfs write [backport 4.2]

See merge request espressif/esp-idf!11071
2020-11-10 15:19:48 +08:00
5ca0f50231 Fix two bugs:
1.Fix supervision timeout in LLC DISC busy statue can not disconnect issue.
 2.Solve the problem that the ble terminate ack packet may lose with a high probability in coex mode.
2020-11-10 03:00:43 +00:00
0df8024219 Wi-Fi: set softap beacon DTIM count according to TSF timer 2020-11-09 19:33:27 +08:00
e31dd41e00 Merge branch 'bugfix/example_test_import_error_4.2' into 'release/v4.2'
bugfix: import error in example tests (4.2)

See merge request espressif/esp-idf!11048
2020-11-09 19:21:10 +08:00
2343aab4da wpa_supplicant: Increase PMK Lifetime to a very high value
For WPA3 connection nearing PMK lifetime expiry, PMK Cache
needs a re-authentication or the cache will expire. After
current expiry of 12 hours Station ends up sending a deauth
to the AP. An SAE re-authentication also cannot occur without
a disconnection with current implementation. So increase the
PMK lifetime to 100 days for now.
2020-11-09 15:40:08 +05:30
f936adf451 Merge branch 'high/fix_ble_scan_irq_by_timer_v4.2' into 'release/v4.2'
components/bt: fix hci timeout, add timer to monitor scan evt

See merge request espressif/esp-idf!11108
2020-11-06 17:45:27 +08:00
ffb4ff0e4b components/bt: fix hci timeout, add timer to monitor scan evt 2020-11-06 14:17:11 +08:00
03c72909a3 esptool: Update to v3.0 release version 2020-11-06 17:11:29 +11:00
e5aa2b1d73 Merge branch 'bugfix/esp32s2_define_correct_size_for_rtc_fast_mem_v4.2' into 'release/v4.2'
esp32s2: Fix missed features CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP and... (v4.2)

See merge request espressif/esp-idf!9965
2020-11-06 12:49:24 +08:00
640083c8cb replace list and ringbuffer with fixed queue
use eventgroup to sync spp_vfs_write

each connection has a switch_delay_timer not sharing a one

revert functions like spp_find_slot_by_xxx

fix vfs read bug when peer close
2020-11-06 03:38:52 +00:00
94093debab move flow control to btc layer
defer free slot in btc layer when receive BTA_JV_RFCOMM_CLOSE_EVT
2020-11-06 03:38:52 +00:00
76f41cc5e0 add event when calling spp API failed 2020-11-06 03:38:52 +00:00
778fe654aa Merge branch 'bugfix/fix_ag_outging_callback_not_triggered_v4.2' into 'release/v4.2'
Bugfix/Fix Ag Example Outgoing Callback Not Triggered [backport v4.2]

See merge request espressif/esp-idf!11020
2020-11-06 11:08:26 +08:00
cd7bfd6d85 Merge branch 'bugfix/fix_TCP_timer_interval_v4.2' into 'release/v4.2'
lw-ip: fix TCP timer interval (backport v4.2)

See merge request espressif/esp-idf!11086
2020-11-06 11:06:52 +08:00
34665cb9f9 Merge branch 'bugfix/fix_clkn_overflow_issue_4_2' into 'release/v4.2'
Fix controller dead when clkn overflow [backport v4.2]

See merge request espressif/esp-idf!11035
2020-11-06 11:06:32 +08:00
57571ae908 Bugfix: Casting int to size_t 2020-11-05 20:32:43 +05:30
b336cb954c esp32s2: Disable ADC calibration routine if running on FPGA 2020-11-05 15:06:33 +08:00
ac04213299 efuse: Fix the order of writing in batch mode for esp32s2 and s3 2020-11-05 15:05:55 +08:00
4bb9bb95d0 Merge branch 'bugfix/ci_clone_https_v4.2' into 'release/v4.2'
ci: use HTTPS for cloning in IT jobs (v4.2)

See merge request espressif/esp-idf!11095
2020-11-05 09:55:58 +08:00
e07d2df67e ci: use HTTPS for cloning in IT jobs 2020-11-03 19:26:28 +08:00
a55db686b9 bugfix: fix TCP timer interval 2020-11-03 10:38:48 +08:00
5e49f0b565 Merge branch 'bugfix/fix_spi_flash_clock_config_error_s2_4.2' into 'release/v4.2'
bootloader_support: fix fix spi flash clock config error (v4.2)

See merge request espressif/esp-idf!10892
2020-11-02 13:21:37 +08:00
9cf81750b9 bugfix: import error in example tests 2020-10-30 16:24:08 +08:00
lly
b2bd4d1cb7 ble_mesh: test: Fix node test function not update role flag 2020-10-29 15:50:00 +08:00
707dde46a8 tools/ldgen: Fix parsing of sections names on Windows 2020-10-29 08:46:03 +01:00
c09d3c6bac tools/ldgen: Parse paths with Unicode characters in archives
Closes https://github.com/espressif/esp-idf/issues/5996
2020-10-29 08:46:03 +01:00
000a533eaa Fix controller dead when clkn overflow 2020-10-29 14:54:20 +08:00
2b4124bced Merge branch 'bugfix/fix_crash_or_reboot_on_esp32s2_v4.2' into 'release/v4.2'
fix reboot or crash when enable lightsleep on esp32s2

See merge request espressif/esp-idf!11026
2020-10-29 00:31:10 +08:00
73e4a15889 Merge branch 'bugfix/resolve_esp32s2_rtc_gpio_reject_lightsleep_v4.2' into 'release/v4.2'
set clk_gate_en when enable rtc gpio wake up _backport_to_v4.2

See merge request espressif/esp-idf!11009
2020-10-28 22:20:44 +08:00
a6467d7683 fix reboot or crash when enable lightsleep on esp32s2 2020-10-28 22:20:41 +08:00
c5e75cb396 Merge branch 'bugfix/assert_10_9_when_AFPM_occur_v4.2' into 'release/v4.2'
Bugfix/assert 10 9 when afpm occur v4.2, Changed the check order for esp_bt_controller_init(release/v4.2)

See merge request espressif/esp-idf!10984
2020-10-28 22:15:59 +08:00
cd482f5e4b Merge branch 'mesh/bugfix_1023_backport_v4.2' into 'release/v4.2'
esp_wifi_mesh: update wifi mesh libs (backport v4.2)

See merge request espressif/esp-idf!11010
2020-10-28 22:14:43 +08:00
783c5ecee2 fix ag example outgoing callback not triggered
Closes https://github.com/espressif/esp-idf/issues/4967
2020-10-28 20:25:43 +08:00
138e1319b1 components/bt: fixed memory damage caused by bluetooth memory release 2020-10-28 19:05:22 +08:00
44e40500da components/bt: fix assert(10, 9), when the AFPM happens. fix tx_prog insert error. 2020-10-28 19:05:12 +08:00
6a0e8cc83a esp_wifi_mesh: update wifi mesh libs
1. Fix FIX-ROOT does not reconnect to router when disconnect reason is too many
2. Add API esp_mesh_print_scan_result
3. Modify not to reset mesh_xonseq of self and children when flush_upstream_packets
4. Fix not switch to a parent candidate which has the same layer and assoc as current parent
5. Fix not arm parent monitor when a parent candidate is cleared without sending an event to mesh layer
6. Fix the new voted root does not reconnect to router if rssi is weak
2020-10-28 15:02:29 +08:00
3d8f16e05d Merge branch 'bugfix/btdm_bluedroid_enable_takes_long_time_v4.2' into 'release/v4.2'
Bugfix/btdm bluedroid enable takes long time v4.2

See merge request espressif/esp-idf!10701
2020-10-28 13:38:51 +08:00
62aade0671 set clk_gate_en when enable rtc gpio wake up 2020-10-28 11:55:49 +08:00
ff52533260 Merge branch 'bugfix/update_toolchain_5.2.0_psram_final_v4.2' into 'release/v4.2'
esp_wifi: Update WiFi toolchain to 1.22.0-97-gc752ad5  (backport v4.2)

See merge request espressif/esp-idf!10640
2020-10-28 11:14:57 +08:00
c245db59b6 bootloader_support: fix fix spi flash clock config error
Relates to: https://github.com/espressif/esp-idf/issues/5099
2020-10-28 01:38:14 +00:00
c97d4cde56 Merge branch 'feature/add_ipv6_ping_for_4.2' into 'release/v4.2'
lw-ip:add feature for ipv6 ping(backport 4.2)

See merge request espressif/esp-idf!10995
2020-10-27 22:36:57 +08:00
e8cee449ea Merge branch 'bugfix/nimble_host_rcv_pkt_length_check_v4.2' into 'release/v4.2'
NimBLE: host_rcv_pkt event buf size check. (v4.2)

See merge request espressif/esp-idf!10758
2020-10-27 18:49:43 +08:00
e40d3bb05d Merge branch 'optimize/ble_mesh_make_buf_config_invisible_v4.2' into 'release/v4.2'
ble_mesh: stack: Make mesh buf debug option invisible (v4.2)

See merge request espressif/esp-idf!10794
2020-10-27 18:48:37 +08:00
22f49e0fa9 Merge branch 'bugfix/ble_mesh_settings_fix_v4.2' into 'release/v4.2'
Bugfix/ble mesh settings fix (v4.2)

See merge request espressif/esp-idf!10784
2020-10-27 18:48:06 +08:00
dd3f1e346a Merge branch 'feat/ble_mesh_device_properties_v2_v4.2' into 'release/v4.2'
Feat/ble mesh device properties v2 (v4.2)

See merge request espressif/esp-idf!10787
2020-10-27 18:47:34 +08:00
a5c3bd3d04 Merge branch 'bugfix/wpa_supplicant_link_depth_v4.2' into 'release/v4.2'
wpa_supplicant: Fix failure to link under some circumstances (v4.2)

See merge request espressif/esp-idf!10976
2020-10-27 18:45:17 +08:00
2454ffc912 Merge branch 'bugfix/fix_bredr_read_rssi_delta_v4.2' into 'release/v4.2'
Bugfix/Fix Read Rssi Delta Bug in Bredr [backport v4.2]

See merge request espressif/esp-idf!10801
2020-10-27 18:44:50 +08:00
e4e46b8384 1. fix read rssi delta bug in bredr
2. modify read rssi related function names

Closes https://github.com/espressif/esp-idf/issues/5660
2020-10-27 06:57:20 +00:00
1d1b4f09b0 esp_wifi: Update WiFi toolchain to 1.22.0-97-gc752ad5 2020-10-27 14:43:57 +08:00
99fbd8a6e1 Merge branch 'doc/add_user_guide_kaluga_1.3_v4.2' into 'release/v4.2'
Add user guide kaluga 1.3 (backport v4.2)

See merge request espressif/esp-idf!10642
2020-10-27 12:40:58 +08:00
fd95013d77 Add user guide kaluga 1.3 (backport v4.2) 2020-10-27 12:40:53 +08:00
a5ddeef60b Merge branch 'feature/explain_hello_world_files_v4.2' into 'release/v4.2'
docs: Add explanation of hello_world folder contents (v4.2)

See merge request espressif/esp-idf!10775
2020-10-27 12:39:13 +08:00
bd5332d368 Merge branch 'feature/guide_change_for_catalina_v4.2' into 'release/v4.2'
docs: Add profile file name used by zsh shell (v4.2)

See merge request espressif/esp-idf!10772
2020-10-27 12:37:40 +08:00
48ea5b465d Merge branch 'bugfix/pmf_softap_coex_issue_v4.2' into 'release/v4.2'
Fix issues related to PMF and WPA2-Enterprise (Backport v4.2)

See merge request espressif/esp-idf!10706
2020-10-27 10:58:11 +08:00
e7e5884a77 lwip:add feature for ipv6 ping 2020-10-27 10:27:30 +08:00
c59eb27698 esp_wifi: Update wifi lib
1. Add STA checks during STA PMF operations
2. Fix WPA2-Ent issue with Open AP
3. Skip WPA-TKIP profile if PMF is required
4. Skip & clear Supplicant PMK Cache with mismatching AP config
2020-10-26 15:55:54 +08:00
5170ead2e6 wpa_supplicant: Fix failure to link under some circumstances
Depending on CMake internals, the wpa_supplicant library may need to be repeated
multiple times in the linker command line.

Closes https://github.com/espressif/esp-idf/issues/5641
2020-10-26 15:12:48 +11:00
8d213150c5 Merge branch 'bugfix/fix_TCP_retransmission_interval_v4.2' into 'release/v4.2'
fix TCP retransmission interval (backport v4.2)

See merge request espressif/esp-idf!10953
2020-10-26 11:25:15 +08:00
d85d336c86 Merge branch 'bugfix/wps_fail_reason_code_v4.2' into 'release/v4.2'
esp_wifi: Add Failures Reason code in all WPS failure send event(backport v4.2)

See merge request espressif/esp-idf!10928
2020-10-26 11:24:30 +08:00
e10e25981b Merge branch 'bugfix/fix_tsf_bug_v4.2' into 'release/v4.2'
WiFi: fix tsf bug (backport v4.2)

See merge request espressif/esp-idf!10947
2020-10-26 11:21:11 +08:00
4fbfac2670 Merge branch 'feature/move_auto_test_script_to_new_repo_4.2' into 'release/v4.2'
ci: move auto_test_script to new repo (backport 4.2)

See merge request espressif/esp-idf!10877
2020-10-24 09:24:38 +08:00
f12808533d ci: move auto_test_script to new repo (backport 4.2) 2020-10-24 09:24:38 +08:00
d5871e9602 Merge branch 'bugfix/ipv6_ping_error_when_src_ip_miss_for_4.2' into 'release/v4.2'
lw-ip:bugfix ipv6 ping error when src ip miss for 4.2(backport 4.2)

See merge request espressif/esp-idf!10932
2020-10-23 11:28:42 +08:00
489c0b9aac Merge branch 'feature/esp32s2_bootloader_random_v4.2' into 'release/v4.2'
bootloader_support: Enable RNG entropy source for ESP32-S2 (v4.2)

See merge request espressif/esp-idf!10882
2020-10-22 23:08:11 +08:00
e05164cb4f CI: Only run check_doc_links if we actually deployed
Update the check_doc_links job run conditions to match
github/doc deploy as a lot of the links link to github files.
2020-10-22 18:26:46 +08:00
84e5aef540 fix TCP retransmission interval 2020-10-22 16:53:00 +08:00
3c3bff6ebb esp_wifi: Fixed the bug for timestamp check, didn't disconnect AP when AP's timestamp decrease abnormally 2020-10-22 15:12:50 +08:00
2592a0534d bootloader: Secure_boot name replaced by secure_boot_v1 & secure_boot_v2
- espefuse.py burn_key secure_boot is no longer used.
- Secure boot V1: espefuse.py burn_key secure_boot_v1 file.bin
- Secure boot V2: espefuse.py burn_key secure_boot_v2 file.bin
2020-10-22 05:57:46 +00:00
6692f4119e bugfix ipv6 ping error when src ip miss for 4.2 2020-10-21 20:52:06 +08:00
379624de53 esp_wifi: Add WPS Reason code in all failures 2020-10-21 17:09:36 +05:30
b34c658554 esp32s2: Use regi2c registers to enable bootloader RNG 2020-10-21 15:09:22 +11:00
87247d5672 Merge branch 'bugfix/adc_dma_test_value_4.2' into 'release/v4.2'
adc_test: fix the failure caused by low expected middle value (v4.2)

See merge request espressif/esp-idf!10887
2020-10-20 11:03:15 +08:00
c0a9ef0e1d esp_idf_version.h: Add __ASSEMBLER__ flag to fix build failure with assembly files 2020-10-19 13:21:26 +05:30
9f0f753a48 Merge branch 'bugfix/fix_i2s_reset_issue_v4.2' into 'release/v4.2'
driver(I2S): Fix I2S reset issue for release/v4.2

See merge request espressif/esp-idf!9582
2020-10-19 15:40:03 +08:00
978b54796f tools: fix path handling errors in gen_esp_err_to_name.py for Windows
Exclude paths that were specified with slash as a path separator were compared
as strings. This would fail on Windows which uses backslash as a path separator.
2020-10-19 14:17:19 +08:00
68141a8844 adc_test: fix the failure caused by low expected middle value 2020-10-19 11:11:34 +08:00
882e924629 esp_ble_mesh: api: fixed comment about autoresp 2020-10-19 11:00:55 +08:00
3cdf0aa18a esp32s2: Enable 8M clock source for RNG also
Either of these options is sufficient to pass dieharder test suite with
bootloader random output, having both enabled is a bonus.
2020-10-19 10:24:37 +11:00
0c320bfb0e esp32s2: Support bootloader_random_enable() 2020-10-19 10:24:37 +11:00
f0e87c933a Merge branch 'spi_dma_close_before_cpu_reset_v4.2' into 'release/v4.2'
spi: fix issue with closing DMA before CPU reset (4.2)

See merge request espressif/esp-idf!10811
2020-10-17 23:37:29 +08:00
33443d80af Merge branch 'bugfix/spi_master_multiple_dev_with_diff_cs_lvl_4.2' into 'release/v4.2'
spi_master: correctly set cs polarity (4.2)

See merge request espressif/esp-idf!10391
2020-10-17 09:27:24 +08:00
ae0bec8de0 Merge branch 'bugfix/fix_adc-dma_reading_gap_for_esp32_backport_v4.2' into 'release/v4.2'
bugfix(adc): missing ranges of ADC-DMA codes in ESP32 (backport v4.2)

See merge request espressif/esp-idf!10670
2020-10-17 09:21:38 +08:00
eb540e3efa Merge branch 'bugfix/pcnt_interrupt_clear_v4.2' into 'release/v4.2'
pcnt: fix bug in clear interrupt status (v4.2)

See merge request espressif/esp-idf!10694
2020-10-16 14:51:17 +08:00
189a2991b7 Merge branch 'doc/adc_grammar_stuff_backport_v4.2' into 'release/v4.2'
Bugfix(doc): minor modifications in the adc section  (backport v4.2)

See merge request espressif/esp-idf!10657
2020-10-16 14:42:36 +08:00
95f353949a bugfix(adc): missing ranges of ADC codes in ESP32 2020-10-16 06:34:46 +00:00
3fa779b463 driver(I2S): Fix I2S reset issue for release/v4.2
`i2s_start` reseting I2S in incorrect order causeing the word-order error.
2020-10-16 06:32:13 +00:00
4c7dca7105 spi: fix issue with closing DMA before CPU reset 2020-10-16 06:00:18 +00:00
3dd5b574ee spi_master: correctly set cs polarity
All devices must be added to the same spi line before use.
2020-10-16 05:53:24 +00:00
a88c479160 cmake: Log the project sdkconfig path as part of normal CMake status output
As discussed in footnote to https://github.com/espressif/esp-idf/issues/5251#issuecomment-625563782
2020-10-16 10:11:39 +11:00
2a7dfb2320 examples: Move idf_as_lib sdkconfig file to the project directory
Also add some explanation about configuring the project in the README

Previously with the default build-esp32.sh script, the build directory was
deleted and recreated so the project would always be built with default config.
2020-10-16 10:11:39 +11:00
df5399cfb5 esp32s2: Fix missed features CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP and CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
Defines the correct size for RTC fast memory (the same as for ESP32).

Closes: IDF-1800
2020-10-15 22:33:12 +00:00
e5fe4ffb08 Merge branch 'feature/support_access_internal_i2c_register_backport_v4.2' into 'release/v4.2'
feature(rtc): add new APIs support access internal i2c register (backport v4.2)

See merge request espressif/esp-idf!10662
2020-10-16 06:32:04 +08:00
lly
2724e02faf ble_mesh: stack: Add mesh device properties v2 definitions
Also fixes wrong characteristic value length of some device
properties.
2020-10-15 12:17:54 +00:00
lly
3c1922864d ble_mesh: stack: Move device property to model common part 2020-10-15 12:17:54 +00:00
lly
86af10c529 ble_mesh: stack: Make mesh buf debug option invisible 2020-10-15 11:48:59 +00:00
lly
c0678d65da ble_mesh: stack: Use settings_core_erase when deinit 2020-10-15 11:48:14 +00:00
lly
2c8fc5f5d6 ble_mesh: stack: Fix storing next net_idx and app_idx 2020-10-15 11:48:14 +00:00
lly
5708d4a4e1 ble_mesh: stack: Continue restore even if failure happens
Previously we have used this solution for node info
restore. Here use the same solution for other mesh
information restore.
2020-10-15 11:48:14 +00:00
lly
094eeaf346 ble_mesh: stack: Split model settings store and clear 2020-10-15 11:48:14 +00:00
lly
c06ce57687 ble_mesh: stack: Erase netkey and appkey with key index 2020-10-15 11:48:14 +00:00
lly
ea0ff4e6d1 ble_mesh: stack: Add clear hb_pub in settings 2020-10-15 11:48:14 +00:00
lly
365c17614b ble_mesh: stack: Transport rx reset settings update
When reset the rx info of transport layer, the
rpl list will always cleared, and rpl stored
in the nvs will only be erased when erase flag
is true and BLE_MESH_SETTINGS is enabled.
Compared with the previous solution, it should
be more clear.
2020-10-15 11:48:14 +00:00
lly
3b9057311b ble_mesh: stack: Use erase settings functions 2020-10-15 11:48:14 +00:00
lly
2459b625f1 ble_mesh: stack: Use mutex for settings operation
Also expose the settings functions with the parameter
bt_mesh_nvs_handle_t, which will be used for further
updates.
2020-10-15 11:48:14 +00:00
lly
a47e89c4e4 ble_mesh: stack: Add role check before enabling device 2020-10-15 11:48:14 +00:00
lly
4b70056966 ble_mesh: stack: Define a type for mesh nvs handle 2020-10-15 11:48:14 +00:00
lly
147db2f700 ble_mesh: ci: Enable settings in sdkconfig.ci.xxx 2020-10-15 11:48:14 +00:00
514389681c examples: fix flash encryption example test
Commit 5e8795eebe has changed the partition table offset, which
has resulted in the ciphertext not matching the one expected in the
example test.
Fix by calculating the ciphertext using espsecure.py.
2020-10-15 18:39:45 +08:00
f5475db6e1 example/flash_encryption: Fix partition table and sdkconfig.defaults
When the flash encryption is enabled then we do not need to change the partition table.
The partition_example.csv should not have fixed offsets for partitions because we want to move the whole table.
The fixed offsets in the table were cleared.
2020-10-15 18:36:17 +08:00
9fe1469c70 components/bt: Fix waking up fail while sleeping 2020-10-15 09:13:22 +00:00
f64d0ec873 components/bt: Make sleep avaliable in hli(for future use) 2020-10-15 09:13:22 +00:00
292e396846 Merge branch 'bugfix/spi_flash_yield_coredump_v4.2' into 'release/v4.2'
spi_flash: don't call vTaskDelay in non-os context (v4.2)

See merge request espressif/esp-idf!10297
2020-10-15 15:10:51 +08:00
747c9a4e44 Merge branch 'bugfix/returns_correct_flash_encryption_mode_v4.2' into 'release/v4.2'
bootloader: Fix esp_get_flash_encryption_mode() (v4.2)

See merge request espressif/esp-idf!10712
2020-10-15 15:06:42 +08:00
9316961219 esp-cryptoauthlib: Update submodule pointer to add a new feature. 2020-10-15 05:16:38 +00:00
bbef823a20 feature(rtc): rename i2c_xxx to regi2c_xxx 2020-10-15 03:34:59 +00:00
d337559a17 rtc: support access internal i2c register 2020-10-15 03:34:59 +00:00
af7d6f4d89 bootloader: Fix esp_get_flash_encryption_mode(). RELEASE = (CRYPT_CNT == max) or (CRYPT_CNT.write_protect == true)
If the CRYPT_CNT efuse is max it means the same as a write protection bit for this efuse.

Closes: https://github.com/espressif/esp-idf/issues/5747
2020-10-15 02:36:04 +00:00
7d8d2b982e Merge branch 'feature/oocd_ver_backport_v4.2' into 'release/v4.2'
tools: Updates OpenOCD version to 'v0.10.0-esp32-20200709' (backport v4.2)

See merge request espressif/esp-idf!8971
2020-10-15 02:55:08 +08:00
eabd01e2ab docs: Add profile file name used by zsh shell 2020-10-14 07:31:34 +00:00
3f011513b8 VSCode Extension Setup Guide 2020-10-14 07:22:09 +00:00
b25f3cd524 docs: Add explanation of hello_world folder contents (v4.2) 2020-10-14 07:22:09 +00:00
57ce9c2f06 Merge branch 'bugfix/bootloader_anti_rollback_mmap_v4.2' into 'release/v4.2'
bootloader_support: fix issue in memory mapping for getting app descriptor (v4.2)

See merge request espressif/esp-idf!10734
2020-10-14 10:44:00 +08:00
4b5146a4ad test_apps: add build test for !CONFIG_SPI_FLASH_YIELD_DURING_ERASE 2020-10-14 02:42:46 +00:00
7092be7422 test_apps: add coredump tests for int_wdt 2020-10-14 02:42:46 +00:00
4baf399f10 spi_flash: don't call vTaskDelay in non-os context
Fixes regression in core dump, when a crash happens in interrupt
context.
2020-10-14 02:42:46 +00:00
489f5c38b4 Merge branch 'bugfix/deepsleep_flush_uarts_correct_v4.2' into 'release/v4.2'
esp32s2/soc: Fix periph_ll_periph_enabled (v4.2)

See merge request espressif/esp-idf!10711
2020-10-14 10:42:13 +08:00
805a4d9b3f Merge branch 'bugfix/prov_retry_failures_v4.2' into 'release/v4.2'
ci: Add retries for all provisioning methods, some refactors (v4.2)

See merge request espressif/esp-idf!9387
2020-10-14 10:41:42 +08:00
8c7a8f146b Merge branch 'bugfix/embed_file_symbol_names_v4.2' into 'release/v4.2'
cmake: fix C identifier generation from embedded file (v4.2)

See merge request espressif/esp-idf!10664
2020-10-14 10:41:12 +08:00
359b6af07c Merge branch 'bugfix/UT_001-parallel-count' into 'release/v4.2'
Increase count of parallel jobs to get UT_001 run through CI

See merge request espressif/esp-idf!10799
2020-10-14 10:40:40 +08:00
304ed67982 tools/docker: Add libpython2.7 in order to satisfy GDB dependencies
It was not possible to run xtensa-esp32-elf-gdb from container due to
missing libpython2.7 library.

Merges https://github.com/espressif/esp-idf/pull/5817
Closes https://github.com/espressif/esp-idf/issues/5284
2020-10-13 16:12:21 +00:00
09714a4f11 ci: add job for unit tests 2020-10-12 16:25:17 +02:00
f871186da3 idf.py: Fixed gdb target to exit cleanly when no openocd watch task
When idf.py gdb starts, it expects openocd was started in the background
and creates a thread to watch for openocd errors. when gdb target exits,
the debug_ext.py aims to cleanup all threads and processes, but fails
with traceback if openocd-watch thread not available, which could happen
if openocd started separately.
2020-10-12 13:30:15 +02:00
e5d252f7cf Increase count of parallel jobs to get UT_001 run through CI 2020-10-12 15:13:28 +08:00
d67e284c8d NimBLE: host_rcv_pkt event buf size check.
Check if the size of HCI event buffer is greater than the received HCI
packet. If not then abort with the error message.
2020-10-09 09:28:51 +05:30
e849a77675 Merge branch 'bugfix/ci_auto_checkout_revision_of_project_used_in_ci_v4.2' into 'release/v4.2'
CI: get git describe from annotated tags (v4.2)

See merge request espressif/esp-idf!10673
2020-10-08 16:44:55 +08:00
22a6e2160f Merge branch 'bugfix/secure_boot_v2_ota_verification_v4.2' into 'release/v4.2'
Secure Boot V2: Fixes the OTA regression with secure boot in ESP32-V3 (v4.2)

See merge request espressif/esp-idf!10612
2020-10-08 11:22:59 +08:00
16ed6a4574 Merge branch 'feature/switch_from_external_to_interanl_ram_v4.2' into 'release/v4.2'
esp32: Switch SPIRAM stack in esp_restart_noos() to internal stack (v4.2)

See merge request espressif/esp-idf!9966
2020-10-08 11:22:55 +08:00
144f459c81 ci: Check version tags are always annotated
Closes https://github.com/espressif/esp-idf/issues/3114
2020-10-07 13:58:21 +11:00
2e469b52ae build system: Also get IDF version from annotated tags only
Builds on previous commit.

Note: Getting the project version still pases --tags so still works with plain
tags, to keep compatibility for existing projects
2020-10-07 13:58:21 +11:00
93aeac9728 bootloader_support: fix issue in memory mapping for getting app descriptor
For getting secure_version field in anti rollback case, bootloader tries
to map whole firmware partition but fails for cases where partition size
is beyond available MMU free pages capacity.

Fix here ensures to map only required length upto application descriptor
size in firmware partition.

Closes https://github.com/espressif/esp-idf/issues/5911
2020-10-06 08:49:49 +05:30
be0444bf54 esp32s2/soc: Fix periph_ll_periph_enabled
Logs, before to go the deepsleep, were not completely flushed.
2020-10-01 03:58:23 +08:00
fcda778a11 CI: get git describe from annotated tags:
we should only parse IDF version from annotated tags
2020-09-30 11:32:25 +08:00
dcb23c0bc8 pcnt: fix bug in clear interrupt status 2020-09-30 11:13:17 +08:00
8223278050 Merge branch 'bugfix/ble_mesh_check_stack_init_v4.2' into 'release/v4.2'
ble_mesh: stack: Check if mesh stack initialized before init vendor client (v4.2)

See merge request espressif/esp-idf!10481
2020-09-30 10:53:56 +08:00
8e62a6992e Merge branch 'optimize/ble_mesh_provisioner_delete_dev_v4.2' into 'release/v4.2'
ble_mesh: stack: Optimize Provisioner delete device function (v4.2)

See merge request espressif/esp-idf!10603
2020-09-30 10:52:48 +08:00
f1e43b274f Merge branch 'bugfix/coex_some_bugfix_about_ble_dyn_prio_v4.2' into 'release/v4.2'
components/coex: Some bugfix about ble dynamic prio v4.2

See merge request espressif/esp-idf!10596
2020-09-30 10:50:15 +08:00
d101b15942 components/coex: Some bugfix about ble dynamic prio
Rewrite ble dynamic prio to fix ble disconn in conn_param_update/channel_map_update
Rewrite ble dynamic prio in connection establishment
Fix ble dynamic prio with latency
Fix status bit set error when conn fail
2020-09-29 14:12:39 +08:00
c5bb6c467f Merge branch 'bugfix/update_esp32_phy_v4500_v4.2' into 'release/v4.2'
esp_wifi: update esp32 phy v4500 (v4.2)

See merge request espressif/esp-idf!10624
2020-09-29 13:59:45 +08:00
lly
11108393f1 ble_mesh: stack: Optimize Provisioner delete device function
Since we have provided separate functions for deleting node
information with node's unicast address, device uuid, etc.
So we update the behavior of this function, which will only
be used to delete device information which is not provisioned
or just under provisioning.
2020-09-29 03:41:29 +00:00
lly
d312651c5c ble_mesh: stack: Check if mesh stack initialized before init vendor client 2020-09-29 03:41:19 +00:00
17fca6235b Merge branch 'bugfix/add_clear_bond_complete_evt_4_2' into 'release/v4.2'
componenet_bt/bugfix: add remove bond device complete event 4.2

See merge request espressif/esp-idf!10651
2020-09-29 11:15:55 +08:00
61e6e718e4 Merge branch 'bugfix/bredr_bugfix_release_for_qa_dummy_disconnect_4_2' into 'release/v4.2'
Bugfix/bredr bugfix release for qa dummy disconnect 4.2

See merge request espressif/esp-idf!10645
2020-09-29 11:15:30 +08:00
d7317eaae1 Merge branch 'bugfix/channel_map_send_time_v4.2' into 'release/v4.2'
component/bt: Insert the llcp packet to the top of the tx_preg linked list.(backport 4.2)

See merge request espressif/esp-idf!10178
2020-09-29 10:40:26 +08:00
cb6299200c doc/adc: modifications in the adc documentation and adc headers 2020-09-28 21:55:42 +08:00
a63bdf782f Merge branch 'bugfix/fix_dac_dma_driver_and_ut_backport_v4.2' into 'release/v4.2'
Driver(dac): fix DAC-DMA driver and unit test (backport v4.2)

See merge request espressif/esp-idf!10216
2020-09-28 21:43:11 +08:00
cf16ae573c Merge branch 'cherry-pick-7876d7f5' into 'release/v4.2'
driver(adc): add adc-dma code for esp32   (backport v4.2)

See merge request espressif/esp-idf!10212
2020-09-28 21:11:11 +08:00
d41f856576 cmake: fix C identifier generation from embedded file 2020-09-28 21:08:56 +08:00
847a697c93 Driver(dac): fix DAC-DMA driver and unit test 2020-09-28 19:35:07 +08:00
2d90885e09 components/bt: Replace task post with btc_inter_profile_call, when post message from btc_dm to btc_gap 2020-09-28 15:09:37 +08:00
2b4fae912c components/bt: Fix clear bond fail when connected without ble included 2020-09-28 14:57:27 +08:00
fba62f5e2e add remove bond device complete event 2020-09-28 14:56:42 +08:00
cfa6db0fee esp_wifi: update esp32 phy v4500 (v4.2)
improve frequence offset feature.
2020-09-28 14:27:34 +08:00
0aaa7ffc28 Merge branch 'bugfix/fix_some_wifi_bugs_0924_v4.2' into 'release/v4.2'
esp_wifi: fix some wifi bugs 0924 (v4.2)

See merge request espressif/esp-idf!10648
2020-09-28 14:23:23 +08:00
5bdded29a1 Merge branch 'bugfix/provisioning_example_warning_with_O2_optimization_v4.2' into 'release/v4.2'
provisioning: use memcpy instead of strncpy for copying SSID (v4.2)

See merge request espressif/esp-idf!10494
2020-09-28 12:44:41 +08:00
7f8c121791 1.revert dummy command
2.fix send MEDIA_CTRL command in disconnect
2020-09-28 10:42:02 +08:00
a6cdf4ed1e 1.fix test case dummy
2.fix sink send media control ESP_A2D_MEDIA_CHECK_SRC_RDY
2020-09-28 10:41:53 +08:00
314960ae31 Merge branch 'bugfix/window_spill_a0_corruption_v4.2' into 'release/v4.2'
freertos: don't clobber a4 while spilling register windows (backport v4.2)

See merge request espressif/esp-idf!10305
2020-09-28 09:15:14 +08:00
466cd7ba22 esp_wifi:
1. Modify LR for esp32 and esp32s2
2. Fix esp32s2 RTS rate
3. Optimize some debug logs for probe response
4. Optimize phy and soc files
5. Add IPv6 DSCP
6. Fix classify AC to TID
7. Fix the bug that no event for connect
2020-09-27 19:50:58 +08:00
81bbc8c88d Merge branch 'doc/esp32s2_jtag_guide_v4.2' into 'release/v4.2'
docs: update JTAG debugging guide for ESP32-S2 (backport v4.2)

See merge request espressif/esp-idf!10311
2020-09-27 14:37:40 +08:00
4b10685fcc Merge branch 'doc/remove_lts_versions_v4.2' into 'release/v4.2'
docs: Update Versions file in line with the latest Support Policy document (v4.2)

See merge request espressif/esp-idf!10599
2020-09-27 14:31:31 +08:00
34209a30bd Merge branch 'feature/docs-add-python-clean_v4.2' into 'release/v4.2'
docs: Add solution for ImportError in idf.py into the documentation (v4.2)

See merge request espressif/esp-idf!10630
2020-09-27 14:27:11 +08:00
123aaf2280 Merge branch 'bugfix/fix_some_wifi_bugs_0916_v4.2' into 'release/v4.2'
eps_wifi: Fix some wifi bugs (backport v4.2)

See merge request espressif/esp-idf!10475
2020-09-27 11:17:53 +08:00
2db55a3b90 Merge branch 'bugfix/add_disconn_req_action_when_no_link_4.2' into 'release/v4.2'
Bugfix/add disconn req action when no link 4.2

See merge request espressif/esp-idf!10508
2020-09-27 11:17:43 +08:00
50e2d0b32d docs: add description of python-clean command 2020-09-27 00:03:38 +02:00
60e4c02963 ci: add unit test job 2020-09-25 16:29:58 +00:00
e2cb7ed9ca Revert "CXX: removed exception windowspill test"
This reverts commit f3e180de72.
2020-09-25 16:29:58 +00:00
f4ab2beaa8 freertos: don't clobber a4 while spilling register windows
Commit 891eb3b0 was fixing an issue with PS and EPC1 not being
preserved after the window spill procedure. It did so by saving PS in
a2 and EPC1 in a4. However the a4 register may be a live register of
another window in the call stack, and if it is overwritten and then
spilled to the stack, then the corresponding register value will end
up being corrupted. In practice the problem would show up as an
IllegalInstruction exception, when trying to return from a function
when a0 value was 0x40020.
Fix by using a0 register instead of a4 as scratch. Also fix a comment
about xthal_save_extra_nw, as this function in fact doesn't clobber
a4 or a5 because XCHAL_NCP_NUM_ATMPS is defined as 1.

Closes https://github.com/espressif/esp-idf/issues/5758
2020-09-25 16:29:58 +00:00
df301b89ec component/bt: Fix assert(9, 10), Insert the llcp packet to the top of the tx_preg linked list 2020-09-25 18:43:14 +08:00
a04d6e7f63 Secure Boot V2: Fixes the OTA regression with secure boot in ESP32-V3
Closes https://github.com/espressif/esp-idf/issues/5905
2020-09-25 14:21:07 +05:30
c7d602cc62 Merge branch 'bugfix/adjtime_return_outdelta_before_new_delta_set_v4.2' into 'release/v4.2'
newlib: Fix adjtime, returns the amount of time remaining from any previous adjustment (v4.2)

See merge request espressif/esp-idf!9971
2020-09-25 08:03:11 +08:00
6443a96834 Merge branch 'backport/shared_stack4.2' into 'release/v4.2'
Backport/shared stack4.2

See merge request espressif/esp-idf!10303
2020-09-25 08:02:55 +08:00
f817747727 Merge branch 'bugfix/efuse_test_stackoverflow_v4.2' into 'release/v4.2'
CI: Increase stack size for efuse unit test (Backport v4.2)

See merge request espressif/esp-idf!10543
2020-09-25 08:02:31 +08:00
dbdb1c1c23 docs: Update Versions file in line with the latest Support Policy document 2020-09-25 09:59:56 +10:00
7402e17838 Merge branch 'bugfix/openss_strict_verify_mode' into 'release/v4.2'
openssl: made verification mode conversion to mbetls modes more strict (v4.2)

See merge request espressif/esp-idf!10499
2020-09-25 07:40:52 +08:00
e610df5870 Merge branch 'bugfix/esp32s2_panic_handler_iram_v4.2' into 'release/v4.2'
esp_common: allow placing panic handler into IRAM on ESP32-S2 (v4.2)

See merge request espressif/esp-idf!10295
2020-09-25 07:40:06 +08:00
6a711671c6 Merge branch 'bugfix/spinlock_coredump_regressions_v4.2' into 'release/v4.2'
Revert "Merge branch 'feature/gdb_stub_task_state' into 'master'" (backport v4.2)

See merge request espressif/esp-idf!10296
2020-09-25 07:33:05 +08:00
3b400767f3 Merge branch 'bugfix/idf_py_disable_cmake_warnings_default_v4.2' into 'release/v4.2'
idf.py: disable cmake uninitialized variable warnings by default (v4.2)

See merge request espressif/esp-idf!10201
2020-09-25 07:32:22 +08:00
4ffe6c096a Merge branch 'bugfix/esp32s2_o2_op_v4.2' into 'release/v4.2'
freertos: fix build error at -O2 optimization level (v4.2)

See merge request espressif/esp-idf!10301
2020-09-25 07:31:58 +08:00
f536db1782 Merge branch 'feature/secure_boot_esp32s2_v4.2' into 'release/v4.2'
Feature/secure boot esp32s2 v4.2

See merge request espressif/esp-idf!9958
2020-09-25 07:31:45 +08:00
dd29046e88 Merge branch 'bugfix/can_mmap_after_get_enough_free_mmu_pages_v4.2' into 'release/v4.2'
flash_mmap: can mmap after get enough free MMU pages (backport v4.2)

See merge request espressif/esp-idf!10584
2020-09-24 22:36:51 +08:00
fd2e2ac34f doc: Getting Started Guide, remove shortcuts to 'build toolchain from scratch' instructions 2020-09-24 18:32:50 +08:00
0831d06dee Fix ccache documentation: environment variable is IDF_CCACHE_ENABLE
Merges https://github.com/espressif/esp-idf/pull/5753
2020-09-24 05:20:33 +00:00
722d67ea36 idf.py: Disable CMake --warn-uninitialized option by default
Can still be enabled by passing --cmake-warn-uninitialized on the command line

Prevents CMake warnings printed by default if IDF_PATH is underneath the CMake
project directory.

The reason for this is that CMake --warn-uninitialized only enables checks
inside the project directory (ie top-level CMakeLists.txt directory and
subdirectories), it doesn't enable for files included from other directories.

(The only way to enable warnings in other directories is to pass
--check-system-dirs and this looks like it's only useful for CMake's own
developers as it prints a lot of warnings from inside CMake otherwise - see
https://gitlab.kitware.com/cmake/cmake/-/issues/19645 )

Plan to follow up with a later commit to clean up most of the warnings (which
aren't problems for CMake execution), but we'll also disable this option by
default to avoid this unexpected triggering of IDF warnings.
2020-09-24 05:20:33 +00:00
3c2fd749f0 Merge branch 'bugfix/wifi_create_and_start_ap_v4.2' into 'release/v4.2'
Set default AP handlers in wifi_create_and_start_ap() v4.2

See merge request espressif/esp-idf!10458
2020-09-24 12:36:50 +08:00
7b30e467b4 Merge branch 'bugfix/confirmed_bugfix_from_baidu_proj_4.2' into 'release/v4.2'
Confirmed bugfix from Baidu project 4.2

See merge request espressif/esp-idf!10544
2020-09-24 12:31:52 +08:00
009956c5a7 Merge branch 'bugfix/wifi_spin_lock_allocation_in_PSRAM_v4.2' into 'release/v4.2'
wifi: Fix spin lock allocation in PSRAM bug(v4.2)

See merge request espressif/esp-idf!10553
2020-09-24 12:31:14 +08:00
88faf37a59 Merge branch 'bugfix/ipv6_send_data_error_when_src_ip_miss_for_4.2' into 'release/v4.2'
lw-ip:ipv6 send multicast data fail when src address is null (backport 4.2)

See merge request espressif/esp-idf!10558
2020-09-24 12:30:35 +08:00
03a749a60e flash_mmap: restore interrupt and cache before err return 2020-09-24 09:49:39 +08:00
98ce1fa080 flash_mmap: can mmap after get enough free MMU pages 2020-09-24 09:49:39 +08:00
9f0c564de4 Merge branch 'feature/toolchain_2020r3_v4.2' into 'release/v4.2'
Update toolchain to esp-2020r3 (backport v4.2)

See merge request espressif/esp-idf!10388
2020-09-23 20:26:24 +08:00
07bfb7cac9 freemodbus: fix event processing failure after destroy
Closes https://github.com/espressif/esp-idf/issues/5275
2020-09-23 07:04:52 +00:00
2d63354ec8 Secure Boot: Fixes the cpp macro in esp32 secure boot rom functions.
Closes https://github.com/espressif/esp-idf/issues/5878
2020-09-23 03:01:51 +05:30
fd083f1e44 ipv6 send multicast data fail when src address is null for 4.2 2020-09-22 17:33:02 +08:00
c06f0738c9 Fix spin lock allocation in PSRAM bug 2020-09-22 14:36:36 +08:00
311d43d021 eps_wifi: Fix some wifi bugs
1. Drop receiving packets from myself
2. scan: Fix scan issue with WPA2-PSK-SHA256 AP
2020-09-22 14:23:43 +08:00
190f310ed1 docs: seperate build_docs html and pdf CI jobs
Due to eager_exclude, Sphinx jobs cannot use the doc cache (doctrees).

PDF and HTML building are now seperate CI jobs to avoid this issue.
PDF building will only be ran on deploy branches and when started
with build_docs tag to reduce CI load
2020-09-22 14:04:12 +08:00
d12eb31f42 CI: Increase stack size for efuse unit test
"Batch mode is thread-safe" case would occasionally cause a stackoverflow.
Increased stack size.
2020-09-22 11:54:08 +08:00
b7d4868a70 Confirmed bugfix from Baidu project 2020-09-22 11:44:09 +08:00
071dc73954 NVS: ensuring default partition
* Also added encryption keys to CMakeLists.txt

Closes https://github.com/espressif/esp-idf/issues/5347
Closes IDFGH-3372
2020-09-21 12:44:57 +08:00
8749c46284 esp_common: allow placing panic handler into IRAM on ESP32-S2 2020-09-18 15:35:48 +00:00
278030ff3e add file stream parameter and log stdout and stderr to same stream 2020-09-18 10:38:33 +02:00
84cda60478 Redesign separating AVRC & A2DP
1. Add g_av_with_rc to avrc_tg_init function
2. Remove g_av_open_fail
3. Add comment in API files
4. Add a2dp init & deinit state variable to inidcate a2dp statement
2020-09-18 14:09:27 +08:00
e940e1d72a Add global header and change declaration position 2020-09-18 14:09:19 +08:00
b16deb4473 Remove uneccessary macro
Separate AVRC from A2DP when AVRC not Initialized
2020-09-18 14:09:10 +08:00
306c978195 Rewrite a2dp clean_up function 2020-09-18 14:09:02 +08:00
59234501dd Add bda_addr for esp_bt_a2dp_disconn_req API
1. Add reaction for a2dp snk & src disconn req when no link up
  2. Change state machine set before EVT upto APP layer in some cases
  3. Add bool open_fail to choose whether post disconnection evt to app layer
2020-09-18 14:08:53 +08:00
26481c4a9d toolchain: C++ exception workaround
* disable C++ exception FDE sorting (saves RAM)

Closes IDF-1128
2020-09-18 12:32:34 +07:00
88a62e8ae5 Update toolchain to esp-2020r3
Fixup more for PSRAM issue;
    Allow GDB work correctly with Privileged Registers;
    Based on GCC 8.4.0;
    Update a fix of C++ exception crashs from the GCC mainline;
    Fixup strptime_l() and some locale in libc;
2020-09-18 12:32:34 +07:00
83ec35f185 tool: Fix 'idf.py bootloader' error if Secure Boot is enabled
If Secure Boot is enabled, there's no bootloader flasher arguments in the
project (to encourage careful manual flashing), so this command would
fail with a KeyError.
2020-09-18 04:05:28 +05:30
223f800dd7 expression_with_stack: added a tweak on TCB stackpointers to avoid false trigger of stack overflow 2020-09-17 20:46:02 +00:00
3e9637a893 test/shared_stack_printf: improved printf with shared stack function test 2020-09-17 20:46:02 +00:00
a6f0b15d3e Revert "Merge branch 'feature/gdb_stub_task_state' into 'master'"
This reverts commit c41a0c1907, reversing
changes made to 5c1d317766.
2020-09-17 17:04:48 +00:00
521eee7384 openssl: made verification mode conversion to mbetls modes more strict 2020-09-17 13:22:36 +02:00
6d37ad39aa provisioning: use memcpy instead of strncpy for copying SSID
Per WiFi library requirement, SSID can be non-null terminated string
if its length goes to 32 bytes (maximum). Use of strncpy in this case,
along with compiler optimization level -O2 results in some warnings
for potential use of non-null terminated strings.

Fix here ensures use of memcpy to copy SSID string upto appropriate
desired length. This helps to avoid compiler specific workaround
flags added earlier.

Closes https://github.com/espressif/esp-idf/issues/5866
Closes IDFGH-3983
2020-09-17 15:51:32 +05:30
dddcc2ede8 Merge branch 'bugfix/add_protection_for_spp_api_4.2' into 'release/v4.2'
Bugfix/add protection for spp api 4.2

See merge request espressif/esp-idf!10281
2020-09-16 14:06:28 +08:00
21b02a9302 Merge branch 'bugfix/update_esp32_phy_4390_v4.2' into 'release/v4.2'
update esp32 phy 4390.(backport v4.2)

See merge request espressif/esp-idf!10456
2020-09-16 11:57:47 +08:00
17525d6035 Merge branch 'bugfix/cxx_flag_operators_v4.2' into 'release/v4.2'
esp_eth: moved extern "C" after includes (v4.2)

See merge request espressif/esp-idf!10351
2020-09-15 16:12:42 +08:00
a4c3aebc3d Merge branch 'bugfix/ulp_as_version_v4.2' into 'release/v4.2'
ulp: fix ULP assembler version detection for localized systems (v4.2)

See merge request espressif/esp-idf!10393
2020-09-15 15:23:26 +08:00
7187a3a1eb Merge branch 'bugfix/eclipse_make_py3_v4.2' into 'release/v4.2'
tools: Fix Python 3 incompatibility for building with Eclipse on Windows (v4.2)

See merge request espressif/esp-idf!10398
2020-09-15 15:08:26 +08:00
86b07ef098 Merge branch 'bugfix/fix_ipv6_nd6_max_queue_num_4.2' into 'release/v4.2'
lw-ip IPv6 ND6 queue too much pkts(Backport v4.2)

See merge request espressif/esp-idf!10091
2020-09-15 15:07:03 +08:00
ac016da8ab Merge branch 'bugfix/bootloader_skip_verify_jtag_v4.2' into 'release/v4.2'
bootloader_support: don't check signature when JTAG is attached, fix signed partition table generation (v4.2)

See merge request espressif/esp-idf!10378
2020-09-15 14:58:01 +08:00
ddedf25ca8 Set default AP handlers in wifi_create_and_start_ap() v4.2 2020-09-15 14:54:46 +08:00
7d57165922 Update to compatible crc & SBv2 enable check api's 2020-09-15 11:29:26 +05:30
d72350c0ce ci: Add test apps for ESP32-S2 Secure Boot 2020-09-15 11:23:51 +05:30
1c6c6eceb5 secure boot: Fixes for ESP32-S2 first boot logic 2020-09-15 11:23:51 +05:30
e7b1640c77 Split unit test configs to fit into ESP32s2's memory 2020-09-15 11:23:51 +05:30
762e8d5f84 bootloader esp32s2: Fix return type of ROM function signature verification 2020-09-15 11:23:51 +05:30
9856198112 bootloader esp32s2: Increase bootloader DRAM & IRAM allowance
Bootloader DRAM now ends at 0x3FFEAB00 which is the start of ROM
static RAM (reclaimable after app is running).

IRAM loader segment increased by 8KB.

Available total static RAM for the app is now reduced by 16KB.
2020-09-15 11:23:51 +05:30
b05213c327 Docs: Secure boot v2 support for ESP32-S2 2020-09-15 11:23:51 +05:30
0f82fe105c Secure boot v2 support for ESP32-S2 2020-09-15 11:23:51 +05:30
c4f4e15cc7 Merge branch 'cherry-pick-4dcaa0e6-3' into 'release/v4.2'
wpa_supplicant: Deinit wpa2 states in wifi deinit(backport v4.2)

See merge request espressif/esp-idf!10163
2020-09-15 12:06:49 +08:00
2cf032a4b6 update esp32 phy 4390.(backport v4.2) 2020-09-15 10:54:41 +08:00
a5907ee3fe lwip: fix IPv6 ND6 queue too much pkts cause no mem issue and add menuconfig item for this params. 2020-09-14 21:06:38 +08:00
ef0db6f034 ci: Use git mirror for docker image 2020-09-14 12:49:05 +02:00
b132ab2091 Merge branch 'bugfix/add_return_in_uart_wait_tx_done_bp4.2' into 'release/v4.2'
bugfix(UART): Add return in uart_wait_tx_done(backport v4.2)

See merge request espressif/esp-idf!10335
2020-09-14 14:26:00 +08:00
ced340a1a3 Merge branch 'bugfix/ci_ulp_adc_more_info_v4.2' into 'release/v4.2'
CI: Fix regex in ulp_adc example test (v4.2)

See merge request espressif/esp-idf!10431
2020-09-13 17:26:53 +08:00
4e27122ee5 CI: Fix regex in ulp_adc example test 2020-09-12 08:01:53 +02:00
bec2dbcb84 Merge branch 'bugfix/ble_mesh_prov_iv_index_v4.2' into 'release/v4.2'
ble_mesh: stack: Using the latest iv_index for provisioning (v4.2)

See merge request espressif/esp-idf!10416
2020-09-11 20:08:39 +08:00
07acd74b04 Merge branch 'bugfix/get_started_inconsistency_backport_v4.2' into 'release/v4.2'
docs: Add missing target setting in step 7 of Getting Started documentation (Backport v4.2)

See merge request espressif/esp-idf!10405
2020-09-11 19:15:17 +08:00
lly
0fff4d46ec ble_mesh: stack: Using the latest iv_index for provisioning
Provisioner should always uses the latest IV Index for provisioning.
For example, if the current IV Index is 0x00000001, but prov->iv_index
is still initialized with 0x00000000, and if Provisioner uses prov->
iv_index for provisioning, this will cause the Provisioner failing to
control the node.
So here bt_mesh.iv_index is used instead of prov->iv_index.
2020-09-11 10:55:47 +08:00
073e855c73 Merge branch 'bugfix/btdm_spp_null_ptr_with_dynamic_memory_v4.2' into 'release/v4.2'
components/bt: Fix SPP using NULL point with dynamic memory

See merge request espressif/esp-idf!10322
2020-09-10 17:39:14 +08:00
0514496744 Merge branch 'feature/vs_allow_custom_part_4.2' into 'release/v4.2'
Feature/vs allow custom part 4.2

See merge request espressif/esp-idf!9514
2020-09-10 16:09:00 +08:00
d212c4673d tools: Fix Python 3 incompatibility for building with Eclipse on Windows 2020-09-10 09:45:37 +02:00
92ef27223d ulp: fix ULP assembler version detection for localized systems 2020-09-10 09:34:40 +02:00
ef19aac267 docs: Add missing target setting in step 7 of Getting Started documentation 2020-09-10 15:33:08 +08:00
156afc0c05 Merge branch 'bugfix/secure_boot_v2_sign_cmake_copy_v4.2' into 'release/v4.2'
Add platform independent CMake copy during signing (v4.2)

See merge request espressif/esp-idf!9544
2020-09-10 14:41:42 +08:00
c81b139479 Merge branch 'feat/ble_mesh_use_model_c_v4.2' into 'release/v4.2'
ble_mesh: stack: Use model callback for operations [Zephyr] (v4.2)

See merge request espressif/esp-idf!10362
2020-09-10 10:39:33 +08:00
fa33addb4a Merge branch 'bugfix/ble_mesh_remove_assert_v4.2' into 'release/v4.2'
ble_mesh: stack: Avoid using assert in mesh stack (v4.2)

See merge request espressif/esp-idf!10358
2020-09-10 10:38:47 +08:00
1f5f72af67 Merge branch 'bugfix/ble_mesh_nimble_ccc_handle_v4.2' into 'release/v4.2'
ble_mesh: nimble: Fix updating ccc handle with wrong value (v4.2)

See merge request espressif/esp-idf!10354
2020-09-10 10:37:59 +08:00
6f2e465ec9 partition_table: fix generation of signed partition table
Fixes the issue that signed partition table was not generated when
CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES was on, because
partition_table_bin depended on unsigned_partition_bin twice.
Regression from acb7a211.

Also use final_partition_bin variable in esptool_py_flash_target_image
arguments, to avoid issues in the future if final_partition_bin is
changed.
2020-09-09 23:39:51 +02:00
93a3beafb8 bootloader_support: don't check signature when JTAG is attached
If an insecure configuration is enabled (no hardware secure boot, just
software signature check), skip the signature check in bootloader if
JTAG debugger is attached. This allows the debugger to set breakpoints
in Flash before the application runs.

Closes https://github.com/espressif/esp-idf/issues/4734
Closes https://github.com/espressif/esp-idf/issues/4878
2020-09-09 23:39:51 +02:00
0e191cf70e examples/parttool: fix the test to work on parallel test runner
Pass the DUT port to parttool_example.py as an argument.
2020-09-09 18:35:07 +02:00
96ad552245 Merge branch 'feature/mqtt_sub_update_01594bf1_v4.2' into 'release/v4.2'
MQTT: Update submodule reference (Backport v4.2)

See merge request espressif/esp-idf!10230
2020-09-09 20:41:14 +08:00
5a23447452 Merge branch 'bugfix/remove_auto_conn_case_v4.2' into 'release/v4.2'
test: remove auto conn case because we do not support this anymore (v4.2)

See merge request espressif/esp-idf!9940
2020-09-09 15:54:42 +08:00
lly
61bb586244 ble_mesh: stack: Use model callback for operations [Zephyr]
- Previously when a model is initialized or deinitialized, in the
  access layer, we need to check the model id with the ids in the
  table in order to find the proper model operation function.
- Currently all the operation functions of each model will be set
  during the mesh initialization. When the model is found, we can
  directly use the corresponding callback for different operations.
- Currently only init/deinit operations are registered, later we
  will add more operations.
2020-09-09 13:59:32 +08:00
lly
1f9d289ee0 ble_mesh: stack: Avoid using assert in mesh stack 2020-09-09 10:57:07 +08:00
a1c8b21928 esp_eth: moved extern "C" after includes 2020-09-09 10:19:03 +08:00
8b1e3c01a0 Merge branch 'bugfix/doc_main_readme_build_v4.2' into 'release/v4.2'
Fix the setup instructions in the main README (v4.2)

See merge request espressif/esp-idf!10337
2020-09-09 02:44:34 +08:00
lly
4eec2c64ee ble_mesh: nimble: Fix updating ccc handle with wrong value 2020-09-08 21:01:32 +08:00
b356d41bb1 Merge branch 'bugfix/fix_some_wifi_bugs_0902_v4.2' into 'release/v4.2'
Bugfix/fix some wifi bugs 0902 v4.2 (backport v4.2)

See merge request espressif/esp-idf!10246
2020-09-08 18:30:31 +08:00
4663b16779 Fix the setup instructions in the main README 2020-09-08 09:54:46 +02:00
a8a2ea7b38 UART: Add return in uart_wait_tx_done
uart_wait_tx_done quit due to timeout but without return ESP_ERR_TIMEOUT.
2020-09-08 15:00:53 +08:00
2854050835 Merge branch 'bugfix/pip_gdbgui_v4.2' into 'release/v4.2'
fix windows incompatibility with gdbgui>=0.14 (v4.2)

See merge request espressif/esp-idf!10326
2020-09-08 00:07:09 +08:00
1fef76cbce tools: fix windows incompatibility with gdbgui>=0.14
gdbgui intentionally (https://github.com/cs01/gdbgui/pull/346) introduced dependencies that are incompatible with windows, and don't seem to have plans to resolve them anytime soon

Closes https://github.com/espressif/esp-idf/issues/5782
Closes https://github.com/espressif/esp-idf/issues/5787
Merges https://github.com/espressif/esp-idf/pull/5794
2020-09-07 07:55:45 +00:00
ad8b3e4274 components/bt: Fix SPP using NULL point with dynamic memory 2020-09-07 15:44:28 +08:00
ecab1d9b2e Merge branch 'bugfix/l2cap_link_timeout_llcp_prog_btu_wtd_v4.2' into 'release/v4.2'
Bugfix/l2cap link timeout llcp prog btu wtd v4.2

See merge request espressif/esp-idf!10255
2020-09-07 14:11:08 +08:00
1f011c3b2a docs: translate idf.py debug target 2020-09-04 21:59:05 +02:00
8f78db8073 docs: jtag-debugging: update Chinese version 2020-09-04 21:59:05 +02:00
7ae490d908 docs: jtag-debugging: fix ups in English version 2020-09-04 21:59:05 +02:00
b58d74da45 docs: add placeholders for {esp32,esp32s2}.inc in JTAG debugging guide 2020-09-04 21:59:05 +02:00
ead33e155d docs: repurpose WROVER-KIT debugging guide for Kaluga-1 2020-09-04 21:59:05 +02:00
964f041269 tools: idf.py: default to board/esp32s2-kaluga-1.cfg for ESP32-S2
NFC. Kaluga-1 config is same as devkitj + esp32s2.
2020-09-04 21:59:05 +02:00
b7760cf269 docs: minor typos in JTAG debugging section 2020-09-04 21:59:05 +02:00
cfbd2566c1 docs: formatting fix in idf.py debugging section 2020-09-04 21:59:05 +02:00
b513dd11ce docs: move target-specific parts of JTAG guide into include files
{esp32,esp32s2}.inc files contain most of the bits and code snippets
which are different between targets. These bits are included from the
rest of the source files.

Also included is an update to the section about OpenOCD configuration
variables and files. This section wasn't updated when some of the
files and variables got renamed.
2020-09-04 21:59:05 +02:00
b181623d9b freertos: fix compilation warning at -O2 level
Closes https://github.com/espressif/esp-idf/issues/5525
2020-09-04 21:33:49 +02:00
acfe648367 ci: add startup test with -O2 optimization level 2020-09-04 21:33:49 +02:00
73813c6bac freertos: ensure the interrupt stack is aligned
CONFIG_FREERTOS_ISR_STACKSIZE was set to 2100 when ELF core dump was
enabled, which resulted in a non-16-byte-aligned interrupt stack
offset. This triggered "is SP corrupted" check in the backtrace,
terminating the backtrace early.

Fix the default value, and make sure that the stack is always aligned,
regardless of the value of CONFIG_FREERTOS_ISR_STACKSIZE.
2020-09-04 20:45:38 +02:00
c3d2942675 panic: skip over the first invalid PC in case of InstrFetchProhibited
InstrFetchProhibited usually occurs because of a jump to an invalid
pointer. In this case, PC in the exception frame is the address of
the jump destination. 'esp_ptr_executable' check in print_backtrace
function recognizes the first frame as invalid, and the backtrace is
interrupted. This prevents the user from finding the location where
the invalid pointer is dereferenced.

Bypass the 'esp_ptr_executable' check if the exception cause is
InstrFetchProhibited. Update the test case to no longer ignore this
issue.
2020-09-04 20:45:38 +02:00
87d96b2c29 Merge branch 'bugfix/ws_stop_deadlock_v4.2' into 'release/v4.2'
Websocket client: avoid deadlock if stop called from event handler (Backport 4.2)

See merge request espressif/esp-idf!10226
2020-09-04 22:51:46 +08:00
5c8a85e839 Merge branch 'bugfix/ble_mesh_sensor_example_fix_v4.2' into 'release/v4.2'
ble_mesh: example: Fix sensor data wrong iteration (v4.2)

See merge request espressif/esp-idf!10273
2020-09-04 16:54:38 +08:00
a7d52dafa6 component/bt: Fixed the watchdog timeout of btu task during multi-connection 2020-09-04 16:27:03 +08:00
a7ddc9c125 Add protection for rfcomm close API in SPP 2020-09-04 14:40:27 +08:00
07e2d3ab0f Add some debug log for bt:
1. Add logs for SPP not enabled successfully
2. Add information to Applicatioin layer that the A2DP is connecting to peer device

Regular BTC and BTU Task name & Add BTC Init protection

1. Regular the BTC Task Name to Close a Github issue

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

2. Add BTC Init failure protection

3. Regular BTU Task Name with BTC

4. Correct the comment of
   a. SDP_ServiceSearchRequest and SDP_ServiceSearchRequest2
   b. l2cu_create_conn_after_switch

5. Correct comment of esp_bt_hf_vra();

6. Fix cpp compilier region
2020-09-04 14:40:19 +08:00
lly
8fe75ff3ce ble_mesh: example: Fix sensor data wrong iteration 2020-09-04 11:54:52 +08:00
b9f0500641 Merge branch 'bugfix/ws_server_async_send_fin_v4.2' into 'release/v4.2'
http_server example: WebSocket server to set final flag in async messages (v4.2)

See merge request espressif/esp-idf!10087
2020-09-03 14:11:13 +08:00
12633717f7 components/bt: Fixed the state not synchronized between controller and host when disconnected. 2020-09-02 21:43:57 +08:00
ec2262e5a4 http_server: WebSocket server to set flag in transmitted messages by default
Add logic to set `FIN` flag automatically for transmitted WS frames, but
if `fragmented` option set indicating an expert/manual mode, then the
`FIN` flag is set according to the `final` option.
2020-09-02 07:54:29 +00:00
4da38b6769 http_server example: WebSocket server to set final flag in async messages
Closes https://github.com/espressif/esp-idf/issues/5405
2020-09-02 07:54:29 +00:00
a0a0d34da6 Merge branch 'bugfix/ethernet_handle_early_rx_interrupt' into 'release/v4.2'
Bugfix/ethernet handle early rx interrupt (v4.2)

See merge request espressif/esp-idf!10098
2020-09-02 15:52:18 +08:00
d17e6a75e0 espnow/pmf: Implement ESPNOW + PMF Co-existance
H/W decryption of Mgmt frames was disabled for PMF and done through
S/W. If ESPNOW packets go through this path, it affects backward
compatibility since method of decrypting Mgmt packets is different in H/W.

To address PMF + ESPNOW Co-existance, CCMP decryption method is modified
for ESPNOW packets so that they can be decrypted correctly. Since Tx
of ESPNOW packets can still be done in H/W alongside PMF, no change
required in encryption method in S/W.

Co-Authored-By: Nachiket Kukade <nachiket.kukade@espressif.com>
Co-Authored-By: zhangyanjiao <zhangyanjiao@espressif.com>
Co-Authored-By: kapil.gupta <kapil.gupta@espressif.com>
2020-09-02 15:06:51 +08:00
089b78b916 esp_wifi:
1. get primary channel from HT info
2. fix the bug that set_channel doesn't work for softAP when STA connects
2020-09-02 15:04:26 +08:00
ddfb11e1c5 wifi: Fix esp_wifi log levels
Closes https://github.com/espressif/esp-idf/issues/5721
2020-09-02 15:02:52 +08:00
594a196364 esp_wifi: Fix null pointer dereferences in mgmt rx 2020-09-02 14:55:10 +08:00
8757cefeec esp_wifi: add rf test long short support 2020-09-02 14:54:23 +08:00
627a05d80e esp_wifi: optimize WiFi debug log
1. Add esp_wifi_statis_dump()
2. Optimize WiFi related debug log
2020-09-02 14:52:49 +08:00
368d623e1a esp_wifi: optimize WiFi TX performance 2020-09-02 14:44:45 +08:00
9cd0e2fd1a Merge branch 'bugfix/btdm_blufi_data_sequence_not_reset_after_disconnect_v4.2' into 'release/v4.2'
component/bt: fix Blufi sends data after disconnect the seq still increase(backport v4.2)

See merge request espressif/esp-idf!10241
2020-09-02 14:20:49 +08:00
82deea84eb component/bt: fix Blufi sends data after disconnect the seq still increase(backport v4.2) 2020-09-02 11:18:25 +08:00
fb4a75110a Merge branch 'bugfix/touch_sensor_denoise_ci_for_esp32s2_backport_v4.2' into 'release/v4.2'
[High priority] Bugfix/touch sensor denoise ci for esp32s2 (backport v4.2)

See merge request espressif/esp-idf!10211
2020-09-01 21:50:59 +08:00
73fd3608e0 Merge branch 'bugfix/ble_mesh_example_compile_warn_v4.2' into 'release/v4.2'
Bugfix/ble mesh example compile warn (v4.2)

See merge request espressif/esp-idf!10222
2020-09-01 19:16:43 +08:00
86d8f15a9a MQTT: Update submodule reference
SSL: add config option for skipping common name check
esp-mqtt commit: 5e8950e681)
Closes https://github.com/espressif/esp-mqtt/issues/158

SSL: add support for tls with secure element (ATECC608A)
esp-mqtt commit: a7ff9afa3f)
Closes https://github.com/espressif/esp-mqtt/issues/156

Websocket: Allow the query part of the uri to be a part of the path
esp-mqtt commit: 40b06deb10)
Closes https://github.com/espressif/esp-mqtt/issues/161

Config: Add check for consistency between config settings
esp-mqtt commit: 8a412c147d)

Add IDF version check for secure element feature
esp-mqtt commit: db4bce01ab)

Fix esp_mqtt_client_stop deadlock
esp-mqtt commit: 5e17dcaeb2)
Closes https://github.com/espressif/esp-mqtt/issues/163

Add dispatch error event for read errors
esp-mqtt commit: d4aaec08ff
Closes https://github.com/espressif/esp-idf/issues/5704

Cleanup expired messages when offline
esp-mqtt commit: bdadd77c6e
Closes https://github.com/espressif/esp-idf/issues/5668

esp_mqtt_client_publish now returns msg id for QoS > 0 when offline
esp-mqtt commit: f7325bfa10
2020-09-01 15:57:47 +08:00
70a67439bc Websocket client: avoid deadlock if stop called from event handler 2020-09-01 15:30:40 +08:00
lly
528747ac4c ble_mesh: example: Remove some useless included header files 2020-09-01 14:10:27 +08:00
840b7f2de7 Fix compilation warnings about portmacro being already define. 2020-09-01 14:09:41 +08:00
a35ce7f959 Merge branch 'doc/local_build_version_note_v4.2' into 'release/v4.2'
docs: fix version specific note on local build (backport v4.2)

See merge request espressif/esp-idf!10148
2020-08-31 21:13:53 +08:00
f3705832fd Merge branch 'bugfix/add_adc-dma_for_esp32' into 'master'
driver(adc): add adc-dma code for esp32

Closes IDF-1407

See merge request espressif/esp-idf!9139

(cherry picked from commit 7876d7f5a6)

bd92e951 driver(adc): add adc-dma code for esp32
2020-08-31 16:29:51 +08:00
0f5bb06920 ut: fix touch sensor denoise ci fail 2020-08-31 16:01:50 +08:00
06d1f69d84 Merge branch 'feature/vfs_uart_set_line_ending_v4.2' into 'release/v4.2'
feature: support vfs uart set line endings with specified uart number release/v4.2

See merge request espressif/esp-idf!9596
2020-08-30 22:34:47 +08:00
1b0691f29a Merge branch 'feature/esp32s2_adc_calib_V1_bp4.2' into 'release/v4.2'
driver/adc: support for esp32s2 adc calibration scheme (backport 4.2)

See merge request espressif/esp-idf!10064
2020-08-29 23:22:47 +08:00
73040c3223 Merge branch 'bugfix/mfg_tool_v4.2' into 'release/v4.2'
mfg_util: Update file handling to maintain line endings across various OS (backport v4.2)

See merge request espressif/esp-idf!10174
2020-08-28 18:22:28 +08:00
7d79d9f312 Merge branch 'bugfix/btdm_blufi_send_longer_custom_data_will_congested_v4.2' into 'release/v4.2'
component/bt: fix Blufi sends longer customer data  will will lead congested(backport v4.2)

See merge request espressif/esp-idf!9948
2020-08-28 13:55:46 +08:00
51ff44d96e component/bt: fix Blufi sends longer customer data will will lead congested(backport v4.2) 2020-08-28 10:20:19 +08:00
e42742891e mfg_util: Update file handling to maintain line endings across various OS
Fixes: https://github.com/espressif/esp-idf/issues/4888
2020-08-27 11:52:33 +05:30
e050feeb26 Merge branch 'bugfix/clean_wpa2_wifi_deinit' into 'master'
wpa_supplicant: Deinit wpa2 states in wifi deinit

See merge request espressif/esp-idf!10103

(cherry picked from commit 4dcaa0e6f4)

06bc7f1d wpa_supplicant: Deinit wpa2 states in wifi deinit
2020-08-26 16:55:04 +08:00
5f56329f00 Merge branch 'bugfix/fix_udp_tx_performance_issue_v4.2' into 'release/v4.2'
lw-ip: fix udp tx packet loss issue (backport v4.2)

See merge request espressif/esp-idf!10017
2020-08-26 12:38:37 +08:00
b498f0aebe Merge branch 'bugfix/buff_semaphore_not_free_v4.2' into 'release/v4.2'
component/bt: Fixed ble memory leak issue, buff_semaphore was not released.

See merge request espressif/esp-idf!9983
2020-08-24 17:30:54 +08:00
5f09ffce96 docs: fix version specific note on local build 2020-08-24 16:10:28 +08:00
a2d20f9412 Merge branch 'bugfix/bootloader_common_get_sha256_of_partition_v4.2' into 'release/v4.2'
bootloader_support: Fix bootloader_common_get_sha256_of_partition(), can handle a long image (v4.2)

See merge request espressif/esp-idf!9952
2020-08-24 13:36:09 +08:00
22221b073b Merge branch 'test/merge_ble_mesh_node_and_provioner_in_console_v4.2' into 'release/v4.2'
Test:merge ble mesh node and provioner in console

See merge request espressif/esp-idf!9913
2020-08-21 19:59:21 +08:00
63d2a19925 Test: merge ble mesh node and provioner in console 2020-08-21 19:59:20 +08:00
2d19e56877 ethernet: support power on timeout
Closes https://github.com/espressif/esp-idf/issues/5425
2020-08-20 10:48:04 +08:00
c54d599d0d ethernet: set DMA owner after all descriptors have configured 2020-08-20 10:47:08 +08:00
d918e7ad8a ethernet: handle early rx interrupt 2020-08-20 10:47:08 +08:00
4cbed9b364 driver/adc: support for esp32s2 adc calibration scheme
ESP32 lets the user choose from using Vref, Lookup Table, and Two-Point Calibration. In ESP32S2 only two-point calibration is supported. This commit support these changes in idf.

Closes https://github.com/espressif/esp-idf/issues/5455
2020-08-17 14:43:41 +08:00
a8b8a1531e Merge branch 'feature/efuse_esp32s2_add_fields_in_table_v4.2' into 'release/v4.2'
efuse: Add some fields in efuse_table and update esp_efuse_get_pkg_ver() (v4.2)

See merge request espressif/esp-idf!9994
2020-08-17 12:50:49 +08:00
8a3ad87821 Merge branch 'bugfix/docs_building_on_windows_v4.2' into 'release/v4.2'
Docs building: added encoding check suitable for windows (v4.2)

See merge request espressif/esp-idf!10020
2020-08-17 12:12:18 +08:00
98d5b5dfd9 Merge branch 'feature/esp_spp_stop_srv_v4.2' into 'release/v4.2'
bugfix/Add API esp_spp_stop_srv and fix collection of SPP [backport v4.2]

See merge request espressif/esp-idf!9993
2020-08-15 15:46:54 +08:00
d0dae54263 Merge branch 'bugfix/update_esp32_phy_4370_v4.2' into 'release/v4.2'
esp_wifi: backport some wifi fix to v4.2

See merge request espressif/esp-idf!10024
2020-08-14 17:45:22 +08:00
a557746cdd component/bt: Fixed ble memory leak issue, buff_semaphore was not released. 2020-08-14 17:16:23 +08:00
3967e1b6d2 vfs: support vfs uart set line endings with specified uart number (release/v4.2) 2020-08-14 16:01:14 +08:00
e169226d3b Merge branch 'bugfix/wifi_deinit_stop_crash_v4.2' into 'release/v4.2'
esp_wifi: fix the crash when wifi stop after deinit (v4.2)

See merge request espressif/esp-idf!10031
2020-08-13 13:47:49 +08:00
6e94f6f9f4 add API esp_spp_stop_srv(), fix the error parameter in esp-idf/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/main/example_spp_initiator_demo.c and fix collection of SPP
Closes https://github.com/espressif/esp-idf/issues/5409
Closes https://github.com/espressif/esp-idf/pull/5408

See merge request espressif/esp-idf!9114
2020-08-13 12:08:28 +08:00
a57fb727e7 esp_wifi: backport some wifi fix to v4.2
1.Fix WiFi fragment issue
2.fix the bug for softAP power save buffer issue
3.fix softap mode event issue
4.fix connect hidden AP doesn't update information
5.update esp32 phy v4370
2020-08-12 21:59:37 +08:00
0e24eacc81 bugfix: fix softap mode event issue
1. add sta connect again ap sent disconnect event
2. add set/get inactive time api

Closes https://github.com/espressif/esp-idf/issues/4401
Closes https://github.com/espressif/esp-idf/issues/4987
Closes https://github.com/espressif/esp-idf/issues/2375
2020-08-12 21:58:48 +08:00
010a825f48 docs: adds to build_docs.py an encoding check suitable for windows 2020-08-12 11:17:35 +02:00
c91ca054c3 lwip: fix udp tx packet loss issue 2020-08-12 15:02:29 +08:00
7dfe4b4684 Merge branch 'bugfix/mbedtls_mpi_exp_mod_v4.2' into 'release/v4.2'
mbedtls: Fix a case for mpi_montgomery_exp_calc() when Z is not init (v4.2)

See merge request espressif/esp-idf!9497
2020-08-11 10:00:07 +08:00
202dbaffa7 Merge branch 'bugfix/wpa3_to_wpa2_transition_fix_v4.2' into 'release/v4.2'
wpa_supplicant: Fix WPA3 and WPA2 transition related failures (Backport v4.2)

See merge request espressif/esp-idf!9865
2020-08-10 23:25:42 +08:00
f4a7ee3db3 esp_wifi: fix the crash when wifi stop after deinit 2020-08-10 20:34:50 +08:00
76cd5c8793 Merge branch 'feature/tinyusb_config_cleanup_v4.2' into 'release/v4.2'
Feature/tinyusb config cleanup (v4.2)

See merge request espressif/esp-idf!9824
2020-08-10 18:17:42 +08:00
94597fc8e3 esp32: Switch SPIRAM stack in esp_restart_noos() to internal stack
If esp_restart_noos() is run and the stack address points to external memory (SPIRAM)
then Cache_Read_Disable() raises up the error "Cache disabled but cached memory region accessed"
to fix this we switch stack to internal RAM before disable cache.

Added unit tests.

Closes: https://github.com/espressif/esp-idf/issues/5107
2020-08-10 09:41:35 +00:00
21dc9fcb5d wpa_supplicant: Fix WPA3 and WPA2 transition related failures
1. If Device is connected to AP in WPA3-PSK mode, AP switching
security to WPA2-PSK causes connection failures even after reset.
Fix is to not store WPA3's PMK in NVS for caching.

2. AP switching back to WPA3 causes even more connection failures.
This is due to device not clearing Supplicant level PMK Cache when
it is no longer valid. Fix is to clear the Cache when 4-way handshake
fails and to check Key Mgmt of Cache before using.

3. When AP switches from WPA3 to WPA2, device's PMF config in
Supplicant remains enabled. This may cause failures during
4-way handshake. So clear PMF config in when PMF is no longer used.
2020-08-10 09:05:48 +00:00
d87d9a714e efuse: Add some fields in efuse_table and update esp_efuse_get_pkg_ver()
Closes: IDF-1077
2020-08-10 15:59:02 +08:00
e01cab4a71 Merge branch 'doc/version_specific_inc_bugfix_v4.2' into 'release/v4.2'
doc: fall back to CI_COMMIT_REF_NAME as a branch name (v4.2)

See merge request espressif/esp-idf!9863
2020-08-10 13:35:55 +08:00
b9535ed91b Merge branch 'bugfix/ble_mesh_client_msg_optimize_v4.2' into 'release/v4.2'
Bugfix/ble mesh client msg optimize (v4.2)

See merge request espressif/esp-idf!9989
2020-08-10 11:02:43 +08:00
lly
c24de8dc10 ble_mesh: stack: Client model related code clean 2020-08-07 21:11:34 +08:00
lly
59a590fb25 ble_mesh: stack: Rename cfg & health client status recv func 2020-08-07 21:11:34 +08:00
lly
f0b89688c9 ble_mesh: stack: Check client msg result in common func 2020-08-07 21:11:34 +08:00
lly
41aea8e528 ble_mesh: stack: Fix no events for some error conditions 2020-08-07 21:11:34 +08:00
lly
bc19eb2506 ble_mesh: stack: Move client role set to the msg function 2020-08-07 21:11:33 +08:00
lly
964f372d58 ble_mesh: stack: Remove some not used client parameters 2020-08-07 21:11:33 +08:00
lly
29749b9dae ble_mesh: stack: Remove some not used variables & functions 2020-08-07 21:11:33 +08:00
lly
c058f3594f ble_mesh: stack: Update client model msg send 2020-08-07 21:11:33 +08:00
c72ae1281e Merge branch 'bugfix/put_periph_module_enable/diable_into_iram_v4.2' into 'release/v4.2'
wifi, bt: move esp_phy_common_clock_disable into periph_ctrl and put it into IRAM(v4.2)

See merge request espressif/esp-idf!9934
2020-08-07 18:10:01 +08:00
2620942568 bootloader_support: Fix bootloader_common_get_sha256_of_partition, can handle a long image
Closes: IDFGH-3594
2020-08-07 08:49:18 +00:00
229dbd70c9 mbedtls: Fix a case for mpi_montgomery_exp_calc() when Z is not init
Closes: IDF-1870
2020-08-07 08:43:12 +00:00
7162964776 Merge branch 'feature/enable_pcm_config_v4.2' into 'release/v4.2'
Feature/enable pcm config v4.2

See merge request espressif/esp-idf!9652
2020-08-07 14:19:03 +08:00
4382ec4b8d Merge branch 'component/seperate_bta_jv_l2c_4.2' into 'release/v4.2'
Component/seperate bta jv l2c 4.2

See merge request espressif/esp-idf!9644
2020-08-07 14:18:02 +08:00
0db87821f1 Merge branch 'bugfix/customer_baidu_int_wdt_v4.2' into 'release/v4.2'
backport v4.2: add soft solution for esp32 eco3 live lock issue

See merge request espressif/esp-idf!9223
2020-08-07 14:12:00 +08:00
501ca00178 Merge branch 'feature/esp_tls_for_supplicant_v4.2' into 'release/v4.2'
wpa_supplicant: Support for mbedtls tls handshake(backport v4.2)

See merge request espressif/esp-idf!9821
2020-08-07 14:01:54 +08:00
04e31d2f81 Merge branch 'test/esp_flash_rw_performance_thr_4.2' into 'release/v4.2'
esp_flash: decrease some of the performance threshold (4.2)

See merge request espressif/esp-idf!9959
2020-08-07 11:58:21 +08:00
15e408d070 newlib: Fix UT for adjtime 2020-08-06 20:01:52 +08:00
39e318977d newlib: Fix adjtime, returns the amount of time remaining from any previous adjustment
If the olddelta argument is not a null pointer, the adjtime function returns information
about any previous time adjustment that has not yet completed.

Closes: https://github.com/espressif/esp-idf/issues/5194
2020-08-06 20:01:52 +08:00
5f0eb04684 esp_flash: decrease some of the performance threshold 2020-08-06 12:04:22 +08:00
dd3c032972 Merge branch 'bugfix/esp_netif_restart_dhcpc_v4.2' into 'release/v4.2'
esp_netif: Remove restarting DHCP client/server if it has already been started (backport v4.2)

See merge request espressif/esp-idf!9919
2020-08-06 11:19:30 +08:00
96bc7761f5 Merge branch 'feature/upgrade_mbedtls_to_v4.2' into 'release/v4.2'
mbedtls: update to mbedtls release v2.16.7 (v4.2)

See merge request espressif/esp-idf!9906
2020-08-05 20:13:40 +08:00
caa21fdc67 remove auto conn case because we do not support this anymore 2020-08-05 18:03:12 +08:00
0b1ef494a7 wifi, bt: move esp_phy_common_clock_disable into periph_ctrl and put it into IRAM
Replace periph_module_enable/disable by periph_wifi_bt_common_module_enable which are in IRAM.
AddIRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rstandIRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rstto fit O0 optimization level.
Delete duplicated spinlock and counter.
2020-08-05 14:08:46 +08:00
789119262b Merge branch 'fixbug/sdmmc_spi_highspeed_v4.2' into 'release/v4.2'
sdmmc: fix the probe issue that forbid sdspi working in highspeed mode(backport v4.2)

See merge request espressif/esp-idf!9841
2020-08-04 17:45:37 +08:00
9409b2ecb7 Merge branch 'feature/support_for_esp32_pico_v3_02_v4.2' into 'release/v4.2'
psram: support for esp32-pico-v3-02 (backport v4.2)

See merge request espressif/esp-idf!9787
2020-08-04 14:30:14 +08:00
e911826340 add soft solution for esp32 eco3 live lock issue 2020-08-04 05:50:18 +00:00
706bc799fa Merge branch 'bugfix/fix_fragment_issue_v4.2' into 'release/v4.2'
esp_wifi: Fix WiFi fragment issue (backport v4.2)

See merge request espressif/esp-idf!9896
2020-08-04 12:26:04 +08:00
0e6777f78b esp_netif tests: Add manual DHCP state transision tests
Extended test cases for DHCP server and DHCP client state transitions to include also manual transitions using esp_netif_dhcps_start/stop() esp_netif_dhcpc_start/stop()
2020-08-04 12:07:57 +08:00
39f804ae07 esp_netif: Remove restarting DHCP client and server if it has already been started
To be in line with previous behaviour in tcpip_adapter, do nothing and return appropriate error if the DHCP client/server has already been started
2020-08-04 12:07:49 +08:00
8796a53132 mbedtls: update to mbedtls release v2.16.7
For detailed release notes, please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/mbedtls-2.16.7
2020-08-03 14:14:10 +05:30
9dbff45229 Merge branch 'feature/twai_backport_v4.2' into 'release/v4.2'
TWAI: esp32s2 support and multiple bugfixes (backport v4.2)

See merge request espressif/esp-idf!9884
2020-08-03 11:13:20 +08:00
2f96a1a3bf Merge branch 'bugfix/add_api_adc2_vref_to_gpio_for_esp32s2_backport_v4.2' into 'release/v4.2'
driver(adc): esp32s2 support API `adc2_vref_to_gpio`  (backport v4.2)

See merge request espressif/esp-idf!9875
2020-08-01 23:50:13 +08:00
a32fc5a2bb Fix tsk watchdog when running spp vfs demo 2020-08-01 16:40:43 +08:00
8de78c2b3b Seperate BTA_JV_L2CAP for less bin size 2020-08-01 16:40:43 +08:00
64eab16847 Enable PCM config in controller 2020-08-01 16:37:34 +08:00
0952b9de8a Enable PCM Config in Host 2020-08-01 16:36:36 +08:00
ad8a873dff esp_wifi: Fix WiFi fragment issue 2020-07-31 20:17:45 +08:00
885f8ce484 driver(adc): esp32s2 support API adc2_vref_to_gpio 2020-07-31 17:52:41 +08:00
934fe37c48 Merge branch 'bugfix/fix_adc_dac_driver_ut_backport' into 'release/v4.2'
Driver(adc): fix adc driver and UT  (backport v4.2)

See merge request espressif/esp-idf!9359
2020-07-31 17:09:24 +08:00
33dab9d165 Merge branch 'bugfix/fix_softap_mode_wpa_memory_leak_issue_v4.2' into 'release/v4.2'
bugfix: fix softap mode wpa memory leak (backport v4.2)

See merge request espressif/esp-idf!9845
2020-07-31 16:45:38 +08:00
9f4f7aa8b1 Merge branch 'feature/export_ps1_tools_v4.2' into 'release/v4.2'
scripts: updates export.ps1 to export tools' paths (v4.2)

See merge request espressif/esp-idf!9876
2020-07-31 05:05:39 +08:00
21e2f02962 TWAI: Remove asserts used for program logic
This commit fixes the bug where TWAI driver program logic was being
called in assert(), thus leading to the logic being omitted in
release builds.
2020-07-30 22:17:41 +08:00
519b8898b3 twai: Fix size of RX msg count field on the esp32
This commit fixes the size of the RX message count register field
on the esp32.
2020-07-30 22:17:14 +08:00
e6db25af9d TWAI: Add ESP32-S2 support
This commit adds TWAI driver support for the
ESP32-S2. The following features were added:

- Expanded BRP support
- Expanded CLKOUT Divider Support
- Updated example READMEs
2020-07-30 22:09:39 +08:00
74df8746a3 scripts: updates export.ps1 to export tools' paths 2020-07-30 13:55:03 +02:00
f444d4d2dc driver(adc): fix unit test for ADC-DMA (test_esp32s2.c); fix unit test for ADC-DMA (test_esp32s2.c); fix commit in adc dirver. 2020-07-30 19:38:23 +08:00
4726076da5 Merge branch 'bugfix/fix_touch_sensor_api_backport_v4.2' into 'release/v4.2'
driver(touch): fix touch sensor driver redundancy  (backport v4.2)

See merge request espressif/esp-idf!9861
2020-07-30 16:17:51 +08:00
2802136595 doc: fall back to CI_COMMIT_REF_NAME as a branch name
In some cases gen_version_specific_includes.py would fail to find a branch/tag name for a commit
and would fall back to using commit SHA-1.

This should never happen in docs that should be published as we use the branch/tag name to generate
example commands for our users. E.g. "git clone -b $branch_name"

Closes https://github.com/espressif/esp-idf/issues/5657
2020-07-30 12:25:59 +08:00
9bc72d5732 driver(touch): fix touch sensor driver redundancy 2020-07-30 11:41:11 +08:00
f06ce4832d Merge branch 'bugfix/update_esp32_phy_4350_v4.2' into 'release/v4.2'
esp_wifi: update phy lib(Backport v4.2)

See merge request espressif/esp-idf!9823
2020-07-30 01:59:04 +08:00
e5b242a3cb usb: removes non-integrated features 2020-07-29 15:50:56 +02:00
e7179db204 Merge branch 'nimble/nrpa_support_v4.2' into 'release/v4.2'
NimBLE: Add Non-Resolvable private address support and misc bug fixes (Backport v4.2)

See merge request espressif/esp-idf!9741
2020-07-29 19:05:01 +08:00
10e59593f6 Merge branch 'bugfix/bt_linkup_fallback_event_v4.2' into 'release/v4.2'
Bluedroid: Fixes cases having fallback to link up event. (v4.2)

See merge request espressif/esp-idf!9801
2020-07-29 19:04:41 +08:00
157ecfaf43 bugfix: fix softap mode wpa memory leak 2020-07-29 14:14:35 +08:00
293d7f34b8 Merge branch 'fix/prov_ble_read_offset_v4.2' into 'release/v4.2'
BLE provisioning: Add check for valid ble read offset (v4.2)

See merge request espressif/esp-idf!9744
2020-07-28 16:42:09 +08:00
2d9325db1e Merge branch 'bugfix/build_docs_check_link_v4.2' into 'release/v4.2'
build_docs: fix incorrect arguments for linkcheck (Backport v4.2)

See merge request espressif/esp-idf!9798
2020-07-28 14:00:55 +08:00
19ae66dfa2 sdmmc: fix the probe issue that forbid sdspi working in highspeed mode
SD cards don't support CMD7 (select_card) in SPI mode. Highspeed probe
of sdspi will fail in this step and stop working in highspeed mode.
Remove the CMD7 in enable_hs_mode_and_check to fix this issue.

Please note that, on ESP32, you have to use the IOMUX pins to use sdspi
in 40MHz, otherwise the initialization process will report reading issue
and fail.
2020-07-28 12:36:03 +08:00
12dd6e5a85 Merge branch 'doc/freertos_backport_v4.2' into 'release/v4.2'
add a note about ESP-IDF FreeRTOS version (backport v4.2)

See merge request espressif/esp-idf!9810
2020-07-27 23:00:47 +08:00
02e7e9c417 esp_wifi: update phy lib
1. esp32 phy lib v4350
2. esp32s2 phy lib v603
2020-07-27 21:42:44 +08:00
8bb287bae8 esp_wifi: Add esp_wifi_get_tsf_time() API to get the tsf time of
specified interface.

Closes https://github.com/espressif/esp-idf/issues/5533
2020-07-27 21:41:36 +08:00
3af4b51a5c Fix handling of multiple AP credentials in WPS
WPS can send multiple AP credentials, while existing implementation
will only use the first credentials which could be for the 5G band.
Fix this by passing these credentials to the App and attempting
to connect using each of those. Older Apps will remain compatible
without breaking WPS, but the issue will remain.
2020-07-27 21:41:20 +08:00
875642fedd Merge branch 'doc/update_chip_features_v4.2' into 'release/v4.2'
doc: update chip features in getting started (Backport v4.2)

See merge request espressif/esp-idf!9797
2020-07-27 21:26:53 +08:00
ebd1bb9a12 wpa_supplicant: Fix IOT issue with latest freeradius
Fix inter operability issue with freeradius version 3.0.21
and openssl 1.1.1f when internal tls client is used which
requires extension elements in client hello.

closes https://github.com/espressif/esp-idf/issues/5273
closes https://github.com/espressif/esp-idf/issues/5627
2020-07-27 18:49:47 +05:30
89ef69cbd0 wpa_supplicant: Fix invalid pointer deference and memleak
Add following changes as part of this:

1. EAP client will crash during validation of key size when CA
certs and keys not present. Add changes to validate it first.
2. Free memory allocated in TLS context
2020-07-27 18:49:07 +05:30
4b7c8d4a2d wpa_supplicant: Support for mbedtls tls handshake
Add support for mbedtls based tls handshake, this removes
dependency from internal implementation of EAP client.
2020-07-27 18:47:27 +05:30
76e7fcf0e4 update a link in the note 2020-07-27 17:27:31 +08:00
9cf4dd20e0 Bluedroid: Fixes cases having fallback to link up event.
Signed-off-by: Chinmay Chhajed <chinmay.chhajed@espressif.com>
2020-07-27 13:52:58 +05:30
b284c48854 Merge branch 'bugfix/esp32s2_lightsleep_uart_suspend_v4.2' into 'release/v4.2'
esp32s2: suspend UART output using XOFF before entering light sleep (backport v4.2)

See merge request espressif/esp-idf!9293
2020-07-27 15:55:33 +08:00
851b4e9576 BLE provisioning: Add check for valid ble read offset 2020-07-27 07:21:07 +00:00
b081292e8e build_docs: fix incorrect arguments for linkcheck 2020-07-27 15:14:59 +08:00
207cbabc51 doc: update chip features in getting started
Fixed number of cores for ESP32 and ESP32S2 being wrong.

Updated S2 to reflect that we have to ULP coprocessors

Closes IDFGH-3616
Closes https://github.com/espressif/esp-idf/issues/5556
2020-07-27 15:12:31 +08:00
636b964c8c Merge branch 'bugfix/ws_send_abort_v4.2' into 'release/v4.2'
websocket client: the client now aborts the connection if send fails. (backport v4.2)

See merge request espressif/esp-idf!9169
2020-07-24 23:15:08 +08:00
3191a8cbc7 esp32s2: Always use eFuse config for WP pin
No reason to override just this pin in software.
2020-07-24 21:45:59 +08:00
a94685a222 esp32: Use package identifier to look up SPI flash/PSRAM WP Pin, unless overridden
Allows booting in QIO/QOUT mode or with PSRAM on ESP32-PICO-V3 and
ESP32-PICO-V3-O2 without any config changes.

Custom WP pins (needed for fully custom circuit boards) should still be compatible.
2020-07-24 21:45:31 +08:00
55a1bd0fb6 feat(esp32): support for esp32-pico-v3-02 2020-07-24 21:20:27 +08:00
c945cb59d8 feat(psram): support 16Mbit PSRAM for esp32 2020-07-24 21:19:45 +08:00
6a253e8809 bugfix(psram): configure MMU after PSRAM initialization 2020-07-24 21:10:37 +08:00
ce7affe81c Merge branch 'docs/doc138_backport_v4.2' into 'release/v4.2'
Fix incorrect redirect link in getting started guide (backport v4.2)

See merge request espressif/esp-idf!9703
2020-07-24 18:04:00 +08:00
a4e8e56288 NimBLE: Add Non-Resolvable private address support and misc bug fixes (Backport v4.2)
- Merges https://github.com/espressif/esp-nimble/pull/12
- Fixes repeated pairing failure in RPA feature

Closes https://github.com/espressif/esp-idf/issues/5530
2020-07-24 06:55:22 +00:00
23beab8a98 Merge branch 'feature/update_cryptoauthlib_submodule_pointer_v4.2' into 'release/v4.2'
esp32/secure_element: update esp-cryptoauthlib submodule pointer (v4.2)

See merge request espressif/esp-idf!9768
2020-07-24 14:45:24 +08:00
04e5b16f74 esp32/secure_element: update esp-cryptoauthlib submodule pointer 2020-07-24 09:45:00 +05:30
6b80aebc87 Merge branch 'bugfix/convert-string-to-bytes_v4.2' into 'release/v4.2'
components: convert string to bytes to fix TypeError (backport v4.2)

See merge request espressif/esp-idf!9734
2020-07-23 16:36:57 +08:00
e6e4fe45c6 Merge branch 'ci/fix_uart_read_write_priorities_v4.2' into 'release/v4.2'
driver test: Ensure uart write task can't overflow buffer of read task (v4.2)

See merge request espressif/esp-idf!9569
2020-07-23 13:15:45 +08:00
16eeb3b432 tools: Updates OpenOCD version to 'v0.10.0-esp32-20200709' 2020-07-22 23:15:40 +03:00
51b5c7a079 Merge branch 'bugfix/mcpwm_fault_init_copypaste_typo_bp4.2' into 'release/v4.2'
MCPWM: Fix PWM-fault init function that read config incorrectly (backport v4.2)

See merge request espressif/esp-idf!9554
2020-07-22 21:12:16 +08:00
5feeb744e1 components: convert string to bytes to fix TypeError There is a string passed as an argument for function, but a format of a string seemingly refers to bytes therefore it needs to be converted to bytes Solves https://esp32.com/viewtopic.php?f=13&t=16529
(cherry picked from commit cb0bdb8bba)
2020-07-22 11:23:12 +02:00
dc06fd3c20 docs: change redirection link in get-started
This link is supposed to go to Step 3, but it goes to Step 2.
2020-07-22 16:49:00 +08:00
ccdfbb865e Merge branch 'bugfix/add_return_task_awoken_for_timer_callback_v4.2' into 'release/v4.2'
timer: add return task awoken for timer callback (backport v4.2)

See merge request espressif/esp-idf!9149
2020-07-22 16:19:37 +08:00
b356707948 Merge branch 'ci/workaround_multiple_ci_failures_v4.2' into 'release/v4.2'
CI: workaround multiple ci failures (v4.2)

See merge request espressif/esp-idf!9684
2020-07-22 11:52:43 +08:00
441308fc16 websocket client: the client now aborts the connection if send fails.
Closes IDF-1744
2020-07-21 07:51:01 +00:00
53e8857849 Merge branch 'bugfix/ipv6_fragment_for_4.2' into 'release/v4.2'
lw-ip:fix bug for ipv6 fragment(backport 4.2)

See merge request espressif/esp-idf!9583
2020-07-21 12:11:34 +08:00
0bcd26a610 Merge branch 'bugfix/fix_hci_max_page_num_v4.2' into 'release/v4.2'
bugfix/Support for more Bluetooth HID devices [backport v4.2]

See merge request espressif/esp-idf!9660
2020-07-21 12:10:59 +08:00
15e40f909f Merge branch 'bugfix/fix_get_bond_device_list_v4.2' into 'release/v4.2'
bugfix/fix esp_bt_gap_get_bond_device_list bug [backport v4.2]

See merge request espressif/esp-idf!9666
2020-07-21 12:10:24 +08:00
e1635edc47 Merge branch 'bugfix/espcoredump_fix_error_reported_for_blank_partition_v42' into 'release/v4.2'
Bugfix/espcoredump fix error reported for blank partition (Backport v4.2)

See merge request espressif/esp-idf!9629
2020-07-21 01:05:57 +08:00
5f1e61498e Bugfix/espcoredump fix error reported for blank partition (Backport v4.2) 2020-07-21 01:05:54 +08:00
e1b03f08af Merge branch 'bugfix/doc_macro_definitions_v4.2' into 'release/v4.2'
doc: Fix macro definitions for different targets (v4.2)

See merge request espressif/esp-idf!9566
2020-07-20 08:25:33 +08:00
b3692aba5e CI: do not run cases likely to fail 2020-07-19 14:52:57 +08:00
468bd6f854 CI: disable cases with test env SSC_T5_1 2020-07-19 14:52:57 +08:00
9d215de21d CI: temp allow mesh job to fail as runner is not stable 2020-07-19 14:52:56 +08:00
fb7e3c508b CI: remove incorrect MTU related cases 2020-07-19 14:52:56 +08:00
73ec4d0c1d Merge branch 'bugfix/ble_mesh_health_current_status_recv_v4.2' into 'release/v4.2'
ble_mesh: stack: Fix recv health current status incorrectly (v4.2)

See merge request espressif/esp-idf!9664
2020-07-17 16:14:25 +08:00
e14906f073 fix esp_bt_gap_get_bond_device_list bug
Closes https://github.com/espressif/esp-idf/issues/5395
2020-07-17 15:06:39 +08:00
lly
b39eaf61b5 ble_mesh: stack: Fix recv health current status incorrectly 2020-07-17 14:05:18 +08:00
d1506fdae0 Support for more Bluetooth HID devices
Some Bluetooth devices - such as an Xbox One S controller (model 1708) - report more than two external features pages and are rejected immediately. Pages 1 and 2 are marked as unhandled in btm_devctl.c anyway, so there is no reason to block devices with more pages.
(IDFGH-3515)

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

Merges https://github.com/espressif/esp-idf/pull/5481
Closes https://github.com/espressif/esp-idf/issues/5470
2020-07-17 10:07:41 +08:00
d26405df96 Merge branch 'bugfix/ble_mesh_misc_updates_v4.2' into 'release/v4.2'
Bugfix/ble mesh misc updates (v4.2)

See merge request espressif/esp-idf!9641
2020-07-16 14:03:27 +08:00
lly
49145856a2 ble_mesh: ci: Enable friend & low power in build check 2020-07-16 11:02:25 +08:00
lly
2e01297603 ble_mesh: stack: Only keep func pointer for very common log
Currently only keep func pointer for the followings:
- Invalid parameter (mesh btc & mesh stack)
- Out of memory (mesh btc & mesh stack)
- Unknown act (mesh btc)
- Invalid model user data (mesh stack)
- BT_DBG("%s", __func__) (mesh btc & mesh stack)
- A few other specific situations (buf ref debug, send status check)
2020-07-16 11:02:24 +08:00
lly
5fceac92ee ble_mesh: stack: Make proxy server & client functions clear 2020-07-16 11:02:24 +08:00
d8c657c6f0 Merge branch 'bugfix/ble_mesh_add_misc_check_v4.2' into 'release/v4.2'
Bugfix/ble mesh add misc check (v4.2)

See merge request espressif/esp-idf!9630
2020-07-16 10:52:26 +08:00
a60bfb8cdc Merge branch 'feature/reassign_example_test_runners_v4.2' into 'release/v4.2'
ci: Modify some dut-unrelated example tests env tag from Example_WIFI to Example_GENERIC (backport v4.2)

See merge request espressif/esp-idf!9634
2020-07-16 03:29:31 +08:00
a73b0c3eb6 ci: Modify some dut-unrelated example tests env tag from Example_WIFI to Example_GENERIC 2020-07-15 16:54:03 +08:00
001c673f4e Merge branch 'bugfix/eth_insert_min_hw_reset_time_v4.2' into 'release/v4.2'
ethernet: insert min assert time for PHY HW reset (v4.2)

See merge request espressif/esp-idf!9579
2020-07-15 16:35:46 +08:00
lly
fc99963376 ble_mesh: stack: Add proxy cfg pdu length check 2020-07-15 16:10:48 +08:00
lly
1846def7ac ble_mesh: stack: Rework using dev flag to check scan status
Different bluetooth host has different behaviors, so it's better
to maintain a scan check mechanism of BLE Mesh itself.
Fixes an issue when only PB-GATT is enabled for node, which will
output a scan error log when the device is provisioned.
2020-07-15 16:10:48 +08:00
lly
cf5b69389e ble_mesh: example: Add result check during mesh init 2020-07-15 16:10:48 +08:00
lly
37322ce93f ble_mesh: stack: Add more checks about input prov bearers 2020-07-15 16:10:48 +08:00
daf8098a00 Merge branch 'feat/ble_mesh_use_iram_for_mem_alloc_v4.2' into 'release/v4.2'
Feat/ble mesh use iram for mem alloc (v4.2)

See merge request espressif/esp-idf!9614
2020-07-15 16:06:47 +08:00
c59b27b417 Merge branch 'bugfix/cleanup_bt_reference_from_esp32s2_ld_v4.2' into 'release/v4.2'
esp32s2: cleanup bt reference from esp32s2 ld (v4.2)

See merge request espressif/esp-idf!9613
2020-07-14 22:52:11 +08:00
lly
a6dcfb4a5a ble_mesh: stack: Rename mesh adv queue and relay queue 2020-07-14 21:19:32 +08:00
lly
efcd9ee4a8 ble_mesh: stack: Use macros for adv task name & prio 2020-07-14 21:19:32 +08:00
lly
e58d982903 ble_mesh: ci: Add iram & psram configurations 2020-07-14 21:19:32 +08:00
lly
6abfc2a8f7 ble_mesh: stack: Make freertos static allocation visible 2020-07-14 21:19:32 +08:00
lly
c0db196464 ble_mesh: stack: Add a option of using IRAM for memory allocation 2020-07-14 21:19:32 +08:00
a9d8d8ea99 esp32s2: remove bt references from esp32s2 ld script 2020-07-14 18:04:28 +05:30
452ce608fe Merge branch 'bugfix/fix_erro_in_ag_api_4.2' into 'release/v4.2'
Fix error of AG API return line v4.2

See merge request espressif/esp-idf!9605
2020-07-14 19:54:17 +08:00
b716800000 Fix error of AG API return line
Closes https://github.com/espressif/esp-idf/issues/5554
2020-07-14 14:43:15 +08:00
38e75dca1d Merge branch 'bugfix/enable_mbedtls_renegotiation_v4.2' into 'release/v4.2'
esp-tls: enable TLS renegotiation using explicit API call (v4.2)

See merge request espressif/esp-idf!9590
2020-07-14 12:05:02 +08:00
c57f9b76cb Merge branch 'bugfix/ota_ci_failures_v4.2' into 'release/v4.2'
Increse receive timeout in OTA Example tests to fix CI failures (v4.2)

See merge request espressif/esp-idf!9588
2020-07-13 23:01:23 +08:00
31121e5af1 Merge branch 'bugfix/rs485_test_temp_disable_v42' into 'release/v4.2'
Bugfix/rs485 test temp disable (backport v4.2)

See merge request espressif/esp-idf!9525
2020-07-13 20:41:42 +08:00
40a29866f6 esp-tls: enable TLS renegotiation using explicit API call
mbedTLS stack does not keep TLS renegotiation enabled even if
relevant config option is turned on, it needs explicit API call
`mbedtls_ssl_conf_renegotiation` to do so.

This issue was observed in case of Azure IoT, where keys needs to
be refreshed periodically to keep TLS connection intact.
2020-07-13 15:32:41 +05:30
4ed889dfa2 esp32s2: sleep_modes: remove dependency on driver/uart.h 2020-07-13 09:52:29 +02:00
3a88ac7900 soc: add periph_ll_periph_enabled to clk_gate_ll.h 2020-07-13 09:52:29 +02:00
31cd3f1294 esp32s2: suspend UART output using XOFF before entering light sleep
Same logic as for the ESP32, except two changes:

* need to set UART_SW_FLOW_CON_EN bit for UART_FORCE_XOFF to take
  effect
* need to check if the peripheral is not clockgated and out of reset
2020-07-13 09:52:29 +02:00
1f16f5cf22 Increse receive timeout in sdkconfig.ci to fix CI failures 2020-07-13 10:15:01 +05:30
74396ae2cc fix bug for ipv6 fragment 2020-07-13 11:49:52 +08:00
49c1d40b2d ethernet: insert min assert time for PHY HW reset
Closes https://github.com/espressif/esp-idf/issues/5528
2020-07-13 11:05:38 +08:00
1f8c5b2b64 Merge branch 'docs/fix_event_typo_backport_v4.2' into 'release/v4.2'
docs/fix event typo backport v4.2

See merge request espressif/esp-idf!9382
2020-07-12 21:24:03 +08:00
9274339fb5 timer: add return task awoken for timer callback 2020-07-12 11:01:47 +00:00
d6553232cb Merge branch 'bugfix/issues_with_vanilla_freertos_v4.2' into 'release/v4.2'
Fix build issues with Vanilla FreeRTOS (v4.2)

See merge request espressif/esp-idf!9576
2020-07-12 16:39:20 +08:00
07abd9092a Include header file soc/cpu.h in memprot.c and system_api.c
This fixes build issues with Vanilla FreeRTOS
2020-07-10 18:21:20 +05:30
897e950e21 Merge branch 'bugfix/add_api_to_get_internal_heap_v4.2' into 'release/v4.2'
esp_wifi: Add API to get available internal heap size (backport v4.2)

See merge request espressif/esp-idf!9516
2020-07-10 16:54:38 +08:00
86c197a8db Merge branch 'bugfix/ble_mesh_update_send_ttl_v4.2' into 'release/v4.2'
Bugfix/ble mesh update send ttl v4.2

See merge request espressif/esp-idf!9562
2020-07-10 14:06:12 +08:00
870fa2237e driver test: Ensure uart write task can't overflow buffer of read task
Previously both tasks had equal priority, possible for write task and another
internal task to be scheduled at the same time - starving read task and
causing data loss.

Related to IDFCI-59
2020-07-10 15:59:48 +10:00
21b123a925 Merge branch 'feature/sphinx_idf_theme_pip_v4.2' into 'release/v4.2'
docs: update build system to use sphinx_idf_theme pip package (v4.2)

See merge request espressif/esp-idf!9478
2020-07-10 12:56:43 +08:00
c44a433b8b driver: Fix some doxygen warnings 2020-07-10 14:53:16 +10:00
e3664e297b docs: Redirect all of Doxygen stderr to the warnings log
Some errors (for example the errors caused by macro values, as fixed in previous
commit) get logged to stderr even if WARN_LOGFILE is set, but Doxygen succeeds.
2020-07-10 14:53:16 +10:00
db5d659762 docs: Log the full list of macros, remove code-style macros to prevent Doxygen errors 2020-07-10 14:53:15 +10:00
2b270bccbf doc: Fix passing of build macros to Doxygen
Regression in fbb54184ef, the dictionary
passed to generate_doxygen function was still the project_description
structure.
2020-07-10 14:53:15 +10:00
b39a0be9d2 Merge branch 'bugfix/fix_adc_dac_conflict_backportv4.2' into 'release/v4.2'
Driver(adc): Disable the synchronization operation function of ADC1 and DAC (backport v4.2)

See merge request espressif/esp-idf!9360
2020-07-10 11:05:00 +08:00
lly
615d64b6f9 ble_mesh: stack: Add two application macros for TTL 2020-07-10 09:13:53 +08:00
lly
1ec2f98691 ble_mesh: stack: Update send_ttl in btc when recv a msg
Update send_ttl mainly for server models. When a server model
receives a message, and the status is required to be replied
by the application, we need to set send_ttl to the msg context.
If send_ttl is not updated in btc, and the applcation does not
set the TTL either, then the status will be replied with TTL=0,
which may cause the client side (e.g. the phone App) failed to
receive the status.

Closes https://github.com/espressif/esp-idf/issues/5300
2020-07-10 09:13:53 +08:00
e64d1378b4 Fix init MCPWM Fault line via config struct
Signed-off-by: wubowen <wubowen@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/5491
Closes https://github.com/espressif/esp-idf/issues/5433
2020-07-09 19:19:23 +08:00
f52c35258c Merge branch 'bugfix/fix_16mbit_psram_id_read_error_v4.2' into 'release/v4.2'
psram: fix 16mbit psram id read error (backport v4.2)

See merge request espressif/esp-idf!9424
2020-07-09 15:27:23 +08:00
d58bb32f95 Merge branch 'bugfix/fix_build_err_in_cpp_backport_v4.2' into 'release/v4.2'
ble_hid_device_demo: fix build if building with c++ backport v4.2

See merge request espressif/esp-idf!9230
2020-07-09 15:25:51 +08:00
d1c4791dad Add platform independent CMake signing 2020-07-09 11:54:53 +05:30
89fa339732 ci provisioning: Add some experiments to check the runner's STA state
Not clear why sometimes it associates without negotiating a new DHCP lease.
2020-07-09 04:56:44 +00:00
de17289461 esp_prov: Extend the timeout for HTTP connection to SoftAP 2020-07-09 04:56:44 +00:00
6d5dc5def3 ci wifi_tools: Log the wpa_supplicant interface state when trying to connect
Trigger reconnection if wpa_supplicant seems to have dropped the connection.
2020-07-09 04:56:44 +00:00
9c6c6e6885 legacy provisioning: Always try to reconnect when disconnected
Some APs may fail authentication temporarily if they have too many
associated stations, for example.
2020-07-09 04:56:44 +00:00
130c97ad69 esp_prov: Refactor to use new 'wait_wifi_connected' function
Means all provisioning examples will have the same retry behaviour.
2020-07-09 04:56:44 +00:00
ae586deeeb ci provisioning: Use strings instead of "magic numbers" for connection state 2020-07-09 04:56:44 +00:00
5e0e4a5f01 ci: Wait up to 60 seconds for client to connect to DUT in provisioning test 2020-07-09 04:56:44 +00:00
9eab094658 Merge branch 'doc/broken_readme_links_v4.2' into 'release/v4.2'
Docs: Fix broken README links (v4.2)

See merge request espressif/esp-idf!9499
2020-07-08 23:53:03 +08:00
f7c5e49504 Merge branch 'doc/check_docs_multi_builder_v4.2' into 'release/v4.2'
docs: fix check_docs not working for multiple builders (v4.2)

See merge request espressif/esp-idf!9480
2020-07-08 23:50:36 +08:00
ccc4f1337b Merge branch 'doc/add_UUID_description_in_gattc_demo_backport_v4.2' into 'release/v4.2'
docs:add 128-bit UUID description backport v4.2

See merge request espressif/esp-idf!9224
2020-07-08 16:14:45 +08:00
0cb87f67da Merge branch 'feature/console_repl_over_uart_v4.2' into 'release/v4.2'
console_repl over UART (v4.2)

See merge request espressif/esp-idf!9422
2020-07-08 16:10:37 +08:00
aec1353ffe ci: temporarily disable RS485 related tests 2020-07-08 06:54:24 +02:00
8efabd1307 esp_wifi: Add API to get available internal heap size. 2020-07-08 10:46:34 +08:00
4911dde551 nvs: unit tests for new partition API 2020-07-08 08:59:12 +08:00
051dff88e4 nvs: allow to specify custom partition
Closes https://github.com/espressif/esp-idf/pull/5172
2020-07-08 08:59:03 +08:00
e4e5b18c61 Fix broken README links 2020-07-07 17:11:32 +08:00
ad5c4eb3f5 Merge branch 'mesh/bugfix_for_tbtt_update_v4.2' into 'release/v4.2'
fix the bug for tsf check (backport v4.2)

See merge request espressif/esp-idf!9279
2020-07-07 14:40:35 +08:00
59541071fb Merge branch 'bugfix/gen_crt_py3_utf_v4.2' into 'release/v4.2'
Fixes issues encoding issues python3 scripts for unicode chars (v4.2)

See merge request espressif/esp-idf!9174
2020-07-07 11:04:59 +08:00
9b21973363 Merge branch 'feature/msys2_env_update_v4.2' into 'release/v4.2'
windows: Update MSYS2 pre-compiled legacy build environment (v4.2)

See merge request espressif/esp-idf!9142
2020-07-06 15:14:45 +08:00
302a43562d docs: fix check_docs not working for multiple builders
Closes IDF-1659
2020-07-06 12:27:02 +08:00
61904135b3 docs: update sphinx_idf_theme documentation
Bump CI doc-env docker image to v5
2020-07-06 10:55:32 +08:00
a3a22d4af5 Merge branch 'bugfix/fix_ci_about_touch_sensor_denoise_ut_backport_v4.2' into 'release/v4.2'
driver(touch): fix touch sensor denoise unit test case (backport v4.2)

See merge request espressif/esp-idf!9451
2020-07-06 10:21:32 +08:00
0e8f630711 Merge branch 'bugfix/esp32_encrypted_flash_write_v4.2' into 'release/v4.2'
spi_flash: esp32: fix regression in encrypted flash write (v4.2)

See merge request espressif/esp-idf!9349
2020-07-06 08:18:56 +08:00
4761c4059a esp_wifi:
1. Avoid parsing RSN/WPA IE's after connection
2. Remove AUTH_CHANGED reason code logic
3. fix the bug when calculating the PMK, the local rx beacon time increment is 0
4. mesh: don't disconnect when tbtt update
2020-07-03 14:18:39 +08:00
a1c11b3f9e Merge branch 'bugfix/ble_mesh_fast_prov_misc_update_v4.2' into 'release/v4.2'
Bugfix/ble mesh fast prov misc update (v4.2)

See merge request espressif/esp-idf!9462
2020-07-03 11:11:37 +08:00
lly
dd6de08bea ble_mesh: stack: Update some fast prov functions 2020-07-03 08:53:16 +08:00
lly
661e1f2500 ble_mesh: stack: Move fast prov functions to a single file 2020-07-03 08:53:16 +08:00
f9cee602fb Merge branch 'bugfix/ble_mesh_split_tinycrypt_v4.2' into 'release/v4.2'
Bugfix/ble mesh split tinycrypt (v4.2)

See merge request espressif/esp-idf!9371
2020-07-02 22:46:21 +08:00
34fc02f5db driver(touch): fix touch sensor denoise unit test case 2020-07-02 13:04:46 +08:00
lly
76baeba6b7 ble_mesh: ci: Fix failing to compile when using make 2020-07-02 03:53:50 +00:00
lly
7e7d2ae401 ble_mesh: Mark platform related default RNG as 0 2020-07-02 03:53:50 +00:00
lly
d9e8508981 ble_mesh: Remove the previously added redundant aes files 2020-07-02 03:53:50 +00:00
lly
11406d7ee8 ble_mesh: Update CMake and make files for tinycrypt 2020-07-02 03:53:50 +00:00
lly
80837bd936 ble_mesh: Update tinycrypt header file include guards
Add BLE_MESH in the macro to make it specific for BLE Mesh.
2020-07-02 03:53:50 +00:00
lly
3c0584f013 ble_mesh: Format source and header files of tinycrypt 2020-07-02 03:53:50 +00:00
lly
f1f3c7afd6 ble_mesh: Port full implementation of tinycrypt [Zephyr]
- Original code is here: https://github.com/zephyrproject-rtos/tinycrypt
- Also this fixes the compile error when NimBLE and ESP BLE Mesh
  both uses the tinycrypt.
2020-07-02 03:53:50 +00:00
de5d145c9b Merge branch 'bugfix/ble_mesh_readme_fix_v4.2' into 'release/v4.2'
ble_mesh: example: Fix example README & tutorial link error (v4.2)

See merge request espressif/esp-idf!9434
2020-07-02 11:29:26 +08:00
fcef568c70 Merge branch 'bugfix/ble_mesh_compile_error_v4.2' into 'release/v4.2'
Bugfix/ble mesh compile error (v4.2)

See merge request espressif/esp-idf!9430
2020-07-02 11:28:55 +08:00
69b0761114 Merge branch 'bugfix/sntp_example_test_v4.2' into 'release/v4.2'
Fix SNTP example test to match pattern (v4.2)

See merge request espressif/esp-idf!9447
2020-07-02 10:28:52 +08:00
6e7a091e39 Fix SNTP example test to match pattern 2020-07-01 14:37:06 +02:00
68ed940668 Driver(adc): Disable the synchronization operation function of ADC1 and DAC
Closes IDF-1585
2020-07-01 09:29:34 +00:00
ce60660c7c Merge branch 'bugfix/fix_ping_specify_length_issue_v4.2' into 'release/v4.2'
bugfix: fix ICMP specify length issue (backport v4.2)

See merge request espressif/esp-idf!9401
2020-07-01 17:25:26 +08:00
68fae8b48f Merge branch 'doc/restore_missing_zh_eth_guide_v4.2' into 'release/v4.2'
docs: restore chinese get-started-ethernet-kit guide (v4.2)

See merge request espressif/esp-idf!9375
2020-07-01 16:25:02 +08:00
lly
f14a71e8b7 ble_mesh: example: Fix example README & tutorial link error 2020-07-01 14:36:30 +08:00
e5fed6d67d Merge branch 'mesh/bugfix_coexist_warning_4.2' into 'release/v4.2'
mesh: remove coexist warnings in ESP_WIFI_MESH (backport 4.2)

See merge request espressif/esp-idf!9412
2020-07-01 13:51:30 +08:00
655772ec23 Merge branch 'feature/bt_secure_conn_downgrade_check_v4.2' into 'release/v4.2'
Bluedroid: Authentication fixes in Legacy and Secure Connection.

See merge request espressif/esp-idf!9336
2020-07-01 13:48:46 +08:00
lly
f0518dfba5 ble_mesh: ci: Add different proxy configurations 2020-07-01 11:54:32 +08:00
lly
b239677c97 ble_mesh: stack: Fix compile error when only proxy enabled
Also remove some redundant CONFIG_BLE_MESH_PROXY checks, because
when the following options are satisfied, the CONFIG_BLE_MESH_PROXY
option will be selected mandatorily.
2020-07-01 11:54:32 +08:00
f1642bfaaf Merge branch 'bugfix/ble_mesh_set_recv_rssi_v4.2' into 'release/v4.2'
Bugfix/ble mesh set recv rssi (v4.2)

See merge request espressif/esp-idf!9390
2020-07-01 11:31:47 +08:00
e9f21b096f Merge branch 'bugfix/ble_mesh_check_subnet_before_update_beacon_sent_v4.2' into 'release/v4.2'
ble_mesh: Check if subnet exists before updating beacon_sent (v4.2)

See merge request espressif/esp-idf!9395
2020-07-01 11:16:16 +08:00
76c1be0d94 spiram: fix the read id failure
The issue is caused by:
1. The disable_qio_mode inside read_id may have side effects.
2. read_id twice may have side effects.

Fix this issue by moving disable_qio_mode out of read_id and only do it
once before read_id. And retry read_id only when the first one is
failed.

Issue introduced in 3ecbb59c15.
2020-06-30 21:45:31 +08:00
a3a4c828e9 psram: fix 16mbit psram id read error 2020-06-30 21:44:39 +08:00
404a5994e6 bugfix: fix ICMP specify length issue 2020-06-30 13:42:19 +00:00
98d7f13c24 console_repl: change config structure to support different devices 2020-06-30 20:18:27 +08:00
ec043aac06 Bluedroid: Authentication fixes in Legacy and Secure Connection.
Prevent a remote device from doing a Bluetooth Impersonation Attack
(BIAS) by:

- Preventing remote device to downgrade secure connection
feature mask. Secure connection feature mask should remain same or
increase to enabled in link key generation and authentication.

- Doing a mutual authentication during Legacy Authentication.

Signed-off-by: Chinmay Chhajed <chinmay.chhajed@espressif.com>
2020-06-30 14:41:46 +05:30
334052194e mesh: remove coexist warnings in ESP_WIFI_MESH
1. remove warning log when mesh is started:
Error! Should use default passive scan time parameter for WiFi scan when Bluetooth is enabled!!!!!!
2. remove abort when mesh is started:
Error! Should enable WiFi modem sleep when both WiFi and Bluetooth are enabled!!!!!!
2020-06-30 16:33:08 +08:00
6938c615d8 Merge branch 'bugfix/connect_param_check_and_channel_map_bugs_v4.2' into 'release/v4.2'
components/bt:Fix channel map instant reverse and add ble connect paramter check.(backport 4.2)

See merge request espressif/esp-idf!9236
2020-06-30 15:11:56 +08:00
lly
6f715c4472 ble_mesh: Check if subnet exists before updating beacon_sent
- Before updating the "beacon_sent" of a subnet, we need to check
  if the subnet still exists, especially for a Provisioner.
- Fix a bug which will cause Provisioner failed to send Secure
  Network Beacon if no device is provisioned
2020-06-30 09:22:21 +08:00
lly
3fa5daf0ba ble_mesh: stack: Copy recv_rssi for other received messages
Follow the commit: 2b80cb6883,
copy the recv_rssi for other mesh messages.
2020-06-30 09:05:23 +08:00
4b3bb6c8fd When a generic mesh model message is received "bt_mesh_generic_server_cb_evt_to_btc" copies the
ctx values to cb_params for the mesh stack.

recv_rssi was not copied.

This means the rssi could not be read when receiving generic server messages using ble_mesh.
2020-06-30 09:05:23 +08:00
5bf8bb6d3a docs:fix event typo
1.In the description of the ESP_API header file, it should be the event that the application layer needs to handle, not the BTA layer.
2.Fix name typo of BTA_GATTS_CREATE_SRVC_EVT event

Closes https://github.com/espressif/esp-idf/issues/5446
2020-06-29 20:48:48 +08:00
a664a80d73 docs: restore chinese get-started-ethernet-kit guide
The chinese translation of get-started-ethernet-kit guide were erroneously
removed in commit 1a90470f02
2020-06-29 13:32:45 +08:00
c0a40cf7e8 Merge branch 'fix/esp_tls_wolfssl_fix_cert_verify_v4.2' into 'release/v4.2'
esp_tls_wolfssl : fix incorrect error message after handshake fails (v4.2)

See merge request espressif/esp-idf!9229
2020-06-29 13:00:49 +08:00
3d68e92a58 Merge branch 'bugfix/http_server_lru_v4.2' into 'release/v4.2'
esp_http_server: Update LRU counter on accepting a new connection (v4.2)

See merge request espressif/esp-idf!9350
2020-06-29 12:57:02 +08:00
00148cd0c6 Merge branch 'bugfix/ble_mesh_get_node_with_name_v4.2' into 'release/v4.2'
ble_mesh: Get node info with pre-configured node name (v4.2)

See merge request espressif/esp-idf!9302
2020-06-28 20:25:32 +08:00
fa8e6918c1 Merge branch 'bugfix/ble_mesh_example_tag_define_v4.2' into 'release/v4.2'
ble_mesh: Move TAG definition to each example (v4.2)

See merge request espressif/esp-idf!9305
2020-06-28 20:25:06 +08:00
3c92395170 Merge branch 'bugfix/ble_mesh_bt_hex_v4.2' into 'release/v4.2'
ble_mesh: Fix wrong log output with bt_hex (v4.2)

See merge request espressif/esp-idf!9309
2020-06-28 20:24:31 +08:00
257384ea75 Merge branch 'bugfix/ble_mesh_not_define_bool_v4.2' into 'release/v4.2'
Bugfix/ble mesh not define bool (v4.2)

See merge request espressif/esp-idf!9316
2020-06-28 20:23:21 +08:00
6d20c836ff Merge branch 'bugfix/ble_mesh_check_model_status_v4.2' into 'release/v4.2'
ble_mesh: stack: Check model status with variable length (v4.2)

See merge request espressif/esp-idf!9319
2020-06-28 20:22:40 +08:00
e538b2a2ed Merge branch 'doc/ds_S2_4.2' into 'release/v4.2'
Doc: DS documentation for S2

See merge request espressif/esp-idf!9358
2020-06-28 20:20:49 +08:00
36ee7d706a Doc: DS documentation for S2 2020-06-28 09:42:02 +08:00
f97751712f esp_http_server: Update LRU counter on accepting a new connection
Closes https://github.com/espressif/esp-idf/issues/3851
2020-06-26 19:24:23 +05:30
e8c8286387 Merge branch 'bugfix/check_python_deps_diagnostic_v4.2' into 'release/v4.2'
tools: fix diagnostic output in check_python_dependencies.py (backport v4.2)

See merge request espressif/esp-idf!9295
2020-06-26 21:16:55 +08:00
390a34f660 Merge branch 'bugfix/export_sh_in_dash_v4.2' into 'release/v4.2'
tools: export.sh: fix compatibility with dash shell (backport v4.2)

See merge request espressif/esp-idf!9296
2020-06-26 21:16:40 +08:00
939a7ada04 spi_flash: esp32: fix regression in encrypted flash write
In commit 309376f51a, it seems like regression
was added to use ROM level API for disabling flash write protection. This
started random firmware crashes (on specific modules) with exception
`IllegalInstruction` during encrypted flash writes.

Fix here removes relevant ROM API call, since disabling flash write protection
is already ensured by caller of this API.

Closes https://github.com/espressif/esp-idf/issues/5467
2020-06-26 18:20:06 +05:30
156bd313d2 Merge branch 'ci/http_client_remove_httpbin_redirect_v4.2' into 'release/v4.2'
ci: Temporarily remove the esp_http_client httpbin redirect tests (v4.2)

See merge request espressif/esp-idf!9340
2020-06-26 01:35:46 +08:00
b53daeecee ci: Temporarily remove the esp_http_client httpbin redirect tests
Need to host httpbin ourselves or wait for
postmanlabs/httpbin/issues/617 to be resolved
2020-06-25 07:57:57 +10:00
ae35b6abcd Merge branch 'bugfix/bootloader_header_align_v4.2' into 'release/v4.2'
bootloader: Force bootloader_image_hdr to be word aligned (v4.2)

See merge request espressif/esp-idf!9069
2020-06-24 20:33:47 +08:00
8bf1d3118a Merge branch 'doc/fix_broken_links_v4.2' into 'release/v4.2'
Doc/fix broken links (backport v4.2)

See merge request espressif/esp-idf!9265
2020-06-24 20:16:20 +08:00
lly
698fe7dd99 ble_mesh: stack: Check model status with variable length 2020-06-24 14:12:53 +08:00
lly
bd5ef62253 ble_mesh: Remove boolean type definitions 2020-06-24 14:05:58 +08:00
5bacf6b23d ble_mesh: Do not #define bool when compiling in C++ 2020-06-24 14:05:58 +08:00
24d455f826 Merge branch 'feature/pyc_clean_v4.2' into 'release/v4.2'
tools/idf.py: Clean Python bytecode files (v4.2)

See merge request espressif/esp-idf!9262
2020-06-24 12:30:15 +08:00
lly
55f48877a4 ble_mesh: Fix wrong log output with bt_hex
- This issue was introduced in the commit: a788e7cd3d
  which updated the bt_hex() function incorrectly.
- And in bt_hex(), we use 2 for the two-dimensional array, because currently
  at most two bt_hex() will be used at the same time. Also this will save
  some DRAM compared with using 4.
2020-06-24 12:29:33 +08:00
ac2698ecb7 Merge branch 'bugfix/idf_py_help_env_var_v4.2' into 'release/v4.2'
Tools: Mention ESPPORT and ESPBAUD in idf.py --help (v4.2)

See merge request espressif/esp-idf!9290
2020-06-24 12:28:29 +08:00
lly
a2e14140b3 ble_mesh: Move TAG definition to each example
Move the TAG definition of each example to the corresponding
source file (previously it is defined in the common example
intialization header file), which can avoid the redefinition
of TAG in some situations.
2020-06-24 12:19:06 +08:00
lly
b4b2cd19f7 ble_mesh: Get node info with pre-configured node name
Also add a function to get the entry of the nodes table.

Closes https://github.com/espressif/esp-idf/issues/5397
2020-06-24 10:58:36 +08:00
4913cbed6a tools: export.sh: fix compatibility with dash shell
* fix constructs invalid in dash
* clean shellcheck warnings and disable false positive ones

Closes https://github.com/espressif/esp-idf/issues/5366
2020-06-23 16:34:19 +02:00
387dfd977a tools: fix diagnostic output in check_python_dependencies.py
If IDF_PYTHON_ENV_PATH was not set, an exception occurred:

Traceback (most recent call last):
  File "/home/user/esp/esp-idf/tools/check_python_dependencies.py", line 108, in <module>
    if idf_python_env_path not in sys.executable:
TypeError: 'in <string>' requires string as left operand, not NoneType

and the final line in the diagnostic message was not printed.
Fix to print the PATH if IDF_PYTHON_ENV_PATH is not set.
2020-06-23 16:32:47 +02:00
647d01dbc6 Tools: Mention ESPPORT and ESPBAUD in idf.py --help
Closes https://github.com/espressif/esp-idf/issues/5461
2020-06-23 15:21:44 +02:00
820e0ead52 Merge branch 'bugfix/wifi_update_tbtt_when_ap_reset_tsf_v4.2' into 'release/v4.2'
esp_wifi: Add TBTT update when AP reset TSF (v4.2)

See merge request espressif/esp-idf!9270
2020-06-23 12:14:27 +08:00
cdc0374448 esp_wifi:
1. Add TBTT update when AP reset TSF
2. fix the bug for regdomian update
3. update ESP32S2 phy lib to 601,5b0f7cd
4. Fix TX DMA buffer issue
2020-06-22 19:33:08 +08:00
c185d924e1 docs: fixed broken platform.io link 2020-06-22 17:17:57 +08:00
35c3a51c17 docs: fix link_roles not linking correctly for certain files
Link_roles could link incorrectly if the name of a file matched the name of a submodule
2020-06-22 17:17:46 +08:00
1c49cf1a09 tools/idf.py: Clean Python bytecode files 2020-06-22 10:23:59 +02:00
ee126bc154 Merge branch 'bugfix/wpa_supplicant_no_hw_mpi_v4.2' into 'release/v4.2'
wpa_supplicant: Allow building with mbedTLS integration but no hardware MPI (v4.2)

See merge request espressif/esp-idf!9011
2020-06-22 13:06:01 +08:00
aaeb2ba733 Merge branch 'bugfix/att_buffer_count_fixed_v4.2' into 'release/v4.2'
Bugfix/att buffer count fixed v4.2

See merge request espressif/esp-idf!9161
2020-06-22 11:44:54 +08:00
12d39f9faa components/bt:Fix instant reverse and add ble connect paramter check. 2020-06-18 15:54:53 +08:00
41f178f5eb ble_hid_device_demo: fix build if building with c++
Signed-off-by: Elvis Dukaj <elvis.dukaj@gmail.com>
Signed-off-by: liminyang <liminyang@example.com>

Merges https://github.com/espressif/esp-idf/pull/5191
2020-06-18 15:32:52 +08:00
f6b0307e1a esp_tls_wolfssl: fix incorrect error message after handshake fails 2020-06-18 12:58:40 +05:30
710249c86a Merge branch 'bugfix/blufi_buffer_overflow_report_v4.2' into 'release/v4.2'
blufi: When the format of the received data packet is wrong, reply with an error response(backport 4.2)

See merge request espressif/esp-idf!9201
2020-06-18 13:44:52 +08:00
920273e619 docs:perfect 128-bit UUID description
The previous description is not easy for the reader to understand, some changees have been made to perfect it.
Closes https://github.com/espressif/esp-idf/issues/5057
2020-06-18 11:57:47 +08:00
82c4ed30b6 Merge branch 'bugfix/fix_fifo_cnt_bug_v4.2' into 'release/v4.2'
bugfix(uart): fix esp32 fifo_cnt bug(backport v4.2)

See merge request espressif/esp-idf!9039
2020-06-18 01:47:51 +08:00
1f074d313b Merge branch 'bugfix/fix_some_wifi_bugs_0617_v4.2' into 'release/v4.2'
fix some wifi bugs 0617 (backport v4.2)

See merge request espressif/esp-idf!9210
2020-06-17 18:27:37 +08:00
a406885360 Merge branch 'feature/make_tcp_rto_configurable_v4.2' into 'release/v4.2'
make  TCP rto time configurable (backport v4.2)

See merge request espressif/esp-idf!9211
2020-06-17 18:23:34 +08:00
a6f2205cdb Merge branch 'bugfix/ble_conn_fail_v4.2' into 'release/v4.2'
Fix bugs from coex test

See merge request espressif/esp-idf!9099
2020-06-17 18:16:37 +08:00
0ea0d2ba3c Merge branch 'bugfix/efuse_logs_v4.2' into 'release/v4.2'
esp32/esp32s2: Reduce using ESP_EARLY_LOGx and move some code after the stdout initialization in startup code (v4.2)

See merge request espressif/esp-idf!9202
2020-06-17 16:54:34 +08:00
c5768c019e feat(lwip): make LWIP TCP rto time configurable 2020-06-17 15:20:00 +08:00
783cd1bb08 components/bt: Fix ble disconnect due to instant of channel map update is too small 2020-06-17 07:15:46 +00:00
d4b232590a Set AFH in time(075dd35)
Send LMP_channelClassification immediately
Fix first LMP_set_AFH not using host value
2020-06-17 07:15:46 +00:00
ef92a22b0c components/coex: Fix ble connecting fail in coexist 2020-06-17 07:15:46 +00:00
f5a6ae7e93 esp_wifi:
1. Fix WPA3 Auth timeout during BLE coex
2. fix addba ssn and send bar for first ampdu
3. fix the bug that airkiss find hidden AP fail
4. update mesh lib
5. fix interrupt handle param variable error
2020-06-17 14:55:45 +08:00
7cbb970b50 esp32s2: disable sdmmc api 2020-06-17 14:53:17 +08:00
ba67a9518e fix esp32s2 do not have crc*_be func 2020-06-17 14:53:08 +08:00
835186b3b9 esp_wifi: re-enable build wifi example 2020-06-17 14:52:58 +08:00
49c9f69eae esp32s2: Move some code after the stdout initialization 2020-06-17 13:40:42 +08:00
a6ac0e8a51 esp32: Reduce using ESP_EARLY_LOGx and move some code after the stdout initialization
After setting _GLOBAL_REENT, ESP_LOGIx can be used instead of ESP_EARLY_LOGx.

Closes: https://github.com/espressif/esp-idf/issues/5343
2020-06-17 13:40:42 +08:00
21ff2f84ce components/bt: Add a detailed description for the user to distinguish the function of the query buffer api. 2020-06-17 12:52:28 +08:00
02cd178115 Update the limited of function esp_ble_get_sendable_packets_num. 2020-06-17 12:52:18 +08:00
17609cbb02 blufi: When the format of the received data packet is wrong, reply with an error response 2020-06-17 12:19:00 +08:00
e7d046cfdd Merge branch 'bugfix/fix_event_bug_in_GAP_API_release_v4.2' into 'release/v4.2'
Bugfix/fix event bug in GAP API [backport v4.2]

See merge request espressif/esp-idf!9190
2020-06-17 11:51:38 +08:00
4dd29dac94 components/bt: Adjust the description of esp_bt_gap_start_discovery and esp_bt_gap_cancel_discovery.
Add some comments to explain why `ESP_BT_GAP_DISC_STATE_CHANGED_EVT` is not reported.
2020-06-16 22:18:21 +08:00
27e6e8c485 bugfix(uart): fix esp32 fifo_cnt bug
When using DPort to read fifo, fifo_cnt is not credible, we need to calculate the real cnt based on the fifo read and write pointer. When using AHB to read FIFO, we can use fifo_cnt to indicate the data length in fifo.
2020-06-16 14:34:23 +08:00
1d1e4497ba ci: fix find_build_apps.py failure with py3 due to non ascii chars
find_build_apps.py would fail when reading non-ascii chars on systems where
the default encoding was ascii.
2020-06-15 15:20:43 +08:00
1531f2db2a ci: fix check_public_headers.py failure with python3 due to non ascii chars
check_public_headers.py would fail when reading non-ascii chars on systems where
the default encoding was ascii.

Also fixes error handling issues, as any uncaught exeception would cause the program
to run indefinitely.
2020-06-15 15:20:43 +08:00
1358734b3f Fixes issues with gen_crt_bundle.py for unicode chars
gen_crt_bundle.py could fail to parse the certificates if it contained a non-ascii character.
2020-06-15 15:20:43 +08:00
7f299d9d60 components/bt: Consider link_xmit_data_q in congest events to prevent excessive memory usage 2020-06-13 15:10:30 +08:00
d53a2719b9 components/bt: Fixed the problem of incomplete data packets caused by disordered acl data packets 2020-06-13 15:09:45 +08:00
f9b0cd1847 components/bt: Add api to query the number of available buffers for the current connection 2020-06-13 15:09:36 +08:00
9b62609499 msys2: Remove python version consideration in pacman commands 2020-06-12 10:20:03 +10:00
036848a375 windows: Update MSYS2 pre-compiled legacy build environment
* Bundled with esp2020r2 toolchain
* Built with Python 3 & latest MSYS2 packages
2020-06-12 10:20:03 +10:00
1504fe5358 Merge branch 'bugfix/esp32_can_not_scan_ap_after_restart_v4.2' into 'release/v4.2'
esp_wifi: upadte esp32 phy lib to 4182 (v4.2)

See merge request espressif/esp-idf!9113
2020-06-11 11:54:24 +08:00
5054cd05fc Merge branch 'bugfix/intr_alloc_no_log_from_critical_section_v4.2' into 'release/v4.2'
intr_alloc: don't call ESP_LOG from critical section (v4.2)

See merge request espressif/esp-idf!9088
2020-06-10 15:58:23 +08:00
c9769e535e esp_wifi: upadte esp32 phy lib to 4182 2020-06-09 17:33:55 +08:00
21a9c9b653 Merge branch 'bugfix/authmode_degrade_fix_v4.2' into 'release/v4.2'
esp_wifi: Remove auth_changed event and fix wpa2_ent authmode threshold(backport v4.2)

See merge request espressif/esp-idf!9090
2020-06-09 17:30:50 +08:00
f74729c3bc esp_wifi: Remove auth_changed event and fix wpa2 authmode threshold
Added following as part of this change
1. Removed auth_changed event
2. Updated doc regarding usage of  WPA/WEP secuiry modes
3. Fixed WPA2 enterprise authmode threshold.
2020-06-08 12:53:22 +05:30
cc99cac782 Merge branch 'feature/pin_ethernet_task_to_core_v4.2' into 'release/v4.2'
ethernet: support pin emac task to core (v4.2)

See merge request espressif/esp-idf!9036
2020-06-08 13:52:01 +08:00
9773f79e6e intr_alloc: using isr version of critical section 2020-06-08 12:52:25 +08:00
b2fb2429dd Merge branch 'bugfix/esp32s2_airkiss_fail_v4.2' into 'release/v4.2'
wifi: fix the bug that ESP32S2 can't receive AMPDU when airkiss (v4.2)

See merge request espressif/esp-idf!9029
2020-06-05 15:34:42 +08:00
8643d7acb9 wifi:
1. Fix the bug that ESP32S2 can't receive AMPDU when airkiss
2. Fix WPA3 Auth issue in coex scenario
2020-06-05 06:00:37 +00:00
e7ab7ce3af bootloader: Force bootloader_image_hdr to be word aligned
Possible due to linker order for this file to be placed unaligned,
causing failure from bootloader_flash_read() function.
2020-06-04 20:56:26 +10:00
a8f40b7095 Merge branch 'bugfix/ble_mesh_remove_relay_dependency_v4.2' into 'release/v4.2'
ble_mesh: Remove relay option dependency (v4.2)

See merge request espressif/esp-idf!9025
2020-06-03 15:20:35 +08:00
9bdaa64d80 Merge branch 'bugfix/ble_mesh_example_nvs_store_v4.2' into 'release/v4.2'
Bugfix/ble mesh example nvs store (v4.2)

See merge request espressif/esp-idf!9015
2020-06-03 15:11:54 +08:00
55cd09578f Merge branch 'bugfix/ble_mesh_model_recv_fix_v4.2' into 'release/v4.2'
Bugfix/ble mesh model recv fix (v4.2)

See merge request espressif/esp-idf!9006
2020-06-03 15:11:15 +08:00
118b69ce0d Merge branch 'bugfix/ble_mesh_rework_prov_pdu_len_check_v4.2' into 'release/v4.2'
ble_mesh: Rework prov pdu length check (v4.2)

See merge request espressif/esp-idf!9002
2020-06-03 15:10:33 +08:00
b16c20fa30 ethernet: support pin emac task to core 2020-06-03 11:06:41 +08:00
lly
eeb44e7dd6 ble_mesh: Remove relay option dependency
When the relay functionality of a node is not enabled, this
issue will cause the node failing to send messages to fixed
group.
2020-06-02 19:18:18 +08:00
lly
5b256c1cb5 ble_mesh: Add nvs operations for examples
- Store onoff_client example proper mesh info
- Store vendor_client example proper mesh info

Closes https://github.com/espressif/esp-idf/issues/5359
2020-06-02 14:02:54 +08:00
lly
c906bcaf40 ble_mesh: Add mesh example common nvs operations 2020-06-02 14:02:54 +08:00
lly
adf785a1b0 ble_mesh: Config and health client btc fixes
Fix an issue which may cause no error code is returned
when sending config client or health client messages
with invalid parameters.
2020-06-02 14:02:54 +08:00
lly
b25cffd4d5 ble_mesh: Add more checks of net_idx & app_idx 2020-06-02 14:02:54 +08:00
lly
4919d17ad1 ble_mesh: Optimize some send & recv logs 2020-06-02 14:02:53 +08:00
c69210c0f2 wpa_supplicant: Allow building with mbedTLS integration but no hardware MPI
Also disable the relevant function in bignum.h based on config, so fails at
compile not link time.

Closes https://github.com/espressif/esp-idf/issues/5321
2020-06-02 13:35:48 +10:00
6fa8df519d Merge branch 'bugfix/ble_mesh_local_model_sub_v4.2' into 'release/v4.2'
Bugfix/ble mesh local model sub (v4.2)

See merge request espressif/esp-idf!8982
2020-06-02 10:58:05 +08:00
lly
1a3c315d2f ble_mesh: correct the return type [Zephyr] 2020-06-02 10:31:08 +08:00
lly
8271ae4a1e ble_mesh: Add net_buf_simple_init_with_data [Zephyr] 2020-06-02 10:31:08 +08:00
lly
d6a247f7e4 ble_mesh: Optimize model recv operations [Zephyr]
Previously the model recv operation is a littl fuzzy.
With the changes, the model recv operation is splitted into:
- find op
- check app_idx
- check dst
- check length
- update info & handle message
2020-06-02 10:31:07 +08:00
lly
4fbc29616c ble_mesh: Rework prov pdu length check 2020-06-02 10:13:21 +08:00
6b36ce95a2 Merge branch 'bugfix/coredump_memregion_size_v4.2' into 'release/v4.2'
coredump: Fixes size of memory region used by espcoredump.py (backport v4.2)

See merge request espressif/esp-idf!8977
2020-06-02 01:11:12 +08:00
lly
067d94e88f ble_mesh: Local model (un)subscribes group address 2020-06-01 09:10:17 +08:00
lly
6bc4f5802d ble_mesh: Define a macro for invalid company id 2020-06-01 09:10:17 +08:00
29b03b2999 coredump: Fixes size of memory region used by espcoredump.py 2020-05-29 21:09:21 +03:00
2006 changed files with 89668 additions and 92213 deletions

View File

@ -38,7 +38,7 @@ If the issue cannot be solved after the steps before, please follow these instru
- Development Kit: [ESP32-Wrover-Kit|ESP32-DevKitC|ESP32-PICO-Kit|ESP32-LyraT|ESP32-LyraTD-MSC|none]
- Kit version (for WroverKit/PicoKit/DevKitC): [v1|v2|v3|v4]
- Module or chip used: [ESP32-WROOM-32|ESP32-WROOM-32D|ESP32-WROOM-32U|ESP32-WROVER|ESP32-WROVER-I|ESP32-WROVER-B|ESP32-WROVER-IB|ESP32-SOLO-1|ESP32-PICO-D4|ESP32]
- IDF version (run ``git describe --tags`` to find it):
- IDF version (run ``git describe`` to find it):
// v3.2-dev-1148-g96cd3b75c
- Build System: [Make|CMake|idf.py]
- Compiler version (run ``xtensa-esp32-elf-gcc --version`` to find it):

87
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,87 @@
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
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 }}
- name: Update Docker Hub repository description (master branch)
if: ${{ github.ref_type == 'branch' && github.ref_name == 'master' }}
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
# Token based authentication is not supported here:
# https://github.com/peter-evans/dockerhub-description/issues/10
# https://github.com/docker/roadmap/issues/115#issuecomment-891694974
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.DOCKERHUB_REPO }}
readme-filepath: ./tools/docker/README.md

17
.github/workflows/release_zips.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Create zip file with recursive source clone for release
on:
push:
tags:
- v*
jobs:
release_zips:
name: Create release zip file
runs-on: ubuntu-20.04
steps:
- name: Create a recursive clone source zip
uses: espressif/github-actions/release_zips@master
env:
RELEASE_PROJECT_NAME: ESP-IDF
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@ -83,3 +83,6 @@ build
# lock files for examples and components
dependencies.lock
# managed_components for examples
managed_components

View File

@ -8,6 +8,18 @@ stages:
- deploy
- post_deploy
# pipelines will not be created in such two cases:
# 1. MR push
# 2. push not on "master/release" branches, and not tagged
# This behavior could be changed after the `rules: changes` feature is implemented
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- 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: always
variables:
# System environment
@ -39,13 +51,15 @@ variables:
APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
# Docker images
# Docker images
BOT_DOCKER_IMAGE_TAG: ":latest"
# target test config file, used by assign test job
# target test config file, used by assign test job
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
# 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"
# Versioned esp-idf-doc env image to use for all document building jobs
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v4"
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v7"
# before each job, we need to check if this job is filtered by bot stage/job filter
@ -64,6 +78,8 @@ variables:
python $SUBMODULE_FETCH_TOOL -s $SUBMODULES_TO_FETCH
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- source tools/ci/setup_python.sh
# apply bot filter in before script
- *apply_bot_filter
@ -85,6 +101,8 @@ before_script:
GIT_SUBMODULE_STRATEGY: none
before_script:
- echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
- 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
@ -94,6 +112,8 @@ before_script:
GIT_SUBMODULE_STRATEGY: none
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
# apply bot filter in before script
- *apply_bot_filter
@ -128,7 +148,12 @@ before_script:
- macos_shell
dependencies: []
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *apply_bot_filter
- 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
@ -141,6 +166,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:
- '/tools/ci/config/pre_check.yml'
- '/tools/ci/config/build.yml'

6
.gitlab/CODEOWNERS Normal file
View File

@ -0,0 +1,6 @@
# For the syntax of this file, see:
#
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
#
* @esp-idf-codeowners/all-maintainers

View File

@ -74,6 +74,10 @@ if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS)
"-Wno-int-in-bool-context")
endif()
if(CONFIG_COMPILER_WARN_WRITE_STRINGS)
list(APPEND compile_options "-Wwrite-strings")
endif()
if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
list(APPEND compile_definitions "-DNDEBUG")
endif()

View File

@ -114,7 +114,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
mon reset halt
# Run to a specific point in ROM code,
# where most of initialization is complete.
thb *0x40007901
thb *0x40007d54
c
# Load the application into RAM
load

View File

@ -2,20 +2,15 @@
* [中文版](./README_CN.md)
ESP-IDF is the official development framework for the **ESP32** and **ESP32-S** Series SoCs.
ESP-IDF is the development framework for Espressif SoCs (released after 2016<sup>[1](#fn1)</sup>) provided for Windows, Linux and macOS.
# Developing With ESP-IDF
## Setting Up ESP-IDF
See setup guides for detailed instructions to set up the ESP-IDF:
See https://idf.espressif.com/ for links to detailed instructions on how to set up the ESP-IDF depending on chip you use.
| Chip | Getting Started Guides for ESP-IDF |
|:----:|:----|
| <img src="docs/_static/chip-esp32.svg" height="85" alt="ESP32"> | <ul><li>[stable](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/) version</li><li>[latest (master branch)](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/) version</li></ul> |
| <img src="docs/_static/chip-esp32-s2.svg" height="100" alt="ESP32-S2"> | <ul><li>[latest (master branch)](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/) version</li></ul> |
**Note:** Each ESP-IDF release has its own documentation. Please see Section [Versions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html) how to find documentation and how to checkout specific release of ESP-IDF.
**Note:** Each SoC series and each ESP-IDF release has its own documentation. Please see Section [Versions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html) on how to find documentation and how to checkout specific release of ESP-IDF.
### Non-GitHub forks
@ -39,25 +34,16 @@ See the Getting Started guide links above for a detailed setup guide. This is a
## Setup Build Environment
(See Getting Started guide for a full list of required steps with details.)
(See the Getting Started guide listed above for a full list of required steps with more details.)
* Install host build dependencies mentioned in Getting Started guide.
* Add `tools/` directory to the PATH
* Run `python -m pip install -r requirements.txt` to install Python dependencies
* Install host build dependencies mentioned in the Getting Started guide.
* Run the install script to set up the build environment. The options include `install.bat` or `install.ps1` for Windows, and `install.sh` or `install.fish` for Unix shells.
* Run the export script on Windows (`export.bat`) or source it on Unix (`source export.sh`) in every shell environment before using ESP-IDF.
## Configuring the Project
`idf.py menuconfig`
* Opens a text-based configuration menu for the project.
* Use up & down arrow keys to navigate the menu.
* Use Enter key to go into a submenu, Escape key to go out or to exit.
* Type `?` to see a help screen. Enter key exits the help screen.
* Use Space key, or `Y` and `N` keys to enable (Yes) and disable (No) configuration items with checkboxes "`[*]`"
* Pressing `?` while highlighting a configuration item displays help about that item.
* Type `/` to search the configuration items.
Once done configuring, press Escape multiple times to exit and say "Yes" to save the new configuration when prompted.
* `idf.py set-target <chip_name>` sets the target of the project to `<chip_name>`. Run `idf.py set-target` without any arguments to see a list of supported targets.
* `idf.py menuconfig` opens a text-based configuration menu where you can configure the project.
## Compiling the Project
@ -79,7 +65,7 @@ You don't need to run `idf.py build` before running `idf.py flash`, `idf.py flas
## Viewing Serial Output
The `idf.py monitor` target uses the [idf_monitor tool](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html) to display serial output from ESP32 or ESP32-S Series SoCs. idf_monitor also has a range of features to decode crash output and interact with the device. [Check the documentation page for details](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
The `idf.py monitor` target uses the [idf_monitor tool](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html) to display serial output from Espressif SoCs. idf_monitor also has a range of features to decode crash output and interact with the device. [Check the documentation page for details](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
Exit the monitor by typing Ctrl-].
@ -115,3 +101,6 @@ This can be combined with other targets, ie `idf.py -p PORT erase_flash flash` w
* If you're interested in contributing to ESP-IDF, please check the [Contributions Guide](https://docs.espressif.com/projects/esp-idf/en/latest/contribute/index.html).
________
<a name="fn1">1</a>: ESP8266 and ESP8285 are not supported in ESP-IDF. See [RTOS SDK](https://github.com/espressif/ESP8266_RTOS_SDK) instead.

View File

@ -2,26 +2,22 @@
* [English Version](./README.md)
ESP-IDF 是由乐鑫官方推出的针对 **ESP32****ESP32-S2** 系列芯片的开发框架
ESP-IDF 是由乐鑫官方针对乐鑫各系列芯片产品(发布于 2016 年后<sup>[1](#fn1)</sup>)推出的开发框架,支持 Windows、Linux 和 macOS 操作系统
# 使用 ESP-IDF 进行开发
## 搭建 ESP-IDF 开发环境
请参阅如下指南搭建 ESP-IDF 的开发环境
| 芯片 | ESP-IDF 入门指南 |
|:----:|:----|
| <img src="docs/_static/chip-esp32.svg" height="85" alt="ESP32"> | <ul><li>[稳定](https://docs.espressif.com/projects/esp-idf/zh_CN/stable/get-started/) 版</li><li>[最新master 分支)](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/get-started/) 版本</li></ul> |
| <img src="docs/_static/chip-esp32-s2.svg" height="100" alt="ESP32-S2"> | <ul><li>[最新master 分支)](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s2/get-started/) 版本</li></ul> |
**注意:** 每个 ESP-IDF 版本都有其对应的文档。 请参阅 [版本](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/versions.html) 部分如何查找文档以及如何检出ESP-IDF的特定发行版。
关于不同芯片如何搭建 ESP-IDF 的开发环境,请参考 https://idf.espressif.com/。
**注意:** 不同系列芯片和不同 ESP-IDF 版本都有其对应的文档。请参阅[版本](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/versions.html)部分,获得关于如何查找文档以及如何检出 ESP-IDF 的特定发行版的详细信息。
### 非 GitHub 分叉的 ESP-IDF 项目
ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodules)),所以它们会指向 GitHub。
如果 ESP-IDF 被分叉到的仓库不在 GitHub 上,那么你需要在克隆结束后运行该[脚本](tools/set-submodules-to-github.sh)。它会为所有的子模块设置绝对路径,接着可以通过 `git submodule update --init --recursive` 完成子模块的更新
如果 ESP-IDF 被分叉到的仓库不在 GitHub 上,那么你需要在克隆结束后运行该脚本 [tools/set-submodules-to-github.sh](tools/set-submodules-to-github.sh)
这个脚本会为所有的子模块设置绝对路径,接着可以通过 `git submodule update --init --recursive` 完成子模块的更新。
如果 ESP-IDF 是从 GitHub 上克隆得到,则不需要此步骤。
## 寻找项目
@ -38,24 +34,16 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
## 设置构建环境
请参考入门指南中列出的详细步骤。
* 在主机中安装入门指南中提到的构建所依赖的工具。
* 将 ESP-IDF 中的 `tools/` 目录加入 PATH 环境变量中。
* 运行 `python -m pip install -r requirements.txt` 安装 Python 依赖库。
请参考入门指南中列出的详细步骤。
* 在主机中安装入门指南中提到的构建所依赖的工具。
* 运行安装脚本来设置构建环境。可为 Windows shell 选择 `install.bat``install.ps1`,为 Unix shell 选择 `install.sh``install.fish`
* 在使用 ESP-IDF 之前,需要在 shell 中运行导出脚本。Windows 下可运行 `export.bat`Unix 下可运行 `source export.sh`
## 配置项目
`idf.py menuconfig`
* 打开项目的文本配置菜单。
* 使用上下键浏览菜单。
* 使用回车键进入子菜单,退出键返回上一级菜单或者退出配置。
* 输入 `?` 查看帮助界面,按下回车键可以退出帮助界面。
* 使用空格键或者 `Y``N` 按键来启用和禁用带复选框“`[*]`”的配置项。
* 高亮某个配置项的同时按下 `?` 键可以显示该选项的帮助文档。
* 输入 `/` 可以搜索指定的配置项。
一旦配置完成,请按下退出键多次以退出配置界面,当提示是否保存新的的配置时,选择 “Yes”。
* `idf.py set-target <chip_name>` 可将项目的目标芯片设置为 `<chip_name>`。运行 `idf.py set-target`,不用带任何参数,可查看所有支持的目标芯片列表。
* `idf.py menuconfig` 可打开一个基于文本的配置菜单,可以用来对项目进行配置。
## 编译项目
@ -65,23 +53,23 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
## 烧写项目
当构建结束,终端会打印出一条命令行,告知如何使用 esptool.py 工具烧写项目到芯片中。但是你还可以运行下面这条命令来自动烧写:
当构建结束,终端会打印出一条命令行,告知如何使用 esptool.py 工具烧写项目到芯片中。但你也可以运行下面这条命令来自动烧写:
`idf.py -p PORT flash`
将其中的 PORT 替换为系统中实际串口的名字(比如 Windows 下的 `COM3`Linux 下的 `/dev/ttyUSB0`,或者 MacOS 下的 `/dev/cu.usbserial-X`。如果省略 `-p` 选项,`idf.py flash` 会尝试使用第一个可用的串口进行烧写。
将其中的 PORT 替换为系统中实际串口的名字(比如 Windows 下的 `COM3`Linux 下的 `/dev/ttyUSB0`,或者 macOS 下的 `/dev/cu.usbserial-X`。如果省略 `-p` 选项,`idf.py flash` 会尝试使用第一个可用的串口进行烧写。
这会烧写整个项目(包括应用程序,引导程序和分区表)到芯片中,此外还可以使用 `idf.py menuconfig` 来调整串口烧写相关的配置。
你也不必先运行 `idf.py build`再运行 `idf.py flash``idf.py flash` 会根据需要自动重新构建项目。
不必先运行 `idf.py build` 再运行 `idf.py flash``idf.py flash` 会根据需要自动重新构建项目。
## 观察串口输入
`idf.py monitor` 会调用 [idf_monitor 工具](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html)来显示 ESP32 和 ESP32-S2 的串口输出。`idf_monitor` 还包含一系列的功能来解析程序崩溃后的输出结果并与设备进行交互。更多详细内容,请参阅[文档](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
`idf.py monitor` 会调用 [idf_monitor 工具](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html)来显示乐鑫芯片的串口输出。`idf_monitor` 还包含一系列的功能来解析程序崩溃后的输出结果并与设备进行交互。更多详细内容,请参阅[文档](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
输入 `Ctrl-]` 可退出监视器。
想要一次性执行构建烧写和监视,可以运行如下命令:
想要一次性执行构建烧写和监视,可以运行如下命令:
`idf.py flash monitor`
@ -92,24 +80,27 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
* `idf.py app` - 仅构建应用程序。
* `idf.py app-flash` - 仅烧写应用程序。
`idf.py app-flash` 会自动判断是否有源文件发生了改变后重新构建应用程序。
`idf.py app-flash` 会自动判断是否有源文件发生了改变后重新构建应用程序。
(在正常的开发中,即使引导程序和分区表没有发生变化,每次都重新烧写它们并不会带来什么危害。)
## 擦除 Flash
`idf.py flash` 并不会擦除 Flash 上所有的内容,但是有时候我们需要设备恢复到完全擦除的状态,尤其是分区表发生了变化或者 OTA 应用升级。要擦除整块 Flash 请运行 `idf.py erase_flash`
`idf.py flash` 并不会擦除 flash 上所有的内容,但是有时候我们需要设备恢复到完全擦除的状态,尤其是分区表发生了变化或者 OTA 应用升级。要擦除整块 flash 请运行 `idf.py erase_flash`
这条命令还可以和其余命令整合在一起,`idf.py -p PORT erase_flash flash` 会擦除一切然后重新烧写新的应用程序引导程序和分区表。
这条命令还可以和其余命令整合在一起,`idf.py -p PORT erase_flash flash` 会擦除一切然后重新烧写新的应用程序引导程序和分区表。
# 其它参考资源
* 最新版的文档https://docs.espressif.com/projects/esp-idf/ ,该文档是由本仓库 [docs 目录](docs) 构建得到。
* 最新版的文档https://docs.espressif.com/projects/esp-idf/,该文档是由本仓库 [docs 目录](docs) 构建得到。
* 可以前往 [esp32.com 论坛](https://esp32.com/) 提问,挖掘社区资源。
* 如果你在使用中发现了错误或者需要新的功能,请先[查看 GitHub Issues](https://github.com/espressif/esp-idf/issues),确保该问题不会被重复提交。
* 如果你在使用中发现了错误或者需要新的功能,请先[查看 GitHub Issues](https://github.com/espressif/esp-idf/issues),确保该问题没有重复提交。
* 如果你有兴趣为 ESP-IDF 作贡献,请先阅读[贡献指南](https://docs.espressif.com/projects/esp-idf/en/latest/contribute/index.html)。
__________
<a name="fn1">1</a>: ESP-IDF 不支持 ESP8266 和 ESP8285。如有需要请参考 [RTOS SDK](https://github.com/espressif/ESP8266_RTOS_SDK)。

View File

@ -30,13 +30,17 @@ endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
PRIV_REQUIRES soc
PRIV_REQUIRES soc esp_ipc
LDFRAGMENTS linker.lf)
# disable --coverage for this component, as it is used as transport
# for gcov
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
# Force app_trace to also appear later than gcov in link line
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
if(CONFIG_APPTRACE_GCOV_ENABLE)
# disable --coverage for this component, as it is used as transport
# for gcov
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
# Force app_trace to also appear later than gcov in link line
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-Wl,--undefined=gcov_rtio_atexit" $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
endif()

View File

@ -8,11 +8,7 @@ COMPONENT_ADD_INCLUDEDIRS = include
COMPONENT_ADD_LDFLAGS = -lapp_trace
# do not produce gcov info for this module, it is used as transport for gcov
CFLAGS := $(subst --coverage,,$(CFLAGS))
ifdef CONFIG_SYSVIEW_ENABLE
COMPONENT_ADD_INCLUDEDIRS += \
sys_view/Config \
sys_view/SEGGER \
@ -26,7 +22,12 @@ COMPONENT_SRCDIRS += \
sys_view/esp32 \
sys_view/ext
else
ifdef CONFIG_APPTRACE_GCOV_ENABLE
# do not produce gcov info for this module, it is used as transport for gcov
CFLAGS := $(subst --coverage,,$(CFLAGS))
COMPONENT_ADD_LDFLAGS += -Wl,--undefined=gcov_rtio_atexit
COMPONENT_SRCDIRS += gcov
endif
endif
COMPONENT_ADD_LDFRAGMENTS += linker.lf

View File

@ -22,7 +22,9 @@
#include "soc/cpu.h"
#include "soc/timer_periph.h"
#include "esp_app_trace.h"
#include "esp_freertos_hooks.h"
#include "esp_private/dbg_stubs.h"
#include "esp_ipc.h"
#include "hal/wdt_hal.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/libc_stubs.h"
@ -37,128 +39,113 @@
#define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL
#include "esp_log.h"
const static char *TAG = "esp_gcov_rtio";
static volatile bool s_create_gcov_task = false;
static volatile bool s_gcov_task_running = false;
extern void __gcov_dump(void);
extern void __gcov_reset(void);
static struct syscall_stub_table s_gcov_stub_table;
static int gcov_stub_lock_try_acquire_recursive(_lock_t *lock)
void gcov_dump_task(void *pvParameter)
{
if (*lock && uxSemaphoreGetCount((xSemaphoreHandle)(*lock)) == 0) {
// we can do nothing here, gcov dump is initiated with some resource locked
// which is also used by gcov functions
ESP_EARLY_LOGE(TAG, "Lock 0x%x is busy during GCOV dump! System state can be inconsistent after dump!", lock);
}
return pdTRUE;
}
int dump_result = 0;
bool *running = (bool *)pvParameter;
static void gcov_stub_lock_acquire_recursive(_lock_t *lock)
{
gcov_stub_lock_try_acquire_recursive(lock);
}
ESP_EARLY_LOGV(TAG, "%s stack use in %d", __FUNCTION__, uxTaskGetStackHighWaterMark(NULL));
static void gcov_stub_lock_release_recursive(_lock_t *lock)
{
}
static int esp_dbg_stub_gcov_dump_do(void)
{
int ret = ESP_OK;
FILE* old_stderr = stderr;
FILE* old_stdout = stdout;
static struct syscall_stub_table *old_tables[portNUM_PROCESSORS];
old_tables[0] = syscall_table_ptr_pro;
#if portNUM_PROCESSORS > 1
old_tables[1] = syscall_table_ptr_app;
#endif
ESP_EARLY_LOGV(TAG, "Alloc apptrace down buf %d bytes", ESP_GCOV_DOWN_BUF_SIZE);
void *down_buf = malloc(ESP_GCOV_DOWN_BUF_SIZE);
if (down_buf == NULL) {
ESP_EARLY_LOGE(TAG, "Could not allocate memory for the buffer");
return ESP_ERR_NO_MEM;
dump_result = ESP_ERR_NO_MEM;
goto gcov_exit;
}
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...");
// incase of dual-core chip APP and PRO CPUs share the same table, so it is safe to save only PRO's table
memcpy(&s_gcov_stub_table, syscall_table_ptr_pro, sizeof(s_gcov_stub_table));
s_gcov_stub_table._lock_acquire_recursive = &gcov_stub_lock_acquire_recursive;
s_gcov_stub_table._lock_release_recursive = &gcov_stub_lock_release_recursive;
s_gcov_stub_table._lock_try_acquire_recursive = &gcov_stub_lock_try_acquire_recursive,
syscall_table_ptr_pro = &s_gcov_stub_table;
#if portNUM_PROCESSORS > 1
syscall_table_ptr_app = &s_gcov_stub_table;
#endif
stderr = (FILE*) &__sf_fake_stderr;
stdout = (FILE*) &__sf_fake_stdout;
__gcov_dump();
// reset dump status to allow incremental data accumulation
__gcov_reset();
stdout = old_stdout;
stderr = old_stderr;
syscall_table_ptr_pro = old_tables[0];
#if portNUM_PROCESSORS > 1
syscall_table_ptr_app = old_tables[1];
#endif
ESP_EARLY_LOGV(TAG, "Free apptrace down buf");
free(down_buf);
stderr = old_stderr;
stdout = old_stdout;
ESP_EARLY_LOGV(TAG, "Finish file transfer session");
ret = esp_apptrace_fstop(ESP_APPTRACE_DEST_TRAX);
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send files transfer stop cmd (%d)!", ret);
dump_result = esp_apptrace_fstop(ESP_APPTRACE_DEST_TRAX);
if (dump_result != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send files transfer stop cmd (%d)!", dump_result);
}
gcov_exit:
ESP_EARLY_LOGV(TAG, "dump_result %d", dump_result);
if (running) {
*running = false;
}
ESP_EARLY_LOGV(TAG, "%s stack use out %d", __FUNCTION__, uxTaskGetStackHighWaterMark(NULL));
vTaskDelete(NULL);
}
void gcov_create_task(void *arg)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", 2048, (void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
}
void gcov_create_task_tick_hook(void)
{
extern esp_err_t esp_ipc_start_gcov_from_isr(uint32_t cpu_id, esp_ipc_func_t func, void* arg);
if (s_create_gcov_task) {
if (esp_ipc_start_gcov_from_isr(xPortGetCoreID(), &gcov_create_task, NULL) == ESP_OK) {
s_create_gcov_task = false;
}
}
ESP_EARLY_LOGV(TAG, "exit %d", ret);
return ret;
}
/**
* @brief Triggers gcov info dump.
* @brief Triggers gcov info dump task
* This function is to be called by OpenOCD, not by normal user code.
* TODO: what about interrupted flash access (when cache disabled)???
* TODO: what about interrupted flash access (when cache disabled)
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
static int esp_dbg_stub_gcov_entry(void)
{
return esp_dbg_stub_gcov_dump_do();
/* we are in isr context here */
s_create_gcov_task = true;
return ESP_OK;
}
int gcov_rtio_atexit(void (*function)(void) __attribute__ ((unused)))
{
uint32_t capabilities = 0;
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
esp_dbg_stub_entry_set(ESP_DBG_STUB_ENTRY_GCOV, (uint32_t)&esp_dbg_stub_gcov_entry);
return 0;
if (esp_dbg_stub_entry_get(ESP_DBG_STUB_ENTRY_CAPABILITIES, &capabilities) == ESP_OK) {
esp_dbg_stub_entry_set(ESP_DBG_STUB_ENTRY_CAPABILITIES, capabilities | ESP_DBG_STUB_CAP_GCOV_TASK);
}
esp_register_freertos_tick_hook(gcov_create_task_tick_hook);
return ESP_OK;
}
void esp_gcov_dump(void)
{
// disable IRQs on this CPU, other CPU is halted by OpenOCD
unsigned irq_state = portENTER_CRITICAL_NESTED();
#if !CONFIG_FREERTOS_UNICORE
int other_core = xPortGetCoreID() ? 0 : 1;
esp_cpu_stall(other_core);
#endif
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
while (!esp_apptrace_host_is_connected(ESP_APPTRACE_DEST_TRAX)) {
wdt_hal_context_t twdt = {.inst = WDT_MWDT0, .mwdt_dev = &TIMERG0};
wdt_hal_context_t iwdt = {.inst = WDT_MWDT1, .mwdt_dev = &TIMERG1};
//Feed the Task Watchdog (TG0) to prevent it from timing out
wdt_hal_write_protect_disable(&twdt);
wdt_hal_feed(&twdt);
wdt_hal_write_protect_enable(&twdt);
//Likewise, feed the Interrupt Watchdog (TG1) to prevent a reboot
wdt_hal_write_protect_disable(&iwdt);
wdt_hal_feed(&iwdt);
wdt_hal_write_protect_enable(&iwdt);
vTaskDelay(pdMS_TO_TICKS(10));
}
esp_dbg_stub_gcov_dump_do();
#if !CONFIG_FREERTOS_UNICORE
esp_cpu_unstall(other_core);
#endif
portEXIT_CRITICAL_NESTED(irq_state);
/* We are not in isr context here. Waiting for the completion is safe */
s_gcov_task_running = true;
s_create_gcov_task = true;
while (s_gcov_task_running) {
vTaskDelay(pdMS_TO_TICKS(10));
}
}
void *gcov_rtio_fopen(const char *path, const char *mode)
@ -177,7 +164,7 @@ int gcov_rtio_fclose(void *stream)
size_t gcov_rtio_fread(void *ptr, size_t size, size_t nmemb, void *stream)
{
ESP_EARLY_LOGV(TAG, "%s read %u", __FUNCTION__, size*nmemb);
ESP_EARLY_LOGV(TAG, "%s read %u", __FUNCTION__, size * nmemb);
size_t sz = esp_apptrace_fread(ESP_APPTRACE_DEST_TRAX, ptr, size, nmemb, stream);
ESP_EARLY_LOGV(TAG, "%s actually read %u", __FUNCTION__, sz);
return sz;

View File

@ -3,12 +3,13 @@ archive: libapp_trace.a
entries:
app_trace (noflash)
app_trace_util (noflash)
SEGGER_SYSVIEW (noflash)
SEGGER_RTT_esp32 (noflash)
SEGGER_SYSVIEW_Config_FreeRTOS (noflash)
SEGGER_SYSVIEW_FreeRTOS (noflash)
if SYSVIEW_ENABLE = y:
SEGGER_SYSVIEW (noflash)
SEGGER_RTT_esp32 (noflash)
SEGGER_SYSVIEW_Config_FreeRTOS (noflash)
SEGGER_SYSVIEW_FreeRTOS (noflash)
[mapping:driver]
[mapping:app_trace_driver]
archive: libdriver.a
entries:
if SYSVIEW_TS_SOURCE_TIMER_00 = y || SYSVIEW_TS_SOURCE_TIMER_01 = y

View File

@ -89,7 +89,10 @@ int IRAM_ATTR esp_ota_get_app_elf_sha256(char* dst, size_t size)
static bool first_call = true;
if (first_call) {
first_call = false;
const uint8_t* src = esp_app_desc.app_elf_sha256;
// At -O2 optimization level, GCC optimizes out the copying of the first byte of the app_elf_sha256,
// because it is zero at compile time, and only modified afterwards by esptool.
// Casting to volatile disables the optimization.
const volatile uint8_t* src = (const volatile uint8_t*)esp_app_desc.app_elf_sha256;
for (size_t i = 0; i < sizeof(s_app_elf_sha256); ++i) {
s_app_elf_sha256[i] = src[i];
}

View File

@ -41,6 +41,12 @@
#include "esp_system.h"
#include "esp_efuse.h"
#ifdef CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/crc.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/crc.h"
#include "esp32s2/rom/secure_boot.h"
#endif
#define SUB_TYPE_ID(i) (i & 0x0F)
@ -858,3 +864,24 @@ esp_err_t esp_ota_erase_last_boot_app_partition(void)
return ESP_OK;
}
#if CONFIG_IDF_TARGET_ESP32S2 && CONFIG_SECURE_BOOT_V2_ENABLED
esp_err_t esp_ota_revoke_secure_boot_public_key(esp_ota_secure_boot_public_key_index_t index) {
if (!esp_secure_boot_enabled()) {
ESP_LOGE(TAG, "Secure boot v2 has not been enabled.");
return ESP_FAIL;
}
if (index != SECURE_BOOT_PUBLIC_KEY_INDEX_0 &&
index != SECURE_BOOT_PUBLIC_KEY_INDEX_1 &&
index != SECURE_BOOT_PUBLIC_KEY_INDEX_2) {
ESP_LOGE(TAG, "Invalid Index found for public key revocation %d.", index);
return ESP_ERR_INVALID_ARG;
}
ets_secure_boot_revoke_public_key_digest(index);
ESP_LOGI(TAG, "Revoked signature block %d.", index);
return ESP_OK;
}
#endif

View File

@ -49,7 +49,7 @@ typedef uint32_t esp_ota_handle_t;
/**
* @brief Return esp_app_desc structure. This structure includes app version.
*
*
* Return description for running app.
* @return Pointer to esp_app_desc structure.
*/
@ -224,7 +224,7 @@ const esp_partition_t* esp_ota_get_next_update_partition(const esp_partition_t *
/**
* @brief Returns esp_app_desc structure for app partition. This structure includes app version.
*
*
* Returns a description for the requested app partition.
* @param[in] partition Pointer to app partition. (only app partition)
* @param[out] app_desc Structure of info about app.
@ -299,6 +299,34 @@ esp_err_t esp_ota_erase_last_boot_app_partition(void);
*/
bool esp_ota_check_rollback_is_possible(void);
#if CONFIG_IDF_TARGET_ESP32S2 && (CONFIG_SECURE_BOOT_V2_ENABLED || __DOXYGEN__)
/**
* Secure Boot V2 public key indexes.
*/
typedef enum {
SECURE_BOOT_PUBLIC_KEY_INDEX_0, /*!< Points to the 0th index of the Secure Boot v2 public key */
SECURE_BOOT_PUBLIC_KEY_INDEX_1, /*!< Points to the 1st index of the Secure Boot v2 public key */
SECURE_BOOT_PUBLIC_KEY_INDEX_2 /*!< Points to the 2nd index of the Secure Boot v2 public key */
} esp_ota_secure_boot_public_key_index_t;
/**
* @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.
*
* @param index - The index of the signature block to be revoked
*
* @return
* - ESP_OK: If revocation is successful.
* - ESP_ERR_INVALID_ARG: If the index of the public key to be revoked is incorrect.
* - ESP_FAIL: If secure boot v2 has not been enabled.
*/
esp_err_t esp_ota_revoke_secure_boot_public_key(esp_ota_secure_boot_public_key_index_t index);
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
#ifdef __cplusplus
}
#endif

View File

@ -87,9 +87,8 @@ class OtatoolTarget():
seq = bytearray(self.otadata[start:start + 4])
crc = bytearray(self.otadata[start + 28:start + 32])
seq = struct.unpack('>I', seq)
crc = struct.unpack('>I', crc)
seq = struct.unpack('I', seq)
crc = struct.unpack('I', crc)
info.append(otadata_info(seq[0], crc[0]))
return info
@ -103,12 +102,11 @@ class OtatoolTarget():
def switch_ota_partition(self, ota_id):
self._check_otadata_partition()
sys.path.append(PARTTOOL_DIR)
import gen_esp32part as gen
def is_otadata_info_valid(status):
seq = status.seq % (1 << 32)
crc = hex(binascii.crc32(struct.pack("I", seq), 0xFFFFFFFF) % (1 << 32))
crc = binascii.crc32(struct.pack('I', seq), 0xFFFFFFFF) % (1 << 32)
return seq < (int('0xFFFFFFFF', 16) % (1 << 32)) and status.crc == crc
partition_table = self.target.partition_table
@ -219,8 +217,8 @@ def _read_otadata(target):
otadata_info = target._get_otadata_info()
print(" {:8s} \t {:8s} | \t {:8s} \t {:8s}".format("OTA_SEQ", "CRC", "OTA_SEQ", "CRC"))
print("Firmware: 0x{:8x} \t0x{:8x} | \t0x{:8x} \t 0x{:8x}".format(otadata_info[0].seq, otadata_info[0].crc,
print(' {:8s} \t {:8s} | \t {:8s} \t {:8s}'.format('OTA_SEQ', 'CRC', 'OTA_SEQ', 'CRC'))
print('Firmware: 0x{:08x} \t0x{:08x} | \t0x{:08x} \t 0x{:08x}'.format(otadata_info[0].seq, otadata_info[0].crc,
otadata_info[1].seq, otadata_info[1].crc))
@ -249,6 +247,10 @@ def _erase_ota_partition(target, ota_id):
def main():
if sys.version_info[0] < 3:
print("WARNING: Support for Python 2 is deprecated and will be removed in future versions.", file=sys.stderr)
elif sys.version_info[0] == 3 and sys.version_info[1] < 6:
print("WARNING: Python 3 versions older than 3.6 are not supported.", file=sys.stderr)
global quiet
parser = argparse.ArgumentParser("ESP-IDF OTA Partitions Tool")

View File

@ -23,7 +23,7 @@
#include "unity.h"
#include "bootloader_common.h"
#include "../include_bootloader/bootloader_flash.h"
#include "../include_bootloader/bootloader_flash_priv.h"
#include "esp_log.h"
#include "esp_ota_ops.h"

View File

@ -53,20 +53,34 @@ menu "Bootloader config"
default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
config BOOTLOADER_SPI_CUSTOM_WP_PIN
bool "Use custom SPI Flash WP Pin when flash pins set in eFuse (read help)"
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
default y if BOOTLOADER_SPI_WP_PIN != 7 # backwards compatibility, can remove in IDF 5
default n
help
This setting is only used if the SPI flash pins have been overridden by setting the eFuses
SPI_PAD_CONFIG_xxx, and the SPI flash mode is QIO or QOUT.
When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka
ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The same pin is also used
for external SPIRAM if it is enabled.
If this config item is set to N (default), the correct WP pin will be automatically used for any
Espressif chip or module with integrated flash. If a custom setting is needed, set this config item to
Y and specify the GPIO number connected to the WP.
config BOOTLOADER_SPI_WP_PIN
int "SPI Flash WP Pin when customising pins via eFuse (read help)"
int "Custom SPI Flash WP Pin"
range 0 33
default 7
depends on ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
#depends on BOOTLOADER_SPI_CUSTOM_WP_PIN # backwards compatibility, can uncomment in IDF 5
help
This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been
overriden by setting the eFuses SPI_PAD_CONFIG_xxx.
The option "Use custom SPI Flash WP Pin" must be set or this value is ignored
When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka ESP32
pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. That pin number is compiled into the
bootloader instead.
The default value (GPIO 7) is correct for WP pin on ESP32-D2WD integrated flash.
If burning a customized set of SPI flash pins in eFuse and using QIO or QOUT mode for flash, set this
value to the GPIO number of the SPI flash WP pin.
choice BOOTLOADER_VDDSDIO_BOOST
bool "VDDSDIO LDO voltage"
@ -100,7 +114,8 @@ menu "Bootloader config"
config BOOTLOADER_NUM_PIN_FACTORY_RESET
int "Number of the GPIO input for factory reset"
depends on BOOTLOADER_FACTORY_RESET
range 0 39
range 0 39 if IDF_TARGET_ESP32
range 0 44 if IDF_TARGET_ESP32S2
default 4
help
The selected GPIO will be configured as an input with internal pull-up enabled.
@ -294,6 +309,15 @@ menu "Bootloader config"
in this area of memory, you can increase it. It must be a multiple of 4 bytes.
This area (rtc_retain_mem_t) is reserved and has access from the bootloader and an application.
config BOOTLOADER_FLASH_XMC_SUPPORT
bool "Enable the support for flash chips of XMC (READ HELP FIRST)"
default y
help
Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow.
XMC chips will be forbidden to be used, when this option is disabled.
DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
endmenu # Bootloader
@ -320,6 +344,16 @@ menu "Security features"
select MBEDTLS_ECDSA_C
depends on SECURE_SIGNED_ON_BOOT || SECURE_SIGNED_ON_UPDATE
config SECURE_BOOT_SUPPORTS_RSA
bool
default y
depends on ESP32_REV_MIN_3 || IDF_TARGET_ESP32S2
config SECURE_TARGET_HAS_SECURE_ROM_DL_MODE
bool
default y
depends on IDF_TARGET_ESP32S2
config SECURE_SIGNED_APPS_NO_SECURE_BOOT
bool "Require signed app images"
@ -355,7 +389,7 @@ menu "Security features"
config SECURE_SIGNED_APPS_RSA_SCHEME
bool "RSA"
depends on ESP32_REV_MIN_3 && SECURE_BOOT_V2_ENABLED
depends on SECURE_BOOT_SUPPORTS_RSA && SECURE_BOOT_V2_ENABLED
help
Appends the RSA-3072 based Signature block to the application.
Refer to <Secure Boot Version 2 documentation link> before enabling.
@ -419,7 +453,9 @@ menu "Security features"
config SECURE_BOOT_V2_ENABLED
bool "Enable Secure Boot version 2"
depends on ESP32_REV_MIN_3
depends on SECURE_BOOT_SUPPORTS_RSA
select SECURE_ENABLE_SECURE_ROM_DL_MODE if !IDF_TARGET_ESP32 && !SECURE_INSECURE_ALLOW_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE # NOERROR
select SECURE_DISABLE_ROM_DL_MODE if ESP32_REV_MIN_3 && !SECURE_INSECURE_ALLOW_DL_MODE
help
Build a bootloader which enables Secure Boot version 2 on first boot.
Refer to Secure Boot V2 section of the ESP-IDF Programmer's Guide for this version before enabling.
@ -539,6 +575,7 @@ menu "Security features"
config SECURE_FLASH_ENC_ENABLED
bool "Enable flash encryption on boot (READ DOCS FIRST)"
default N
select SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE
help
If this option is set, flash contents will be encrypted by the bootloader on first boot.
@ -587,7 +624,8 @@ menu "Security features"
config SECURE_FLASH_ENCRYPTION_MODE_RELEASE
bool "Release"
select SECURE_ENABLE_SECURE_ROM_DL_MODE
select SECURE_ENABLE_SECURE_ROM_DL_MODE if SECURE_TARGET_HAS_SECURE_ROM_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE # NOERROR
select PARTITION_TABLE_MD5 if !ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS
endchoice
@ -649,9 +687,30 @@ menu "Security features"
efuse when Secure Boot is enabled. This prevents any more efuses from being read protected.
If this option is set, it will remain possible to write the EFUSE_RD_DIS efuse field after Secure
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse holding the public
key digest, causing an immediate denial of service and possibly allowing an additional fault
injection attack to bypass the signature protection.
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse (for ESP32) and
BLOCK4-BLOCK10 (i.e. BLOCK_KEY0-BLOCK_KEY5)(for other chips) holding the public key digest, causing an
immediate denial of service and possibly allowing an additional fault injection attack to
bypass the signature protection.
NOTE: Once a BLOCK is read-protected, the application will read all zeros from that block
NOTE: If "UART ROM download mode (Permanently disabled (recommended))" or
"UART ROM download mode (Permanently switch to Secure mode (recommended))" is set,
then it is __NOT__ possible to read/write efuses using espefuse.py utility.
However, efuse can be read/written from the application
config SECURE_INSECURE_ALLOW_DL_MODE
bool "Don't automatically restrict UART download mode"
depends on SECURE_BOOT_INSECURE && SECURE_BOOT_V2_ENABLED
default N
help
By default, enabling either flash encryption in release mode or secure boot will automatically
disable UART download mode on ESP32 ECO3, or enable secure download mode on newer chips.
This is recommended to reduce the attack surface of the chip.
To allow the full UART download mode to stay enabled, enable this option and ensure
the options SECURE_DISABLE_ROM_DL_MODE and SECURE_ENABLE_SECURE_ROM_DL_MODE are disabled as applicable.
This is not recommended.
config SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC
bool "Leave UART bootloader encryption enabled"
@ -719,7 +778,7 @@ menu "Security features"
config SECURE_ENABLE_SECURE_ROM_DL_MODE
bool "Permanently switch to ROM UART Secure Download mode"
depends on IDF_TARGET_ESP32S2 && !SECURE_DISABLE_ROM_DL_MODE
depends on SECURE_TARGET_HAS_SECURE_ROM_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE
help
If set, during startup the app will burn an eFuse bit to permanently switch the UART ROM
Download Mode into a separate Secure Download mode. This option can only work if

View File

@ -102,7 +102,7 @@ endif
bootloader: $(BOOTLOADER_DIGEST_BIN)
@echo $(SEPARATOR)
@echo "Bootloader built and secure digest generated. First time flash command is:"
@echo "$(ESPEFUSEPY) burn_key secure_boot $(SECURE_BOOTLOADER_KEY)"
@echo "$(ESPEFUSEPY) burn_key secure_boot_v1 $(SECURE_BOOTLOADER_KEY)"
@echo "$(ESPTOOLPY_WRITE_FLASH) $(BOOTLOADER_OFFSET) $(BOOTLOADER_BIN)"
@echo $(SEPARATOR)
@echo "To reflash the bootloader after initial flash:"

View File

@ -92,20 +92,20 @@ endif()
if(CONFIG_SECURE_BOOT_V2_ENABLED)
if(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)
get_filename_component(secure_boot_signing_key
get_filename_component(secure_boot_signing_key
"${SECURE_BOOT_SIGNING_KEY}" ABSOLUTE BASE_DIR "${project_dir}")
if(NOT EXISTS "${secure_boot_signing_key}")
message(FATAL_ERROR
"Secure Boot Signing Key Not found."
"\nGenerate the Secure Boot V2 RSA-PSS 3072 Key."
"\nTo generate one, you can use this command:"
"\n\t${espsecurepy} generate_signing_key --version 2 ${SECURE_BOOT_SIGNING_KEY}")
message(FATAL_ERROR
"Secure Boot Signing Key Not found."
"\nGenerate the Secure Boot V2 RSA-PSS 3072 Key."
"\nTo generate one, you can use this command:"
"\n\t${espsecurepy} generate_signing_key --version 2 ${SECURE_BOOT_SIGNING_KEY}")
endif()
set(bootloader_unsigned_bin "bootloader-unsigned.bin")
add_custom_command(OUTPUT ".signed_bin_timestamp"
COMMAND cp "${CMAKE_BINARY_DIR}/${PROJECT_BIN}" "${CMAKE_BINARY_DIR}/${bootloader_unsigned_bin}"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/${PROJECT_BIN}" "${CMAKE_BINARY_DIR}/${bootloader_unsigned_bin}"
COMMAND ${ESPSECUREPY} sign_data --version 2 --keyfile "${secure_boot_signing_key}"
-o "${CMAKE_BINARY_DIR}/${PROJECT_BIN}" "${CMAKE_BINARY_DIR}/${bootloader_unsigned_bin}"
COMMAND ${CMAKE_COMMAND} -E echo "Generated signed binary image ${build_dir}/${PROJECT_BIN}"
@ -117,7 +117,7 @@ if(CONFIG_SECURE_BOOT_V2_ENABLED)
else()
add_custom_command(OUTPUT ".signed_bin_timestamp"
VERBATIM
COMMENT "Bootloader generated but not signed")
COMMENT "Bootloader generated but not signed")
endif()
add_custom_target (gen_signed_bootloader ALL DEPENDS "${build_dir}/.signed_bin_timestamp")
@ -147,7 +147,7 @@ elseif(CONFIG_SECURE_BOOTLOADER_REFLASHABLE)
COMMAND ${CMAKE_COMMAND} -E echo
"Burn secure boot key to efuse using:"
COMMAND ${CMAKE_COMMAND} -E echo
"\t${espefusepy} burn_key secure_boot ${secure_bootloader_key}"
"\t${espefusepy} burn_key secure_boot_v1 ${secure_bootloader_key}"
COMMAND ${CMAKE_COMMAND} -E echo
"First time flash command is:"
COMMAND ${CMAKE_COMMAND} -E echo
@ -166,6 +166,24 @@ elseif(CONFIG_SECURE_BOOTLOADER_REFLASHABLE)
"* Not recommended to re-use the same secure boot keyfile on multiple production devices."
DEPENDS gen_secure_bootloader_key gen_bootloader_digest_bin
VERBATIM)
elseif(CONFIG_SECURE_BOOT_V2_ENABLED AND CONFIG_IDF_TARGET_ESP32S2)
add_custom_command(TARGET bootloader.elf POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo
"=============================================================================="
COMMAND ${CMAKE_COMMAND} -E echo
"Bootloader built. Secure boot enabled, so bootloader not flashed automatically."
COMMAND ${CMAKE_COMMAND} -E echo
"To sign the bootloader with additional private keys."
COMMAND ${CMAKE_COMMAND} -E echo
"\t${espsecurepy} sign_data -k secure_boot_signing_key2.pem -v 2 --append_signatures -o signed_bootloader.bin build/bootloader/bootloader.bin"
COMMAND ${CMAKE_COMMAND} -E echo
"Secure boot enabled, so bootloader not flashed automatically."
COMMAND ${CMAKE_COMMAND} -E echo
"\t${esptoolpy_write_flash} ${BOOTLOADER_OFFSET} ${CMAKE_BINARY_DIR}/bootloader.bin"
COMMAND ${CMAKE_COMMAND} -E echo
"=============================================================================="
DEPENDS gen_signed_bootloader
VERBATIM)
elseif(CONFIG_SECURE_BOOT_V2_ENABLED)
add_custom_command(TARGET bootloader.elf POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo

View File

@ -32,4 +32,6 @@ CFLAGS += -D BOOTLOADER_BUILD=1
# include the top-level "project" include directory, for sdkconfig.h
CFLAGS += -I$(BUILD_DIR_BASE)/../include
COMPONENT_ADD_LDFLAGS += -l$(COMPONENT_NAME) -Wl,--wrap=longjmp \
include $(IDF_PATH)/make/project.mk

View File

@ -42,6 +42,7 @@ SECTIONS
*libbootloader_support.a:bootloader_common.*(.literal .text .literal.* .text.*)
*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_efuse_esp32.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
@ -163,8 +164,35 @@ SECTIONS
*(.fini.literal)
*(.fini)
*(.gnu.version)
/** CPU will try to prefetch up to 16 bytes of
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
* safe access to up to 16 bytes after the last real instruction, add
* dummy bytes to ensure this
*/
. += 16;
_text_end = ABSOLUTE(.);
_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

@ -5,9 +5,9 @@
MEMORY
{
iram_seg (RWX) : org = 0x40050000, len = 0x4000 /* 16KB, SRAM Block_14 */
iram_loader_seg (RWX) : org = 0x40054000, len = 0x4000 /* 16KB, SRAM Block_15 */
dram_seg (RW) : org = 0x3FFE8000, len = 0x2800 /* 10KB, Top of SRAM Block_16, and before ROM data and stack */
iram_seg (RWX) : org = 0x4004c000, len = 0x4000 /* SRAM Block 13 */
iram_loader_seg (RWX) : org = 0x40050000, len = 0x6000 /* SRAM Block 14 & part of 15 */
dram_seg (RW) : org = 0x3FFE6000, len = 0x4B00 /* Part SRAM Blocks 15 & 16, ROM static buffer starts at end of this region (reclaimed after app runs) */
}
/* Default entry point: */
@ -28,6 +28,7 @@ SECTIONS
*libbootloader_support.a:bootloader_common.*(.literal .text .literal.* .text.*)
*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_efuse_esp32s2.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
@ -39,6 +40,7 @@ SECTIONS
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
*libsoc.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
*libsoc.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
*libefuse.a:*.*(.literal .text .literal.* .text.*)
*(.fini.literal)
*(.fini)
@ -148,8 +150,35 @@ SECTIONS
*(.fini.literal)
*(.fini)
*(.gnu.version)
/** CPU will try to prefetch up to 16 bytes of
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
* safe access to up to 16 bytes after the last real instruction, add
* dummy bytes to ensure this
*/
. += 16;
_text_end = ABSOLUTE(.);
_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

@ -4,6 +4,7 @@ set(srcs
"src/bootloader_flash.c"
"src/bootloader_mem.c"
"src/bootloader_random.c"
"src/bootloader_random_${IDF_TARGET}.c"
"src/bootloader_utility.c"
"src/esp_image_format.c"
"src/flash_encrypt.c"

View File

@ -20,7 +20,8 @@ COMPONENT_OBJEXCLUDE := src/bootloader_init.o
endif
COMPONENT_OBJEXCLUDE += src/bootloader_flash_config_esp32s2.o \
src/bootloader_efuse_esp32s2.o
src/bootloader_efuse_esp32s2.o \
src/bootloader_random_esp32s2.o
ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME

View File

@ -0,0 +1,61 @@
// Copyright 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.
#pragma once
#include <stdint.h>
#include <esp_err.h>
#include <esp_spi_flash.h> /* including in bootloader for error values */
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Read flash ID by sending 0x9F command
* @return flash raw ID
* mfg_id = (ID >> 16) & 0xFF;
flash_id = ID & 0xffff;
*/
uint32_t bootloader_read_flash_id(void);
#if SOC_CACHE_SUPPORT_WRAP
/**
* @brief Set the burst mode setting command for specified wrap mode.
*
* @param mode The specified warp mode.
* @return always ESP_OK
*/
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
#endif
/**
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
*
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indiciating you should reboot before erase/write).
*/
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 bootloader_flash_unlock(void);
#ifdef __cplusplus
}
#endif

View File

@ -14,6 +14,7 @@
#pragma once
#include "sdkconfig.h"
#include "esp_image_format.h"
#ifdef __cplusplus
@ -27,6 +28,14 @@ extern "C" {
*/
void bootloader_flash_update_id(void);
/**
* @brief Update the flash size in g_rom_flashchip (global esp_rom_spiflash_chip_t structure).
*
* @param size The size to store, in bytes.
* @return None
*/
void bootloader_flash_update_size(uint32_t size);
/**
* @brief Set the flash CS setup and hold time.
*
@ -66,6 +75,22 @@ void bootloader_flash_gpio_config(const esp_image_header_t* pfhdr);
*/
void bootloader_flash_dummy_config(const esp_image_header_t* pfhdr);
#ifdef CONFIG_IDF_TARGET_ESP32
/**
* @brief Return the pin number used for custom SPI flash and/or SPIRAM WP pin
*
* Can be determined by eFuse values in most cases, or overriden in configuration
*
* This value is only meaningful if the other SPI flash pins are overriden via eFuse.
*
* This value is only meaningful if flash is set to QIO or QOUT mode, or if
* SPIRAM is enabled.
*
* @return Pin number to use, or -1 if the default should be kept
*/
int bootloader_flash_get_wp_pin(void);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -42,6 +42,9 @@ extern "C" {
#define PART_FLAG_ENCRYPTED (1<<0)
/* The md5sum value is found this many bytes after the ESP_PARTITION_MAGIC_MD5 offset */
#define ESP_PARTITION_MD5_OFFSET 16
/* Pre-partition table fixed flash offsets */
#define ESP_BOOTLOADER_DIGEST_OFFSET 0x0
#define ESP_BOOTLOADER_OFFSET 0x1000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */

View File

@ -169,6 +169,14 @@ esp_err_t esp_image_verify_bootloader(uint32_t *length);
*/
esp_err_t esp_image_verify_bootloader_data(esp_image_metadata_t *data);
/**
* @brief Get the flash size of the image
*
* @param app_flash_size The value configured in the image header
* @return Actual size, in bytes.
*/
int esp_image_get_flash_size(esp_image_flash_size_t app_flash_size);
typedef struct {
uint32_t drom_addr;

View File

@ -19,11 +19,28 @@
#include <stdint.h>
#include <esp_err.h>
#include <esp_spi_flash.h> /* including in bootloader for error values */
#include "sdkconfig.h"
#include "bootloader_flash.h"
#define FLASH_SECTOR_SIZE 0x1000
#define FLASH_BLOCK_SIZE 0x10000
#define MMAP_ALIGNED_MASK 0x0000FFFF
/* SPI commands (actual on-wire commands not SPI controller bitmasks)
Suitable for use with the bootloader_execute_flash_command static function.
*/
#define CMD_RDID 0x9F
#define CMD_WRSR 0x01
#define CMD_WRSR2 0x31 /* Not all SPI flash uses this command */
#define CMD_WREN 0x06
#define CMD_WRDI 0x04
#define CMD_RDSR 0x05
#define CMD_RDSR2 0x35 /* Not all SPI flash uses this command */
#define CMD_OTPEN 0x3A /* Enable OTP mode, not all SPI flash uses this command */
#define CMD_RDSFDP 0x5A /* Read the SFDP of the flash */
#define CMD_WRAP 0x77 /* Set burst with wrap command */
/* Provide a Flash API for bootloader_support code,
that can be used from bootloader or app code.
@ -136,4 +153,29 @@ static inline uint32_t bootloader_cache_pages_to_map(uint32_t size, uint32_t vad
return (size + (vaddr - (vaddr & MMU_FLASH_MASK)) + MMU_BLOCK_SIZE - 1) / MMU_BLOCK_SIZE;
}
/**
* @brief Execute a user command on the flash
*
* @param command The command value to execute.
* @param mosi_data MOSI data to send
* @param mosi_len Length of MOSI data, in bits
* @param miso_len Length of MISO data to receive, in bits
* @return Received MISO data
*/
uint32_t bootloader_execute_flash_command(uint8_t command, uint32_t mosi_data, uint8_t mosi_len, uint8_t miso_len);
/**
* @brief Read the SFDP of the flash
*
* @param sfdp_addr Address of the parameter to read
* @param miso_byte_num Bytes to read
* @return The read SFDP, little endian, 4 bytes at most
*/
uint32_t bootloader_flash_read_sfdp(uint32_t sfdp_addr, unsigned int miso_byte_num);
/**
* @brief Enable the flash write protect (WEL bit).
*/
void bootloader_enable_wp(void);
#endif

View File

@ -99,9 +99,10 @@ __attribute__((noreturn)) void bootloader_reset(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

@ -13,6 +13,8 @@
// limitations under the License.
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -28,11 +28,13 @@
#include "esp32s2/rom/gpio.h"
#endif
#include "esp_flash_partitions.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_common.h"
#include "bootloader_utility.h"
#include "soc/gpio_periph.h"
#include "soc/rtc.h"
#include "soc/efuse_reg.h"
#include "soc/soc_memory_layout.h"
#include "esp_image_format.h"
#include "bootloader_sha.h"
#include "sys/param.h"
@ -187,22 +189,7 @@ esp_err_t bootloader_common_get_sha256_of_partition (uint32_t address, uint32_t
size = data.image_len;
}
// If image is type by data then hash is calculated for entire image.
const void *partition_bin = bootloader_mmap(address, size);
if (partition_bin == NULL) {
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", address, size);
return ESP_FAIL;
}
bootloader_sha256_handle_t sha_handle = bootloader_sha256_start();
if (sha_handle == NULL) {
bootloader_munmap(partition_bin);
return ESP_ERR_NO_MEM;
}
bootloader_sha256_data(sha_handle, partition_bin, size);
bootloader_sha256_finish(sha_handle, out_sha_256);
bootloader_munmap(partition_bin);
return ESP_OK;
return bootloader_sha256_flash_contents(address, size, out_sha_256);
}
int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata, bool *valid_two_otadata, bool max)
@ -248,13 +235,15 @@ esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t
return ESP_ERR_INVALID_ARG;
}
const uint8_t *image = bootloader_mmap(partition->offset, partition->size);
const uint32_t app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t);
const uint32_t mmap_size = app_desc_offset + sizeof(esp_app_desc_t);
const uint8_t *image = bootloader_mmap(partition->offset, mmap_size);
if (image == NULL) {
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, partition->size);
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, mmap_size);
return ESP_FAIL;
}
memcpy(app_desc, image + sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t), sizeof(esp_app_desc_t));
memcpy(app_desc, image + app_desc_offset, sizeof(esp_app_desc_t));
bootloader_munmap(image);
if (app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
@ -307,7 +296,18 @@ RESET_REASON bootloader_common_get_reset_reason(int cpu_no)
#if defined( CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP ) || defined( CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC )
rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)(SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t));
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
#if !IS_BOOTLOADER_BUILD
/* The app needs to be told this memory is reserved, important if configured to use RTC memory as heap.
Note that keeping this macro here only works when other symbols in this file are referenced by the app, as
this feature is otherwise 100% part of the bootloader. However this seems to happen in all apps.
*/
SOC_RESERVE_MEMORY_REGION(RTC_RETAIN_MEM_ADDR, RTC_RETAIN_MEM_ADDR + sizeof(rtc_retain_mem_t), rtc_retain_mem);
#endif
static bool check_rtc_retain_mem(void)
{

View File

@ -15,9 +15,10 @@
#include "sdkconfig.h"
#include "bootloader_clock.h"
#include "bootloader_common.h"
#include "soc/efuse_reg.h"
uint8_t bootloader_common_get_chip_revision(void)
{
/* No other revisions for ESP32-S2 */
return 0;
// 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);
}

View File

@ -13,13 +13,44 @@
// limitations under the License.
#include <stddef.h>
#include <bootloader_flash.h>
#include <bootloader_flash_priv.h>
#include <esp_log.h>
#include <esp_flash_encrypt.h>
#if CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/spi_flash.h"
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#if CONFIG_IDF_TARGET_ESP32
# include "soc/spi_struct.h"
# include "soc/spi_reg.h"
/* SPI flash controller */
# define SPIFLASH SPI1
#else
# include "soc/spi_mem_struct.h"
# include "soc/spi_mem_reg.h"
/* SPI flash controller */
# define SPIFLASH SPIMEM1
#endif
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/spi_flash.h"
#include "esp32/rom/ets_sys.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/spi_flash.h" //For SPI_Encrypt_Write
#include "esp32s2/rom/ets_sys.h"
#endif
#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_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...
*/
@ -89,7 +120,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
return spi_flash_erase_range(start_addr, size);
}
#else
#else //BOOTLOADER_BUILD
/* Bootloader version, uses ROM functions only */
#include "soc/dport_reg.h"
#if CONFIG_IDF_TARGET_ESP32
@ -318,7 +349,7 @@ esp_err_t bootloader_flash_write(size_t dest_addr, void *src, size_t size, bool
return ESP_FAIL;
}
err = spi_to_esp_err(esp_rom_spiflash_unlock());
err = bootloader_flash_unlock();
if (err != ESP_OK) {
return err;
}
@ -364,4 +395,332 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
}
return spi_to_esp_err(rc);
}
#endif // BOOTLOADER_BUILD
FORCE_INLINE_ATTR bool is_issi_chip(const esp_rom_spiflash_chip_t* chip)
{
return BYTESHIFT(chip->device_id, 2) == ISSI_ID;
}
// For GD25Q32, GD25Q64, GD25Q127C, GD25Q128, which use single command to read/write different SR.
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 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) || 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);
} 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.
*/
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_GD_SR2;
} else {
/* For common behaviour, like XMC chips, Use 01H+2Bytes to write both SR1 and SR2*/
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.)
*/
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) {
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WREN, 0, 0, 0);
bootloader_execute_flash_command(CMD_WRSR, new_status, sr1_bit_num, 0);
status_written = true;
}
if (status_sr2 != new_status_sr2) {
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
bootloader_execute_flash_command(CMD_WREN, 0, 0, 0);
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);
}
return err;
}
/* dummy_len_plus values defined in ROM for SPI flash configuration */
extern uint8_t g_rom_spiflash_dummy_len_plus[];
IRAM_ATTR static uint32_t bootloader_flash_execute_command_common(
uint8_t command,
uint32_t addr_len, uint32_t address,
uint8_t dummy_len,
uint8_t mosi_len, uint32_t mosi_data,
uint8_t miso_len)
{
assert(mosi_len <= 32);
assert(miso_len <= 32);
uint32_t old_ctrl_reg = SPIFLASH.ctrl.val;
uint32_t old_user_reg = SPIFLASH.user.val;
uint32_t old_user1_reg = SPIFLASH.user1.val;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.ctrl.val = SPI_WP_REG_M; // keep WP high while idle, otherwise leave DIO mode
#else
SPIFLASH.ctrl.val = SPI_MEM_WP_REG_M; // keep WP high while idle, otherwise leave DIO mode
#endif
//command phase
SPIFLASH.user.usr_command = 1;
SPIFLASH.user2.usr_command_bitlen = 7;
SPIFLASH.user2.usr_command_value = command;
//addr phase
SPIFLASH.user.usr_addr = addr_len > 0;
SPIFLASH.user1.usr_addr_bitlen = addr_len - 1;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.addr = (addr_len > 0)? (address << (32-addr_len)) : 0;
#else
SPIFLASH.addr = address;
#endif
//dummy phase
if (miso_len > 0) {
uint32_t total_dummy = dummy_len + g_rom_spiflash_dummy_len_plus[1];
SPIFLASH.user.usr_dummy = total_dummy > 0;
SPIFLASH.user1.usr_dummy_cyclelen = total_dummy - 1;
} else {
SPIFLASH.user.usr_dummy = 0;
SPIFLASH.user1.usr_dummy_cyclelen = 0;
}
//output data
SPIFLASH.user.usr_mosi = mosi_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.mosi_dlen.usr_mosi_dbitlen = mosi_len ? (mosi_len - 1) : 0;
#else
SPIFLASH.mosi_dlen.usr_mosi_bit_len = mosi_len ? (mosi_len - 1) : 0;
#endif
SPIFLASH.data_buf[0] = mosi_data;
//input data
SPIFLASH.user.usr_miso = miso_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.miso_dlen.usr_miso_dbitlen = miso_len ? (miso_len - 1) : 0;
#else
SPIFLASH.miso_dlen.usr_miso_bit_len = miso_len ? (miso_len - 1) : 0;
#endif
SPIFLASH.cmd.usr = 1;
while (SPIFLASH.cmd.usr != 0) {
}
SPIFLASH.ctrl.val = old_ctrl_reg;
SPIFLASH.user.val = old_user_reg;
SPIFLASH.user1.val = old_user1_reg;
uint32_t ret = SPIFLASH.data_buf[0];
if (miso_len < 32) {
//set unused bits to 0
ret &= ~(UINT32_MAX << miso_len);
}
return ret;
}
uint32_t IRAM_ATTR bootloader_execute_flash_command(uint8_t command, uint32_t mosi_data, uint8_t mosi_len, uint8_t miso_len)
{
const uint8_t addr_len = 0;
const uint8_t address = 0;
const uint8_t dummy_len = 0;
return bootloader_flash_execute_command_common(command, addr_len, address,
dummy_len, mosi_len, mosi_data, miso_len);
}
// cmd(0x5A) + 24bit address + 8 cycles dummy
uint32_t IRAM_ATTR bootloader_flash_read_sfdp(uint32_t sfdp_addr, unsigned int miso_byte_num)
{
assert(miso_byte_num <= 4);
const uint8_t command = CMD_RDSFDP;
const uint8_t addr_len = 24;
const uint8_t dummy_len = 8;
const uint8_t mosi_len = 0;
const uint32_t mosi_data = 0;
const uint8_t miso_len = miso_byte_num * 8;
return bootloader_flash_execute_command_common(command, addr_len, sfdp_addr,
dummy_len, mosi_len, mosi_data, miso_len);
}
void bootloader_enable_wp(void)
{
bootloader_execute_flash_command(CMD_WRDI, 0, 0, 0); /* Exit OTP mode */
}
uint32_t IRAM_ATTR bootloader_read_flash_id(void)
{
uint32_t id = bootloader_execute_flash_command(CMD_RDID, 0, 0, 24);
id = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00);
return id;
}
#if SOC_CACHE_SUPPORT_WRAP
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode)
{
uint32_t reg_bkp_ctrl = SPIFLASH.ctrl.val;
uint32_t reg_bkp_usr = SPIFLASH.user.val;
SPIFLASH.user.fwrite_dio = 0;
SPIFLASH.user.fwrite_dual = 0;
SPIFLASH.user.fwrite_qio = 1;
SPIFLASH.user.fwrite_quad = 0;
SPIFLASH.ctrl.fcmd_dual = 0;
SPIFLASH.ctrl.fcmd_quad = 0;
SPIFLASH.user.usr_dummy = 0;
SPIFLASH.user.usr_addr = 1;
SPIFLASH.user.usr_command = 1;
SPIFLASH.user2.usr_command_bitlen = 7;
SPIFLASH.user2.usr_command_value = CMD_WRAP;
SPIFLASH.user1.usr_addr_bitlen = 23;
SPIFLASH.addr = 0;
SPIFLASH.user.usr_miso = 0;
SPIFLASH.user.usr_mosi = 1;
SPIFLASH.mosi_dlen.usr_mosi_bit_len = 7;
SPIFLASH.data_buf[0] = (uint32_t) mode << 4;;
SPIFLASH.cmd.usr = 1;
while(SPIFLASH.cmd.usr != 0)
{ }
SPIFLASH.ctrl.val = reg_bkp_ctrl;
SPIFLASH.user.val = reg_bkp_usr;
return ESP_OK;
}
#endif //SOC_CACHE_SUPPORT_WRAP
/*******************************************************************************
* XMC startup flow
******************************************************************************/
#define XMC_SUPPORT CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT
#define XMC_VENDOR_ID 0x20
#if BOOTLOADER_BUILD
#define BOOTLOADER_FLASH_LOG(level, ...) ESP_LOG##level(TAG, ##__VA_ARGS__)
#else
static DRAM_ATTR char bootloader_flash_tag[] = "bootloader_flash";
#define BOOTLOADER_FLASH_LOG(level, ...) ESP_DRAM_LOG##level(bootloader_flash_tag, ##__VA_ARGS__)
#endif
#if XMC_SUPPORT
//strictly check the model
static IRAM_ATTR bool is_xmc_chip_strict(uint32_t rdid)
{
uint32_t vendor_id = BYTESHIFT(rdid, 2);
uint32_t mfid = BYTESHIFT(rdid, 1);
uint32_t cpid = BYTESHIFT(rdid, 0);
if (vendor_id != XMC_VENDOR_ID) {
return false;
}
bool matched = false;
if (mfid == 0x40) {
if (cpid >= 0x13 && cpid <= 0x20) {
matched = true;
}
} else if (mfid == 0x41) {
if (cpid >= 0x17 && cpid <= 0x20) {
matched = true;
}
} else if (mfid == 0x50) {
if (cpid >= 0x15 && cpid <= 0x16) {
matched = true;
}
}
return matched;
}
esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
{
// If the RDID value is a valid XMC one, may skip the flow
const bool fast_check = true;
if (fast_check && is_xmc_chip_strict(g_rom_flashchip.device_id)) {
BOOTLOADER_FLASH_LOG(D, "XMC chip detected by RDID (%08X), skip.", g_rom_flashchip.device_id);
return ESP_OK;
}
// Check the Manufacturer ID in SFDP registers (JEDEC standard). If not XMC chip, no need to run the flow
const int sfdp_mfid_addr = 0x10;
uint8_t mf_id = (bootloader_flash_read_sfdp(sfdp_mfid_addr, 1) & 0xff);
if (mf_id != XMC_VENDOR_ID) {
BOOTLOADER_FLASH_LOG(D, "non-XMC chip detected by SFDP Read (%02X), skip.", mf_id);
return ESP_OK;
}
BOOTLOADER_FLASH_LOG(I, "XM25QHxxC startup flow");
// Enter DPD
bootloader_execute_flash_command(0xB9, 0, 0, 0);
// Enter UDPD
bootloader_execute_flash_command(0x79, 0, 0, 0);
// Exit UDPD
bootloader_execute_flash_command(0xFF, 0, 0, 0);
// Delay tXUDPD
ets_delay_us(2000);
// Release Power-down
bootloader_execute_flash_command(0xAB, 0, 0, 0);
ets_delay_us(20);
// Read flash ID and check again
g_rom_flashchip.device_id = bootloader_read_flash_id();
if (!is_xmc_chip_strict(g_rom_flashchip.device_id)) {
BOOTLOADER_FLASH_LOG(E, "XMC flash startup fail");
return ESP_FAIL;
}
return ESP_OK;
}
#else
//only compare the vendor id
static IRAM_ATTR bool is_xmc_chip(uint32_t rdid)
{
uint32_t vendor_id = (rdid >> 16) & 0xFF;
return (vendor_id == XMC_VENDOR_ID);
}
esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
{
if (is_xmc_chip(g_rom_flashchip.device_id)) {
BOOTLOADER_FLASH_LOG(E, "XMC chip detected (%08X) while support disabled.", g_rom_flashchip.device_id);
return ESP_FAIL;
}
return ESP_OK;
}
#endif //XMC_SUPPORT

View File

@ -25,6 +25,7 @@
#include "soc/spi_reg.h"
#include "soc/spi_caps.h"
#include "flash_qio_mode.h"
#include "bootloader_common.h"
#include "bootloader_flash_config.h"
void bootloader_flash_update_id(void)
@ -32,6 +33,11 @@ void bootloader_flash_update_id(void)
g_rom_flashchip.device_id = bootloader_read_flash_id();
}
void bootloader_flash_update_size(uint32_t size)
{
g_rom_flashchip.chip_size = size;
}
void IRAM_ATTR bootloader_flash_cs_timing_config(void)
{
SET_PERI_REG_MASK(SPI_USER_REG(0), SPI_CS_HOLD_M | SPI_CS_SETUP_M);
@ -75,18 +81,11 @@ void IRAM_ATTR bootloader_flash_gpio_config(const esp_image_header_t* pfhdr)
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
uint32_t pkg_ver = chip_ver & 0x7;
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5) {
// For ESP32D2WD the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
} else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2) {
// For ESP32PICOD2 the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
} else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4) {
// For ESP32PICOD4 the SPI pins are already configured
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302) {
// For ESP32D2WD or ESP32-PICO series,the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
@ -163,4 +162,33 @@ void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t* pfhdr)
SET_PERI_REG_BITS(SPI_USER1_REG(0), SPI_USR_DUMMY_CYCLELEN_V, spi_cache_dummy + g_rom_spiflash_dummy_len_plus[0],
SPI_USR_DUMMY_CYCLELEN_S);
}
}
#define ESP32_D2WD_WP_GPIO 7 /* ESP32-D2WD & ESP32-PICO-D4 has this GPIO wired to WP pin of flash */
#define ESP32_PICO_V3_GPIO 18 /* ESP32-PICO-V3* use this GPIO for WP pin of flash */
int bootloader_flash_get_wp_pin(void)
{
#if CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN
return CONFIG_BOOTLOADER_SPI_WP_PIN; // can be set for bootloader when QIO or QOUT config in use
#elif CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN
return CONFIG_SPIRAM_SPIWP_SD3_PIN; // can be set for app when DIO or DOUT config used for PSRAM only
#else
// no custom value, find it based on the package eFuse value
uint8_t chip_ver;
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
switch(pkg_ver) {
case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH:
case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5:
return ESP32_D2WD_WP_GPIO;
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4:
/* Same package IDs are used for ESP32-PICO-V3 and ESP32-PICO-D4, silicon version differentiates */
chip_ver = bootloader_common_get_chip_revision();
return (chip_ver < 3) ? ESP32_D2WD_WP_GPIO : ESP32_PICO_V3_GPIO;
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
return ESP32_PICO_V3_GPIO;
default:
return SPI_WP_GPIO_NUM;
}
#endif
}

View File

@ -39,6 +39,11 @@ void bootloader_flash_update_id()
g_rom_flashchip.device_id = bootloader_read_flash_id();
}
void bootloader_flash_update_size(uint32_t size)
{
g_rom_flashchip.chip_size = size;
}
void IRAM_ATTR bootloader_flash_cs_timing_config()
{
SET_PERI_REG_MASK(SPI_MEM_USER_REG(0), SPI_MEM_CS_HOLD_M | SPI_MEM_CS_SETUP_M);
@ -69,6 +74,7 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t* pfhdr)
break;
}
esp_rom_spiflash_config_clk(spi_clk_div, 0);
esp_rom_spiflash_config_clk(spi_clk_div, 1);
}
void IRAM_ATTR bootloader_flash_set_dummy_out(void)

View File

@ -14,9 +14,10 @@
#include <string.h>
#include <stdint.h>
#include "sdkconfig.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "bootloader_init.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_flash_config.h"
#include "bootloader_random.h"
#include "bootloader_clock.h"
@ -28,7 +29,7 @@
static const char *TAG = "boot";
esp_image_header_t bootloader_image_hdr;
esp_image_header_t WORD_ALIGNED_ATTR bootloader_image_hdr;
void bootloader_clear_bss_section(void)
{

View File

@ -1,4 +1,4 @@
// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD
// Copyright 2010-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.
@ -15,16 +15,6 @@
#include "bootloader_random.h"
#include "soc/cpu.h"
#include "soc/wdev_reg.h"
#include "soc/rtc_periph.h"
#include "soc/sens_periph.h"
#include "soc/syscon_periph.h"
#include "soc/dport_reg.h"
#include "soc/i2s_periph.h"
#include "esp_log.h"
#include "soc/io_mux_reg.h"
#if CONFIG_IDF_TARGET_ESP32S2
#include "soc/apb_saradc_reg.h"
#endif
#ifndef BOOTLOADER_BUILD
#include "esp_system.h"
@ -64,150 +54,3 @@ void bootloader_fill_random(void *buffer, size_t length)
}
}
#endif // BOOTLOADER_BUILD
void bootloader_random_enable(void)
{
/* Ensure the hardware RNG is enabled following a soft reset. This should always be the case already (this clock is
never disabled while the CPU is running), this is a "belts and braces" type check.
*/
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_RNG_EN);
#else
periph_module_enable(PERIPH_RNG_MODULE);
#endif // BOOTLOADER_BUILD
/* Enable SAR ADC in test mode to feed ADC readings of the 1.1V
reference via I2S into the RNG entropy input.
Note: I2S requires the PLL to be running, so the call to rtc_set_cpu_freq(CPU_80M)
in early bootloader startup must have been made.
*/
#if CONFIG_IDF_TARGET_ESP32
SET_PERI_REG_BITS(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_DTEST_RTC, 2, RTC_CNTL_DTEST_RTC_S);
SET_PERI_REG_MASK(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_ENT_RTC);
SET_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_SAR2_EN_TEST);
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_I2S0_CLK_EN);
#else
periph_module_enable(PERIPH_I2S0_MODULE);
#endif // BOOTLOADER_BUILD
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_ULP_CP_FORCE_START_TOP);
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_ULP_CP_START_TOP);
#elif CONFIG_IDF_TARGET_ESP32S2
/* Disable IO1 digital function for random function. */
PIN_INPUT_DISABLE(PERIPHS_IO_MUX_GPIO1_U);
PIN_PULLDWN_DIS(PERIPHS_IO_MUX_GPIO1_U);
PIN_PULLUP_DIS(PERIPHS_IO_MUX_GPIO1_U);
WRITE_PERI_REG(APB_SARADC_SAR1_PATT_TAB1_REG, 0xFFFFFFFF);
SET_PERI_REG_MASK(SENS_SAR_MEAS2_CTRL1_REG, SENS_SAR2_EN_TEST);
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_I2S0_CLK_EN);
CLEAR_PERI_REG_MASK(RTC_CNTL_ULP_CP_CTRL_REG, RTC_CNTL_ULP_CP_FORCE_START_TOP);
CLEAR_PERI_REG_MASK(RTC_CNTL_ULP_CP_CTRL_REG, RTC_CNTL_ULP_CP_START_TOP);
#endif
// Test pattern configuration byte 0xAD:
//--[7:4] channel_sel: 10-->en_test
//--[3:2] bit_width : 3-->12bit
//--[1:0] atten : 1-->3dB attenuation
#if CONFIG_IDF_TARGET_ESP32
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB1_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB2_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB3_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB4_REG, 0xADADADAD);
SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR, 3, SENS_FORCE_XPD_SAR_S);
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL_REG, SENS_SAR1_DIG_FORCE);
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DIG_FORCE);
#elif CONFIG_IDF_TARGET_ESP32S2
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB1_REG, 0xADADADAD);
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB2_REG, 0xADADADAD);
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB3_REG, 0xADADADAD);
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB4_REG, 0xADADADAD);
SET_PERI_REG_BITS(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 3, SENS_FORCE_XPD_SAR_S);
SET_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG, SENS_SAR1_DIG_FORCE);
#endif
#if CONFIG_IDF_TARGET_ESP32
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR2_MUX);
SET_PERI_REG_BITS(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR_CLK_DIV, 4, SYSCON_SARADC_SAR_CLK_DIV_S);
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_RSTB_WAIT, 8, SYSCON_SARADC_RSTB_WAIT_S); /* was 1 */
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_START_WAIT, 10, SYSCON_SARADC_START_WAIT_S);
SET_PERI_REG_BITS(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_WORK_MODE, 0, SYSCON_SARADC_WORK_MODE_S);
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR_SEL);
CLEAR_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_DATA_SAR_SEL);
SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_RX_BCK_DIV_NUM, 20, I2S_RX_BCK_DIV_NUM_S);
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_DATA_TO_I2S);
#elif CONFIG_IDF_TARGET_ESP32S2
SET_PERI_REG_BITS(APB_SARADC_CTRL_REG, APB_SARADC_SAR_CLK_DIV, 4, APB_SARADC_SAR_CLK_DIV_S);
SET_PERI_REG_BITS(APB_SARADC_FSM_REG, APB_SARADC_RSTB_WAIT, 8, APB_SARADC_RSTB_WAIT_S); /* was 1 */
SET_PERI_REG_BITS(APB_SARADC_CTRL_REG, APB_SARADC_WORK_MODE, 0, APB_SARADC_WORK_MODE_S);
SET_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_SAR_SEL);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_DATA_SAR_SEL);
SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_RX_BCK_DIV_NUM, 20, I2S_RX_BCK_DIV_NUM_S);
SET_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_DATA_TO_I2S);
#endif
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_CAMERA_EN);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_LCD_EN);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE_TEST_EN);
SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);
}
void bootloader_random_disable(void)
{
/* Reset some i2s configuration (possibly redundant as we reset entire
I2S peripheral further down). */
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);
SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_RESET);
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_RESET);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_CAMERA_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_LCD_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE_TEST_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE);
/* Disable i2s clock */
#ifdef BOOTLOADER_BUILD
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_I2S0_CLK_EN);
#else
periph_module_disable(PERIPH_I2S0_MODULE);
#endif // BOOTLOADER_BUILD
/* Restore SYSCON mode registers */
#if CONFIG_IDF_TARGET_ESP32
CLEAR_PERI_REG_MASK(SENS_SAR_READ_CTRL_REG, SENS_SAR1_DIG_FORCE);
CLEAR_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DIG_FORCE);
#elif CONFIG_IDF_TARGET_ESP32S2
CLEAR_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG, SENS_SAR1_DIG_FORCE);
#endif
#if CONFIG_IDF_TARGET_ESP32
/* Restore SAR ADC mode */
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_SAR2_EN_TEST);
CLEAR_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR2_MUX
| SYSCON_SARADC_SAR_SEL | SYSCON_SARADC_DATA_TO_I2S);
SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR, 0, SENS_FORCE_XPD_SAR_S);
#elif CONFIG_IDF_TARGET_ESP32S2
CLEAR_PERI_REG_MASK(SENS_SAR_MEAS2_CTRL1_REG, SENS_SAR2_EN_TEST);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL_REG, APB_SARADC_SAR_SEL | APB_SARADC_DATA_TO_I2S);
SET_PERI_REG_BITS(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 0, SENS_FORCE_XPD_SAR_S);
#endif
#if CONFIG_IDF_TARGET_ESP32
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_START_WAIT, 8, SYSCON_SARADC_START_WAIT_S);
#endif
/* Reset i2s peripheral */
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_I2S0_RST);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_I2S0_RST);
#else
periph_module_reset(PERIPH_I2S0_MODULE);
#endif
#if CONFIG_IDF_TARGET_ESP32
/* Disable pull supply voltage to SAR ADC */
CLEAR_PERI_REG_MASK(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_ENT_RTC);
SET_PERI_REG_BITS(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_DTEST_RTC, 0, RTC_CNTL_DTEST_RTC_S);
#endif
}

View File

@ -0,0 +1,128 @@
// Copyright 2016-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.
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/rtc_periph.h"
#include "soc/sens_periph.h"
#include "soc/syscon_periph.h"
#include "soc/dport_reg.h"
#include "soc/i2s_periph.h"
#include "esp_log.h"
#include "soc/io_mux_reg.h"
#ifndef BOOTLOADER_BUILD
#include "driver/periph_ctrl.h"
#endif
void bootloader_random_enable(void)
{
/* Ensure the hardware RNG is enabled following a soft reset. This should always be the case already (this clock is
never disabled while the CPU is running), this is a "belts and braces" type check.
*/
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_RNG_EN);
#else
periph_module_enable(PERIPH_RNG_MODULE);
#endif // BOOTLOADER_BUILD
/* Enable SAR ADC in test mode to feed ADC readings of the 1.1V
reference via I2S into the RNG entropy input.
Note: I2S requires the PLL to be running, so the call to rtc_set_cpu_freq(CPU_80M)
in early bootloader startup must have been made.
*/
SET_PERI_REG_BITS(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_DTEST_RTC, 2, RTC_CNTL_DTEST_RTC_S);
SET_PERI_REG_MASK(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_ENT_RTC);
SET_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_SAR2_EN_TEST);
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_I2S0_CLK_EN);
#else
periph_module_enable(PERIPH_I2S0_MODULE);
#endif // BOOTLOADER_BUILD
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_ULP_CP_FORCE_START_TOP);
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_ULP_CP_START_TOP);
// Test pattern configuration byte 0xAD:
//--[7:4] channel_sel: 10-->en_test
//--[3:2] bit_width : 3-->12bit
//--[1:0] atten : 1-->3dB attenuation
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB1_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB2_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB3_REG, 0xADADADAD);
WRITE_PERI_REG(SYSCON_SARADC_SAR2_PATT_TAB4_REG, 0xADADADAD);
SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR, 3, SENS_FORCE_XPD_SAR_S);
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL_REG, SENS_SAR1_DIG_FORCE);
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DIG_FORCE);
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR2_MUX);
SET_PERI_REG_BITS(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR_CLK_DIV, 4, SYSCON_SARADC_SAR_CLK_DIV_S);
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_RSTB_WAIT, 8, SYSCON_SARADC_RSTB_WAIT_S); /* was 1 */
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_START_WAIT, 10, SYSCON_SARADC_START_WAIT_S);
SET_PERI_REG_BITS(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_WORK_MODE, 0, SYSCON_SARADC_WORK_MODE_S);
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR_SEL);
CLEAR_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_DATA_SAR_SEL);
SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_RX_BCK_DIV_NUM, 20, I2S_RX_BCK_DIV_NUM_S);
SET_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_DATA_TO_I2S);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_CAMERA_EN);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_LCD_EN);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE_TEST_EN);
SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);
}
void bootloader_random_disable(void)
{
/* Reset some i2s configuration (possibly redundant as we reset entire
I2S peripheral further down). */
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);
SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_RESET);
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_RESET);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_CAMERA_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_LCD_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE_TEST_EN);
CLEAR_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE);
/* Disable i2s clock */
#ifdef BOOTLOADER_BUILD
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_I2S0_CLK_EN);
#else
periph_module_disable(PERIPH_I2S0_MODULE);
#endif // BOOTLOADER_BUILD
/* Restore SYSCON mode registers */
CLEAR_PERI_REG_MASK(SENS_SAR_READ_CTRL_REG, SENS_SAR1_DIG_FORCE);
CLEAR_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DIG_FORCE);
/* Restore SAR ADC mode */
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_SAR2_EN_TEST);
CLEAR_PERI_REG_MASK(SYSCON_SARADC_CTRL_REG, SYSCON_SARADC_SAR2_MUX
| SYSCON_SARADC_SAR_SEL | SYSCON_SARADC_DATA_TO_I2S);
SET_PERI_REG_BITS(SENS_SAR_MEAS_WAIT2_REG, SENS_FORCE_XPD_SAR, 0, SENS_FORCE_XPD_SAR_S);
SET_PERI_REG_BITS(SYSCON_SARADC_FSM_REG, SYSCON_SARADC_START_WAIT, 8, SYSCON_SARADC_START_WAIT_S);
/* Reset i2s peripheral */
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_I2S0_RST);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_I2S0_RST);
#else
periph_module_reset(PERIPH_I2S0_MODULE);
#endif
/* Disable pull supply voltage to SAR ADC */
CLEAR_PERI_REG_MASK(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_ENT_RTC);
SET_PERI_REG_BITS(RTC_CNTL_TEST_MUX_REG, RTC_CNTL_DTEST_RTC, 0, RTC_CNTL_DTEST_RTC_S);
}

View File

@ -0,0 +1,106 @@
// Copyright 2019-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.
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/rtc_periph.h"
#include "soc/sens_periph.h"
#include "soc/syscon_periph.h"
#include "soc/dport_reg.h"
#include "soc/i2s_periph.h"
#include "esp_log.h"
#include "soc/io_mux_reg.h"
#include "soc/apb_saradc_reg.h"
#include "regi2c_ctrl.h"
#include "hal/adc_ll.h"
#ifndef BOOTLOADER_BUILD
#include "driver/periph_ctrl.h"
#endif
void bootloader_random_enable(void)
{
/* Ensure the Wifi clock for RNG modiule is enabled following a soft reset. This should always be the case already
(this clock is never disabled while the CPU is running), this is a "belt and braces" type check.
*/
#ifdef BOOTLOADER_BUILD
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_RNG_EN);
#else
periph_module_enable(PERIPH_RNG_MODULE);
#endif // BOOTLOADER_BUILD
// 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
SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN0_REG,DPORT_APB_SARADC_CLK_EN);
REG_SET_FIELD(APB_SARADC_APB_ADC_CLKM_CONF_REG, APB_SARADC_CLK_SEL, 2);
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_SAR_I2C_FORCE_PD_M);
SET_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_SAR_I2C_FORCE_PU_M);
CLEAR_PERI_REG_MASK(ANA_CONFIG_REG, BIT(18));
SET_PERI_REG_MASK(ANA_CONFIG2_REG, BIT(16));
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_DREF_ADDR, 0x4);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_DREF_ADDR, 0x4);
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);
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SAR1_PATT_LEN, 0);
WRITE_PERI_REG(APB_SARADC_SAR1_PATT_TAB1_REG,0xafffffff); // set adc1 channel & bitwidth & atten
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SAR2_PATT_LEN, 0);
WRITE_PERI_REG(APB_SARADC_SAR2_PATT_TAB1_REG,0xafffffff); //set adc2 channel & bitwidth & atten
SET_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG,SENS_SAR1_DIG_FORCE);
REG_SET_FIELD(APB_SARADC_CTRL_REG,APB_SARADC_WORK_MODE, 1);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL2_REG,APB_SARADC_MEAS_NUM_LIMIT);
REG_SET_FIELD(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 3);
SET_PERI_REG_MASK(APB_SARADC_CTRL2_REG,APB_SARADC_TIMER_SEL);
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_TARGET, 100);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL_REG,APB_SARADC_START_FORCE);
SET_PERI_REG_MASK(APB_SARADC_CTRL2_REG,APB_SARADC_TIMER_EN);
}
void bootloader_random_disable(void)
{
/* Restore internal I2C bus state */
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_DREF_ADDR, 0x1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_DREF_ADDR, 0x1);
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);
/* Restore SARADC to default mode */
CLEAR_PERI_REG_MASK(SENS_SAR_MEAS1_MUX_REG, SENS_SAR1_DIG_FORCE);
SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN0_REG, DPORT_APB_SARADC_CLK_EN);
SET_PERI_REG_BITS(SENS_SAR_POWER_XPD_SAR_REG, SENS_FORCE_XPD_SAR, 0, SENS_FORCE_XPD_SAR_S);
CLEAR_PERI_REG_MASK(APB_SARADC_CTRL2_REG, APB_SARADC_TIMER_EN);
/* 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

@ -59,13 +59,14 @@
#include "esp_secure_boot.h"
#include "esp_flash_encrypt.h"
#include "esp_flash_partitions.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_random.h"
#include "bootloader_config.h"
#include "bootloader_common.h"
#include "bootloader_utility.h"
#include "bootloader_sha.h"
#include "esp_efuse.h"
#include "esp_fault.h"
static const char *TAG = "boot";
@ -257,9 +258,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
@ -272,6 +280,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);
}
}
@ -800,27 +810,25 @@ 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 (int 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
}
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest)
{
if (digest == NULL) {
return ESP_ERR_INVALID_ARG;
}
@ -837,7 +845,7 @@ esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len,
while (len > 0) {
uint32_t mmu_page_offset = ((flash_offset & MMAP_ALIGNED_MASK) != 0) ? 1 : 0; /* Skip 1st MMU Page if it is already populated */
uint32_t partial_image_len = MIN(len, ((mmu_free_pages_count - mmu_page_offset) * SPI_FLASH_MMU_PAGE_SIZE)); /* Read the image that fits in the free MMU pages */
const void * image = bootloader_mmap(flash_offset, partial_image_len);
if (image == NULL) {
bootloader_sha256_finish(sha_handle, NULL);

View File

@ -23,6 +23,7 @@
#include "bootloader_common.h"
#include "bootloader_flash_config.h"
#include "bootloader_mem.h"
#include "bootloader_flash_priv.h"
#include "soc/cpu.h"
#include "soc/dport_reg.h"
@ -55,18 +56,11 @@ void bootloader_configure_spi_pins(int drv)
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
uint32_t pkg_ver = chip_ver & 0x7;
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5) {
// For ESP32D2WD the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
} else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2) {
// For ESP32PICOD2 the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
} else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4) {
// For ESP32PICOD4 the SPI pins are already configured
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302) {
// For ESP32D2WD or ESP32-PICO series,the SPI pins are already configured
// flash clock signal should come from IO MUX.
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
@ -266,7 +260,7 @@ static esp_err_t bootloader_init_spi_flash(void)
}
#endif
esp_rom_spiflash_unlock();
bootloader_flash_unlock();
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
bootloader_enable_qio_mode();
@ -274,6 +268,8 @@ static esp_err_t bootloader_init_spi_flash(void)
print_flash_info(&bootloader_image_hdr);
update_flash_config(&bootloader_image_hdr);
//ensure the flash is write-protected
bootloader_enable_wp();
return ESP_OK;
}
@ -312,11 +308,13 @@ static void bootloader_init_uart_console(void)
const uint32_t tx_idx = tx_idx_list[uart_num];
const uint32_t rx_idx = rx_idx_list[uart_num];
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[uart_rx_gpio], PIN_FUNC_GPIO);
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
gpio_pad_pullup(uart_rx_gpio);
gpio_matrix_out(uart_tx_gpio, tx_idx, 0, 0);
gpio_matrix_in(uart_rx_gpio, rx_idx, 0);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[uart_tx_gpio], PIN_FUNC_GPIO);
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
@ -457,6 +455,11 @@ esp_err_t bootloader_init(void)
bootloader_print_banner();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow
if ((ret = bootloader_flash_xmc_startup()) != ESP_OK) {
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
goto err;
}
// read bootloader header
if ((ret = bootloader_read_bootloader_header()) != ESP_OK) {
goto err;

View File

@ -14,7 +14,7 @@
#include <strings.h>
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "esp_image_format.h"
#include "esp_flash_encrypt.h"
#include "esp_flash_partitions.h"
@ -252,9 +252,7 @@ static esp_err_t encrypt_bootloader(void)
ESP_LOGD(TAG, "bootloader is plaintext. Encrypting...");
#if CONFIG_SECURE_BOOT_V2_ENABLED
// Account for the signature sector after the bootloader
image_length = (image_length + FLASH_SECTOR_SIZE - 1) & ~(FLASH_SECTOR_SIZE - 1);
image_length += FLASH_SECTOR_SIZE;
/* The image length obtained from esp_image_verify_bootloader includes the sector boundary padding and the signature block lengths */
if (ESP_BOOTLOADER_OFFSET + image_length > ESP_PARTITION_TABLE_OFFSET) {
ESP_LOGE(TAG, "Bootloader is too large to fit Secure Boot V2 signature sector and partition table (configured offset 0x%x)", ESP_PARTITION_TABLE_OFFSET);
return ESP_ERR_INVALID_STATE;

View File

@ -29,7 +29,7 @@
#include "sdkconfig.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_random.h"
#include "esp_image_format.h"
#include "esp_secure_boot.h"
@ -319,16 +319,26 @@ esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *imag
uint32_t dis_reg = REG_READ(EFUSE_BLK0_RDATA0_REG);
bool efuse_key_read_protected = dis_reg & EFUSE_RD_DIS_BLK2;
bool efuse_key_write_protected = dis_reg & EFUSE_WR_DIS_BLK2;
if (efuse_key_write_protected == false
&& efuse_key_read_protected == false
&& REG_READ(EFUSE_BLK2_RDATA0_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA1_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA2_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA3_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA4_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA5_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA6_REG) == 0
&& REG_READ(EFUSE_BLK2_RDATA7_REG) == 0) {
uint32_t efuse_blk2_r0, efuse_blk2_r1, efuse_blk2_r2, efuse_blk2_r3, efuse_blk2_r4, efuse_blk2_r5, efuse_blk2_r6, efuse_blk2_r7;
efuse_blk2_r0 = REG_READ(EFUSE_BLK2_RDATA0_REG);
efuse_blk2_r1 = REG_READ(EFUSE_BLK2_RDATA1_REG);
efuse_blk2_r2 = REG_READ(EFUSE_BLK2_RDATA2_REG);
efuse_blk2_r3 = REG_READ(EFUSE_BLK2_RDATA3_REG);
efuse_blk2_r4 = REG_READ(EFUSE_BLK2_RDATA4_REG);
efuse_blk2_r5 = REG_READ(EFUSE_BLK2_RDATA5_REG);
efuse_blk2_r6 = REG_READ(EFUSE_BLK2_RDATA6_REG);
efuse_blk2_r7 = REG_READ(EFUSE_BLK2_RDATA7_REG);
if (efuse_key_read_protected == true) {
ESP_LOGE(TAG, "Secure Boot v2 digest(BLK2) read protected, aborting....");
return ESP_FAIL;
}
if (efuse_key_write_protected == false
&& efuse_blk2_r0 == 0 && efuse_blk2_r1 == 0
&& efuse_blk2_r2 == 0 && efuse_blk2_r3 == 0
&& efuse_blk2_r4 == 0 && efuse_blk2_r5 == 0
&& efuse_blk2_r6 == 0 && efuse_blk2_r7 == 0) {
/* Verifies the signature block appended to the image matches with the signature block of the app to be loaded */
ret = secure_boot_v2_digest_generate(bootloader_data.start_addr, bootloader_data.image_len - SIG_BLOCK_PADDING, boot_pub_key_digest);
if (ret != ESP_OK) {
@ -343,14 +353,26 @@ esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *imag
ESP_LOGD(TAG, "EFUSE_BLKx_WDATA%d_REG = 0x%08x", i, boot_public_key_digest_ptr[i]);
}
ESP_LOGI(TAG, "Write protecting public key digest...");
new_wdata0 |= EFUSE_WR_DIS_BLK2;
efuse_key_write_protected = true;
efuse_key_read_protected = false;
} else {
uint32_t efuse_blk2_digest[8];
efuse_blk2_digest[0] = efuse_blk2_r0;
efuse_blk2_digest[1] = efuse_blk2_r1;
efuse_blk2_digest[2] = efuse_blk2_r2;
efuse_blk2_digest[3] = efuse_blk2_r3;
efuse_blk2_digest[4] = efuse_blk2_r4;
efuse_blk2_digest[5] = efuse_blk2_r5;
efuse_blk2_digest[6] = efuse_blk2_r6;
efuse_blk2_digest[7] = efuse_blk2_r7;
memcpy(boot_pub_key_digest, efuse_blk2_digest, DIGEST_LEN);
ESP_LOGW(TAG, "Using pre-loaded secure boot v2 public key digest in EFUSE block 2");
}
if (efuse_key_write_protected == false) {
ESP_LOGI(TAG, "Write protecting public key digest...");
new_wdata0 |= EFUSE_WR_DIS_BLK2; // delay burning until second half of this function
efuse_key_write_protected = true;
}
uint8_t app_pub_key_digest[DIGEST_LEN];
ret = secure_boot_v2_digest_generate(image_data->start_addr, image_data->image_len - SIG_BLOCK_PADDING, app_pub_key_digest);
if (ret != ESP_OK) {

View File

@ -13,7 +13,7 @@
// limitations under the License.
#include "sdkconfig.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_sha.h"
#include "bootloader_utility.h"
#include "esp_log.h"

View File

@ -26,6 +26,7 @@
#include "bootloader_clock.h"
#include "bootloader_flash_config.h"
#include "bootloader_mem.h"
#include "bootloader_flash_priv.h"
#include "esp32s2/rom/cache.h"
#include "esp32s2/rom/ets_sys.h"
@ -205,7 +206,7 @@ static esp_err_t bootloader_init_spi_flash(void)
}
#endif
esp_rom_spiflash_unlock();
bootloader_flash_unlock();
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
bootloader_enable_qio_mode();
@ -213,6 +214,8 @@ static esp_err_t bootloader_init_spi_flash(void)
print_flash_info(&bootloader_image_hdr);
update_flash_config(&bootloader_image_hdr);
//ensure the flash is write-protected
bootloader_enable_wp();
return ESP_OK;
}
@ -251,11 +254,13 @@ static void bootloader_init_uart_console(void)
const uint32_t tx_idx = tx_idx_list[uart_num];
const uint32_t rx_idx = rx_idx_list[uart_num];
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[uart_rx_gpio], PIN_FUNC_GPIO);
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
gpio_pad_pullup(uart_rx_gpio);
gpio_matrix_out(uart_tx_gpio, tx_idx, 0, 0);
gpio_matrix_in(uart_rx_gpio, rx_idx, 0);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[uart_tx_gpio], PIN_FUNC_GPIO);
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
@ -372,6 +377,11 @@ esp_err_t bootloader_init(void)
bootloader_print_banner();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow
if ((ret = bootloader_flash_xmc_startup()) != ESP_OK) {
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
goto err;
}
// read bootloader header
if ((ret = bootloader_read_bootloader_header()) != ESP_OK) {
goto err;

View File

@ -14,7 +14,7 @@
#include <strings.h>
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_random.h"
#include "bootloader_utility.h"
#include "esp_image_format.h"
@ -211,6 +211,12 @@ static esp_err_t initialise_flash_encryption(void)
esp_efuse_write_field_bit(ESP_EFUSE_DIS_BOOT_REMAP);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_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
// otherwise the Flash Encryption key cannot be read protected
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
#endif
esp_err_t err = esp_efuse_batch_write_commit();
return err;
@ -286,9 +292,7 @@ static esp_err_t encrypt_bootloader(void)
ESP_LOGD(TAG, "bootloader is plaintext. Encrypting...");
#if CONFIG_SECURE_BOOT_V2_ENABLED
// Account for the signature sector after the bootloader
image_length = (image_length + FLASH_SECTOR_SIZE - 1) & ~(FLASH_SECTOR_SIZE - 1);
image_length += FLASH_SECTOR_SIZE;
/* The image length obtained from esp_image_verify_bootloader includes the sector boundary padding and the signature block lengths */
if (ESP_BOOTLOADER_OFFSET + image_length > ESP_PARTITION_TABLE_OFFSET) {
ESP_LOGE(TAG, "Bootloader is too large to fit Secure Boot V2 signature sector and partition table (configured offset 0x%x)", ESP_PARTITION_TABLE_OFFSET);
return ESP_ERR_INVALID_SIZE;
@ -299,8 +303,8 @@ static esp_err_t encrypt_bootloader(void)
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to encrypt bootloader in place: 0x%x", err);
return err;
}
}
ESP_LOGI(TAG, "bootloader encrypted successfully");
return err;
}

View File

@ -11,43 +11,342 @@
// 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.
#include "esp_secure_boot.h"
#include <string.h>
#include "esp_log.h"
#include "esp_secure_boot.h"
#include "soc/efuse_reg.h"
#include "bootloader_flash_priv.h"
#include "bootloader_sha.h"
#include "bootloader_utility.h"
#include "esp32s2/rom/crc.h"
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp32s2/rom/efuse.h"
#include "esp32s2/rom/secure_boot.h"
static const char *TAG = "secure_boot";
static const char *TAG = "secure_boot_v2";
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
esp_err_t esp_secure_boot_permanently_enable(void)
#define SIG_BLOCK_MAGIC_BYTE 0xe7
#define CRC_SIGN_BLOCK_LEN 1196
#define SIG_BLOCK_PADDING 4096
#define DIGEST_LEN 32
/* A signature block is valid when it has correct magic byte, crc and image digest. */
static esp_err_t validate_signature_block(const ets_secure_boot_sig_block_t *block, int block_num, const uint8_t *image_digest)
{
uint8_t hash[32];
if (ets_efuse_secure_boot_enabled())
{
ESP_LOGI(TAG, "secure boot is already enabled, continuing..");
uint32_t crc = crc32_le(0, (uint8_t *)block, CRC_SIGN_BLOCK_LEN);
if (block->magic_byte != SIG_BLOCK_MAGIC_BYTE) {
// All signature blocks have been parsed, no new signature block present.
ESP_LOGD(TAG, "Signature block(%d) invalid/absent.", block_num);
return ESP_FAIL;
}
if (block->block_crc != crc) {
ESP_LOGE(TAG, "Magic byte correct but incorrect crc.");
return ESP_FAIL;
}
if (memcmp(image_digest, block->image_digest, DIGEST_LEN)) {
ESP_LOGE(TAG, "Magic byte & CRC correct but incorrect image digest.");
return ESP_FAIL;
} else {
ESP_LOGD(TAG, "valid signature block(%d) found", block_num);
return ESP_OK;
}
ESP_LOGI(TAG, "Verifying bootloader signature...\n");
int r = ets_secure_boot_verify_bootloader(hash, false);
if (r != ESP_OK) {
ESP_LOGE(TAG, "Failed to verify bootloader signature");
return r;
return ESP_FAIL;
}
/* Structure to hold public key digests calculated from the signature blocks of a single image.
Each image can have one or more signature blocks (up to SECURE_BOOT_NUM_BLOCKS). Each signature block
includes a public key.
Different to the ROM ets_secure_boot_key_digests_t structure which holds pointers to eFuse data with digests,
in this data structure the digest data is included.
*/
typedef struct {
uint8_t key_digests[SECURE_BOOT_NUM_BLOCKS][DIGEST_LEN];
unsigned num_digests; /* Number of valid digests, starting at index 0 */
} image_sig_public_key_digests_t;
/* Generates the public key digests of the valid public keys in an image's
signature block, verifies each signature, and stores the key digests in the
public_key_digests structure.
@param flash_offset Image offset in flash
@param flash_size Image size in flash (not including signature block)
@param[out] public_key_digests Pointer to structure to hold the key digests for valid sig blocks
Note that this function doesn't read any eFuses, so it doesn't know if the
keys are ultimately trusted by the hardware or not
@return - ESP_OK if no signatures failed to verify, or if no valid signature blocks are found at all.
- ESP_FAIL if there's a valid signature block that doesn't verify using the included public key (unexpected!)
*/
static esp_err_t s_calculate_image_public_key_digests(uint32_t flash_offset, uint32_t flash_size, image_sig_public_key_digests_t *public_key_digests)
{
esp_err_t ret;
uint8_t image_digest[DIGEST_LEN] = {0};
uint8_t __attribute__((aligned(4))) key_digest[DIGEST_LEN] = {0};
size_t sig_block_addr = flash_offset + ALIGN_UP(flash_size, FLASH_SECTOR_SIZE);
ESP_LOGD(TAG, "calculating public key digests for sig blocks of image offset 0x%x (sig block offset 0x%x)", flash_offset, sig_block_addr);
bzero(public_key_digests, sizeof(image_sig_public_key_digests_t));
ret = bootloader_sha256_flash_contents(flash_offset, sig_block_addr - flash_offset, image_digest);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "error generating image digest, %d", ret);
return ret;
}
esp_efuse_batch_write_begin(); /* Batch all efuse writes at the end of this function */
ESP_LOGD(TAG, "reading signatures");
const ets_secure_boot_signature_t *signatures = bootloader_mmap(sig_block_addr, sizeof(ets_secure_boot_signature_t));
if (signatures == NULL) {
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", sig_block_addr, sizeof(ets_secure_boot_signature_t));
return ESP_FAIL;
}
for (int i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
const ets_secure_boot_sig_block_t *block = &signatures->block[i];
ret = validate_signature_block(block, i, image_digest);
if (ret != ESP_OK) {
ret = ESP_OK; // past the last valid signature block
break;
}
/* Generating the SHA of the public key components in the signature block */
bootloader_sha256_handle_t sig_block_sha;
sig_block_sha = bootloader_sha256_start();
bootloader_sha256_data(sig_block_sha, &block->key, sizeof(block->key));
bootloader_sha256_finish(sig_block_sha, key_digest);
// Check we can verify the image using this signature and this key
uint8_t temp_verified_digest[DIGEST_LEN];
bool verified = ets_rsa_pss_verify(&block->key, block->signature, image_digest, temp_verified_digest);
if (!verified) {
/* We don't expect this: the signature blocks before we enable secure boot should all be verifiable or invalid,
so this is a fatal error
*/
ret = ESP_FAIL;
ESP_LOGE(TAG, "Secure boot key (%d) verification failed.", i);
break;
}
ESP_LOGD(TAG, "Signature block (%d) is verified", i);
/* Copy the key digest to the buffer provided by the caller */
memcpy((void *)public_key_digests->key_digests[i], key_digest, DIGEST_LEN);
public_key_digests->num_digests++;
}
if (ret == ESP_OK && public_key_digests->num_digests > 0) {
ESP_LOGI(TAG, "Digests successfully calculated, %d valid signatures (image offset 0x%x)",
public_key_digests->num_digests, flash_offset);
}
bootloader_munmap(signatures);
return ret;
}
esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *image_data)
{
ESP_LOGI(TAG, "enabling secure boot v2 - ESP32-S2...");
if (esp_secure_boot_enabled()) {
ESP_LOGI(TAG, "secure boot v2 is already enabled, continuing..");
return ESP_OK;
}
esp_err_t ret;
/* Verify the bootloader */
esp_image_metadata_t bootloader_data = { 0 };
ret = esp_image_verify_bootloader_data(&bootloader_data);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "bootloader image appears invalid! error %d", ret);
return ret;
}
/* Check if secure boot digests are present */
bool has_secure_boot_digest = ets_efuse_find_purpose(ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST0, NULL);
has_secure_boot_digest |= ets_efuse_find_purpose(ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST1, NULL);
has_secure_boot_digest |= ets_efuse_find_purpose(ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST2, NULL);
ESP_LOGI(TAG, "Secure boot digests %s", has_secure_boot_digest ? "already present":"absent, generating..");
ets_efuse_clear_program_registers();
if (!has_secure_boot_digest) {
image_sig_public_key_digests_t boot_key_digests = {0};
image_sig_public_key_digests_t app_key_digests = {0};
/* Generate the bootloader public key digests */
ret = s_calculate_image_public_key_digests(bootloader_data.start_addr, bootloader_data.image_len - SIG_BLOCK_PADDING, &boot_key_digests);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Bootloader signature block is invalid");
return ret;
}
if (boot_key_digests.num_digests == 0) {
ESP_LOGE(TAG, "No valid bootloader signature blocks found.");
return ESP_FAIL;
}
ESP_LOGI(TAG, "%d signature block(s) found appended to the bootloader.", boot_key_digests.num_digests);
int unused_key_slots = ets_efuse_count_unused_key_blocks();
if (boot_key_digests.num_digests > unused_key_slots) {
ESP_LOGE(TAG, "Bootloader signatures(%d) more than available key slots(%d).", boot_key_digests.num_digests, unused_key_slots);
return ESP_FAIL;
}
for (int i = 0; i < boot_key_digests.num_digests; i++) {
ets_efuse_block_t block;
const uint32_t secure_boot_key_purpose[SECURE_BOOT_NUM_BLOCKS] = { ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST0,
ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST1, ETS_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST2 };
block = ets_efuse_find_unused_key_block();
if (block == ETS_EFUSE_BLOCK_MAX) {
ESP_LOGE(TAG, "No more unused key blocks available.");
return ESP_FAIL;
}
int r = ets_efuse_write_key(block, secure_boot_key_purpose[i], boot_key_digests.key_digests[i], DIGEST_LEN);
if (r != 0) {
ESP_LOGE(TAG, "Failed to write efuse block %d with purpose %d. Can't continue.", block, secure_boot_key_purpose[i]);
return ESP_FAIL;
}
// Note: write key will write protect both the block and the purpose eFuse, always
}
/* Generate the application public key digests */
ret = s_calculate_image_public_key_digests(image_data->start_addr, image_data->image_len - SIG_BLOCK_PADDING, &app_key_digests);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "App signature block is invalid.");
return ret;
}
if (app_key_digests.num_digests == 0) {
ESP_LOGE(TAG, "No valid applications signature blocks found.");
return ESP_FAIL;
}
ESP_LOGI(TAG, "%d signature block(s) found appended to the app.", app_key_digests.num_digests);
if (app_key_digests.num_digests > boot_key_digests.num_digests) {
ESP_LOGW(TAG, "App has %d signature blocks but bootloader only has %d. Some keys missing from bootloader?");
}
/* Confirm if at least one public key from the application matches a public key in the bootloader
(Also, ensure if that public revoke bit is not set for the matched key) */
bool match = false;
const uint32_t revoke_bits[SECURE_BOOT_NUM_BLOCKS] = { EFUSE_SECURE_BOOT_KEY_REVOKE0,
EFUSE_SECURE_BOOT_KEY_REVOKE1, EFUSE_SECURE_BOOT_KEY_REVOKE2 };
for (int i = 0; i < boot_key_digests.num_digests; i++) {
if (REG_GET_BIT(EFUSE_RD_REPEAT_DATA1_REG, revoke_bits[i])) {
ESP_LOGI(TAG, "Key block(%d) has been revoked.", i);
continue; // skip if the key block is revoked
}
for (int j = 0; j < app_key_digests.num_digests; j++) {
if (!memcmp(boot_key_digests.key_digests[i], app_key_digests.key_digests[j], DIGEST_LEN)) {
ESP_LOGI(TAG, "Application key(%d) matches with bootloader key(%d).", j, i);
match = true;
}
}
}
if (match == false) {
ESP_LOGE(TAG, "No application key digest matches the bootloader key digest.");
return ESP_FAIL;
}
/* Revoke the empty signature blocks */
if (boot_key_digests.num_digests < SECURE_BOOT_NUM_BLOCKS) {
/* The revocation index can be 0, 1, 2. Bootloader count can be 1,2,3. */
for (uint8_t i = boot_key_digests.num_digests; i < SECURE_BOOT_NUM_BLOCKS; i++) {
ESP_LOGI(TAG, "Revoking empty key digest slot (%d)...", i);
ets_secure_boot_revoke_public_key_digest(i);
}
}
}
esp_err_t err = esp_efuse_batch_write_begin();
if (err != ESP_OK) {
ESP_LOGI(TAG, "Error batch programming security eFuses.");
return err;
}
__attribute__((unused)) static const uint8_t enable = 1;
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_BOOT_REMAP);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
// TODO: also disable JTAG here, etc
esp_err_t err = esp_efuse_batch_write_commit();
if (err == ESP_OK) {
assert(ets_efuse_secure_boot_enabled());
ESP_LOGI(TAG, "Secure boot permanently enabled");
esp_err_t err = ESP_FAIL;
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
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, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
esp_efuse_write_field_bit(ESP_EFUSE_SOFT_DIS_JTAG);
#else
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
#endif
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool rd_dis_now = true;
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
/* If flash encryption is not enabled yet then don't read-disable efuses yet, do it later in the boot
when Flash Encryption is being enabled */
rd_dis_now = esp_flash_encryption_enabled();
#endif
if (rd_dis_now) {
ESP_LOGI(TAG, "Prevent read disabling of additional efuses...");
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
}
#else
ESP_LOGW(TAG, "Allowing read disabling of additional efuses - SECURITY COMPROMISED");
#endif
err = esp_efuse_batch_write_commit();
if (err != ESP_OK) {
ESP_LOGI(TAG, "Error programming security eFuses.");
return err;
}
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
assert(ets_efuse_secure_boot_aggressive_revoke_enabled());
#endif
assert(ets_efuse_secure_boot_enabled());
ESP_LOGI(TAG, "Secure boot permanently enabled");
return ESP_OK;
}

View File

@ -13,29 +13,32 @@
// limitations under the License.
#include "sdkconfig.h"
#include "bootloader_flash.h"
#include <string.h>
#include "esp_fault.h"
#include "bootloader_flash_priv.h"
#include "bootloader_sha.h"
#include "bootloader_utility.h"
#include "esp_log.h"
#include "esp_image_format.h"
#include "esp_secure_boot.h"
#include "esp32s2/rom/secure_boot.h"
static const char* TAG = "secure_boot";
#define DIGEST_LEN 32
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
{
ets_secure_boot_key_digests_t trusted_keys = { 0 };
uint8_t digest[DIGEST_LEN];
uint8_t verified_digest[DIGEST_LEN] = { 0 }; /* Note: this function doesn't do any anti-FI checks on this buffer */
const uint8_t *data;
ESP_LOGD(TAG, "verifying signature src_addr 0x%x length 0x%x", src_addr, length);
if ((src_addr + length) % 4096 != 0) {
ESP_LOGE(TAG, "addr 0x%x length 0x%x doesn't end on a sector boundary", src_addr, length);
return ESP_ERR_INVALID_ARG;
}
/* Padding to round off the input to the nearest 4k boundary */
int padded_length = ALIGN_UP(length, FLASH_SECTOR_SIZE);
ESP_LOGD(TAG, "verifying src_addr 0x%x length", src_addr, padded_length);
data = bootloader_mmap(src_addr, length + sizeof(struct ets_secure_boot_sig_block));
if (data == NULL) {
@ -43,23 +46,16 @@ esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
return ESP_FAIL;
}
// Calculate digest of main image
#ifdef BOOTLOADER_BUILD
bootloader_sha256_handle_t handle = bootloader_sha256_start();
bootloader_sha256_data(handle, data, length);
bootloader_sha256_finish(handle, digest);
#else
/* Use thread-safe esp-idf SHA function */
esp_sha(SHA2_256, data, length, digest);
#endif
int r = ets_secure_boot_read_key_digests(&trusted_keys);
if (r == ETS_OK) {
const ets_secure_boot_signature_t *sig = (const ets_secure_boot_signature_t *)(data + length);
// TODO: calling this function in IDF app context is unsafe
r = ets_secure_boot_verify_signature(sig, digest, &trusted_keys, verified_digest);
/* Calculate digest of main image */
esp_err_t err = bootloader_sha256_flash_contents(src_addr, padded_length, digest);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Digest calculation failed 0x%x, 0x%x", src_addr, padded_length);
bootloader_munmap(data);
return err;
}
const ets_secure_boot_signature_t *sig = (const ets_secure_boot_signature_t *)(data + length);
int r = esp_secure_boot_verify_rsa_signature_block(sig, digest, verified_digest);
bootloader_munmap(data);
return (r == ETS_OK) ? ESP_OK : ESP_FAIL;
@ -68,15 +64,30 @@ esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, uint8_t *verified_digest)
{
ets_secure_boot_key_digests_t trusted_keys;
ets_secure_boot_key_digests_t trusted_key_copies[2];
ETS_STATUS r;
ets_secure_boot_status_t sb_result;
int r = ets_secure_boot_read_key_digests(&trusted_keys);
if (r != 0) {
ESP_LOGE(TAG, "No trusted key digests were found in efuse!");
} else {
ESP_LOGD(TAG, "Verifying with RSA-PSS...");
// TODO: calling this function in IDF app context is unsafe
r = ets_secure_boot_verify_signature(sig_block, image_digest, &trusted_keys, verified_digest);
memset(&trusted_keys, 0, sizeof(ets_secure_boot_key_digests_t));
memset(trusted_key_copies, 0, 2 * sizeof(ets_secure_boot_key_digests_t));
if (!esp_secure_boot_enabled()) {
return ESP_OK;
}
return (r == 0) ? ESP_OK : ESP_ERR_IMAGE_INVALID;
r = ets_secure_boot_read_key_digests(&trusted_keys);
if (r != ETS_OK) {
ESP_LOGI(TAG, "Could not read secure boot digests!");
return ESP_FAIL;
}
// Create the copies for FI checks (assuming result is ETS_OK, if it's not then it'll fail the fault check anyhow)
ets_secure_boot_read_key_digests(&trusted_key_copies[0]);
ets_secure_boot_read_key_digests(&trusted_key_copies[1]);
ESP_FAULT_ASSERT(memcmp(&trusted_keys, &trusted_key_copies[0], sizeof(ets_secure_boot_key_digests_t)) == 0);
ESP_FAULT_ASSERT(memcmp(&trusted_keys, &trusted_key_copies[1], sizeof(ets_secure_boot_key_digests_t)) == 0);
ESP_LOGI(TAG, "Verifying with RSA-PSS boot...");
sb_result = ets_secure_boot_verify_signature(sig_block, image_digest, &trusted_keys, verified_digest);
return (sb_result == SB_SUCCESS) ? ESP_OK : ESP_FAIL;
}

View File

@ -20,7 +20,7 @@
#include <esp_log.h>
#include <esp_attr.h>
#include <esp_spi_flash.h>
#include <bootloader_flash.h>
#include <bootloader_flash_priv.h>
#include <bootloader_random.h>
#include <bootloader_sha.h>
#include "bootloader_util.h"
@ -220,8 +220,18 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
#ifdef SECURE_BOOT_CHECK_SIGNATURE
// secure boot images have a signature appended
err = verify_secure_boot_signature(sha_handle, data, image_digest, verified_digest);
#else
#if defined(BOOTLOADER_BUILD) && !defined(CONFIG_SECURE_BOOT)
// If secure boot is not enabled in hardware, then
// skip the signature check in bootloader when the debugger is attached.
// This is done to allow for breakpoints in Flash.
if (!esp_cpu_in_ocd_debug_mode()) {
#else // CONFIG_SECURE_BOOT
if (true) {
#endif // end checking for JTAG
err = verify_secure_boot_signature(sha_handle, data, image_digest, verified_digest);
sha_handle = NULL; // verify_secure_boot_signature finishes sha_handle
}
#else // SECURE_BOOT_CHECK_SIGNATURE
// No secure boot, but SHA-256 can be appended for basic corruption detection
if (sha_handle != NULL && !esp_cpu_in_ocd_debug_mode()) {
err = verify_simple_hash(sha_handle, data);
@ -266,7 +276,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
"only verify signature in bootloader" into the macro so it's tested multiple times.
*/
#if CONFIG_SECURE_BOOT_V2_ENABLED
ESP_FAULT_ASSERT(memcmp(image_digest, verified_digest, HASH_LEN) == 0);
ESP_FAULT_ASSERT(!esp_secure_boot_enabled() || memcmp(image_digest, verified_digest, HASH_LEN) == 0);
#else // Secure Boot V1 on ESP32, only verify signatures for apps not bootloaders
ESP_FAULT_ASSERT(data->start_addr == ESP_BOOTLOADER_OFFSET || memcmp(image_digest, verified_digest, HASH_LEN) == 0);
#endif
@ -301,7 +311,7 @@ err:
// Prevent invalid/incomplete data leaking out
bzero(data, sizeof(esp_image_metadata_t));
return err;
}
}
esp_err_t bootloader_load_image(const esp_partition_pos_t *part, esp_image_metadata_t *data)
{
@ -841,3 +851,21 @@ static esp_err_t verify_simple_hash(bootloader_sha256_handle_t sha_handle, esp_i
bootloader_munmap(hash);
return ESP_OK;
}
int esp_image_get_flash_size(esp_image_flash_size_t app_flash_size)
{
switch (app_flash_size) {
case ESP_IMAGE_FLASH_SIZE_1MB:
return 1 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_2MB:
return 2 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_4MB:
return 4 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_8MB:
return 8 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_16MB:
return 16 * 1024 * 1024;
default:
return 0;
}
}

View File

@ -50,7 +50,7 @@ void esp_flash_encryption_init_checks()
// (this distinction is important on ESP32 ECO3 where write-procted FLASH_CRYPT_CNT also write-protects UART_DL_DIS)
return;
}
ESP_EARLY_LOGE(TAG, "Flash encryption & Secure Boot together requires FLASH_CRYPT_CNT efuse to be write protected. Fixing now...");
ESP_LOGE(TAG, "Flash encryption & Secure Boot together requires FLASH_CRYPT_CNT efuse to be write protected. Fixing now...");
esp_flash_write_protect_crypt_cnt();
}
}
@ -62,13 +62,13 @@ void esp_flash_encryption_init_checks()
mode = esp_get_flash_encryption_mode();
if (mode == ESP_FLASH_ENC_MODE_DEVELOPMENT) {
#ifdef CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE
ESP_EARLY_LOGE(TAG, "Flash encryption settings error: app is configured for RELEASE but efuses are set for DEVELOPMENT");
ESP_EARLY_LOGE(TAG, "Mismatch found in security options in bootloader menuconfig and efuse settings. Device is not secure.");
ESP_LOGE(TAG, "Flash encryption settings error: app is configured for RELEASE but efuses are set for DEVELOPMENT");
ESP_LOGE(TAG, "Mismatch found in security options in bootloader menuconfig and efuse settings. Device is not secure.");
#else
ESP_EARLY_LOGW(TAG, "Flash encryption mode is DEVELOPMENT (not secure)");
ESP_LOGW(TAG, "Flash encryption mode is DEVELOPMENT (not secure)");
#endif
} else if (mode == ESP_FLASH_ENC_MODE_RELEASE) {
ESP_EARLY_LOGI(TAG, "Flash encryption mode is RELEASE");
ESP_LOGI(TAG, "Flash encryption mode is RELEASE");
}
}
#endif
@ -80,7 +80,7 @@ void esp_flash_write_protect_crypt_cnt(void)
esp_flash_enc_mode_t esp_get_flash_encryption_mode(void)
{
uint8_t efuse_flash_crypt_cnt_wr_protected = 0;
bool flash_crypt_cnt_wr_dis = false;
#if CONFIG_IDF_TARGET_ESP32
uint8_t dis_dl_enc = 0, dis_dl_dec = 0, dis_dl_cache = 0;
#elif CONFIG_IDF_TARGET_ESP32S2
@ -94,9 +94,17 @@ esp_flash_enc_mode_t esp_get_flash_encryption_mode(void)
if (esp_flash_encryption_enabled()) {
/* Check if FLASH CRYPT CNT is write protected */
efuse_flash_crypt_cnt_wr_protected = esp_efuse_read_field_bit(WR_DIS_CRYPT_CNT);
if (efuse_flash_crypt_cnt_wr_protected) {
flash_crypt_cnt_wr_dis = esp_efuse_read_field_bit(WR_DIS_CRYPT_CNT);
if (!flash_crypt_cnt_wr_dis) {
uint8_t flash_crypt_cnt = 0;
esp_efuse_read_field_blob(CRYPT_CNT, &flash_crypt_cnt, CRYPT_CNT[0]->bit_count);
if (flash_crypt_cnt == (1 << (CRYPT_CNT[0]->bit_count)) - 1) {
flash_crypt_cnt_wr_dis = true;
}
}
if (flash_crypt_cnt_wr_dis) {
#if CONFIG_IDF_TARGET_ESP32
dis_dl_cache = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_DL_CACHE);

View File

@ -52,7 +52,7 @@ esp_err_t esp_partition_table_verify(const esp_partition_info_t *partition_table
MD5Update(&context, (unsigned char *) partition_table, num_parts * sizeof(esp_partition_info_t));
MD5Final(digest, &context);
unsigned char *md5sum = ((unsigned char *) part) + 16; // skip the 2B magic number and the 14B fillup bytes
unsigned char *md5sum = ((unsigned char *) part) + ESP_PARTITION_MD5_OFFSET;
if (memcmp(md5sum, digest, sizeof(digest)) != 0) {
if (log_errors) {

View File

@ -13,7 +13,9 @@
// limitations under the License.
#include <stddef.h>
#include <stdint.h>
#include "bootloader_flash_config.h"
#include "flash_qio_mode.h"
#include "bootloader_flash_priv.h"
#include "esp_log.h"
#include "esp_err.h"
#if CONFIG_IDF_TARGET_ESP32
@ -24,30 +26,10 @@
#include "esp32s2/rom/efuse.h"
#include "soc/spi_mem_struct.h"
#endif
#include "soc/spi_struct.h"
#include "soc/spi_reg.h"
#include "soc/efuse_periph.h"
#include "soc/io_mux_reg.h"
#include "sdkconfig.h"
/* SPI flash controller */
#if CONFIG_IDF_TARGET_ESP32
#define SPIFLASH SPI1
#elif CONFIG_IDF_TARGET_ESP32S2
#define SPIFLASH SPIMEM1
#endif
/* SPI commands (actual on-wire commands not SPI controller bitmasks)
Suitable for use with the execute_flash_command static function.
*/
#define CMD_RDID 0x9F
#define CMD_WRSR 0x01
#define CMD_WRSR2 0x31 /* Not all SPI flash uses this command */
#define CMD_WREN 0x06
#define CMD_WRDI 0x04
#define CMD_RDSR 0x05
#define CMD_RDSR2 0x35 /* Not all SPI flash uses this command */
#define CMD_OTPEN 0x3A /* Enable OTP mode, not all SPI flash uses this command */
static const char *TAG = "qio_mode";
@ -84,12 +66,6 @@ static unsigned read_status_8b_xmc25qu64a(void);
/* Write 8 bit status of XM25QU64A */
static void write_status_8b_xmc25qu64a(unsigned new_status);
#define ESP32_D2WD_WP_GPIO 7 /* ESP32-D2WD has this GPIO wired to WP pin of flash */
#ifndef CONFIG_BOOTLOADER_SPI_WP_PIN // Set in menuconfig if SPI flasher config is set to a quad mode
#define CONFIG_BOOTLOADER_SPI_WP_PIN ESP32_D2WD_WP_GPIO
#endif
/* Array of known flash chips and data to enable Quad I/O mode
Manufacturer & flash ID can be tested by running "esptool.py
@ -109,6 +85,7 @@ const static qio_info_t chip_data[] = {
{ "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 },
{ "TH", 0xcd, 0x6000, 0xFF00, read_status_16b_rdsr_rdsr2, write_status_16b_wrsr, 9 },
/* Final entry is default entry, if no other IDs have matched.
@ -130,56 +107,6 @@ static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
The command passed here is always the on-the-wire command given to the SPI flash unit.
*/
static uint32_t execute_flash_command(uint8_t command, uint32_t mosi_data, uint8_t mosi_len, uint8_t miso_len);
/* dummy_len_plus values defined in ROM for SPI flash configuration */
extern uint8_t g_rom_spiflash_dummy_len_plus[];
uint32_t bootloader_read_flash_id(void)
{
uint32_t id = execute_flash_command(CMD_RDID, 0, 0, 24);
id = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00);
return id;
}
#if CONFIG_IDF_TARGET_ESP32S2
#define FLASH_WRAP_CMD 0x77
typedef enum {
FLASH_WRAP_MODE_8B = 0,
FLASH_WRAP_MODE_16B = 2,
FLASH_WRAP_MODE_32B = 4,
FLASH_WRAP_MODE_64B = 6,
FLASH_WRAP_MODE_DISABLE = 1
} spi_flash_wrap_mode_t;
static esp_err_t spi_flash_wrap_set(spi_flash_wrap_mode_t mode)
{
uint32_t reg_bkp_ctrl = SPIFLASH.ctrl.val;
uint32_t reg_bkp_usr = SPIFLASH.user.val;
SPIFLASH.user.fwrite_dio = 0;
SPIFLASH.user.fwrite_dual = 0;
SPIFLASH.user.fwrite_qio = 1;
SPIFLASH.user.fwrite_quad = 0;
SPIFLASH.ctrl.fcmd_dual = 0;
SPIFLASH.ctrl.fcmd_quad = 0;
SPIFLASH.user.usr_dummy = 0;
SPIFLASH.user.usr_addr = 1;
SPIFLASH.user.usr_command = 1;
SPIFLASH.user2.usr_command_bitlen = 7;
SPIFLASH.user2.usr_command_value = FLASH_WRAP_CMD;
SPIFLASH.user1.usr_addr_bitlen = 23;
SPIFLASH.addr = 0;
SPIFLASH.user.usr_miso = 0;
SPIFLASH.user.usr_mosi = 1;
SPIFLASH.mosi_dlen.usr_mosi_bit_len = 7;
SPIFLASH.data_buf[0] = (uint32_t) mode << 4;;
SPIFLASH.cmd.usr = 1;
while (SPIFLASH.cmd.usr != 0) {
}
SPIFLASH.ctrl.val = reg_bkp_ctrl;
SPIFLASH.user.val = reg_bkp_usr;
return ESP_OK;
}
#endif
void bootloader_enable_qio_mode(void)
{
@ -212,8 +139,8 @@ void bootloader_enable_qio_mode(void)
enable_qio_mode(chip_data[i].read_status_fn,
chip_data[i].write_status_fn,
chip_data[i].status_qio_bit);
#if CONFIG_IDF_TARGET_ESP32S2
spi_flash_wrap_set(FLASH_WRAP_MODE_DISABLE);
#if SOC_CACHE_SUPPORT_WRAP
bootloader_flash_wrap_set(FLASH_WRAP_MODE_DISABLE);
#endif
}
@ -224,31 +151,13 @@ static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
uint32_t status;
const uint32_t spiconfig = ets_efuse_get_spiconfig();
#if CONFIG_IDF_TARGET_ESP32
if (spiconfig != EFUSE_SPICONFIG_SPI_DEFAULTS && spiconfig != EFUSE_SPICONFIG_HSPI_DEFAULTS) {
// spiconfig specifies a custom efuse pin configuration. This config defines all pins -except- WP,
// which is compiled into the bootloader instead.
//
// Most commonly an overriden pin mapping means ESP32-D2WD or ESP32-PICOD4.
//Warn if chip is ESP32-D2WD/ESP32-PICOD4 but someone has changed the WP pin
//assignment from that chip's WP pin.
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
if (CONFIG_BOOTLOADER_SPI_WP_PIN != ESP32_D2WD_WP_GPIO &&
(pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 ||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4)) {
ESP_LOGW(TAG, "Chip is ESP32-D2WD/ESP32-PICOD4 but flash WP pin is different value to internal flash");
}
}
#endif
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
status = read_status_fn();
ESP_LOGD(TAG, "Initial flash chip status 0x%x", status);
if ((status & (1 << status_qio_bit)) == 0) {
execute_flash_command(CMD_WREN, 0, 0, 0);
bootloader_execute_flash_command(CMD_WREN, 0, 0, 0);
write_status_fn(status | (1 << status_qio_bit));
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
@ -276,108 +185,58 @@ static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn,
esp_rom_spiflash_config_readmode(mode);
#if CONFIG_IDF_TARGET_ESP32
esp_rom_spiflash_select_qio_pins(CONFIG_BOOTLOADER_SPI_WP_PIN, spiconfig);
int wp_pin = bootloader_flash_get_wp_pin();
esp_rom_spiflash_select_qio_pins(wp_pin, spiconfig);
#elif CONFIG_IDF_TARGET_ESP32S2
if (ets_efuse_get_wp_pad() <= MAX_PAD_GPIO_NUM) {
esp_rom_spiflash_select_qio_pins(ets_efuse_get_wp_pad(), spiconfig);
} else {
esp_rom_spiflash_select_qio_pins(CONFIG_BOOTLOADER_SPI_WP_PIN, spiconfig);
}
esp_rom_spiflash_select_qio_pins(ets_efuse_get_wp_pad(), spiconfig);
#endif
return ESP_OK;
}
static unsigned read_status_8b_rdsr(void)
{
return execute_flash_command(CMD_RDSR, 0, 0, 8);
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
}
static unsigned read_status_8b_rdsr2(void)
{
return execute_flash_command(CMD_RDSR2, 0, 0, 8);
return bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8);
}
static unsigned read_status_16b_rdsr_rdsr2(void)
{
return execute_flash_command(CMD_RDSR, 0, 0, 8) | (execute_flash_command(CMD_RDSR2, 0, 0, 8) << 8);
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)
{
execute_flash_command(CMD_WRSR, new_status, 8, 0);
bootloader_execute_flash_command(CMD_WRSR, new_status, 8, 0);
}
static void write_status_8b_wrsr2(unsigned new_status)
{
execute_flash_command(CMD_WRSR2, new_status, 8, 0);
bootloader_execute_flash_command(CMD_WRSR2, new_status, 8, 0);
}
static void write_status_16b_wrsr(unsigned new_status)
{
execute_flash_command(CMD_WRSR, new_status, 16, 0);
bootloader_execute_flash_command(CMD_WRSR, new_status, 16, 0);
}
static unsigned read_status_8b_xmc25qu64a(void)
{
execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
uint32_t read_status = execute_flash_command(CMD_RDSR, 0, 0, 8);
execute_flash_command(CMD_WRDI, 0, 0, 0); /* Exit OTP mode */
uint32_t read_status = bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
bootloader_execute_flash_command(CMD_WRDI, 0, 0, 0); /* Exit OTP mode */
return read_status;
}
static void write_status_8b_xmc25qu64a(unsigned new_status)
{
execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
execute_flash_command(CMD_WRSR, new_status, 8, 0);
bootloader_execute_flash_command(CMD_WRSR, new_status, 8, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
execute_flash_command(CMD_WRDI, 0, 0, 0); /* Exit OTP mode */
}
static uint32_t execute_flash_command(uint8_t command, uint32_t mosi_data, uint8_t mosi_len, uint8_t miso_len)
{
uint32_t old_ctrl_reg = SPIFLASH.ctrl.val;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.ctrl.val = SPI_WP_REG_M; // keep WP high while idle, otherwise leave DIO mode
#elif CONFIG_IDF_TARGET_ESP32S2
SPIFLASH.ctrl.val = SPI_MEM_WP_REG_M; // keep WP high while idle, otherwise leave DIO mode
#endif
SPIFLASH.user.usr_dummy = 0;
SPIFLASH.user.usr_addr = 0;
SPIFLASH.user.usr_command = 1;
SPIFLASH.user2.usr_command_bitlen = 7;
SPIFLASH.user2.usr_command_value = command;
SPIFLASH.user.usr_miso = miso_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.miso_dlen.usr_miso_dbitlen = miso_len ? (miso_len - 1) : 0;
#elif CONFIG_IDF_TARGET_ESP32S2
SPIFLASH.miso_dlen.usr_miso_bit_len = miso_len ? (miso_len - 1) : 0;
#endif
SPIFLASH.user.usr_mosi = mosi_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.mosi_dlen.usr_mosi_dbitlen = mosi_len ? (mosi_len - 1) : 0;
#elif CONFIG_IDF_TARGET_ESP32S2
SPIFLASH.mosi_dlen.usr_mosi_bit_len = mosi_len ? (mosi_len - 1) : 0;
#endif
SPIFLASH.data_buf[0] = mosi_data;
if (g_rom_spiflash_dummy_len_plus[1]) {
/* When flash pins are mapped via GPIO matrix, need a dummy cycle before reading via MISO */
if (miso_len > 0) {
SPIFLASH.user.usr_dummy = 1;
SPIFLASH.user1.usr_dummy_cyclelen = g_rom_spiflash_dummy_len_plus[1] - 1;
} else {
SPIFLASH.user.usr_dummy = 0;
SPIFLASH.user1.usr_dummy_cyclelen = 0;
}
}
SPIFLASH.cmd.usr = 1;
while (SPIFLASH.cmd.usr != 0) {
}
SPIFLASH.ctrl.val = old_ctrl_reg;
return SPIFLASH.data_buf[0];
bootloader_execute_flash_command(CMD_WRDI, 0, 0, 0); /* Exit OTP mode */
}

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "bootloader_sha.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include <stdbool.h>
#include <string.h>
#include <assert.h>
@ -51,4 +51,5 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
}
mbedtls_sha256_free(ctx);
free(handle);
handle = NULL;
}

View File

@ -13,7 +13,7 @@
// limitations under the License.
#include "sdkconfig.h"
#include "bootloader_flash.h"
#include "bootloader_flash_priv.h"
#include "bootloader_sha.h"
#include "bootloader_utility.h"
#include "esp_log.h"
@ -27,6 +27,11 @@
#include "mbedtls/ctr_drbg.h"
#include <string.h>
#include <sys/param.h>
#include "esp_secure_boot.h"
#ifdef CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/secure_boot.h>
#endif
#define DIGEST_LEN 32
@ -142,6 +147,26 @@ static const char *TAG = "secure_boot_v2";
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
#define RSA_KEY_SIZE 384 /* RSA 3072 Bits */
#if CONFIG_IDF_TARGET_ESP32S2
inline static bool digest_matches(const void *trusted, const void *computed)
{
if (trusted == NULL) {
return false;
}
// 'trusted' is probably a pointer to read-only efuse registers,
// which only support word reads. memcmp() cannot be guaranteed
// to do word reads, so we make a local copy here (we know that
// memcpy() will do word operations if it can).
uint8_t __attribute__((aligned(4))) trusted_local[ETS_DIGEST_LEN];
uint8_t __attribute__((aligned(4))) computed_local[ETS_DIGEST_LEN];
memcpy(trusted_local, trusted, ETS_DIGEST_LEN);
memcpy(computed_local, computed, ETS_DIGEST_LEN);
return memcmp(trusted_local, computed_local, ETS_DIGEST_LEN) == 0;
}
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
{
uint8_t digest[DIGEST_LEN] = {0};
@ -173,23 +198,27 @@ esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, uint8_t *verified_digest)
{
int i = 0;
uint8_t i = 0;
#if CONFIG_SECURE_BOOT_V2_ENABLED /* Verify key against efuse block */
uint8_t efuse_trusted_digest[DIGEST_LEN] = {0}, sig_block_trusted_digest[DIGEST_LEN] = {0};
memcpy(efuse_trusted_digest, (uint8_t *) EFUSE_BLK2_RDATA0_REG, sizeof(efuse_trusted_digest));
uint8_t sig_block_key_digest[SECURE_BOOT_NUM_BLOCKS][DIGEST_LEN] = {0};
/* Note: in IDF verification we don't add any fault injection resistance, as we don't expect this to be called
during boot-time verification. */
memset(verified_digest, 0, DIGEST_LEN);
/* Generating the SHA of the public key components in the signature block */
bootloader_sha256_handle_t sig_block_sha;
sig_block_sha = bootloader_sha256_start();
bootloader_sha256_data(sig_block_sha, &sig_block->block[0].key, sizeof(sig_block->block[0].key));
bootloader_sha256_finish(sig_block_sha, (unsigned char *)sig_block_trusted_digest);
for (i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
bootloader_sha256_handle_t sig_block_sha;
sig_block_sha = bootloader_sha256_start();
bootloader_sha256_data(sig_block_sha, &sig_block->block[i].key, sizeof(sig_block->block[i].key));
bootloader_sha256_finish(sig_block_sha, (unsigned char *)sig_block_key_digest[i]);
}
if (memcmp(efuse_trusted_digest, sig_block_trusted_digest, DIGEST_LEN) != 0) {
#if CONFIG_IDF_TARGET_ESP32
uint8_t efuse_trusted_digest[DIGEST_LEN] = {0};
memcpy(efuse_trusted_digest, (uint8_t *) EFUSE_BLK2_RDATA0_REG, sizeof(efuse_trusted_digest));
if (memcmp(efuse_trusted_digest, sig_block_key_digest[0], DIGEST_LEN) != 0) {
const uint8_t zeroes[DIGEST_LEN] = {0};
/* Can't continue if secure boot is enabled, OR if a different digest is already written in efuse BLK2
@ -200,7 +229,17 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
return ESP_FAIL;
}
}
#endif
#elif CONFIG_IDF_TARGET_ESP32S2
bool match = false;
ets_secure_boot_key_digests_t efuse_trusted_digest;
ETS_STATUS r;
r = ets_secure_boot_read_key_digests(&efuse_trusted_digest);
if (r != 0) {
ESP_LOGI(TAG, "Could not read secure boot digests!");
return ESP_FAIL;
}
#endif /* CONFIG_IDF_TARGET_ESP32 */
#endif /* CONFIG_SECURE_BOOT_V2_ENABLED */
ESP_LOGI(TAG, "Verifying with RSA-PSS...");
int ret = 0;
@ -222,6 +261,19 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
}
for (i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
#if CONFIG_IDF_TARGET_ESP32S2
for (uint8_t j = 0; j < SECURE_BOOT_NUM_BLOCKS; j++) {
if (digest_matches(efuse_trusted_digest.key_digests[j], sig_block_key_digest[i])) {
ESP_LOGI(TAG, "eFuse key matches(%d) matches the application key(%d).", j, i);
match = true;
break;
}
}
if (match == false) {
continue; // Skip the public keys whose digests don't match.
}
# endif
const mbedtls_mpi N = { .s = 1,
.n = sizeof(sig_block->block[i].key.n)/sizeof(mbedtls_mpi_uint),
.p = (void *)sig_block->block[i].key.n,
@ -260,8 +312,8 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
goto exit;
}
ret = mbedtls_rsa_rsassa_pss_verify( &pk, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PUBLIC, MBEDTLS_MD_SHA256, 32,
sig_block->block[i].image_digest, sig_be);
ret = mbedtls_rsa_rsassa_pss_verify( &pk, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PUBLIC, MBEDTLS_MD_SHA256, DIGEST_LEN,
image_digest, sig_be);
if (ret != 0) {
ESP_LOGE(TAG, "Failed mbedtls_rsa_rsassa_pss_verify, err: %d", ret);
} else {
@ -273,9 +325,13 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
break;
}
}
free(sig_be);
free(buf);
return (!ret) ? ESP_OK : ESP_ERR_IMAGE_INVALID;
#if CONFIG_IDF_TARGET_ESP32
return (ret != 0) ? ESP_ERR_IMAGE_INVALID: ESP_OK;
#elif CONFIG_IDF_TARGET_ESP32S2
return (ret != 0 || match == false) ? ESP_ERR_IMAGE_INVALID: ESP_OK;
#endif /* CONFIG_IDF_TARGET_ESP32 */
}
#endif

View File

@ -96,6 +96,7 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/bta/dm/bta_dm_main.c"
"host/bluedroid/bta/dm/bta_dm_pm.c"
"host/bluedroid/bta/dm/bta_dm_sco.c"
"host/bluedroid/bta/dm/bta_dm_qos.c"
"host/bluedroid/bta/gatt/bta_gatt_common.c"
"host/bluedroid/bta/gatt/bta_gattc_act.c"
"host/bluedroid/bta/gatt/bta_gattc_api.c"
@ -315,6 +316,7 @@ if(CONFIG_BT_ENABLED)
if(CONFIG_BLE_MESH)
list(APPEND include_dirs
"esp_ble_mesh/mesh_common/include"
"esp_ble_mesh/mesh_common/tinycrypt/include"
"esp_ble_mesh/mesh_core"
"esp_ble_mesh/mesh_core/include"
"esp_ble_mesh/mesh_core/storage"
@ -339,6 +341,7 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/api/models/esp_ble_mesh_lighting_model_api.c"
"esp_ble_mesh/api/models/esp_ble_mesh_sensor_model_api.c"
"esp_ble_mesh/api/models/esp_ble_mesh_time_scene_model_api.c"
"esp_ble_mesh/btc/btc_ble_mesh_ble.c"
"esp_ble_mesh/btc/btc_ble_mesh_config_model.c"
"esp_ble_mesh/btc/btc_ble_mesh_generic_model.c"
"esp_ble_mesh/btc/btc_ble_mesh_health_model.c"
@ -346,7 +349,21 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/btc/btc_ble_mesh_prov.c"
"esp_ble_mesh/btc/btc_ble_mesh_sensor_model.c"
"esp_ble_mesh/btc/btc_ble_mesh_time_scene_model.c"
"esp_ble_mesh/mesh_common/mesh_aes_encrypt.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/aes_decrypt.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/aes_encrypt.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/cbc_mode.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ccm_mode.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/cmac_mode.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ctr_mode.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ctr_prng.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ecc_dh.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ecc_dsa.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ecc_platform_specific.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/ecc.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/hmac_prng.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/hmac.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/sha256.c"
"esp_ble_mesh/mesh_common/tinycrypt/src/utils.c"
"esp_ble_mesh/mesh_common/mesh_atomic.c"
"esp_ble_mesh/mesh_common/mesh_buf.c"
"esp_ble_mesh/mesh_common/mesh_common.c"
@ -361,9 +378,11 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/mesh_core/cfg_cli.c"
"esp_ble_mesh/mesh_core/cfg_srv.c"
"esp_ble_mesh/mesh_core/crypto.c"
"esp_ble_mesh/mesh_core/fast_prov.c"
"esp_ble_mesh/mesh_core/friend.c"
"esp_ble_mesh/mesh_core/health_cli.c"
"esp_ble_mesh/mesh_core/health_srv.c"
"esp_ble_mesh/mesh_core/local_operation.c"
"esp_ble_mesh/mesh_core/lpn.c"
"esp_ble_mesh/mesh_core/main.c"
"esp_ble_mesh/mesh_core/net.c"
@ -372,15 +391,17 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/mesh_core/provisioner_prov.c"
"esp_ble_mesh/mesh_core/proxy_client.c"
"esp_ble_mesh/mesh_core/proxy_server.c"
"esp_ble_mesh/mesh_core/settings_uid.c"
"esp_ble_mesh/mesh_core/settings.c"
"esp_ble_mesh/mesh_core/scan.c"
"esp_ble_mesh/mesh_core/test.c"
"esp_ble_mesh/mesh_core/transport.c"
"esp_ble_mesh/mesh_models/common/device_property.c"
"esp_ble_mesh/mesh_models/client/client_common.c"
"esp_ble_mesh/mesh_models/client/generic_client.c"
"esp_ble_mesh/mesh_models/client/lighting_client.c"
"esp_ble_mesh/mesh_models/client/sensor_client.c"
"esp_ble_mesh/mesh_models/client/time_scene_client.c"
"esp_ble_mesh/mesh_models/server/device_property.c"
"esp_ble_mesh/mesh_models/server/generic_server.c"
"esp_ble_mesh/mesh_models/server/lighting_server.c"
"esp_ble_mesh/mesh_models/server/sensor_server.c"
@ -552,6 +573,6 @@ idf_component_register(SRCS "${srcs}"
if(CONFIG_BT_ENABLED)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough -Wno-unused-const-variable)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib/esp32")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
endif()

View File

@ -79,6 +79,47 @@ menu "Bluetooth"
default 1 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM
default 0
menuconfig BTDM_CTRL_PCM_ROLE_EDGE_CONFIG
bool "PCM Signal Config (Role and Polar)"
depends on BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM
default y
choice BTDM_CTRL_PCM_ROLE
prompt "PCM Role"
depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG
help
PCM role can be configured as PCM master or PCM slave
config BTDM_CTRL_PCM_ROLE_MASTER
bool "PCM Master"
config BTDM_CTRL_PCM_ROLE_SLAVE
bool "PCM Slave"
endchoice
choice BTDM_CTRL_PCM_POLAR
prompt "PCM Polar"
depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG
help
PCM polarity can be configured as Falling Edge or Rising Edge
config BTDM_CTRL_PCM_POLAR_FALLING_EDGE
bool "Falling Edge"
config BTDM_CTRL_PCM_POLAR_RISING_EDGE
bool "Rising Edge"
endchoice
config BTDM_CTRL_PCM_ROLE_EFF
int
default 0 if BTDM_CTRL_PCM_ROLE_MASTER
default 1 if BTDM_CTRL_PCM_ROLE_SLAVE
default 0
config BTDM_CTRL_PCM_POLAR_EFF
int
default 0 if BTDM_CTRL_PCM_POLAR_FALLING_EDGE
default 1 if BTDM_CTRL_PCM_POLAR_RISING_EDGE
default 0
config BTDM_CTRL_AUTO_LATENCY
bool "Auto latency"
depends on BTDM_CTRL_MODE_BTDM
@ -92,6 +133,19 @@ menu "Bluetooth"
default BTDM_CTRL_AUTO_LATENCY if BTDM_CTRL_MODE_BTDM
default n
config BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT
bool "Legacy Authentication Vendor Specific Event Enable"
depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
default y
help
To protect from BIAS attack during Legacy authentication,
Legacy authentication Vendor specific event should be enabled
config BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT_EFF
bool
default BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
default 0
config BTDM_CTRL_BLE_MAX_CONN_EFF
int
@ -311,11 +365,27 @@ menu "Bluetooth"
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.
config BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BTDM_BLE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BTDM_BLE_MESH_SCAN_DUPL_EN
bool "Special duplicate scan mechanism for BLE Mesh scan"
depends on BTDM_BLE_SCAN_DUPL
@ -327,7 +397,7 @@ menu "Bluetooth"
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.
@ -374,21 +444,6 @@ menu "Bluetooth"
If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.
menuconfig BTDM_COEX_BT_OPTIONS
bool "Coexistence Bluetooth Side Options"
depends on ESP32_WIFI_SW_COEXIST_ENABLE
default n
help
Options of Bluetooth Side of WiFi and bluetooth coexistence.
config BTDM_COEX_BLE_ADV_HIGH_PRIORITY
bool "Improve BLE ADV priority for WiFi & BLE coexistence"
depends on BTDM_COEX_BT_OPTIONS
default n
help
Improve BLE ADV coexistence priority to make it better performance.
For example, BLE mesh need to enable this option to improve BLE adv performance.
endmenu
choice BT_HOST

View File

@ -57,6 +57,7 @@
#endif
#if CONFIG_BLE_MESH
#include "btc_ble_mesh_ble.h"
#include "btc_ble_mesh_prov.h"
#include "btc_ble_mesh_health_model.h"
#include "btc_ble_mesh_config_model.h"
@ -68,7 +69,7 @@
#define BTC_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE)
#define BTC_TASK_STACK_SIZE (BT_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) //by menuconfig
#define BTC_TASK_NAME "btcT"
#define BTC_TASK_NAME "BTC_TASK"
#define BTC_TASK_PRIO (BT_TASK_MAX_PRIORITIES - 6)
osi_thread_t *btc_thread;
@ -93,9 +94,9 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
#endif ///BLE_INCLUDED == TRUE
[BTC_PID_BLE_HID] = {NULL, NULL},
[BTC_PID_SPPLIKE] = {NULL, NULL},
#if (GATTS_INCLUDED == TRUE)
#if (BLUFI_INCLUDED == TRUE)
[BTC_PID_BLUFI] = {btc_blufi_call_handler, btc_blufi_cb_handler },
#endif ///GATTS_INCLUDED == TRUE
#endif ///BLUFI_INCLUDED == TRUE
[BTC_PID_DM_SEC] = {NULL, btc_dm_sec_cb_handler },
#endif
[BTC_PID_ALARM] = {btc_alarm_handler, NULL },
@ -124,18 +125,43 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
#if CONFIG_BLE_MESH
[BTC_PID_PROV] = {btc_ble_mesh_prov_call_handler, btc_ble_mesh_prov_cb_handler },
[BTC_PID_MODEL] = {btc_ble_mesh_model_call_handler, btc_ble_mesh_model_cb_handler },
#if CONFIG_BLE_MESH_HEALTH_CLI
[BTC_PID_HEALTH_CLIENT] = {btc_ble_mesh_health_client_call_handler, btc_ble_mesh_health_client_cb_handler },
#endif /* CONFIG_BLE_MESH_HEALTH_CLI */
#if CONFIG_BLE_MESH_HEALTH_SRV
[BTC_PID_HEALTH_SERVER] = {btc_ble_mesh_health_server_call_handler, btc_ble_mesh_health_server_cb_handler },
#endif /* CONFIG_BLE_MESH_HEALTH_SRV */
#if CONFIG_BLE_MESH_CFG_CLI
[BTC_PID_CONFIG_CLIENT] = {btc_ble_mesh_config_client_call_handler, btc_ble_mesh_config_client_cb_handler },
#endif /* CONFIG_BLE_MESH_CFG_CLI */
[BTC_PID_CONFIG_SERVER] = {NULL, btc_ble_mesh_config_server_cb_handler },
#if CONFIG_BLE_MESH_GENERIC_CLIENT
[BTC_PID_GENERIC_CLIENT] = {btc_ble_mesh_generic_client_call_handler, btc_ble_mesh_generic_client_cb_handler },
#endif /* CONFIG_BLE_MESH_GENERIC_CLIENT */
#if CONFIG_BLE_MESH_LIGHTING_CLIENT
[BTC_PID_LIGHTING_CLIENT] = {btc_ble_mesh_lighting_client_call_handler, btc_ble_mesh_lighting_client_cb_handler },
#endif /* CONFIG_BLE_MESH_LIGHTING_CLIENT */
#if CONFIG_BLE_MESH_SENSOR_CLI
[BTC_PID_SENSOR_CLIENT] = {btc_ble_mesh_sensor_client_call_handler, btc_ble_mesh_sensor_client_cb_handler },
#endif /* CONFIG_BLE_MESH_SENSOR_CLI */
#if CONFIG_BLE_MESH_TIME_SCENE_CLIENT
[BTC_PID_TIME_SCENE_CLIENT] = {btc_ble_mesh_time_scene_client_call_handler, btc_ble_mesh_time_scene_client_cb_handler},
#endif /* CONFIG_BLE_MESH_TIME_SCENE_CLIENT */
#if CONFIG_BLE_MESH_GENERIC_SERVER
[BTC_PID_GENERIC_SERVER] = {NULL, btc_ble_mesh_generic_server_cb_handler },
#endif /* CONFIG_BLE_MESH_GENERIC_SERVER */
#if CONFIG_BLE_MESH_LIGHTING_SERVER
[BTC_PID_LIGHTING_SERVER] = {NULL, btc_ble_mesh_lighting_server_cb_handler },
#endif /* CONFIG_BLE_MESH_LIGHTING_SERVER */
#if CONFIG_BLE_MESH_SENSOR_SERVER
[BTC_PID_SENSOR_SERVER] = {NULL, btc_ble_mesh_sensor_server_cb_handler },
#endif /* CONFIG_BLE_MESH_SENSOR_SERVER */
#if CONFIG_BLE_MESH_TIME_SCENE_SERVER
[BTC_PID_TIME_SCENE_SERVER] = {NULL, btc_ble_mesh_time_scene_server_cb_handler},
#endif /* CONFIG_BLE_MESH_TIME_SCENE_SERVER */
#if CONFIG_BLE_MESH_BLE_COEX_SUPPORT
[BTC_PID_BLE_MESH_BLE_COEX] = {btc_ble_mesh_ble_call_handler, btc_ble_mesh_ble_cb_handler },
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */
#endif /* #if CONFIG_BLE_MESH */
};
@ -161,59 +187,93 @@ static void btc_thread_handler(void *arg)
break;
}
if (msg->arg) {
osi_free(msg->arg);
}
osi_free(msg);
}
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;
}
return BT_STATUS_SUCCESS;
}
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
/**
* transfer an message to another module in the different task.
* @param msg message
* @param arg paramter
* @param arg_len length of paramter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
btc_arg_deep_free_t free_func)
{
btc_msg_t lmsg;
if (msg == NULL) {
btc_msg_t* lmsg;
bt_status_t ret;
// arg XOR arg_len
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
BTC_TRACE_WARNING("%s Invalid parameters\n", __func__);
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) + arg_len);
if (lmsg == NULL) {
BTC_TRACE_WARNING("%s No memory\n", __func__);
return BT_STATUS_NOMEM;
}
return btc_task_post(&lmsg, OSI_THREAD_MAX_TIMEOUT);
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (arg) {
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);
}
}
ret = btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
if (ret != BT_STATUS_SUCCESS) {
if (copy_func && free_func) {
free_func(lmsg);
}
osi_free(lmsg);
}
return ret;
}
/**
* transfer an message to another module in tha same task.
* @param msg message
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_inter_profile_call(btc_msg_t *msg)
{
if (msg == NULL) {
return BT_STATUS_PARM_INVALID;
}
switch (msg->sig) {
case BTC_SIG_API_CALL:
profile_tab[msg->pid].btc_call(msg);
break;
case BTC_SIG_API_CB:
profile_tab[msg->pid].btc_cb(msg);
break;
default:
break;
}
return BT_STATUS_SUCCESS;
}
#if BTC_DYNAMIC_MEMORY
static void btc_deinit_mem(void) {
@ -244,12 +304,13 @@ static void btc_deinit_mem(void) {
osi_free(btc_creat_tab_env_ptr);
btc_creat_tab_env_ptr = NULL;
}
#if (BLUFI_INCLUDED == TRUE)
if (blufi_env_ptr) {
osi_free(blufi_env_ptr);
blufi_env_ptr = NULL;
}
#endif
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if (hf_client_local_param_ptr) {
@ -298,12 +359,13 @@ static bt_status_t btc_init_mem(void) {
goto error_exit;
}
memset((void *)btc_creat_tab_env_ptr, 0, sizeof(esp_btc_creat_tab_t));
#if (BLUFI_INCLUDED == TRUE)
if ((blufi_env_ptr = (tBLUFI_ENV *)osi_malloc(sizeof(tBLUFI_ENV))) == NULL) {
goto error_exit;
}
memset((void *)blufi_env_ptr, 0, sizeof(tBLUFI_ENV));
#endif
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if ((hf_client_local_param_ptr = (hf_client_local_param_t *)osi_malloc(sizeof(hf_client_local_param_t))) == NULL) {
@ -331,9 +393,9 @@ error_exit:;
}
#endif ///BTC_DYNAMIC_MEMORY
int btc_init(void)
bt_status_t btc_init(void)
{
btc_thread = osi_thread_create("BTC_TASK", BTC_TASK_STACK_SIZE, BTC_TASK_PRIO, BTC_TASK_PINNED_TO_CORE, 2);
btc_thread = osi_thread_create(BTC_TASK_NAME, BTC_TASK_STACK_SIZE, BTC_TASK_PRIO, BTC_TASK_PINNED_TO_CORE, 2);
if (btc_thread == NULL) {
return BT_STATUS_NOMEM;
}
@ -378,3 +440,8 @@ bool btc_check_queue_is_congest(void)
return false;
}
int get_btc_work_queue_size(void)
{
return osi_thread_queue_wait_size(btc_thread, 0);
}

View File

@ -28,7 +28,7 @@ typedef struct btc_msg {
uint8_t aid; //application id
uint8_t pid; //profile id
uint8_t act; //profile action, defined in seprerate header files
void *arg; //param for btc function or function param
uint8_t arg[0]; //param for btc function or function param
} btc_msg_t;
typedef struct btc_adv_packet {
@ -53,7 +53,9 @@ typedef enum {
BTC_PID_GAP_BLE,
BTC_PID_BLE_HID,
BTC_PID_SPPLIKE,
#if (BLUFI_INCLUDED == TRUE)
BTC_PID_BLUFI,
#endif ///BLUFI_INCLUDED == TRUE
BTC_PID_DM_SEC,
BTC_PID_ALARM,
#if (CLASSIC_BT_INCLUDED == TRUE)
@ -85,6 +87,7 @@ typedef enum {
BTC_PID_LIGHTING_SERVER,
BTC_PID_SENSOR_SERVER,
BTC_PID_TIME_SCENE_SERVER,
BTC_PID_BLE_MESH_BLE_COEX,
#endif /* CONFIG_BLE_MESH */
BTC_PID_NUM,
} btc_pid_t; //btc profile id
@ -95,11 +98,32 @@ typedef struct {
} btc_func_t;
typedef void (* btc_arg_deep_copy_t)(btc_msg_t *msg, void *dst, void *src);
typedef void (* btc_arg_deep_free_t)(btc_msg_t *msg);
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func);
/**
* transfer an message to another module in the different task.
* @param msg message
* @param arg paramter
* @param arg_len length of paramter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
btc_arg_deep_free_t free_func);
int btc_init(void);
/**
* transfer an message to another module in tha same task.
* @param msg message
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_inter_profile_call(btc_msg_t *msg);
bt_status_t btc_init(void);
void btc_deinit(void);
bool btc_check_queue_is_congest(void);
int get_btc_work_queue_size(void);
#endif /* __BTC_TASK_H__ */

View File

@ -42,6 +42,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

@ -80,4 +80,11 @@
#define UC_BT_LOG_OSI_TRACE_LEVEL UC_TRACE_LEVEL_WARNING
#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,13 +143,13 @@ 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;
arg.cb = alarm->cb;
arg.cb_data = alarm->cb_data;
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL);
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL, NULL);
}
osi_alarm_t *osi_alarm_new(const char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire)
@ -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;
@ -318,3 +318,16 @@ uint32_t osi_time_get_os_boottime_ms(void)
{
return (uint32_t)(esp_timer_get_time() / 1000);
}
bool osi_alarm_is_active(osi_alarm_t *alarm)
{
assert(alarm != NULL);
assert(alarm_mutex != NULL);
bool is_active = false;
osi_mutex_lock(&alarm_mutex, OSI_MUTEX_MAX_TIMEOUT);
is_active = alarm->deadline_us > 0;
osi_mutex_unlock(&alarm_mutex);
return is_active;
}

View File

@ -267,6 +267,7 @@ bool config_remove_key(config_t *config, const char *section, const char *key)
assert(config != NULL);
assert(section != NULL);
assert(key != NULL);
bool ret;
section_t *sec = section_find(config, section);
entry_t *entry = entry_find(config, section, key);
@ -274,7 +275,12 @@ bool config_remove_key(config_t *config, const char *section, const char *key)
return false;
}
return list_remove(sec->entries, entry);
ret = list_remove(sec->entries, entry);
if (list_length(sec->entries) == 0) {
OSI_TRACE_DEBUG("%s remove section name:%s",__func__, section);
ret &= config_remove_section(config, section);
}
return ret;
}
const config_section_node_t *config_section_begin(const config_t *config)
@ -544,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

@ -20,6 +20,7 @@
#define _ALARM_H_
#include <stdint.h>
#include <stdbool.h>
#include "esp_timer.h"
typedef struct alarm_t osi_alarm_t;
@ -77,4 +78,8 @@ period_ms_t osi_alarm_get_remaining_ms(const osi_alarm_t *alarm);
uint32_t osi_time_get_os_boottime_ms(void);
// This function returns whether the alarm which encapsulated
// a one-shot timer is active or not
bool osi_alarm_is_active(osi_alarm_t *alarm);
#endif /*_ALARM_H_*/

View File

@ -22,6 +22,10 @@ list_t *list_new(list_free_cb callback);
list_node_t *list_free_node(list_t *list, list_node_t *node);
// similar with list_free_node, this function doesn't free the node data
list_node_t *list_delete_node(list_t *list, list_node_t *node);
// Frees the list. This function accepts NULL as an argument, in which case it
// behaves like a no-op.
void list_free(list_t *list);
@ -75,6 +79,9 @@ bool list_append(list_t *list, void *data);
bool list_remove(list_t *list, void *data);
// similar with list_remove, but do not free the node data
bool list_delete(list_t *list, void *data);
// Removes all elements in the list. Calling this function will return the list to the
// same state it was in after |list_new|. |list| may not be NULL.
void list_clear(list_t *list);

View File

@ -186,6 +186,36 @@ bool list_remove(list_t *list, void *data)
return false;
}
bool list_delete(list_t *list, void *data)
{
assert(list != NULL);
assert(data != NULL);
if (list_is_empty(list)) {
return false;
}
if (list->head->data == data) {
list_node_t *next = list_delete_node(list, list->head);
if (list->tail == list->head) {
list->tail = next;
}
list->head = next;
return true;
}
for (list_node_t *prev = list->head, *node = list->head->next; node; prev = node, node = node->next)
if (node->data == data) {
prev->next = list_delete_node(list, node);
if (list->tail == node) {
list->tail = prev;
}
return true;
}
return false;
}
void list_clear(list_t *list)
{
assert(list != NULL);
@ -251,3 +281,17 @@ list_node_t *list_free_node(list_t *list, list_node_t *node)
return next;
}
// remove the element from list but do not free the node data
list_node_t *list_delete_node(list_t *list, list_node_t *node)
{
assert(list != NULL);
assert(node != NULL);
list_node_t *next = node->next;
osi_free(node);
--list->length;
return next;
}

View File

@ -110,7 +110,6 @@ static void osi_thread_stop(osi_thread_t *thread)
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)
{
int ret;
osi_thread_t *thread;
struct osi_thread_start_arg start_arg = {0};
if (stack_size <= 0 ||
@ -119,17 +118,17 @@ osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priorit
return NULL;
}
thread = (osi_thread_t *)osi_malloc(sizeof(osi_thread_t));
osi_thread_t *thread = (osi_thread_t *)osi_calloc(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 = (fixed_queue_t **)osi_calloc(sizeof(fixed_queue_t *) * work_queue_num);
if (thread->work_queues == NULL) {
goto _err;
}
thread->work_queue_num = work_queue_num;
for (int i = 0; i < thread->work_queue_num; i++) {
thread->work_queues[i] = fixed_queue_new(DEFAULT_WORK_QUEUE_CAPACITY);

View File

@ -9,11 +9,11 @@ COMPONENT_ADD_INCLUDEDIRS := include
LIBS := btdm_app
COMPONENT_ADD_LDFLAGS := -lbt -L $(COMPONENT_PATH)/controller/lib \
COMPONENT_ADD_LDFLAGS := -lbt -L $(COMPONENT_PATH)/controller/lib/esp32 \
$(addprefix -l,$(LIBS))
# re-link program if BT binary libs change
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/controller/lib/lib%.a,$(LIBS))
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/controller/lib/esp32/lib%.a,$(LIBS))
COMPONENT_SUBMODULES += controller/lib
@ -139,6 +139,7 @@ endif
ifdef CONFIG_BLE_MESH
COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_common/include \
esp_ble_mesh/mesh_common/tinycrypt/include \
esp_ble_mesh/mesh_core \
esp_ble_mesh/mesh_core/include \
esp_ble_mesh/mesh_core/storage \
@ -151,9 +152,11 @@ COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_common/include \
esp_ble_mesh/api
COMPONENT_SRCDIRS += esp_ble_mesh/mesh_common \
esp_ble_mesh/mesh_common/tinycrypt/src \
esp_ble_mesh/mesh_core \
esp_ble_mesh/mesh_core/storage \
esp_ble_mesh/btc \
esp_ble_mesh/mesh_models/common \
esp_ble_mesh/mesh_models/client \
esp_ble_mesh/mesh_models/server \
esp_ble_mesh/api/core \

File diff suppressed because it is too large Load Diff

View File

@ -18,12 +18,118 @@ if BLE_MESH
option in the Bluetooth Controller section in menuconfig, which is
"Scan Duplicate By Device Address and Advertising Data".
config BLE_MESH_ALLOC_FROM_PSRAM_FIRST
bool "BLE Mesh will first allocate memory from PSRAM"
choice BLE_MESH_MEM_ALLOC_MODE
prompt "Memory allocation strategy"
default BLE_MESH_MEM_ALLOC_MODE_INTERNAL
help
Allocation strategy for BLE Mesh stack, essentially provides ability to
allocate all required dynamic allocations from,
- Internal DRAM memory only
- External SPIRAM memory only
- Either internal or external memory based on default malloc()
behavior in ESP-IDF
- Internal IRAM memory wherever applicable else internal DRAM
Recommended mode here is always internal, since that is most preferred
from security perspective. But if application requirement does not allow
sufficient free internal memory then alternate mode can be selected.
config BLE_MESH_MEM_ALLOC_MODE_INTERNAL
bool "Internal DRAM"
config BLE_MESH_MEM_ALLOC_MODE_EXTERNAL
bool "External SPIRAM"
depends on ESP32_SPIRAM_SUPPORT
config BLE_MESH_MEM_ALLOC_MODE_DEFAULT
bool "Default alloc mode"
depends on ESP32_SPIRAM_SUPPORT
help
Enable this option to use the default memory allocation strategy when
external SPIRAM is enabled. See the SPIRAM options for more details.
config BLE_MESH_MEM_ALLOC_MODE_IRAM_8BIT
bool "Internal IRAM"
depends on ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
help
Allows to use IRAM memory region as 8bit accessible region. Every
unaligned (8bit or 16bit) access will result in an exception and
incur penalty of certain clock cycles per unaligned read/write.
endchoice # BLE_MESH_MEM_ALLOC_MODE
config BLE_MESH_FREERTOS_STATIC_ALLOC
bool "Enable FreeRTOS static allocation"
depends on FREERTOS_SUPPORT_STATIC_ALLOCATION && (ESP32_SPIRAM_SUPPORT || ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
default n
help
When this option is enabled, BLE Mesh stack will try to allocate memory
from PSRAM firstly. This will save the internal RAM if PSRAM exists.
Enable this option to use FreeRTOS static allocation APIs for BLE Mesh,
which provides the ability to use different dynamic memory (i.e. SPIRAM
or IRAM) for FreeRTOS objects.
If this option is disabled, the FreeRTOS static allocation APIs will not
be used, and internal DRAM will be allocated for FreeRTOS objects.
choice BLE_MESH_FREERTOS_STATIC_ALLOC_MODE
prompt "Memory allocation for FreeRTOS objects"
depends on BLE_MESH_FREERTOS_STATIC_ALLOC
help
Choose the memory to be used for FreeRTOS objects.
config BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL
bool "External SPIRAM"
depends on ESP32_SPIRAM_SUPPORT
help
If enabled, BLE Mesh allocates dynamic memory from external SPIRAM for
FreeRTOS objects, i.e. mutex, queue, and task stack. External SPIRAM
can only be used for task stack when SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
is enabled. See the SPIRAM options for more details.
config BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT
bool "Internal IRAM"
depends on ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
help
If enabled, BLE Mesh allocates dynamic memory from internal IRAM for
FreeRTOS objects, i.e. mutex, queue. Note: IRAM region cannot be used
as task stack.
endchoice # BLE_MESH_FREERTOS_STATIC_ALLOC_MODE
config BLE_MESH_DEINIT
bool "Support de-initialize BLE Mesh stack"
default y
help
If enabled, users can use the function esp_ble_mesh_deinit() to de-initialize
the whole BLE Mesh stack.
menu "BLE Mesh and BLE coexistence support"
config BLE_MESH_SUPPORT_BLE_ADV
bool "Support sending normal BLE advertising packets"
default n
help
When selected, users can send normal BLE advertising packets
with specific API.
if BLE_MESH_SUPPORT_BLE_ADV
config BLE_MESH_BLE_ADV_BUF_COUNT
int "Number of advertising buffers for BLE advertising packets"
default 3
range 1 255
help
Number of advertising buffers for BLE packets available.
endif # BLE_MESH_SUPPORT_BLE_ADV
config BLE_MESH_SUPPORT_BLE_SCAN
bool "Support scanning normal BLE advertising packets"
default n
help
When selected, users can register a callback and receive normal BLE
advertising packets in the application layer.
endmenu # BLE Mesh and BLE coexistence support
config BLE_MESH_FAST_PROV
bool "Enable BLE Mesh Fast Provisioning"
@ -118,6 +224,28 @@ if BLE_MESH
This option specifies how many application keys the Provisioner can have.
Indeed, this value decides the number of the application keys which can be added by a Provisioner.
config BLE_MESH_PROVISIONER_RECV_HB
bool "Support receiving Heartbeat messages"
default n
help
When this option is enabled, Provisioner can call specific functions to enable
or disable receiving Heartbeat messages and notify them to the application layer.
if BLE_MESH_PROVISIONER_RECV_HB
config BLE_MESH_PROVISIONER_RECV_HB_FILTER_SIZE
int "Maximum number of filter entries for receiving Heartbeat messages"
default 3
range 1 1000
help
This option specifies how many heartbeat filter entries Provisioner supports.
The heartbeat filter (acceptlist or rejectlist) entries are used to store a
list of SRC and DST which can be used to decide if a heartbeat message will
be processed and notified to the application layer by Provisioner.
Note: The filter is an empty rejectlist by default.
endif # BLE_MESH_PROVISIONER_RECV_HB
endif # BLE_MESH_PROVISIONER
# Virtual option enabled whenever Generic Provisioning layer is needed
@ -137,6 +265,19 @@ if BLE_MESH
advertising bearer. This option should be enabled if PB-ADV is
going to be used during provisioning procedure.
config BLE_MESH_UNPROVISIONED_BEACON_INTERVAL
int "Interval between two consecutive Unprovisioned Device Beacon"
depends on BLE_MESH_NODE && BLE_MESH_PB_ADV
default 5
default 3 if BLE_MESH_FAST_PROV
range 1 100
help
This option specifies the interval of sending two consecutive unprovisioned
device beacon, users can use this option to change the frequency of sending
unprovisioned device beacon. For example, if the value is 5, it means the
unprovisioned device beacon will send every 5 seconds. When the option of
BLE_MESH_FAST_PROV is selected, the value is better to be 3 seconds, or less.
config BLE_MESH_PB_GATT
bool "Provisioning support using GATT (PB-GATT)"
select BLE_MESH_PROXY
@ -199,7 +340,7 @@ if BLE_MESH
advertising bearer.
config BLE_MESH_NET_BUF_POOL_USAGE
bool "BLE Mesh net buffer pool usage tracking"
bool
default y
help
Enable BLE Mesh net buffer pool tracking. This option is used to introduce another
@ -221,28 +362,6 @@ if BLE_MESH
if BLE_MESH_SETTINGS
config BLE_MESH_SPECIFIC_PARTITION
bool "Use a specific NVS partition for BLE Mesh"
default n
help
When selected, the mesh stack will use a specified NVS partition instead of
default NVS partition. Note that the specified partition must be registered
with NVS using nvs_flash_init_partition() API, and the partition must exists
in the csv file.
When Provisioner needs to store a large amount of nodes' information in the
flash (e.g. more than 20), this option is recommended to be enabled.
if BLE_MESH_SPECIFIC_PARTITION
config BLE_MESH_PARTITION_NAME
string "Name of the NVS partition for BLE Mesh"
default "ble_mesh"
help
This value defines the name of the specified NVS partition used by the
mesh stack.
endif # BLE_MESH_SPECIFIC_PARTITION
config BLE_MESH_STORE_TIMEOUT
int "Delay (in seconds) before storing anything persistently"
range 0 1000000
@ -257,7 +376,7 @@ if BLE_MESH
config BLE_MESH_SEQ_STORE_RATE
int "How often the sequence number gets updated in storage"
range 0 1000000
default 6
default 0
help
This value defines how often the local sequence number gets updated in
persistent storage (i.e. flash). e.g. a value of 100 means that the
@ -272,7 +391,7 @@ if BLE_MESH
config BLE_MESH_RPL_STORE_TIMEOUT
int "Minimum frequency that the RPL gets updated in storage"
range 0 1000000
default 5
default 0
help
This value defines in seconds how soon the RPL (Replay Protection List)
gets written to persistent storage after a change occurs. If the node
@ -308,6 +427,50 @@ if BLE_MESH
in advance before recovering node information and make sure the node
information recovering could work as expected.
config BLE_MESH_SPECIFIC_PARTITION
bool "Use a specific NVS partition for BLE Mesh"
default n
help
When selected, the mesh stack will use a specified NVS partition instead of
default NVS partition. Note that the specified partition must be registered
with NVS using nvs_flash_init_partition() API, and the partition must exists
in the csv file.
When Provisioner needs to store a large amount of nodes' information in the
flash (e.g. more than 20), this option is recommended to be enabled.
config BLE_MESH_PARTITION_NAME
string "Name of the NVS partition for BLE Mesh"
depends on BLE_MESH_SPECIFIC_PARTITION
default "ble_mesh"
help
This value defines the name of the specified NVS partition used by the
mesh stack.
config BLE_MESH_USE_MULTIPLE_NAMESPACE
bool "Support using multiple NVS namespaces by Provisioner"
depends on BLE_MESH_PROVISIONER
default n
help
When selected, Provisioner can use different NVS namespaces to store
different instances of mesh information.
For example, if in the first room, Provisioner uses NetKey A, AppKey
A and provisions three devices, these information will be treated as
mesh information instance A. When the Provisioner moves to the second
room, it uses NetKey B, AppKey B and provisions two devices, then the
information will be treated as mesh information instance B.
Here instance A and instance B will be stored in different namespaces.
With this option enabled, Provisioner needs to use specific functions
to open the corresponding NVS namespace, restore the mesh information,
release the mesh information or erase the mesh information.
config BLE_MESH_MAX_NVS_NAMESPACE
int "Maximum number of NVS namespaces"
depends on BLE_MESH_USE_MULTIPLE_NAMESPACE
default 2
range 1 255
help
This option specifies the maximum NVS namespaces supported by Provisioner.
endif # if BLE_MESH_SETTINGS
config BLE_MESH_SUBNET_COUNT
@ -389,24 +552,6 @@ if BLE_MESH
SDU size is 60 bytes, which leaves 56 bytes for application layer data
using a 4-byte MIC, or 52 bytes using an 8-byte MIC.
config BLE_MESH_SUPPORT_BLE_ADV
bool "Support sending normal BLE advertising packets"
default n
help
When selected, users can send normal BLE advertising packets
with specific API.
if BLE_MESH_SUPPORT_BLE_ADV
config BLE_MESH_BLE_ADV_BUF_COUNT
int "Number of advertising buffers for BLE advertising packets"
default 3
range 1 255
help
Number of advertising buffers for BLE packets available.
endif # BLE_MESH_SUPPORT_BLE_ADV
config BLE_MESH_IVU_DIVIDER
int "Divider for IV Update state refresh timer"
default 4
@ -433,6 +578,21 @@ if BLE_MESH
stored to flash. E.g. the default value of 4 means that the
state is saved every 24 hours (96 / 4).
config BLE_MESH_IVU_RECOVERY_IVI
bool "Recovery the IV index when the latest whole IV update procedure is missed"
default n
help
According to Section 3.10.5 of Mesh Specification v1.0.1.
If a node in Normal Operation receives a Secure Network beacon with an IV index
equal to the last known IV index+1 and the IV Update Flag set to 0, the node may
update its IV without going to the IV Update in Progress state, or it may initiate
an IV Index Recovery procedure (Section 3.10.6), or it may ignore the Secure
Network beacon. The node makes the choice depending on the time since last IV
update and the likelihood that the node has missed the Secure Network beacons
with the IV update Flag.
When the above situation is encountered, this option can be used to decide whether
to perform the IV index recovery procedure.
config BLE_MESH_TX_SEG_MSG_COUNT
int "Maximum number of simultaneous outgoing segmented messages"
default 1
@ -651,6 +811,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
@ -801,104 +968,138 @@ if BLE_MESH
uses 0 as the timeout value when sending acknowledged messages, then
the default value will be used which is four seconds.
menu "Support for BLE Mesh Client Models"
menu "Support for BLE Mesh Foundation models"
config BLE_MESH_CFG_CLI
bool "Configuration Client Model"
bool "Configuration Client model"
help
Enable support for Configuration client model.
Enable support for Configuration Client model.
config BLE_MESH_HEALTH_CLI
bool "Health Client Model"
bool "Health Client model"
help
Enable support for Health client model.
Enable support for Health Client model.
config BLE_MESH_HEALTH_SRV
bool "Health Server model"
default y
help
Enable support for Health Server model.
endmenu #Support for BLE Mesh Foundation models
menu "Support for BLE Mesh Client/Server models"
config BLE_MESH_GENERIC_ONOFF_CLI
bool "Generic OnOff Client Model"
bool "Generic OnOff Client model"
help
Enable support for Generic OnOff client model.
Enable support for Generic OnOff Client model.
config BLE_MESH_GENERIC_LEVEL_CLI
bool "Generic Level Client Model"
bool "Generic Level Client model"
help
Enable support for Generic Level client model.
Enable support for Generic Level Client model.
config BLE_MESH_GENERIC_DEF_TRANS_TIME_CLI
bool "Generic Default Transition Time Client Model"
bool "Generic Default Transition Time Client model"
help
Enable support for Generic Default Transition Time client model.
Enable support for Generic Default Transition Time Client model.
config BLE_MESH_GENERIC_POWER_ONOFF_CLI
bool "Generic Power OnOff Client Model"
bool "Generic Power OnOff Client model"
help
Enable support for Generic Power OnOff client model.
Enable support for Generic Power OnOff Client model.
config BLE_MESH_GENERIC_POWER_LEVEL_CLI
bool "Generic Power Level Client Model"
bool "Generic Power Level Client model"
help
Enable support for Generic Power Level client model.
Enable support for Generic Power Level Client model.
config BLE_MESH_GENERIC_BATTERY_CLI
bool "Generic Battery Client Model"
bool "Generic Battery Client model"
help
Enable support for Generic Battery client model.
Enable support for Generic Battery Client model.
config BLE_MESH_GENERIC_LOCATION_CLI
bool "Generic Location Client Model"
bool "Generic Location Client model"
help
Enable support for Generic Location client model.
Enable support for Generic Location Client model.
config BLE_MESH_GENERIC_PROPERTY_CLI
bool "Generic Property Client Model"
bool "Generic Property Client model"
help
Enable support for Generic Property client model.
Enable support for Generic Property Client model.
config BLE_MESH_SENSOR_CLI
bool "Sensor Client Model"
bool "Sensor Client model"
help
Enable support for Sensor client model.
Enable support for Sensor Client model.
config BLE_MESH_TIME_CLI
bool "Time Client Model"
bool "Time Client model"
help
Enable support for Time client model.
Enable support for Time Client model.
config BLE_MESH_SCENE_CLI
bool "Scene Client Model"
bool "Scene Client model"
help
Enable support for Scene client model.
Enable support for Scene Client model.
config BLE_MESH_SCHEDULER_CLI
bool "Scheduler Client Model"
bool "Scheduler Client model"
help
Enable support for Scheduler client model.
Enable support for Scheduler Client model.
config BLE_MESH_LIGHT_LIGHTNESS_CLI
bool "Light Lightness Client Model"
bool "Light Lightness Client model"
help
Enable support for Light Lightness client model.
Enable support for Light Lightness Client model.
config BLE_MESH_LIGHT_CTL_CLI
bool "Light CTL Client Model"
bool "Light CTL Client model"
help
Enable support for Light CTL client model.
Enable support for Light CTL Client model.
config BLE_MESH_LIGHT_HSL_CLI
bool "Light HSL Client Model"
bool "Light HSL Client model"
help
Enable support for Light HSL client model.
Enable support for Light HSL Client model.
config BLE_MESH_LIGHT_XYL_CLI
bool "Light XYL Client Model"
bool "Light XYL Client model"
help
Enable support for Light XYL client model.
Enable support for Light XYL Client model.
config BLE_MESH_LIGHT_LC_CLI
bool "Light LC Client Model"
bool "Light LC Client model"
help
Enable support for Light LC client model.
Enable support for Light LC Client model.
endmenu
config BLE_MESH_GENERIC_SERVER
bool "Generic server models"
default y
help
Enable support for Generic server models.
config BLE_MESH_SENSOR_SERVER
bool "Sensor server models"
default y
help
Enable support for Sensor server models.
config BLE_MESH_TIME_SCENE_SERVER
bool "Time and Scenes server models"
default y
help
Enable support for Time and Scenes server models.
config BLE_MESH_LIGHTING_SERVER
bool "Lighting server models"
default y
help
Enable support for Lighting server models.
endmenu #Support for BLE Mesh Client/Server models
config BLE_MESH_IV_UPDATE_TEST
bool "Test the IV Update Procedure"
@ -908,6 +1109,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,4 +1,4 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
// 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.
@ -15,19 +15,25 @@
#include <stdint.h>
#include <string.h>
#include "btc/btc_manage.h"
#include "esp_err.h"
#include "btc_ble_mesh_prov.h"
#include "esp_ble_mesh_defs.h"
#include "btc_ble_mesh_ble.h"
#include "esp_ble_mesh_ble_api.h"
#if CONFIG_BLE_MESH_BLE_COEX_SUPPORT
esp_err_t esp_ble_mesh_register_ble_callback(esp_ble_mesh_ble_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_BLE_MESH_BLE_COEX, callback) == 0 ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
esp_err_t esp_ble_mesh_start_ble_advertising(const esp_ble_mesh_ble_adv_param_t *param,
const esp_ble_mesh_ble_adv_data_t *data)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_ble_mesh_ble_args_t arg = {0};
btc_msg_t msg = {0};
if (param == NULL) {
@ -37,21 +43,21 @@ esp_err_t esp_ble_mesh_start_ble_advertising(const esp_ble_mesh_ble_adv_param_t
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_START_BLE_ADVERTISING;
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_START_BLE_ADV;
memcpy(&arg.start_ble_advertising.param, param, sizeof(esp_ble_mesh_ble_adv_param_t));
memcpy(&arg.start_ble_adv.param, param, sizeof(esp_ble_mesh_ble_adv_param_t));
if (data) {
memcpy(&arg.start_ble_advertising.data, data, sizeof(esp_ble_mesh_ble_adv_data_t));
memcpy(&arg.start_ble_adv.data, data, sizeof(esp_ble_mesh_ble_adv_data_t));
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_stop_ble_advertising(uint8_t index)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_ble_mesh_ble_args_t arg = {0};
btc_msg_t msg = {0};
if (index >= CONFIG_BLE_MESH_BLE_ADV_BUF_COUNT) {
@ -61,13 +67,44 @@ esp_err_t esp_ble_mesh_stop_ble_advertising(uint8_t index)
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_STOP_BLE_ADVERTISING;
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_STOP_BLE_ADV;
arg.stop_ble_advertising.index = index;
arg.stop_ble_adv.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
esp_err_t esp_ble_mesh_start_ble_scanning(esp_ble_mesh_ble_scan_param_t *param)
{
btc_ble_mesh_ble_args_t arg = {0};
btc_msg_t msg = {0};
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_START_BLE_SCAN;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */
esp_err_t esp_ble_mesh_stop_ble_scanning(void)
{
btc_ble_mesh_ble_args_t arg = {0};
btc_msg_t msg = {0};
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_STOP_BLE_SCAN;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */

View File

@ -42,7 +42,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
// Create a semaphore
if ((semaphore = xSemaphoreCreateCounting(1, 0)) == NULL) {
BT_ERR("%s, Failed to allocate memory for the semaphore", __func__);
BT_ERR("Failed to create semaphore");
return ESP_ERR_NO_MEM;
}
@ -55,9 +55,9 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_MESH_INIT;
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL) != BT_STATUS_SUCCESS) {
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) != BT_STATUS_SUCCESS) {
vSemaphoreDelete(semaphore);
BT_ERR("%s, BLE Mesh initialise failed", __func__);
BT_ERR("Failed to start mesh init");
return ESP_FAIL;
}
@ -69,6 +69,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
return ESP_OK;
}
#if CONFIG_BLE_MESH_DEINIT
esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
{
btc_ble_mesh_prov_args_t arg = {0};
@ -86,7 +87,7 @@ esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_DEINIT_MESH;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_DEINIT */

View File

@ -13,6 +13,7 @@
// limitations under the License.
#include <stdint.h>
#include <string.h>
#include "esp_err.h"
@ -32,7 +33,8 @@ uint16_t esp_ble_mesh_get_primary_element_address(void)
return btc_ble_mesh_get_primary_addr();
}
uint16_t *esp_ble_mesh_is_model_subscribed_to_group(esp_ble_mesh_model_t *model, uint16_t group_addr)
uint16_t *esp_ble_mesh_is_model_subscribed_to_group(esp_ble_mesh_model_t *model,
uint16_t group_addr)
{
if (model == NULL) {
return NULL;
@ -54,7 +56,7 @@ uint8_t esp_ble_mesh_get_element_count(void)
}
esp_ble_mesh_model_t *esp_ble_mesh_find_vendor_model(const esp_ble_mesh_elem_t *element,
uint16_t company_id, uint16_t model_id)
uint16_t company_id, uint16_t model_id)
{
if (element == NULL) {
return NULL;
@ -62,7 +64,8 @@ esp_ble_mesh_model_t *esp_ble_mesh_find_vendor_model(const esp_ble_mesh_elem_t *
return btc_ble_mesh_model_find_vnd(element, company_id, model_id);
}
esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *element, uint16_t model_id)
esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *element,
uint16_t model_id)
{
if (element == NULL) {
return NULL;
@ -75,3 +78,138 @@ const esp_ble_mesh_comp_t *esp_ble_mesh_get_composition_data(void)
return btc_ble_mesh_comp_get();
}
esp_err_t esp_ble_mesh_model_subscribe_group_addr(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t group_addr)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!ESP_BLE_MESH_ADDR_IS_UNICAST(element_addr) ||
!ESP_BLE_MESH_ADDR_IS_GROUP(group_addr)) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_MODEL_SUBSCRIBE_GROUP_ADDR;
arg.model_sub_group_addr.element_addr = element_addr;
arg.model_sub_group_addr.company_id = company_id;
arg.model_sub_group_addr.model_id = model_id;
arg.model_sub_group_addr.group_addr = group_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_model_unsubscribe_group_addr(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t group_addr)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!ESP_BLE_MESH_ADDR_IS_UNICAST(element_addr) ||
!ESP_BLE_MESH_ADDR_IS_GROUP(group_addr)) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_MODEL_UNSUBSCRIBE_GROUP_ADDR;
arg.model_unsub_group_addr.element_addr = element_addr;
arg.model_unsub_group_addr.company_id = company_id;
arg.model_unsub_group_addr.model_id = model_id;
arg.model_unsub_group_addr.group_addr = group_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if CONFIG_BLE_MESH_NODE
const uint8_t *esp_ble_mesh_node_get_local_net_key(uint16_t net_idx)
{
return btc_ble_mesh_node_get_local_net_key(net_idx);
}
const uint8_t *esp_ble_mesh_node_get_local_app_key(uint16_t app_idx)
{
return btc_ble_mesh_node_get_local_app_key(app_idx);
}
esp_err_t esp_ble_mesh_node_add_local_net_key(const uint8_t net_key[16], uint16_t net_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (net_key == NULL || net_idx > 0xFFF) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_NODE_ADD_LOCAL_NET_KEY;
arg.node_add_local_net_key.net_idx = net_idx;
memcpy(arg.node_add_local_net_key.net_key, net_key, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_node_add_local_app_key(const uint8_t app_key[16], uint16_t net_idx, uint16_t app_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (app_key == NULL || net_idx > 0xFFF || app_idx > 0xFFF) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_NODE_ADD_LOCAL_APP_KEY;
arg.node_add_local_app_key.net_idx = net_idx;
arg.node_add_local_app_key.app_idx = app_idx;
memcpy(arg.node_add_local_app_key.app_key, app_key, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_node_bind_app_key_to_local_model(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t app_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!ESP_BLE_MESH_ADDR_IS_UNICAST(element_addr) || app_idx > 0xFFF) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_NODE_BIND_APP_KEY_TO_MODEL;
arg.node_local_mod_app_bind.element_addr = element_addr;
arg.node_local_mod_app_bind.model_id = model_id;
arg.node_local_mod_app_bind.company_id = company_id;
arg.node_local_mod_app_bind.app_idx = app_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_NODE */

View File

@ -29,7 +29,7 @@ esp_err_t esp_ble_mesh_lpn_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_LPN_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_lpn_disable(bool force)
@ -45,7 +45,7 @@ esp_err_t esp_ble_mesh_lpn_disable(bool force)
arg.lpn_disable.force = force;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -59,5 +59,5 @@ esp_err_t esp_ble_mesh_lpn_poll(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_LPN_POLL;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -23,12 +23,12 @@
#define ESP_BLE_MESH_TX_SDU_MAX ((CONFIG_BLE_MESH_ADV_BUF_COUNT - 3) * 12)
static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
btc_ble_mesh_model_act_t act,
uint16_t length, uint8_t *data,
int32_t msg_timeout, bool need_rsp,
esp_ble_mesh_dev_role_t device_role)
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
btc_ble_mesh_model_act_t act,
uint16_t length, uint8_t *data,
int32_t msg_timeout, bool need_rsp,
esp_ble_mesh_dev_role_t device_role)
{
btc_ble_mesh_model_args_t arg = {0};
uint8_t op_len = 0, mic_len = 0;
@ -39,12 +39,12 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
if (ctx && ctx->addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
BT_ERR("%s, Invalid destination address 0x0000", __func__);
BT_ERR("Invalid destination address 0x0000");
return ESP_ERR_INVALID_ARG;
}
if (device_role > ROLE_FAST_PROV) {
BT_ERR("%s, Invalid device role 0x%02x", __func__, device_role);
BT_ERR("Invalid device role 0x%02x", device_role);
return ESP_ERR_INVALID_ARG;
}
@ -63,7 +63,7 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
if (act == BTC_BLE_MESH_ACT_MODEL_PUBLISH) {
if (op_len + length > model->pub->msg->size) {
BT_ERR("%s, Model publication msg size %d is too small", __func__, model->pub->msg->size);
BT_ERR("Too small publication msg size %d", model->pub->msg->size);
return ESP_ERR_INVALID_ARG;
}
}
@ -75,7 +75,7 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
}
if (op_len + length + mic_len > MIN(ESP_BLE_MESH_SDU_MAX_LEN, ESP_BLE_MESH_TX_SDU_MAX)) {
BT_ERR("%s, Data length %d is too large", __func__, length);
BT_ERR("Too large data length %d", length);
return ESP_ERR_INVALID_ARG;
}
@ -109,8 +109,8 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
arg.model_send.msg_timeout = msg_timeout;
}
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
bt_mesh_free(msg_data);
@ -164,6 +164,7 @@ esp_err_t esp_ble_mesh_client_model_init(esp_ble_mesh_model_t *model)
return btc_ble_mesh_client_model_init(model);
}
#if CONFIG_BLE_MESH_DEINIT
esp_err_t esp_ble_mesh_client_model_deinit(esp_ble_mesh_model_t *model)
{
if (model == NULL) {
@ -174,26 +175,36 @@ esp_err_t esp_ble_mesh_client_model_deinit(esp_ble_mesh_model_t *model)
return btc_ble_mesh_client_model_deinit(model);
}
#endif /* CONFIG_BLE_MESH_DEINIT */
esp_err_t esp_ble_mesh_server_model_send_msg(esp_ble_mesh_model_t *model,
esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode,
uint16_t length, uint8_t *data)
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
uint16_t length, uint8_t *data)
{
if (!model || !ctx) {
if (model == NULL || ctx == NULL ||
ctx->net_idx == ESP_BLE_MESH_KEY_UNUSED ||
ctx->app_idx == ESP_BLE_MESH_KEY_UNUSED) {
return ESP_ERR_INVALID_ARG;
}
return ble_mesh_model_send_msg(model, ctx, opcode, BTC_BLE_MESH_ACT_SERVER_MODEL_SEND,
length, data, 0, false, ROLE_NODE);
}
esp_err_t esp_ble_mesh_client_model_send_msg(esp_ble_mesh_model_t *model,
esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode,
uint16_t length, uint8_t *data, int32_t msg_timeout,
bool need_rsp, esp_ble_mesh_dev_role_t device_role)
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
uint16_t length, uint8_t *data,
int32_t msg_timeout, bool need_rsp,
esp_ble_mesh_dev_role_t device_role)
{
if (!model || !ctx) {
if (model == NULL || ctx == NULL ||
ctx->net_idx == ESP_BLE_MESH_KEY_UNUSED ||
ctx->app_idx == ESP_BLE_MESH_KEY_UNUSED) {
return ESP_ERR_INVALID_ARG;
}
return ble_mesh_model_send_msg(model, ctx, opcode, BTC_BLE_MESH_ACT_CLIENT_MODEL_SEND,
length, data, msg_timeout, need_rsp, device_role);
}
@ -202,16 +213,19 @@ esp_err_t esp_ble_mesh_model_publish(esp_ble_mesh_model_t *model, uint32_t opcod
uint16_t length, uint8_t *data,
esp_ble_mesh_dev_role_t device_role)
{
if (!model || !model->pub || !model->pub->msg) {
if (model == NULL || model->pub == NULL || model->pub->msg == NULL ||
model->pub->publish_addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
return ble_mesh_model_send_msg(model, NULL, opcode, BTC_BLE_MESH_ACT_MODEL_PUBLISH,
length, data, 0, false, device_role);
}
#if CONFIG_BLE_MESH_SERVER_MODEL
esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model,
esp_ble_mesh_server_state_type_t type,
esp_ble_mesh_server_state_value_t *value)
esp_ble_mesh_server_state_type_t type,
esp_ble_mesh_server_state_value_t *value)
{
btc_ble_mesh_model_args_t arg = {0};
btc_msg_t msg = {0};
@ -230,9 +244,10 @@ esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model,
msg.pid = BTC_PID_MODEL;
msg.act = BTC_BLE_MESH_ACT_SERVER_MODEL_UPDATE_STATE;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SERVER_MODEL */
esp_err_t esp_ble_mesh_node_local_reset(void)
{
@ -244,7 +259,7 @@ esp_err_t esp_ble_mesh_node_local_reset(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_NODE_RESET;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (CONFIG_BLE_MESH_PROVISIONER)
@ -268,7 +283,7 @@ esp_err_t esp_ble_mesh_provisioner_set_node_name(uint16_t index, const char *nam
memset(arg.set_node_name.name, 0, sizeof(arg.set_node_name.name));
strncpy(arg.set_node_name.name, name, ESP_BLE_MESH_NODE_NAME_MAX_LEN);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -286,7 +301,8 @@ uint16_t esp_ble_mesh_provisioner_get_node_index(const char *name)
return bt_mesh_provisioner_get_node_index(name);
}
esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr, uint8_t *data, uint16_t length)
esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr,
uint8_t *data, uint16_t length)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -304,8 +320,8 @@ esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr, u
arg.store_node_comp_data.unicast_addr = unicast_addr;
arg.store_node_comp_data.length = length;
arg.store_node_comp_data.data = data;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_uuid(const uint8_t uuid[16])
@ -326,6 +342,25 @@ esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_addr(uint16_t unicas
return btc_ble_mesh_provisioner_get_node_with_addr(unicast_addr);
}
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_name(const char *name)
{
if (!name || (strlen(name) > ESP_BLE_MESH_NODE_NAME_MAX_LEN)) {
return NULL;
}
return btc_ble_mesh_provisioner_get_node_with_name(name);
}
uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void)
{
return btc_ble_mesh_provisioner_get_prov_node_count();
}
const esp_ble_mesh_node_t **esp_ble_mesh_provisioner_get_node_table_entry(void)
{
return btc_ble_mesh_provisioner_get_node_table_entry();
}
esp_err_t esp_ble_mesh_provisioner_delete_node_with_uuid(const uint8_t uuid[16])
{
btc_ble_mesh_prov_args_t arg = {0};
@ -343,7 +378,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_uuid(const uint8_t uuid[16])
memcpy(arg.delete_node_with_uuid.uuid, uuid, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -364,12 +399,12 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_addr(uint16_t unicast_addr)
arg.delete_node_with_addr.unicast_addr = unicast_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
uint16_t net_idx, uint16_t app_idx)
uint16_t net_idx, uint16_t app_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -387,12 +422,12 @@ esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
} else {
bzero(arg.add_local_app_key.app_key, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_update_local_app_key(const uint8_t app_key[16],
uint16_t net_idx, uint16_t app_idx)
uint16_t net_idx, uint16_t app_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -410,7 +445,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_app_key(const uint8_t app_key[16
memcpy(arg.update_local_app_key.app_key, app_key, 16);
arg.update_local_app_key.net_idx = net_idx;
arg.update_local_app_key.app_idx = app_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -420,7 +455,7 @@ const uint8_t *esp_ble_mesh_provisioner_get_local_app_key(uint16_t net_idx, uint
}
esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_addr, uint16_t app_idx,
uint16_t model_id, uint16_t company_id)
uint16_t model_id, uint16_t company_id)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -439,7 +474,7 @@ esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_
arg.local_mod_app_bind.app_idx = app_idx;
arg.local_mod_app_bind.model_id = model_id;
arg.local_mod_app_bind.cid = company_id;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -464,7 +499,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_net_key(const uint8_t net_key[16],
} else {
bzero(arg.add_local_net_key.net_key, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -485,7 +520,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_net_key(const uint8_t net_key[16
memcpy(arg.update_local_net_key.net_key, net_key, 16);
arg.update_local_net_key.net_idx = net_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -494,11 +529,245 @@ const uint8_t *esp_ble_mesh_provisioner_get_local_net_key(uint16_t net_idx)
return bt_mesh_provisioner_local_net_key_get(net_idx);
}
uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void)
#if CONFIG_BLE_MESH_PROVISIONER_RECV_HB
esp_err_t esp_ble_mesh_provisioner_recv_heartbeat(bool enable)
{
return btc_ble_mesh_provisioner_get_prov_node_count();
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_ENABLE_HEARTBEAT_RECV;
arg.enable_heartbeat_recv.enable = enable;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_type(uint8_t type)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (type > ESP_BLE_MESH_HEARTBEAT_FILTER_REJECTLIST) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_SET_HEARTBEAT_FILTER_TYPE;
arg.set_heartbeat_filter_type.type = type;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble_mesh_heartbeat_filter_info_t *info)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (op > ESP_BLE_MESH_HEARTBEAT_FILTER_REMOVE || info == NULL) {
return ESP_ERR_INVALID_ARG;
}
if (!ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_src) &&
!ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_dst) &&
!ESP_BLE_MESH_ADDR_IS_GROUP(info->hb_dst)) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_SET_HEARTBEAT_FILTER_INFO;
arg.set_heartbeat_filter_info.op = op;
arg.set_heartbeat_filter_info.hb_src = info->hb_src;
arg.set_heartbeat_filter_info.hb_dst = info->hb_dst;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_PROVISIONER_RECV_HB */
#if CONFIG_BLE_MESH_SETTINGS
esp_err_t esp_ble_mesh_provisioner_direct_erase_settings(void)
{
btc_msg_t msg = {0};
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_DIRECT_ERASE_SETTINGS;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SETTINGS */
#if CONFIG_BLE_MESH_USE_MULTIPLE_NAMESPACE
esp_err_t esp_ble_mesh_provisioner_open_settings_with_index(uint8_t index)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (index >= CONFIG_BLE_MESH_MAX_NVS_NAMESPACE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_OPEN_SETTINGS_WITH_INDEX;
arg.open_settings_with_index.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_open_settings_with_uid(const char *uid)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!uid || strlen(uid) > ESP_BLE_MESH_SETTINGS_UID_SIZE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_OPEN_SETTINGS_WITH_UID;
strncpy(arg.open_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_close_settings_with_index(uint8_t index, bool erase)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (index >= CONFIG_BLE_MESH_MAX_NVS_NAMESPACE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_CLOSE_SETTINGS_WITH_INDEX;
arg.close_settings_with_index.index = index;
arg.close_settings_with_index.erase = erase;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_close_settings_with_uid(const char *uid, bool erase)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!uid || strlen(uid) > ESP_BLE_MESH_SETTINGS_UID_SIZE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_CLOSE_SETTINGS_WITH_UID;
strncpy(arg.close_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
arg.close_settings_with_uid.erase = erase;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_delete_settings_with_index(uint8_t index)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (index >= CONFIG_BLE_MESH_MAX_NVS_NAMESPACE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_DELETE_SETTINGS_WITH_INDEX;
arg.delete_settings_with_index.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_delete_settings_with_uid(const char *uid)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (!uid || strlen(uid) > ESP_BLE_MESH_SETTINGS_UID_SIZE) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_DELETE_SETTINGS_WITH_UID;
strncpy(arg.delete_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
const char *esp_ble_mesh_provisioner_get_settings_uid(uint8_t index)
{
if (index >= CONFIG_BLE_MESH_MAX_NVS_NAMESPACE) {
return NULL;
}
return btc_ble_mesh_provisioner_get_settings_uid(index);
}
uint8_t esp_ble_mesh_provisioner_get_settings_index(const char *uid)
{
if (!uid || strlen(uid) > ESP_BLE_MESH_SETTINGS_UID_SIZE) {
return ESP_BLE_MESH_INVALID_SETTINGS_IDX;
}
return btc_ble_mesh_provisioner_get_settings_index(uid);
}
uint8_t esp_ble_mesh_provisioner_get_free_settings_count(void)
{
return btc_ble_mesh_provisioner_get_free_settings_count();
}
#endif /* CONFIG_BLE_MESH_USE_MULTIPLE_NAMESPACE */
#endif /* CONFIG_BLE_MESH_PROVISIONER */
#if (CONFIG_BLE_MESH_FAST_PROV)

View File

@ -35,11 +35,29 @@ bool esp_ble_mesh_node_is_provisioned(void)
return bt_mesh_is_provisioned();
}
static bool prov_bearers_valid(esp_ble_mesh_prov_bearer_t bearers)
{
if ((!(bearers & (ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT))) ||
(IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
!IS_ENABLED(CONFIG_BLE_MESH_PB_GATT) &&
!(bearers & ESP_BLE_MESH_PROV_ADV)) ||
(!IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT) &&
!(bearers & ESP_BLE_MESH_PROV_GATT))) {
return false;
}
return true;
}
esp_err_t esp_ble_mesh_node_prov_enable(esp_ble_mesh_prov_bearer_t bearers)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (prov_bearers_valid(bearers) == false) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
@ -47,7 +65,7 @@ esp_err_t esp_ble_mesh_node_prov_enable(esp_ble_mesh_prov_bearer_t bearers)
msg.act = BTC_BLE_MESH_ACT_PROV_ENABLE;
arg.node_prov_enable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -56,6 +74,10 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers)
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (prov_bearers_valid(bearers) == false) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
@ -63,12 +85,12 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers)
msg.act = BTC_BLE_MESH_ACT_PROV_DISABLE;
arg.node_prov_disable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_key_y[32],
uint8_t private_key[32])
uint8_t private_key[32])
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -87,7 +109,7 @@ esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_k
memcpy(arg.set_oob_pub_key.pub_key_y, pub_key_y, 32);
memcpy(arg.set_oob_pub_key.private_key, private_key, 32);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -107,7 +129,7 @@ esp_err_t esp_ble_mesh_node_input_number(uint32_t number)
msg.act = BTC_BLE_MESH_ACT_INPUT_NUMBER;
arg.input_number.number = number;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -129,7 +151,7 @@ esp_err_t esp_ble_mesh_node_input_string(const char *string)
strncpy(arg.input_string.string, string,
MIN(strlen(string), sizeof(arg.input_string.string)));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -151,13 +173,13 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name)
memset(arg.set_device_name.name, 0, sizeof(arg.set_device_name.name));
strncpy(arg.set_device_name.name, name, ESP_BLE_MESH_DEVICE_NAME_MAX_LEN);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (CONFIG_BLE_MESH_PROVISIONER)
esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pub_key_x[32],
uint8_t pub_key_y[32])
uint8_t pub_key_y[32])
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -176,7 +198,7 @@ esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pu
memcpy(arg.provisioner_read_oob_pub_key.pub_key_x, pub_key_x, 32);
memcpy(arg.provisioner_read_oob_pub_key.pub_key_y, pub_key_y, 32);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -201,7 +223,7 @@ esp_err_t esp_ble_mesh_provisioner_input_string(const char *string, uint8_t link
MIN(strlen(string), sizeof(arg.provisioner_input_str.string)));
arg.provisioner_input_str.link_idx = link_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -223,7 +245,7 @@ esp_err_t esp_ble_mesh_provisioner_input_number(uint32_t number, uint8_t link_id
arg.provisioner_input_num.number = number;
arg.provisioner_input_num.link_idx = link_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -232,6 +254,10 @@ esp_err_t esp_ble_mesh_provisioner_prov_enable(esp_ble_mesh_prov_bearer_t bearer
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (prov_bearers_valid(bearers) == false) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
@ -240,7 +266,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_enable(esp_ble_mesh_prov_bearer_t bearer
arg.provisioner_enable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -249,6 +275,10 @@ esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t beare
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
if (prov_bearers_valid(bearers) == false) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
@ -257,12 +287,12 @@ esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t beare
arg.provisioner_disable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t *add_dev,
esp_ble_mesh_dev_add_flag_t flags)
esp_ble_mesh_dev_add_flag_t flags)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -283,13 +313,15 @@ esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t
memcpy(arg.provisioner_dev_add.add_dev.addr, add_dev->addr, sizeof(esp_ble_mesh_bd_addr_t));
memcpy(arg.provisioner_dev_add.add_dev.uuid, add_dev->uuid, 16);
arg.provisioner_dev_add.flags = flags;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_prov_device_with_addr(const uint8_t uuid[16],
esp_ble_mesh_bd_addr_t addr, esp_ble_mesh_addr_type_t addr_type,
esp_ble_mesh_prov_bearer_t bearer, uint16_t oob_info, uint16_t unicast_addr)
esp_ble_mesh_bd_addr_t addr,
esp_ble_mesh_addr_type_t addr_type,
esp_ble_mesh_prov_bearer_t bearer,
uint16_t oob_info, uint16_t unicast_addr)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -315,7 +347,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_device_with_addr(const uint8_t uuid[16],
arg.provisioner_prov_dev_with_addr.bearer = bearer;
arg.provisioner_prov_dev_with_addr.oob_info = oob_info;
arg.provisioner_prov_dev_with_addr.unicast_addr = unicast_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -342,12 +374,12 @@ esp_err_t esp_ble_mesh_provisioner_delete_dev(esp_ble_mesh_device_delete_t *del_
} else if (del_dev->flag & DEL_DEV_UUID_FLAG) {
memcpy(arg.provisioner_dev_del.del_dev.uuid, del_dev->uuid, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val, uint8_t match_len,
uint8_t offset, bool prov_after_match)
uint8_t offset, bool prov_after_match)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -368,7 +400,7 @@ esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val,
arg.set_dev_uuid_match.match_len = match_len;
arg.set_dev_uuid_match.offset = offset;
arg.set_dev_uuid_match.prov_after_match = prov_after_match;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -396,7 +428,7 @@ esp_err_t esp_ble_mesh_provisioner_set_prov_data_info(esp_ble_mesh_prov_data_inf
} else if (prov_data_info->flag & PROV_DATA_IV_INDEX_FLAG) {
arg.set_prov_data_info.prov_data.iv_index = prov_data_info->iv_index;
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -417,7 +449,7 @@ esp_err_t esp_ble_mesh_provisioner_set_static_oob_value(const uint8_t *value, ui
arg.set_static_oob_val.length = length;
memcpy(arg.set_static_oob_val.value, value, length);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -437,7 +469,7 @@ esp_err_t esp_ble_mesh_provisioner_set_primary_elem_addr(uint16_t addr)
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_SET_PRIMARY_ELEM_ADDR;
arg.set_primary_elem_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -473,7 +505,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_info(esp_ble_mesh_fast_prov_info_t *fast_pr
if (fast_prov_info->match_len && fast_prov_info->match_val) {
memcpy(arg.set_fast_prov_info.match_val, fast_prov_info->match_val, fast_prov_info->match_len);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -493,7 +525,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_action(esp_ble_mesh_fast_prov_action_t acti
msg.act = BTC_BLE_MESH_ACT_SET_FAST_PROV_ACTION;
arg.set_fast_prov_action.action = action;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -30,7 +30,7 @@ esp_err_t esp_ble_mesh_proxy_identity_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_IDENTITY_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
@ -43,7 +43,7 @@ esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
@ -56,11 +56,12 @@ esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_DISABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
esp_ble_mesh_addr_type_t addr_type, uint16_t net_idx)
esp_ble_mesh_addr_type_t addr_type,
uint16_t net_idx)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -79,7 +80,7 @@ esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
arg.proxy_client_connect.addr_type = addr_type;
arg.proxy_client_connect.net_idx = net_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -96,12 +97,12 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle)
arg.proxy_client_disconnect.conn_handle = conn_handle;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
uint16_t net_idx, esp_ble_mesh_proxy_filter_type_t filter_type)
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle, uint16_t net_idx,
esp_ble_mesh_proxy_filter_type_t filter_type)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -120,12 +121,12 @@ esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
arg.proxy_client_set_filter_type.net_idx = net_idx;
arg.proxy_client_set_filter_type.filter_type = filter_type;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle,
uint16_t net_idx, uint16_t *addr, uint16_t addr_num)
esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle, uint16_t net_idx,
uint16_t *addr, uint16_t addr_num)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -145,12 +146,12 @@ esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle,
arg.proxy_client_add_filter_addr.addr_num = addr_num;
arg.proxy_client_add_filter_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle,
uint16_t net_idx, uint16_t *addr, uint16_t addr_num)
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint16_t net_idx,
uint16_t *addr, uint16_t addr_num)
{
btc_ble_mesh_prov_args_t arg = {0};
btc_msg_t msg = {0};
@ -170,6 +171,6 @@ esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle,
arg.proxy_client_remove_filter_addr.addr_num = addr_num;
arg.proxy_client_remove_filter_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -1,4 +1,4 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
// 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.
@ -21,6 +21,106 @@
extern "C" {
#endif
/** This enum value is the event of BLE operations */
typedef enum {
ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT, /*!< Start BLE advertising completion event */
ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT, /*!< Stop BLE advertising completion event */
ESP_BLE_MESH_START_BLE_SCANNING_COMP_EVT, /*!< Start BLE scanning completion event */
ESP_BLE_MESH_STOP_BLE_SCANNING_COMP_EVT, /*!< Stop BLE scanning completion event */
ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT, /*!< Scanning BLE advertising packets event */
ESP_BLE_MESH_BLE_EVT_MAX,
} esp_ble_mesh_ble_cb_event_t;
/** BLE operation callback parameters */
typedef union {
/**
* @brief ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of starting BLE advertising */
uint8_t index; /*!< Index of the BLE advertising */
} start_ble_advertising_comp; /*!< Event parameters of ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT */
/**
* @brief ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of stopping BLE advertising */
uint8_t index; /*!< Index of the BLE advertising */
} stop_ble_advertising_comp; /*!< Event parameters of ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT */
/**
* @brief ESP_BLE_MESH_START_BLE_SCANNING_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of starting BLE scanning */
} start_ble_scan_comp; /*!< Event parameters of ESP_BLE_MESH_START_BLE_SCANNING_COMP_EVT */
/**
* @brief ESP_BLE_MESH_STOP_BLE_SCANNING_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of stopping BLE scanning */
} stop_ble_scan_comp; /*!< Event parameters of ESP_BLE_MESH_STOP_BLE_SCANNING_COMP_EVT */
/**
* @brief ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT
*/
struct {
uint8_t addr[6]; /*!< Device address */
uint8_t addr_type; /*!< Device address type */
uint8_t adv_type; /*!< Advertising data type */
uint8_t *data; /*!< Advertising data */
uint16_t length; /*!< Advertising data length */
int8_t rssi; /*!< RSSI of the advertising packet */
} scan_ble_adv_pkt; /*!< Event parameters of ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT */
} esp_ble_mesh_ble_cb_param_t;
/**
* @brief BLE scanning callback function type
*
* @param event: BLE scanning callback event type
* @param param: BLE scanning callback parameter
*/
typedef void (* esp_ble_mesh_ble_cb_t)(esp_ble_mesh_ble_cb_event_t event,
esp_ble_mesh_ble_cb_param_t *param);
/**
* @brief Register BLE scanning callback.
*
* @param[in] callback: Pointer to the BLE scaning callback function.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_register_ble_callback(esp_ble_mesh_ble_cb_t callback);
/** Count for sending BLE advertising packet infinitely */
#define ESP_BLE_MESH_BLE_ADV_INFINITE 0xFFFF
/*!< This enum value is the priority of BLE advertising packet */
typedef enum {
ESP_BLE_MESH_BLE_ADV_PRIO_LOW,
ESP_BLE_MESH_BLE_ADV_PRIO_HIGH,
} esp_ble_mesh_ble_adv_priority_t;
/** Context of BLE advertising parameters. */
typedef struct {
uint16_t interval; /*!< BLE advertising interval */
uint8_t adv_type; /*!< BLE advertising type */
uint8_t own_addr_type; /*!< Own address type */
uint8_t peer_addr_type; /*!< Peer address type */
uint8_t peer_addr[BD_ADDR_LEN]; /*!< Peer address */
uint16_t duration; /*!< Duration is milliseconds */
uint16_t period; /*!< Period in milliseconds */
uint16_t count; /*!< Number of advertising duration */
uint8_t priority:2; /*!< Priority of BLE advertising packet */
} esp_ble_mesh_ble_adv_param_t;
/** Context of BLE advertising data. */
typedef struct {
uint8_t adv_data_len; /*!< Advertising data length */
uint8_t adv_data[31]; /*!< Advertising data */
uint8_t scan_rsp_data_len; /*!< Scan response data length */
uint8_t scan_rsp_data[31]; /*!< Scan response data */
} esp_ble_mesh_ble_adv_data_t;
/**
* @brief This function is called to start BLE advertising with the corresponding data
* and parameters while BLE Mesh is working at the same time.
@ -58,6 +158,31 @@ esp_err_t esp_ble_mesh_start_ble_advertising(const esp_ble_mesh_ble_adv_param_t
*/
esp_err_t esp_ble_mesh_stop_ble_advertising(uint8_t index);
/** Context of BLE scanning parameters. */
typedef struct {
uint32_t duration; /*!< Duration used to scan normal BLE advertising packets */
} esp_ble_mesh_ble_scan_param_t;
/**
* @brief This function is called to start scanning normal BLE advertising packets
* and notifying the packets to the application layer.
*
* @param[in] param: Pointer to the BLE scanning parameters
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_start_ble_scanning(esp_ble_mesh_ble_scan_param_t *param);
/**
* @brief This function is called to stop notifying normal BLE advertising packets
* to the application layer.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_stop_ble_scanning(void);
#ifdef __cplusplus
}
#endif

View File

@ -55,7 +55,8 @@ uint16_t esp_ble_mesh_get_primary_element_address(void);
* to 0x0000 in order to unsubscribe the model from the group.
*
*/
uint16_t *esp_ble_mesh_is_model_subscribed_to_group(esp_ble_mesh_model_t *model, uint16_t group_addr);
uint16_t *esp_ble_mesh_is_model_subscribed_to_group(esp_ble_mesh_model_t *model,
uint16_t group_addr);
/**
* @brief Find the BLE Mesh element pointer via the element address.
@ -87,7 +88,7 @@ uint8_t esp_ble_mesh_get_element_count(void);
*
*/
esp_ble_mesh_model_t *esp_ble_mesh_find_vendor_model(const esp_ble_mesh_elem_t *element,
uint16_t company_id, uint16_t model_id);
uint16_t company_id, uint16_t model_id);
/**
* @brief Find the SIG model with the given element and Model id.
@ -98,7 +99,8 @@ esp_ble_mesh_model_t *esp_ble_mesh_find_vendor_model(const esp_ble_mesh_elem_t *
* @return Pointer to the SIG Model on success, or NULL on failure which means the SIG Model is not found.
*
*/
esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *element, uint16_t model_id);
esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *element,
uint16_t model_id);
/**
* @brief Get the Composition data which has been registered.
@ -108,6 +110,104 @@ esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *ele
*/
const esp_ble_mesh_comp_t *esp_ble_mesh_get_composition_data(void);
/**
* @brief A local model of node or Provisioner subscribes a group address.
*
* @note This function shall not be invoked before node is provisioned or Provisioner is enabled.
*
* @param[in] element_addr: Unicast address of the element to which the model belongs.
* @param[in] company_id: A 16-bit company identifier.
* @param[in] model_id: A 16-bit model identifier.
* @param[in] group_addr: The group address to be subscribed.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_model_subscribe_group_addr(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t group_addr);
/**
* @brief A local model of node or Provisioner unsubscribes a group address.
*
* @note This function shall not be invoked before node is provisioned or Provisioner is enabled.
*
* @param[in] element_addr: Unicast address of the element to which the model belongs.
* @param[in] company_id: A 16-bit company identifier.
* @param[in] model_id: A 16-bit model identifier.
* @param[in] group_addr: The subscribed group address.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_model_unsubscribe_group_addr(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t group_addr);
/**
* @brief This function is called by Node to get the local NetKey.
*
* @param[in] net_idx: NetKey index.
*
* @return NetKey on success, or NULL on failure.
*
*/
const uint8_t *esp_ble_mesh_node_get_local_net_key(uint16_t net_idx);
/**
* @brief This function is called by Node to get the local AppKey.
*
* @param[in] app_idx: AppKey index.
*
* @return AppKey on success, or NULL on failure.
*
*/
const uint8_t *esp_ble_mesh_node_get_local_app_key(uint16_t app_idx);
/**
* @brief This function is called by Node to add a local NetKey.
*
* @param[in] net_key: NetKey to be added.
* @param[in] net_idx: NetKey Index.
*
* @note This function can only be called after the device is provisioned.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_node_add_local_net_key(const uint8_t net_key[16], uint16_t net_idx);
/**
* @brief This function is called by Node to add a local AppKey.
*
* @param[in] app_key: AppKey to be added.
* @param[in] net_idx: NetKey Index.
* @param[in] app_idx: AppKey Index.
*
* @note The net_idx must be an existing one.
* This function can only be called after the device is provisioned.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_node_add_local_app_key(const uint8_t app_key[16], uint16_t net_idx, uint16_t app_idx);
/**
* @brief This function is called by Node to bind AppKey to model locally.
*
* @param[in] element_addr: Node local element address
* @param[in] company_id: Node local company id
* @param[in] model_id: Node local model id
* @param[in] app_idx: Node local appkey index
*
* @note If going to bind app_key with local vendor model, the company_id
* shall be set to 0xFFFF.
* This function can only be called after the device is provisioned.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_node_bind_app_key_to_local_model(uint16_t element_addr, uint16_t company_id,
uint16_t model_id, uint16_t app_idx);
#ifdef __cplusplus
}
#endif

View File

@ -23,7 +23,7 @@ extern "C" {
/** @brief: event, event code of user-defined model events; param, parameters of user-defined model events */
typedef void (* esp_ble_mesh_model_cb_t)(esp_ble_mesh_model_cb_event_t event,
esp_ble_mesh_model_cb_param_t *param);
esp_ble_mesh_model_cb_param_t *param);
/**
* @brief Register BLE Mesh callback for user-defined models' operations.
@ -104,8 +104,9 @@ esp_err_t esp_ble_mesh_client_model_deinit(esp_ble_mesh_model_t *model);
*
*/
esp_err_t esp_ble_mesh_server_model_send_msg(esp_ble_mesh_model_t *model,
esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode,
uint16_t length, uint8_t *data);
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
uint16_t length, uint8_t *data);
/**
* @brief Send client model message (such as model get, set, etc).
@ -123,9 +124,11 @@ esp_err_t esp_ble_mesh_server_model_send_msg(esp_ble_mesh_model_t *model,
*
*/
esp_err_t esp_ble_mesh_client_model_send_msg(esp_ble_mesh_model_t *model,
esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode,
uint16_t length, uint8_t *data, int32_t msg_timeout,
bool need_rsp, esp_ble_mesh_dev_role_t device_role);
esp_ble_mesh_msg_ctx_t *ctx,
uint32_t opcode,
uint16_t length, uint8_t *data,
int32_t msg_timeout, bool need_rsp,
esp_ble_mesh_dev_role_t device_role);
/**
* @brief Send a model publication message.
@ -166,8 +169,8 @@ esp_err_t esp_ble_mesh_model_publish(esp_ble_mesh_model_t *model, uint32_t opcod
*
*/
esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model,
esp_ble_mesh_server_state_type_t type,
esp_ble_mesh_server_state_value_t *value);
esp_ble_mesh_server_state_type_t type,
esp_ble_mesh_server_state_value_t *value);
/**
* @brief Reset the provisioning procedure of the local BLE Mesh node.
@ -226,7 +229,8 @@ uint16_t esp_ble_mesh_provisioner_get_node_index(const char *name);
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr, uint8_t *data, uint16_t length);
esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr,
uint8_t *data, uint16_t length);
/**
* @brief This function is called to get the provisioned node information
@ -250,6 +254,48 @@ esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_uuid(const uint8_t u
*/
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_addr(uint16_t unicast_addr);
/**
* @brief This function is called to get the provisioned node information
* with the node name.
*
* @param[in] name: Name of the node (end by '\0').
*
* @return Pointer of the node info struct or NULL on failure.
*
*/
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_name(const char *name);
/**
* @brief This function is called by Provisioner to get provisioned node count.
*
* @return Number of the provisioned nodes.
*
*/
uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void);
/**
* @brief This function is called by Provisioner to get the entry of the node table.
*
* @note After invoking the function to get the entry of nodes, users can use the "for"
* loop combined with the macro CONFIG_BLE_MESH_MAX_PROV_NODES to get each node's
* information. Before trying to read the node's information, users need to check
* if the node exists, i.e. if the *(esp_ble_mesh_node_t **node) is NULL.
* For example:
* ```
* const esp_ble_mesh_node_t **entry = esp_ble_mesh_provisioner_get_node_table_entry();
* for (int i = 0; i < CONFIG_BLE_MESH_MAX_PROV_NODES; i++) {
* const esp_ble_mesh_node_t *node = entry[i];
* if (node) {
* ......
* }
* }
* ```
*
* @return Pointer to the start of the node table.
*
*/
const esp_ble_mesh_node_t **esp_ble_mesh_provisioner_get_node_table_entry(void);
/**
* @brief This function is called to delete the provisioned node information
* with the node device uuid.
@ -287,7 +333,8 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_addr(uint16_t unicast_addr);
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16], uint16_t net_idx, uint16_t app_idx);
esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
uint16_t net_idx, uint16_t app_idx);
/**
* @brief This function is used to update a local AppKey for Provisioner.
@ -300,7 +347,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
*
*/
esp_err_t esp_ble_mesh_provisioner_update_local_app_key(const uint8_t app_key[16],
uint16_t net_idx, uint16_t app_idx);
uint16_t net_idx, uint16_t app_idx);
/**
* @brief This function is called by Provisioner to get the local app key value.
@ -328,7 +375,7 @@ const uint8_t *esp_ble_mesh_provisioner_get_local_app_key(uint16_t net_idx, uint
*
*/
esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_addr, uint16_t app_idx,
uint16_t model_id, uint16_t company_id);
uint16_t model_id, uint16_t company_id);
/**
* @brief This function is called by Provisioner to add local network key.
@ -367,12 +414,229 @@ esp_err_t esp_ble_mesh_provisioner_update_local_net_key(const uint8_t net_key[16
const uint8_t *esp_ble_mesh_provisioner_get_local_net_key(uint16_t net_idx);
/**
* @brief This function is called by Provisioner to get provisioned node count.
* @brief This function is called by Provisioner to enable or disable receiving
* heartbeat messages.
*
* @return Number of the provisioned nodes.
* @note If enabling receiving heartbeat message successfully, the filter will
* be an empty rejectlist by default, which means all heartbeat messages
* received by the Provisioner will be reported to the application layer.
*
* @param[in] enable: Enable or disable receiving heartbeat messages.
*
* @return ESP_OK on success or error code otherwise.
*
*/
uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void);
esp_err_t esp_ble_mesh_provisioner_recv_heartbeat(bool enable);
/**
* @brief This function is called by Provisioner to set the heartbeat filter type.
*
* @note 1. If the filter type is not the same with the current value, then all the
* filter entries will be cleaned.
* 2. If the previous type is rejectlist, and changed to acceptlist, then the
* filter will be an empty acceptlist, which means no heartbeat messages
* will be reported. Users need to add SRC or DST into the filter entry,
* then heartbeat messages from the SRC or to the DST will be reported.
*
* @param[in] type: Heartbeat filter type (acceptlist or rejectlist).
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_type(uint8_t type);
/**
* @brief This function is called by Provisioner to add or remove a heartbeat filter entry.
*
* @note 1. If the operation is "ADD", the "hb_src" can be set to the SRC (can only be a
* unicast address) of heartbeat messages, and the "hb_dst" can be set to the
* DST (unicast address or group address), at least one of them needs to be set.
* - If only one of them is set, the filter entry will only use the configured
* SRC or DST to filter heartbeat messages.
* - If both of them are set, the SRC and DST will both be used to decide if a
* heartbeat message will be handled.
* - If SRC or DST already exists in some filter entry, then the corresponding
* entry will be cleaned firstly, then a new entry will be allocated to store
* the information.
* 2. If the operation is "REMOVE", the "hb_src" can be set to the SRC (can only be
* a unicast address) of heartbeat messages, and the "hb_dst" can be set to the
* DST (unicast address or group address), at least one of them needs to be set.
* - The filter entry with the same SRC or DST will be removed.
*
* @param[in] op: Add or REMOVE
* @param[in] info: Heartbeat filter entry information, including:
* hb_src - Heartbeat source address;
* hb_dst - Heartbeat destination address;
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble_mesh_heartbeat_filter_info_t *info);
/**
* @brief This function is called by Provisioner to directly erase the mesh
* information from nvs namespace.
*
* @note This function can be invoked when the mesh stack is not initialized
* or has been de-initialized.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_direct_erase_settings(void);
/**
* @brief This function is called by Provisioner to open a nvs namespace
* for storing mesh information.
*
* @note Before open another nvs namespace, the previously opened nvs
* namespace must be closed firstly.
*
* @param[in] index: Settings index.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_open_settings_with_index(uint8_t index);
/**
* @brief This function is called by Provisioner to open a nvs namespace
* for storing mesh information.
*
* @note Before open another nvs namespace, the previously opened nvs
* namespace must be closed firstly.
*
* @param[in] uid: Settings user id.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_open_settings_with_uid(const char *uid);
/**
* @brief This function is called by Provisioner to close a nvs namespace
* which is opened previously for storing mesh information.
*
* @note 1. Before closing the nvs namespace, it must be open.
* 2. When the function is invoked, the Provisioner functionality
* will be disabled firstly, and:
* a) If the "erase" flag is set to false, the mesh information
* will be cleaned (e.g. removing NetKey, AppKey, nodes, etc)
* from the mesh stack.
* b) If the "erase" flag is set to true, the mesh information
* stored in the nvs namespace will also be erased besides
* been cleaned from the mesh stack.
* 3. If Provisioner tries to work properly again, we can invoke the
* open function to open a new nvs namespace or a previously added
* one, and restore the mesh information from it if not erased.
* 4. The working process shall be as following:
* a) Open settings A
* b) Start to provision and control nodes
* c) Close settings A
* d) Open settings B
* e) Start to provision and control other nodes
* f) Close settings B
* g) ......
*
* @param[in] index: Settings index.
* @param[in] erase: Indicate if erasing mesh information.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_close_settings_with_index(uint8_t index, bool erase);
/**
* @brief This function is called by Provisioner to close a nvs namespace
* which is opened previously for storing mesh information.
*
* @note 1. Before closing the nvs namespace, it must be open.
* 2. When the function is invoked, the Provisioner functionality
* will be disabled firstly, and:
* a) If the "erase" flag is set to false, the mesh information
* will be cleaned (e.g. removing NetKey, AppKey, nodes, etc)
* from the mesh stack.
* b) If the "erase" flag is set to true, the mesh information
* stored in the nvs namespace will also be erased besides
* been cleaned from the mesh stack.
* 3. If Provisioner tries to work properly again, we can invoke the
* open function to open a new nvs namespace or a previously added
* one, and restore the mesh information from it if not erased.
* 4. The working process shall be as following:
* a) Open settings A
* b) Start to provision and control nodes
* c) Close settings A
* d) Open settings B
* e) Start to provision and control other nodes
* f) Close settings B
* g) ......
*
* @param[in] uid: Settings user id.
* @param[in] erase: Indicate if erasing mesh information.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_close_settings_with_uid(const char *uid, bool erase);
/**
* @brief This function is called by Provisioner to erase the mesh information
* and settings user id from a nvs namespace.
*
* @note When this function is called, the nvs namespace must not be open.
* This function is used to erase the mesh information and settings
* user id which are not used currently.
*
* @param[in] index: Settings index.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_delete_settings_with_index(uint8_t index);
/**
* @brief This function is called by Provisioner to erase the mesh information
* and settings user id from a nvs namespace.
*
* @note When this function is called, the nvs namespace must not be open.
* This function is used to erase the mesh information and settings
* user id which are not used currently.
*
* @param[in] uid: Settings user id.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_provisioner_delete_settings_with_uid(const char *uid);
/**
* @brief This function is called by Provisioner to get settings user id.
*
* @param[in] index: Settings index.
*
* @return Setting user id on success or NULL on failure.
*
*/
const char *esp_ble_mesh_provisioner_get_settings_uid(uint8_t index);
/**
* @brief This function is called by Provisioner to get settings index.
*
* @param[in] uid: Settings user id.
*
* @return Settings index.
*
*/
uint8_t esp_ble_mesh_provisioner_get_settings_index(const char *uid);
/**
* @brief This function is called by Provisioner to get the number of free
* settings user id.
*
* @return Number of free settings user id.
*
*/
uint8_t esp_ble_mesh_provisioner_get_free_settings_count(void);
/**
* @brief This function is called to get fast provisioning application key.

View File

@ -69,6 +69,12 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers);
/**
* @brief Unprovisioned device set own oob public key & private key pair.
*
* @note In order to avoid suffering brute-forcing attack (CVE-2020-26559).
* The Bluetooth SIG recommends that potentially vulnerable mesh provisioners
* use an out-of-band mechanism to exchange the public keys.
* So as an unprovisioned device, it should use this function to input
* the Public Key exchanged through the out-of-band mechanism.
*
* @param[in] pub_key_x: Unprovisioned device's Public Key X
* @param[in] pub_key_y: Unprovisioned device's Public Key Y
* @param[in] private_key: Unprovisioned device's Private Key
@ -76,7 +82,7 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers);
* @return ESP_OK on success or error code otherwise.
*/
esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_key_y[32],
uint8_t private_key[32]);
uint8_t private_key[32]);
/**
* @brief Provide provisioning input OOB number.
@ -121,6 +127,10 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name);
/**
* @brief Provisioner inputs unprovisioned device's oob public key.
*
* @note In order to avoid suffering brute-forcing attack (CVE-2020-26559).
* The Bluetooth SIG recommends that potentially vulnerable mesh provisioners
* use an out-of-band mechanism to exchange the public keys.
*
* @param[in] link_idx: The provisioning link index
* @param[in] pub_key_x: Unprovisioned device's Public Key X
* @param[in] pub_key_y: Unprovisioned device's Public Key Y
@ -128,7 +138,7 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name);
* @return ESP_OK on success or error code otherwise.
*/
esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pub_key_x[32],
uint8_t pub_key_y[32]);
uint8_t pub_key_y[32]);
/**
* @brief Provide provisioning input OOB string.
@ -232,7 +242,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t beare
*
*/
esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t *add_dev,
esp_ble_mesh_dev_add_flag_t flags);
esp_ble_mesh_dev_add_flag_t flags);
/** @brief Provision an unprovisioned device and assign a fixed unicast address for it in advance.
*
@ -257,16 +267,17 @@ esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t
* and "esp_ble_mesh_provisioner_prov_device_with_addr" by a Provisioner.
*/
esp_err_t esp_ble_mesh_provisioner_prov_device_with_addr(const uint8_t uuid[16],
esp_ble_mesh_bd_addr_t addr, esp_ble_mesh_addr_type_t addr_type,
esp_ble_mesh_prov_bearer_t bearer, uint16_t oob_info, uint16_t unicast_addr);
esp_ble_mesh_bd_addr_t addr,
esp_ble_mesh_addr_type_t addr_type,
esp_ble_mesh_prov_bearer_t bearer,
uint16_t oob_info, uint16_t unicast_addr);
/**
* @brief Delete device from queue, reset current provisioning link and reset the node.
* @brief Delete device from queue, and reset current provisioning link with the device.
*
* @note If the device is in the queue, remove it from the queue; if the device is being
* provisioned, terminate the provisioning procedure; if the device has already
* been provisioned, reset the device. And either one of the addr or device UUID
* can be input.
* @note If the device is in the queue, remove it from the queue; if the device is
* being provisioned, terminate the provisioning procedure. Either one of the
* device address or device UUID can be used as input.
*
* @param[in] del_dev: Pointer to a struct containing the device information.
*
@ -290,8 +301,8 @@ esp_err_t esp_ble_mesh_provisioner_delete_dev(esp_ble_mesh_device_delete_t *del_
*
*/
typedef void (*esp_ble_mesh_prov_adv_cb_t)(const esp_ble_mesh_bd_addr_t addr, const esp_ble_mesh_addr_type_t addr_type,
const uint8_t adv_type, const uint8_t *dev_uuid,
uint16_t oob_info, esp_ble_mesh_prov_bearer_t bearer);
const uint8_t adv_type, const uint8_t *dev_uuid,
uint16_t oob_info, esp_ble_mesh_prov_bearer_t bearer);
/**
* @brief This function is called by Provisioner to set the part of the device UUID
@ -307,7 +318,7 @@ typedef void (*esp_ble_mesh_prov_adv_cb_t)(const esp_ble_mesh_bd_addr_t addr, co
*
*/
esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val, uint8_t match_len,
uint8_t offset, bool prov_after_match);
uint8_t offset, bool prov_after_match);
/**
* @brief This function is called by Provisioner to set provisioning data information
@ -323,6 +334,19 @@ esp_err_t esp_ble_mesh_provisioner_set_prov_data_info(esp_ble_mesh_prov_data_inf
/**
* @brief This function is called by Provisioner to set static oob value used for provisioning.
*
* @note The Bluetooth SIG recommends that mesh implementations enforce a randomly selected
* AuthValue using all of the available bits, where permitted by the implementation.
* A large entropy helps ensure that a brute-force of the AuthValue, even a static
* AuthValue, cannot normally be completed in a reasonable time (CVE-2020-26557).
*
* AuthValues selected using a cryptographically secure random or pseudorandom number
* generator and having the maximum permitted entropy (128-bits) will be most difficult
* to brute-force. AuthValues with reduced entropy or generated in a predictable manner
* will not grant the same level of protection against this vulnerability. Selecting a
* new AuthValue with each provisioning attempt can also make it more difficult to launch
* a brute-force attack by requiring the attacker to restart the search with each
* provisioning attempt (CVE-2020-26556).
*
* @param[in] value: Pointer to the static oob value.
* @param[in] length: Length of the static oob value.
*

View File

@ -65,7 +65,8 @@ esp_err_t esp_ble_mesh_proxy_gatt_disable(void);
*
*/
esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
esp_ble_mesh_addr_type_t addr_type, uint16_t net_idx);
esp_ble_mesh_addr_type_t addr_type,
uint16_t net_idx);
/**
* @brief Proxy Client terminates a connection with the Proxy Server.
@ -87,8 +88,8 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle);
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
uint16_t net_idx, esp_ble_mesh_proxy_filter_type_t filter_type);
esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle, uint16_t net_idx,
esp_ble_mesh_proxy_filter_type_t filter_type);
/**
* @brief Proxy Client adds address to the Proxy Server filter list.
@ -101,8 +102,8 @@ esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle,
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle,
uint16_t net_idx, uint16_t *addr, uint16_t addr_num);
esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle, uint16_t net_idx,
uint16_t *addr, uint16_t addr_num);
/**
* @brief Proxy Client removes address from the Proxy Server filter list.
@ -115,8 +116,8 @@ esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle,
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle,
uint16_t net_idx, uint16_t *addr, uint16_t addr_num);
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint16_t net_idx,
uint16_t *addr, uint16_t addr_num);
#ifdef __cplusplus
}

View File

@ -17,6 +17,7 @@
#include <stdint.h>
#include "mesh_config.h"
#include "mesh_common.h"
#include "proxy_server.h"
#include "provisioner_main.h"
@ -50,6 +51,12 @@ extern "C" {
/*!< The maximum length of a BLE Mesh unprovisioned device name */
#define ESP_BLE_MESH_DEVICE_NAME_MAX_LEN DEVICE_NAME_SIZE
/*!< The maximum length of settings user id */
#define ESP_BLE_MESH_SETTINGS_UID_SIZE 20
/*!< Invalid settings index */
#define ESP_BLE_MESH_INVALID_SETTINGS_IDX 0xFF
/*!< Define the BLE Mesh octet 16 bytes size */
#define ESP_BLE_MESH_OCTET16_LEN 16
typedef uint8_t esp_ble_mesh_octet16_t[ESP_BLE_MESH_OCTET16_LEN];
@ -58,6 +65,15 @@ typedef uint8_t esp_ble_mesh_octet16_t[ESP_BLE_MESH_OCTET16_LEN];
#define ESP_BLE_MESH_OCTET8_LEN 8
typedef uint8_t esp_ble_mesh_octet8_t[ESP_BLE_MESH_OCTET8_LEN];
/*!< Invalid Company ID */
#define ESP_BLE_MESH_CID_NVAL 0xFFFF
/*!< Special TTL value to request using configured default TTL */
#define ESP_BLE_MESH_TTL_DEFAULT 0xFF
/*!< Maximum allowed TTL value */
#define ESP_BLE_MESH_TTL_MAX 0x7F
#define ESP_BLE_MESH_ADDR_UNASSIGNED 0x0000
#define ESP_BLE_MESH_ADDR_ALL_NODES 0xFFFF
#define ESP_BLE_MESH_ADDR_PROXIES 0xFFFC
@ -262,7 +278,7 @@ typedef enum {
#define ESP_BLE_MESH_MODEL_OP_2(b0, b1) (((b0) << 8) | (b1))
#define ESP_BLE_MESH_MODEL_OP_3(b0, cid) ((((b0) << 16) | 0xC00000) | (cid))
/*!< This macro is associated with BLE_MESH_MODEL in mesh_access.h */
/*!< This macro is associated with BLE_MESH_MODEL_CB in mesh_access.h */
#define ESP_BLE_MESH_SIG_MODEL(_id, _op, _pub, _user_data) \
{ \
.model_id = (_id), \
@ -275,7 +291,7 @@ typedef enum {
.user_data = _user_data, \
}
/*!< This macro is associated with BLE_MESH_MODEL_VND in mesh_access.h */
/*!< This macro is associated with BLE_MESH_MODEL_VND_CB in mesh_access.h */
#define ESP_BLE_MESH_VENDOR_MODEL(_company, _id, _op, _pub, _user_data) \
{ \
.vnd.company_id = (_company), \
@ -452,6 +468,19 @@ typedef struct {
*/
#define ESP_BLE_MESH_MODEL_OP_END {0, 0, 0}
/** Abstraction that describes a model callback structure.
* This structure is associated with struct bt_mesh_model_cb in mesh_access.h.
*/
typedef struct {
/** Callback used during model initialization. Initialized by the stack. */
esp_ble_mesh_cb_t init_cb;
#if CONFIG_BLE_MESH_DEINIT
/** Callback used during model deinitialization. Initialized by the stack. */
esp_ble_mesh_cb_t deinit_cb;
#endif /* CONFIG_BLE_MESH_DEINIT */
} esp_ble_mesh_model_cbs_t;
/** Abstraction that describes a Mesh Model instance.
* This structure is associated with struct bt_mesh_model in mesh_access.h
*/
@ -485,6 +514,9 @@ struct esp_ble_mesh_model {
/** Model operation context */
esp_ble_mesh_model_op_t *op;
/** Model callback structure */
esp_ble_mesh_model_cbs_t *cb;
/** Model-specific user data */
void *user_data;
};
@ -519,7 +551,7 @@ typedef struct {
/** Force sending reliably by using segment acknowledgement */
uint8_t send_rel: 1;
/** TTL, or BLE_MESH_TTL_DEFAULT for default TTL. */
/** TTL, or ESP_BLE_MESH_TTL_DEFAULT for default TTL. */
uint8_t send_ttl;
/** Opcode of a received message. Not used for sending message. */
@ -550,6 +582,12 @@ typedef struct {
/** Out of Band information field. */
esp_ble_mesh_prov_oob_info_t oob_info;
/* NOTE: In order to avoid suffering brute-forcing attack (CVE-2020-26559).
* The Bluetooth SIG recommends that potentially vulnerable mesh provisioners
* support an out-of-band mechanism to exchange the public keys.
* So as an unprovisioned device, it should enable this flag to support
* using an out-of-band mechanism to exchange Public Key.
*/
/** Flag indicates whether unprovisioned devices support OOB public key */
bool oob_pub_key;
@ -603,12 +641,29 @@ typedef struct {
/** Provisioning Algorithm for the Provisioner */
uint8_t prov_algorithm;
/* NOTE: In order to avoid suffering brute-forcing attack (CVE-2020-26559).
* The Bluetooth SIG recommends that potentially vulnerable mesh provisioners
* use an out-of-band mechanism to exchange the public keys.
*/
/** Provisioner public key oob */
uint8_t prov_pub_key_oob;
/** Callback used to notify to set device OOB Public Key. Initialized by the stack. */
esp_ble_mesh_cb_t provisioner_prov_read_oob_pub_key;
/* NOTE: The Bluetooth SIG recommends that mesh implementations enforce a randomly
* selected AuthValue using all of the available bits, where permitted by the
* implementation. A large entropy helps ensure that a brute-force of the AuthValue,
* even a static AuthValue, cannot normally be completed in a reasonable time (CVE-2020-26557).
*
* AuthValues selected using a cryptographically secure random or pseudorandom number
* generator and having the maximum permitted entropy (128-bits) will be most difficult
* to brute-force. AuthValues with reduced entropy or generated in a predictable manner
* will not grant the same level of protection against this vulnerability. Selecting a
* new AuthValue with each provisioning attempt can also make it more difficult to launch
* a brute-force attack by requiring the attacker to restart the search with each
* provisioning attempt (CVE-2020-26556).
*/
/** Provisioner static oob value */
uint8_t *prov_static_oob_val;
/** Provisioner static oob value length */
@ -745,35 +800,19 @@ typedef enum {
PROXY_FILTER_BLACKLIST,
} esp_ble_mesh_proxy_filter_type_t;
/** Count for sending BLE advertising packet infinitely */
#define ESP_BLE_MESH_BLE_ADV_INFINITE 0xFFFF
/*!< Provisioner heartbeat filter type */
#define ESP_BLE_MESH_HEARTBEAT_FILTER_ACCEPTLIST 0x00
#define ESP_BLE_MESH_HEARTBEAT_FILTER_REJECTLIST 0x01
/*!< This enum value is the priority of BLE advertising packet */
typedef enum {
ESP_BLE_MESH_BLE_ADV_PRIO_LOW,
ESP_BLE_MESH_BLE_ADV_PRIO_HIGH,
} esp_ble_mesh_ble_adv_priority_t;
/*!< Provisioner heartbeat filter operation */
#define ESP_BLE_MESH_HEARTBEAT_FILTER_ADD 0x00
#define ESP_BLE_MESH_HEARTBEAT_FILTER_REMOVE 0x01
/** Context of BLE advertising parameters. */
/** Context of Provisioner heartbeat filter information to be set */
typedef struct {
uint16_t interval; /*!< BLE advertising interval */
uint8_t adv_type; /*!< BLE advertising type */
uint8_t own_addr_type; /*!< Own address type */
uint8_t peer_addr_type; /*!< Peer address type */
uint8_t peer_addr[BD_ADDR_LEN]; /*!< Peer address */
uint16_t duration; /*!< Duration is milliseconds */
uint16_t period; /*!< Period in milliseconds */
uint16_t count; /*!< Number of advertising duration */
uint8_t priority:2; /*!< Priority of BLE advertising packet */
} esp_ble_mesh_ble_adv_param_t;
/** Context of BLE advertising data. */
typedef struct {
uint8_t adv_data_len; /*!< Advertising data length */
uint8_t adv_data[31]; /*!< Advertising data */
uint8_t scan_rsp_data_len; /*!< Scan response data length */
uint8_t scan_rsp_data[31]; /*!< Scan response data */
} esp_ble_mesh_ble_adv_data_t;
uint16_t hb_src; /*!< Heartbeat source address (unicast address) */
uint16_t hb_dst; /*!< Heartbeat destination address (unicast address or group address) */
} esp_ble_mesh_heartbeat_filter_info_t;
/*!< This enum value is the event of node/provisioner/fast provisioning */
typedef enum {
@ -795,6 +834,9 @@ typedef enum {
ESP_BLE_MESH_NODE_PROXY_IDENTITY_ENABLE_COMP_EVT, /*!< Enable BLE Mesh Proxy Identity advertising completion event */
ESP_BLE_MESH_NODE_PROXY_GATT_ENABLE_COMP_EVT, /*!< Enable BLE Mesh GATT Proxy Service completion event */
ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT, /*!< Disable BLE Mesh GATT Proxy Service completion event */
ESP_BLE_MESH_NODE_ADD_LOCAL_NET_KEY_COMP_EVT, /*!< Node add NetKey locally completion event */
ESP_BLE_MESH_NODE_ADD_LOCAL_APP_KEY_COMP_EVT, /*!< Node add AppKey locally completion event */
ESP_BLE_MESH_NODE_BIND_APP_KEY_TO_MODEL_COMP_EVT, /*!< Node bind AppKey to model locally completion event */
ESP_BLE_MESH_PROVISIONER_PROV_ENABLE_COMP_EVT, /*!< Provisioner enable provisioning functionality completion event */
ESP_BLE_MESH_PROVISIONER_PROV_DISABLE_COMP_EVT, /*!< Provisioner disable provisioning functionality completion event */
ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT, /*!< Provisioner receives unprovisioned device beacon event */
@ -806,7 +848,7 @@ typedef enum {
ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT, /*!< Provisioner provisioning done event */
ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT, /*!< Provisioner add a device to the list which contains devices that are waiting/going to be provisioned completion event */
ESP_BLE_MESH_PROVISIONER_PROV_DEV_WITH_ADDR_COMP_EVT, /*!< Provisioner start to provision an unprovisioned device completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_DEV_COMP_EVT, /*!< Provisioner delete a device from the list, close provisioning link with the device if it exists and remove the device from network completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_DEV_COMP_EVT, /*!< Provisioner delete a device from the list, close provisioning link with the device completion event */
ESP_BLE_MESH_PROVISIONER_SET_DEV_UUID_MATCH_COMP_EVT, /*!< Provisioner set the value to be compared with part of the unprovisioned device UUID completion event */
ESP_BLE_MESH_PROVISIONER_SET_PROV_DATA_INFO_COMP_EVT, /*!< Provisioner set net_idx/flags/iv_index used for provisioning completion event */
ESP_BLE_MESH_PROVISIONER_SET_STATIC_OOB_VALUE_COMP_EVT, /*!< Provisioner set static oob value used for provisioning completion event */
@ -823,6 +865,17 @@ typedef enum {
ESP_BLE_MESH_PROVISIONER_STORE_NODE_COMP_DATA_COMP_EVT, /*!< Provisioner store node composition data completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_UUID_COMP_EVT, /*!< Provisioner delete node with uuid completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_ADDR_COMP_EVT, /*!< Provisioner delete node with unicast address completion event */
ESP_BLE_MESH_PROVISIONER_ENABLE_HEARTBEAT_RECV_COMP_EVT, /*!< Provisioner start to receive heartbeat message completion event */
ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_TYPE_COMP_EVT, /*!< Provisioner set the heartbeat filter type completion event */
ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_INFO_COMP_EVT, /*!< Provisioner set the heartbeat filter information completion event */
ESP_BLE_MESH_PROVISIONER_RECV_HEARTBEAT_MESSAGE_EVT, /*!< Provisioner receive heartbeat message event */
ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT, /*!< Provisioner directly erase settings completion event */
ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_INDEX_COMP_EVT, /*!< Provisioner open settings with index completion event */
ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_UID_COMP_EVT, /*!< Provisioner open settings with user id completion event */
ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_INDEX_COMP_EVT, /*!< Provisioner close settings with index completion event */
ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_UID_COMP_EVT, /*!< Provisioner close settings with user id completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_INDEX_COMP_EVT, /*!< Provisioner delete settings with index completion event */
ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_UID_COMP_EVT, /*!< Provisioner delete settings with user id completion event */
ESP_BLE_MESH_SET_FAST_PROV_INFO_COMP_EVT, /*!< Set fast provisioning information (e.g. unicast address range, net_idx, etc.) completion event */
ESP_BLE_MESH_SET_FAST_PROV_ACTION_COMP_EVT, /*!< Set fast provisioning action completion event */
ESP_BLE_MESH_HEARTBEAT_MESSAGE_RECV_EVT, /*!< Receive Heartbeat message event */
@ -842,8 +895,8 @@ typedef enum {
ESP_BLE_MESH_PROXY_CLIENT_SET_FILTER_TYPE_COMP_EVT, /*!< Proxy Client set filter type completion event */
ESP_BLE_MESH_PROXY_CLIENT_ADD_FILTER_ADDR_COMP_EVT, /*!< Proxy Client add filter address completion event */
ESP_BLE_MESH_PROXY_CLIENT_REMOVE_FILTER_ADDR_COMP_EVT, /*!< Proxy Client remove filter address completion event */
ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT, /*!< Start BLE advertising completion event */
ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT, /*!< Stop BLE advertising completion event */
ESP_BLE_MESH_MODEL_SUBSCRIBE_GROUP_ADDR_COMP_EVT, /*!< Local model subscribes group address completion event */
ESP_BLE_MESH_MODEL_UNSUBSCRIBE_GROUP_ADDR_COMP_EVT, /*!< Local model unsubscribes group address completion event */
ESP_BLE_MESH_DEINIT_MESH_COMP_EVT, /*!< De-initialize BLE Mesh stack completion event */
ESP_BLE_MESH_PROV_EVT_MAX,
} esp_ble_mesh_prov_cb_event_t;
@ -960,6 +1013,31 @@ typedef union {
struct ble_mesh_proxy_gatt_disable_comp_param {
int err_code; /*!< Indicate the result of disabling Mesh Proxy Service */
} node_proxy_gatt_disable_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT */
/**
* @brief ESP_BLE_MESH_NODE_ADD_LOCAL_NET_KEY_COMP_EVT
*/
struct ble_mesh_node_add_local_net_key_comp_param {
int err_code; /*!< Indicate the result of adding local NetKey by the node */
uint16_t net_idx; /*!< NetKey Index */
} node_add_net_key_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_ADD_LOCAL_NET_KEY_COMP_EVT */
/**
* @brief ESP_BLE_MESH_NODE_ADD_LOCAL_APP_KEY_COMP_EVT
*/
struct ble_mesh_node_add_local_app_key_comp_param {
int err_code; /*!< Indicate the result of adding local AppKey by the node */
uint16_t net_idx; /*!< NetKey Index */
uint16_t app_idx; /*!< AppKey Index */
} node_add_app_key_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_ADD_LOCAL_APP_KEY_COMP_EVT */
/**
* @brief ESP_BLE_MESH_NODE_BIND_APP_KEY_TO_MODEL_COMP_EVT
*/
struct ble_mesh_node_bind_local_mod_app_comp_param {
int err_code; /*!< Indicate the result of binding AppKey with model by the node */
uint16_t element_addr; /*!< Element address */
uint16_t app_idx; /*!< AppKey Index */
uint16_t company_id; /*!< Company ID */
uint16_t model_id; /*!< Model ID */
} node_bind_app_key_to_model_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_BIND_APP_KEY_TO_MODEL_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT
*/
@ -1107,6 +1185,7 @@ typedef union {
*/
struct ble_mesh_provisioner_add_local_app_key_comp_param {
int err_code; /*!< Indicate the result of adding local AppKey by the Provisioner */
uint16_t net_idx; /*!< NetKey Index */
uint16_t app_idx; /*!< AppKey Index */
} provisioner_add_app_key_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_APP_KEY_COMP_EVT */
/**
@ -1151,17 +1230,103 @@ typedef union {
/**
* @brief ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_UUID_COMP_EVT
*/
struct ble_mesh_provisioner_delete_node_with_uuid_comp_data_comp_param {
struct ble_mesh_provisioner_delete_node_with_uuid_comp_param {
int err_code; /*!< Indicate the result of deleting node with uuid by the Provisioner */
uint8_t uuid[16]; /*!< Node device uuid */
} provisioner_delete_node_with_uuid_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_UUID_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_ADDR_COMP_EVT
*/
struct ble_mesh_provisioner_delete_node_with_addr_comp_data_comp_param {
struct ble_mesh_provisioner_delete_node_with_addr_comp_param {
int err_code; /*!< Indicate the result of deleting node with unicast address by the Provisioner */
uint16_t unicast_addr; /*!< Node unicast address */
} provisioner_delete_node_with_addr_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_DELETE_NODE_WITH_ADDR_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_ENABLE_HEARTBEAT_RECV_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of enabling/disabling to receive heartbeat messages by the Provisioner */
bool enable; /*!< Indicate enabling or disabling receiving heartbeat messages */
} provisioner_enable_heartbeat_recv_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_ENABLE_HEARTBEAT_RECV_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_TYPE_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of setting the heartbeat filter type by the Provisioner */
uint8_t type; /*!< Type of the filter used for receiving heartbeat messages */
} provisioner_set_heartbeat_filter_type_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_TYPE_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_INFO_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of setting the heartbeat filter address by the Provisioner */
uint8_t op; /*!< Operation (add, remove, clean) */
uint16_t hb_src; /*!< Heartbeat source address */
uint16_t hb_dst; /*!< Heartbeat destination address */
} provisioner_set_heartbeat_filter_info_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_INFO_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_RECV_HEARTBEAT_MESSAGE_EVT
*/
struct {
uint16_t hb_src; /*!< Heartbeat source address */
uint16_t hb_dst; /*!< Heartbeat destination address */
uint8_t init_ttl; /*!< Heartbeat InitTTL */
uint8_t rx_ttl; /*!< Heartbeat RxTTL */
uint8_t hops; /*!< Heartbeat hops (InitTTL - RxTTL + 1) */
uint16_t feature; /*!< Bit field of currently active features of the node */
int8_t rssi; /*!< RSSI of the heartbeat message */
} provisioner_recv_heartbeat; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_RECV_HEARTBEAT_MESSAGE_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of directly erasing settings by the Provisioner */
} provisioner_direct_erase_settings_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_INDEX_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of opening settings with index by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
} provisioner_open_settings_with_index_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_INDEX_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_UID_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of opening settings with user id by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
char uid[ESP_BLE_MESH_SETTINGS_UID_SIZE + 1]; /*!< Provisioner settings user id */
} provisioner_open_settings_with_uid_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_UID_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_INDEX_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of closing settings with index by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
} provisioner_close_settings_with_index_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_INDEX_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_UID_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of closing settings with user id by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
char uid[ESP_BLE_MESH_SETTINGS_UID_SIZE + 1]; /*!< Provisioner settings user id */
} provisioner_close_settings_with_uid_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_UID_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_INDEX_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of deleting settings with index by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
} provisioner_delete_settings_with_index_comp; /*!< Event parameter of ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_INDEX_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_UID_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of deleting settings with user id by the Provisioner */
uint8_t index; /*!< Index of Provisioner settings */
char uid[ESP_BLE_MESH_SETTINGS_UID_SIZE + 1]; /*!< Provisioner settings user id */
} provisioner_delete_settings_with_uid_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_DELETE_SETTINGS_WITH_UID_COMP_EVT */
/**
* @brief ESP_BLE_MESH_SET_FAST_PROV_INFO_COMP_EVT
*/
@ -1313,19 +1478,25 @@ typedef union {
uint16_t net_idx; /*!< Corresponding NetKey Index */
} proxy_client_remove_filter_addr_comp; /*!< Event parameter of ESP_BLE_MESH_PROXY_CLIENT_REMOVE_FILTER_ADDR_COMP_EVT */
/**
* @brief ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT
* @brief ESP_BLE_MESH_MODEL_SUBSCRIBE_GROUP_ADDR_COMP_EVT
*/
struct ble_mesh_start_ble_advertising_comp_param {
int err_code; /*!< Indicate the result of starting BLE advertising */
uint8_t index; /*!< Index of the BLE advertising */
} start_ble_advertising_comp; /*!< Event parameter of ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT */
struct ble_mesh_model_sub_group_addr_comp_param {
int err_code; /*!< Indicate the result of local model subscribing group address */
uint16_t element_addr; /*!< Element address */
uint16_t company_id; /*!< Company ID */
uint16_t model_id; /*!< Model ID */
uint16_t group_addr; /*!< Group Address */
} model_sub_group_addr_comp; /*!< Event parameters of ESP_BLE_MESH_MODEL_SUBSCRIBE_GROUP_ADDR_COMP_EVT */
/**
* @brief ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT
* @brief ESP_BLE_MESH_MODEL_UNSUBSCRIBE_GROUP_ADDR_COMP_EVT
*/
struct ble_mesh_stop_ble_advertising_comp_param {
int err_code; /*!< Indicate the result of stopping BLE advertising */
uint8_t index; /*!< Index of the BLE advertising */
} stop_ble_advertising_comp; /*!< Event parameter of ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT */
struct ble_mesh_model_unsub_group_addr_comp_param {
int err_code; /*!< Indicate the result of local model unsubscribing group address */
uint16_t element_addr; /*!< Element address */
uint16_t company_id; /*!< Company ID */
uint16_t model_id; /*!< Model ID */
uint16_t group_addr; /*!< Group Address */
} model_unsub_group_addr_comp; /*!< Event parameters of ESP_BLE_MESH_MODEL_UNSUBSCRIBE_GROUP_ADDR_COMP_EVT */
/**
* @brief ESP_BLE_MESH_DEINIT_MESH_COMP_EVT
*/
@ -1929,8 +2100,8 @@ typedef struct {
int64_t timestamp; /*!< Time when the last message is received */
} esp_ble_mesh_last_msg_info_t;
#define ESP_BLE_MESH_SERVER_RSP_BY_APP 0 /*!< Response will be sent internally */
#define ESP_BLE_MESH_SERVER_AUTO_RSP 1 /*!< Response need to be sent in the application */
#define ESP_BLE_MESH_SERVER_RSP_BY_APP 0 /*!< Response need to be sent in the application */
#define ESP_BLE_MESH_SERVER_AUTO_RSP 1 /*!< Response will be sent internally */
/** Parameters of the Server Model response control */
typedef struct {
@ -1983,6 +2154,11 @@ typedef union {
uint16_t temperature; /*!< The value of the Light CTL Temperature state */
int16_t delta_uv; /*!< The value of the Light CTL Delta UV state */
} light_ctl_temp_delta_uv; /*!< The Light CTL Temperature & Delta UV states */
struct {
uint16_t lightness; /*!< The value of the Light HSL Lightness state */
uint16_t hue; /*!< The value of the Light HSL Hue state */
uint16_t saturation; /*!< The value of the Light HSL Saturation state */
} light_hsl; /*!< The Light HSL composite state */
struct {
uint16_t lightness; /*!< The value of the Light HSL Lightness state */
} light_hsl_lightness; /*!< The Light HSL Lightness state */
@ -2010,6 +2186,7 @@ typedef enum {
ESP_BLE_MESH_LIGHT_LIGHTNESS_LINEAR_STATE,
ESP_BLE_MESH_LIGHT_CTL_LIGHTNESS_STATE,
ESP_BLE_MESH_LIGHT_CTL_TEMP_DELTA_UV_STATE,
ESP_BLE_MESH_LIGHT_HSL_STATE,
ESP_BLE_MESH_LIGHT_HSL_LIGHTNESS_STATE,
ESP_BLE_MESH_LIGHT_HSL_HUE_STATE,
ESP_BLE_MESH_LIGHT_HSL_SATURATION_STATE,

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_config_model.h"
#include "esp_ble_mesh_config_model_api.h"
#if CONFIG_BLE_MESH_CFG_CLI
esp_err_t esp_ble_mesh_register_config_client_callback(esp_ble_mesh_cfg_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -26,13 +27,6 @@ esp_err_t esp_ble_mesh_register_config_client_callback(esp_ble_mesh_cfg_client_c
return (btc_profile_cb_set(BTC_PID_CONFIG_CLIENT, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_register_config_server_callback(esp_ble_mesh_cfg_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_CONFIG_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
static bool config_client_get_need_param(esp_ble_mesh_opcode_t opcode)
{
switch (opcode) {
@ -53,13 +47,15 @@ static bool config_client_get_need_param(esp_ble_mesh_opcode_t opcode)
}
esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_cfg_client_get_state_t *get_state)
esp_ble_mesh_cfg_client_get_state_t *get_state)
{
btc_ble_mesh_config_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !ESP_BLE_MESH_ADDR_IS_UNICAST(params->ctx.addr) ||
(config_client_get_need_param(params->opcode) && !get_state)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
!ESP_BLE_MESH_ADDR_IS_UNICAST(params->ctx.addr) ||
(config_client_get_need_param(params->opcode) && get_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -71,18 +67,20 @@ esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_
arg.cfg_client_get_state.params = params;
arg.cfg_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_cfg_client_set_state_t *set_state)
esp_ble_mesh_cfg_client_set_state_t *set_state)
{
btc_ble_mesh_config_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !ESP_BLE_MESH_ADDR_IS_UNICAST(params->ctx.addr) ||
(params->opcode != ESP_BLE_MESH_MODEL_OP_NODE_RESET && !set_state)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
!ESP_BLE_MESH_ADDR_IS_UNICAST(params->ctx.addr) ||
(params->opcode != ESP_BLE_MESH_MODEL_OP_NODE_RESET && set_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -94,6 +92,14 @@ esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_
arg.cfg_client_set_state.params = params;
arg.cfg_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_CFG_CLI */
esp_err_t esp_ble_mesh_register_config_server_callback(esp_ble_mesh_cfg_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_CONFIG_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_generic_model.h"
#include "esp_ble_mesh_generic_model_api.h"
#if CONFIG_BLE_MESH_GENERIC_CLIENT
esp_err_t esp_ble_mesh_register_generic_client_callback(esp_ble_mesh_generic_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -40,13 +41,16 @@ static bool generic_client_get_need_param(esp_ble_mesh_opcode_t opcode)
}
esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_generic_client_get_state_t *get_state)
esp_ble_mesh_generic_client_get_state_t *get_state)
{
btc_ble_mesh_generic_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr ||
(generic_client_get_need_param(params->opcode) && !get_state)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED ||
(generic_client_get_need_param(params->opcode) && get_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -58,17 +62,20 @@ esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param
arg.generic_client_get_state.params = params;
arg.generic_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_generic_client_set_state_t *set_state)
esp_ble_mesh_generic_client_set_state_t *set_state)
{
btc_ble_mesh_generic_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !set_state) {
if (params == NULL || params->model == NULL || set_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -80,13 +87,16 @@ esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param
arg.generic_client_set_state.params = params;
arg.generic_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_GENERIC_CLIENT */
#if CONFIG_BLE_MESH_GENERIC_SERVER
esp_err_t esp_ble_mesh_register_generic_server_callback(esp_ble_mesh_generic_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_GENERIC_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_GENERIC_SERVER */

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_health_model.h"
#include "esp_ble_mesh_health_model_api.h"
#if CONFIG_BLE_MESH_HEALTH_CLI
esp_err_t esp_ble_mesh_register_health_client_callback(esp_ble_mesh_health_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -26,21 +27,17 @@ esp_err_t esp_ble_mesh_register_health_client_callback(esp_ble_mesh_health_clien
return (btc_profile_cb_set(BTC_PID_HEALTH_CLIENT, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_register_health_server_callback(esp_ble_mesh_health_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_HEALTH_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_health_client_get_state_t *get_state)
esp_ble_mesh_health_client_get_state_t *get_state)
{
btc_ble_mesh_health_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || (!get_state &&
params->opcode == ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_GET)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED ||
(params->opcode == ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_GET && get_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -52,17 +49,20 @@ esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_
arg.health_client_get_state.params = params;
arg.health_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_health_client_set_state_t *set_state)
esp_ble_mesh_health_client_set_state_t *set_state)
{
btc_ble_mesh_health_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !set_state) {
if (params == NULL || params->model == NULL || set_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -74,8 +74,17 @@ esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_
arg.health_client_set_state.params = params;
arg.health_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_HEALTH_CLI */
#if CONFIG_BLE_MESH_HEALTH_SRV
esp_err_t esp_ble_mesh_register_health_server_callback(esp_ble_mesh_health_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_HEALTH_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_health_server_fault_update(esp_ble_mesh_elem_t *element)
@ -94,6 +103,7 @@ esp_err_t esp_ble_mesh_health_server_fault_update(esp_ble_mesh_elem_t *element)
msg.act = BTC_BLE_MESH_ACT_HEALTH_SERVER_FAULT_UPDATE;
arg.health_fault_update.element = element;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_HEALTH_SRV */

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_lighting_model.h"
#include "esp_ble_mesh_lighting_model_api.h"
#if CONFIG_BLE_MESH_LIGHTING_CLIENT
esp_err_t esp_ble_mesh_register_light_client_callback(esp_ble_mesh_light_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -27,13 +28,16 @@ esp_err_t esp_ble_mesh_register_light_client_callback(esp_ble_mesh_light_client_
}
esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_get_state_t *get_state)
esp_ble_mesh_light_client_get_state_t *get_state)
{
btc_ble_mesh_lighting_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || (!get_state &&
params->opcode == ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_GET)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED ||
(params->opcode == ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_GET && get_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -45,17 +49,20 @@ esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t
arg.light_client_get_state.params = params;
arg.light_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy,
btc_ble_mesh_lighting_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_set_state_t *set_state)
esp_ble_mesh_light_client_set_state_t *set_state)
{
btc_ble_mesh_lighting_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !set_state) {
if (params == NULL || params->model == NULL || set_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -67,13 +74,16 @@ esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t
arg.light_client_set_state.params = params;
arg.light_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy,
btc_ble_mesh_lighting_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_LIGHTING_CLIENT */
#if CONFIG_BLE_MESH_LIGHTING_SERVER
esp_err_t esp_ble_mesh_register_lighting_server_callback(esp_ble_mesh_lighting_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_LIGHTING_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_LIGHTING_SERVER */

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_sensor_model.h"
#include "esp_ble_mesh_sensor_model_api.h"
#if CONFIG_BLE_MESH_SENSOR_CLI
esp_err_t esp_ble_mesh_register_sensor_client_callback(esp_ble_mesh_sensor_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -27,12 +28,15 @@ esp_err_t esp_ble_mesh_register_sensor_client_callback(esp_ble_mesh_sensor_clien
}
esp_err_t esp_ble_mesh_sensor_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_sensor_client_get_state_t *get_state)
esp_ble_mesh_sensor_client_get_state_t *get_state)
{
btc_ble_mesh_sensor_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !get_state) {
if (params == NULL || params->model == NULL || get_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -44,17 +48,20 @@ esp_err_t esp_ble_mesh_sensor_client_get_state(esp_ble_mesh_client_common_param_
arg.sensor_client_get_state.params = params;
arg.sensor_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy,
btc_ble_mesh_sensor_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_sensor_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_sensor_client_set_state_t *set_state)
esp_ble_mesh_sensor_client_set_state_t *set_state)
{
btc_ble_mesh_sensor_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !set_state) {
if (params == NULL || params->model == NULL || set_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -66,15 +73,16 @@ esp_err_t esp_ble_mesh_sensor_client_set_state(esp_ble_mesh_client_common_param_
arg.sensor_client_set_state.params = params;
arg.sensor_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy,
btc_ble_mesh_sensor_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SENSOR_CLI */
#if CONFIG_BLE_MESH_SENSOR_SERVER
esp_err_t esp_ble_mesh_register_sensor_server_callback(esp_ble_mesh_sensor_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_SENSOR_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SENSOR_SERVER */

View File

@ -19,6 +19,7 @@
#include "btc_ble_mesh_time_scene_model.h"
#include "esp_ble_mesh_time_scene_model_api.h"
#if CONFIG_BLE_MESH_TIME_SCENE_CLIENT
esp_err_t esp_ble_mesh_register_time_scene_client_callback(esp_ble_mesh_time_scene_client_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
@ -27,13 +28,16 @@ esp_err_t esp_ble_mesh_register_time_scene_client_callback(esp_ble_mesh_time_sce
}
esp_err_t esp_ble_mesh_time_scene_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_time_scene_client_get_state_t *get_state)
esp_ble_mesh_time_scene_client_get_state_t *get_state)
{
btc_ble_mesh_time_scene_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || (!get_state &&
params->opcode == ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_GET)) {
if (params == NULL || params->model == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED ||
(params->opcode == ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_GET && get_state == NULL)) {
return ESP_ERR_INVALID_ARG;
}
@ -45,17 +49,20 @@ esp_err_t esp_ble_mesh_time_scene_client_get_state(esp_ble_mesh_client_common_pa
arg.time_scene_client_get_state.params = params;
arg.time_scene_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy,
btc_ble_mesh_time_scene_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_time_scene_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_time_scene_client_set_state_t *set_state)
esp_ble_mesh_time_scene_client_set_state_t *set_state)
{
btc_ble_mesh_time_scene_client_args_t arg = {0};
btc_msg_t msg = {0};
if (!params || !params->model || !params->ctx.addr || !set_state) {
if (params == NULL || params->model == NULL || set_state == NULL ||
params->ctx.net_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.app_idx == ESP_BLE_MESH_KEY_UNUSED ||
params->ctx.addr == ESP_BLE_MESH_ADDR_UNASSIGNED) {
return ESP_ERR_INVALID_ARG;
}
@ -67,14 +74,16 @@ esp_err_t esp_ble_mesh_time_scene_client_set_state(esp_ble_mesh_client_common_pa
arg.time_scene_client_set_state.params = params;
arg.time_scene_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy,
btc_ble_mesh_time_scene_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_TIME_SCENE_CLIENT */
#if CONFIG_BLE_MESH_TIME_SCENE_SERVER
esp_err_t esp_ble_mesh_register_time_scene_server_callback(esp_ble_mesh_time_scene_server_cb_t callback)
{
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
return (btc_profile_cb_set(BTC_PID_TIME_SCENE_SERVER, callback) == 0 ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_TIME_SCENE_SERVER */

View File

@ -756,7 +756,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_cfg_client_cb_t)(esp_ble_mesh_cfg_client_cb_event_t event,
esp_ble_mesh_cfg_client_cb_param_t *param);
esp_ble_mesh_cfg_client_cb_param_t *param);
/**
* @brief Configuration Server Model callback function type
@ -764,7 +764,7 @@ typedef void (* esp_ble_mesh_cfg_client_cb_t)(esp_ble_mesh_cfg_client_cb_event_t
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_cfg_server_cb_t)(esp_ble_mesh_cfg_server_cb_event_t event,
esp_ble_mesh_cfg_server_cb_param_t *param);
esp_ble_mesh_cfg_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Config Client Model callback.
@ -800,7 +800,7 @@ esp_err_t esp_ble_mesh_register_config_server_callback(esp_ble_mesh_cfg_server_c
*
*/
esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_cfg_client_get_state_t *get_state);
esp_ble_mesh_cfg_client_get_state_t *get_state);
/**
* @brief Set the value of the Configuration Server Model states using the Config Client Model set messages.
@ -816,7 +816,7 @@ esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_
*
*/
esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_cfg_client_set_state_t *set_state);
esp_ble_mesh_cfg_client_set_state_t *set_state);
#ifdef __cplusplus
}

View File

@ -367,10 +367,10 @@ typedef struct {
/** Parameters of Generic Battery Status. */
typedef struct {
u32_t battery_level : 8; /*!< Value of Generic Battery Level state */
u32_t time_to_discharge : 24; /*!< Value of Generic Battery Time to Discharge state */
u32_t time_to_charge : 24; /*!< Value of Generic Battery Time to Charge state */
u32_t flags : 8; /*!< Value of Generic Battery Flags state */
uint32_t battery_level : 8; /*!< Value of Generic Battery Level state */
uint32_t time_to_discharge : 24; /*!< Value of Generic Battery Time to Discharge state */
uint32_t time_to_charge : 24; /*!< Value of Generic Battery Time to Charge state */
uint32_t flags : 8; /*!< Value of Generic Battery Flags state */
} esp_ble_mesh_gen_battery_status_cb_t;
/** Parameters of Generic Location Global Status. */
@ -483,7 +483,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_generic_client_cb_t)(esp_ble_mesh_generic_client_cb_event_t event,
esp_ble_mesh_generic_client_cb_param_t *param);
esp_ble_mesh_generic_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Generic Client Model callback.
@ -509,7 +509,7 @@ esp_err_t esp_ble_mesh_register_generic_client_callback(esp_ble_mesh_generic_cli
*
*/
esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_generic_client_get_state_t *get_state);
esp_ble_mesh_generic_client_get_state_t *get_state);
/**
* @brief Set the value of Generic Server Model states using the Generic Client Model set messages.
@ -525,7 +525,7 @@ esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param
*
*/
esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_generic_client_set_state_t *set_state);
esp_ble_mesh_generic_client_set_state_t *set_state);
/**
* @brief Generic Server Models related context.
@ -1285,7 +1285,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_generic_server_cb_t)(esp_ble_mesh_generic_server_cb_event_t event,
esp_ble_mesh_generic_server_cb_param_t *param);
esp_ble_mesh_generic_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Generic Server Model callback.

View File

@ -335,7 +335,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_health_client_cb_t)(esp_ble_mesh_health_client_cb_event_t event,
esp_ble_mesh_health_client_cb_param_t *param);
esp_ble_mesh_health_client_cb_param_t *param);
/**
* @brief Health Server Model callback function type
@ -343,7 +343,7 @@ typedef void (* esp_ble_mesh_health_client_cb_t)(esp_ble_mesh_health_client_cb_e
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_health_server_cb_t)(esp_ble_mesh_health_server_cb_event_t event,
esp_ble_mesh_health_server_cb_param_t *param);
esp_ble_mesh_health_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Health Model callback, the callback will report Health Client & Server Model events.
@ -379,7 +379,7 @@ esp_err_t esp_ble_mesh_register_health_server_callback(esp_ble_mesh_health_serve
*
*/
esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_health_client_get_state_t *get_state);
esp_ble_mesh_health_client_get_state_t *get_state);
/**
* @brief This function is called to set the Health Server states using the Health Client Model set messages.
@ -395,7 +395,7 @@ esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_
*
*/
esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_health_client_set_state_t *set_state);
esp_ble_mesh_health_client_set_state_t *set_state);
/**
* @brief This function is called by the Health Server Model to update the context of its Health Current status.

View File

@ -539,7 +539,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_light_client_cb_t)(esp_ble_mesh_light_client_cb_event_t event,
esp_ble_mesh_light_client_cb_param_t *param);
esp_ble_mesh_light_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Light Client Model callback.
@ -565,7 +565,7 @@ esp_err_t esp_ble_mesh_register_light_client_callback(esp_ble_mesh_light_client_
*
*/
esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_get_state_t *get_state);
esp_ble_mesh_light_client_get_state_t *get_state);
/**
* @brief Set the value of Light Server Model states using the Light Client Model set messages.
@ -581,7 +581,7 @@ esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t
*
*/
esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_set_state_t *set_state);
esp_ble_mesh_light_client_set_state_t *set_state);
/**
* @brief Lighting Server Models related context.
@ -1663,7 +1663,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_lighting_server_cb_t)(esp_ble_mesh_lighting_server_cb_event_t event,
esp_ble_mesh_lighting_server_cb_param_t *param);
esp_ble_mesh_lighting_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Lighting Server Model callback.

View File

@ -215,7 +215,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_sensor_client_cb_t)(esp_ble_mesh_sensor_client_cb_event_t event,
esp_ble_mesh_sensor_client_cb_param_t *param);
esp_ble_mesh_sensor_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Sensor Client Model callback.
@ -241,7 +241,7 @@ esp_err_t esp_ble_mesh_register_sensor_client_callback(esp_ble_mesh_sensor_clien
*
*/
esp_err_t esp_ble_mesh_sensor_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_sensor_client_get_state_t *get_state);
esp_ble_mesh_sensor_client_get_state_t *get_state);
/**
* @brief Set the value of Sensor Server Model states using the Sensor Client Model set messages.
@ -257,7 +257,7 @@ esp_err_t esp_ble_mesh_sensor_client_get_state(esp_ble_mesh_client_common_param_
*
*/
esp_err_t esp_ble_mesh_sensor_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_sensor_client_set_state_t *set_state);
esp_ble_mesh_sensor_client_set_state_t *set_state);
/**
* @brief Sensor Server Models related context.
@ -698,7 +698,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_sensor_server_cb_t)(esp_ble_mesh_sensor_server_cb_event_t event,
esp_ble_mesh_sensor_server_cb_param_t *param);
esp_ble_mesh_sensor_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Sensor Server Model callback.

View File

@ -276,7 +276,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_time_scene_client_cb_t)(esp_ble_mesh_time_scene_client_cb_event_t event,
esp_ble_mesh_time_scene_client_cb_param_t *param);
esp_ble_mesh_time_scene_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Time Scene Client Model callback.
@ -301,7 +301,7 @@ esp_err_t esp_ble_mesh_register_time_scene_client_callback(esp_ble_mesh_time_sce
* @return ESP_OK on success or error code otherwise.
*/
esp_err_t esp_ble_mesh_time_scene_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_time_scene_client_get_state_t *get_state);
esp_ble_mesh_time_scene_client_get_state_t *get_state);
/**
* @brief Set the value of Time Scene Server Model states using the Time Scene Client Model set messages.
@ -316,7 +316,7 @@ esp_err_t esp_ble_mesh_time_scene_client_get_state(esp_ble_mesh_client_common_pa
* @return ESP_OK on success or error code otherwise.
*/
esp_err_t esp_ble_mesh_time_scene_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_time_scene_client_set_state_t *set_state);
esp_ble_mesh_time_scene_client_set_state_t *set_state);
/**
* @brief Time Scene Server Models related context.
@ -900,7 +900,7 @@ typedef enum {
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_time_scene_server_cb_t)(esp_ble_mesh_time_scene_server_cb_event_t event,
esp_ble_mesh_time_scene_server_cb_param_t *param);
esp_ble_mesh_time_scene_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Time and Scenes Server Model callback.

View File

@ -0,0 +1,203 @@
// Copyright 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.
#include <stdint.h>
#include <string.h>
#include "btc_ble_mesh_ble.h"
#include "adv.h"
#include "scan.h"
#include "mesh_bearer_adapt.h"
#include "esp_ble_mesh_ble_api.h"
#if CONFIG_BLE_MESH_BLE_COEX_SUPPORT
static void btc_ble_mesh_ble_copy_req_data(btc_msg_t *msg, void *p_dst, void *p_src)
{
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
esp_ble_mesh_ble_cb_param_t *p_dst_data = (esp_ble_mesh_ble_cb_param_t *)p_dst;
esp_ble_mesh_ble_cb_param_t *p_src_data = (esp_ble_mesh_ble_cb_param_t *)p_src;
if (!msg || !p_src_data || !p_dst_data) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
switch (msg->act) {
case ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT:
if (p_src_data->scan_ble_adv_pkt.data && p_src_data->scan_ble_adv_pkt.length) {
p_dst_data->scan_ble_adv_pkt.length = p_src_data->scan_ble_adv_pkt.length;
p_dst_data->scan_ble_adv_pkt.data = bt_mesh_calloc(p_src_data->scan_ble_adv_pkt.length);
if (p_dst_data->scan_ble_adv_pkt.data) {
memcpy(p_dst_data->scan_ble_adv_pkt.data, p_src_data->scan_ble_adv_pkt.data,
p_src_data->scan_ble_adv_pkt.length);
} else {
BT_ERR("%s, Out of memory, act %d", __func__, msg->act);
}
}
break;
default:
break;
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */
}
static void btc_ble_mesh_ble_free_req_data(btc_msg_t *msg)
{
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
esp_ble_mesh_ble_cb_param_t *arg = NULL;
if (!msg || !msg->arg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
arg = (esp_ble_mesh_ble_cb_param_t *)msg->arg;
switch (msg->act) {
case ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT:
if (arg->scan_ble_adv_pkt.data) {
bt_mesh_free(arg->scan_ble_adv_pkt.data);
}
break;
default:
break;
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */
}
static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, uint8_t act)
{
btc_msg_t msg = {0};
/* If corresponding callback is not registered, event will not be posted. */
if (!btc_profile_cb_get(BTC_PID_BLE_MESH_BLE_COEX)) {
return;
}
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = act;
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t),
btc_ble_mesh_ble_copy_req_data, btc_ble_mesh_ble_free_req_data);
}
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
void bt_mesh_ble_scan_cb_evt_to_btc(const bt_mesh_addr_t *addr,
uint8_t adv_type, uint8_t data[],
uint16_t length, int8_t rssi)
{
esp_ble_mesh_ble_cb_param_t param = {0};
if (addr == NULL) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
memcpy(param.scan_ble_adv_pkt.addr, addr->val, sizeof(addr->val));
param.scan_ble_adv_pkt.addr_type = addr->type;
if (data && length) {
param.scan_ble_adv_pkt.data = data;
param.scan_ble_adv_pkt.length = length;
}
param.scan_ble_adv_pkt.adv_type = adv_type;
param.scan_ble_adv_pkt.rssi = rssi;
btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */
void btc_ble_mesh_ble_call_handler(btc_msg_t *msg)
{
esp_ble_mesh_ble_cb_param_t param = {0};
btc_ble_mesh_ble_args_t *arg = NULL;
if (!msg || !msg->arg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
arg = (btc_ble_mesh_ble_args_t *)msg->arg;
switch (msg->act) {
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
case BTC_BLE_MESH_ACT_START_BLE_ADV: {
struct bt_mesh_ble_adv_param *set = (struct bt_mesh_ble_adv_param *)&arg->start_ble_adv.param;
struct bt_mesh_ble_adv_data *data = NULL;
if (arg->start_ble_adv.data.adv_data_len || arg->start_ble_adv.data.scan_rsp_data_len) {
data = (struct bt_mesh_ble_adv_data *)&arg->start_ble_adv.data;
}
param.start_ble_advertising_comp.err_code =
bt_mesh_start_ble_advertising(set, data, &param.start_ble_advertising_comp.index);
btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT);
break;
}
case BTC_BLE_MESH_ACT_STOP_BLE_ADV:
param.stop_ble_advertising_comp.index = arg->stop_ble_adv.index;
param.stop_ble_advertising_comp.err_code =
bt_mesh_stop_ble_advertising(arg->stop_ble_adv.index);
btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT);
break;
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
case BTC_BLE_MESH_ACT_START_BLE_SCAN:
param.start_ble_scan_comp.err_code =
bt_mesh_start_ble_scan((struct bt_mesh_ble_scan_param *)&arg->start_ble_scan.param);
btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_START_BLE_SCANNING_COMP_EVT);
break;
case BTC_BLE_MESH_ACT_STOP_BLE_SCAN:
param.stop_ble_scan_comp.err_code = bt_mesh_stop_ble_scan();
btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_STOP_BLE_SCANNING_COMP_EVT);
break;
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */
default:
return;
}
}
static inline void btc_ble_mesh_ble_cb_to_app(esp_ble_mesh_ble_cb_event_t event,
esp_ble_mesh_ble_cb_param_t *param)
{
esp_ble_mesh_ble_cb_t btc_ble_mesh_cb =
(esp_ble_mesh_ble_cb_t)btc_profile_cb_get(BTC_PID_BLE_MESH_BLE_COEX);
if (btc_ble_mesh_cb) {
btc_ble_mesh_cb(event, param);
}
}
void btc_ble_mesh_ble_cb_handler(btc_msg_t *msg)
{
esp_ble_mesh_ble_cb_param_t *param = NULL;
if (!msg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
param = (esp_ble_mesh_ble_cb_param_t *)msg->arg;
if (msg->act < ESP_BLE_MESH_BLE_EVT_MAX) {
btc_ble_mesh_ble_cb_to_app(msg->act, param);
} else {
BT_ERR("%s, Unknown act %d", __func__, msg->act);
}
btc_ble_mesh_ble_free_req_data(msg);
}
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */

Some files were not shown because too many files have changed in this diff Show More