Commit Graph

13931 Commits

Author SHA1 Message Date
tgotic
f738750ae6 [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:59:04 +08:00
Jin Cheng
3f27363753 Corrects header names in string from "bt.h" to "esp_bt.h". 2022-10-21 13:15:44 +08:00
xiongweichao
65d3c54c19 bt: Fixed esp_spp_write() crash when len is 0
Closes https://github.com/espressif/esp-idf/issues/9977
2022-10-21 11:33:37 +08:00
Jiang Jiang Jian
0736faff89 Merge branch 'bugfix/fix_sta_scan_when_already_connected_v4.1' into 'release/v4.1'
esp-wifi: Restores station status to connected when no other AP is found for roam

See merge request espressif/esp-idf!20391
2022-10-21 10:46:35 +08:00
Fu Hanxi
514a6f8589 ci: support one pipeline must based on commmits 2022-10-20 12:46:03 +00:00
Jiang Jiang Jian
bbfca2c729 Merge branch 'bugfix/revert_commit_da44fc9c_v4.1' into 'release/v4.1'
Revert "fixed the issue iOS devices cannot initiate connection" (v4.1)

See merge request espressif/esp-idf!20669
2022-10-20 19:19:04 +08:00
Island
e51646aff0 Merge branch 'feature/Add_IVI_recovery_option_v4.1' into 'release/v4.1'
ble_mesh: stack: Add IV index recovery option when device missed the whole IV update(v4.1)

See merge request espressif/esp-idf!20645
2022-10-20 16:43:03 +08:00
Island
3ab621c0a3 Merge branch 'bugfix/fix_fast_interval_prov_adv_v4.1' into 'release/v4.1'
ble_mesh: stack: Fix send fast interval prov_adv failed(v4.1)

See merge request espressif/esp-idf!20636
2022-10-20 16:42:11 +08:00
Michael (XIAO Xufeng)
29b807713b Merge branch 'feat/epi_flash_api_iram_save_4.1' into 'release/v4.1'
spi_flash: partially move API functions out of IRAM (v4.1)

See merge request espressif/esp-idf!18477
2022-10-19 03:32:10 +08:00
Jin Cheng
87ca734e48 Revert "fixed the issue iOS devices cannot initiate connection"
This reverts commit da44fc9cbe.
2022-10-18 19:46:19 +08:00
Michael (XIAO Xufeng)
3f09c2abc9 bootloader: support unlock MXIC flash chips 2022-10-17 19:15:25 +08:00
Cao Sen Miao
dda13f88ea spi_flash: move the unlock patch to bootloader and add support for GD 2022-10-17 19:15:25 +08:00
Michael (XIAO Xufeng)
fa18296c32 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-10-17 19:15:25 +08:00
Michael (XIAO Xufeng)
bab633cf9e bootloader: add xmc spi_flash startup flow to improve reliability 2022-10-17 19:15:25 +08:00
Michael (XIAO Xufeng)
eba6f019ef bootloader: create public bootloader_flash.h header
Move non-public functions into bootloader_flash_priv.h header
2022-10-17 19:15:25 +08:00
Michael (XIAO Xufeng)
d2f9113d14 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-10-17 19:15:25 +08:00
Michael (XIAO Xufeng)
740b961bb1 test_spiffs: increase test case stack size 2022-10-17 19:15:24 +08:00
Michael (XIAO Xufeng)
61989e0fbb spi_flash: partially move API functions out of IRAM 2022-10-17 19:15:24 +08:00
wangjialiang
eab26282ce ble_mesh: stack: Add IV index recovery option when device missed the whole IV update 2022-10-17 16:55:46 +08:00
wangjialiang
11bd23d67e ble_mesh: stack: Fix send fast interval prov_adv failed when PB-ADV and PB-GATT enable simultaneously 2022-10-17 16:41:12 +08:00
Roland Dobai
56dff0beae Merge branch 'fix/virtualenv_dir_v4.1' into 'release/v4.1'
Tools: Keep making virtual environments with python in the bin directory (v4.1)

See merge request espressif/esp-idf!20622
2022-10-17 01:04:54 +08:00
Roland Dobai
e4d57fa1fa 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:38:24 +02:00
Michael (XIAO Xufeng)
c5dfaec6b3 Merge branch 'feat/essl_extra_component_v4.1' into 'release/v4.1'
sdio/example: fixed the essl return value issue (v4.1)

See merge request espressif/esp-idf!20348
2022-10-14 16:19:41 +08:00
morris
5bf01cedf6 Merge branch 'bugfix/fix_rtc8m_calibration_fail_after_cpu_core_reset_v4.1' into 'release/v4.1'
rtc_clk: Fix rtc8m calibration failure after cpu/core reset (backport v4.1)

See merge request espressif/esp-idf!20556
2022-10-14 14:07:20 +08:00
Song Ruo Jing
ed3a570e20 rtc_clk: Fix rtc8m calibration failure after cpu/core reset
Explicitly guarantee 8md256 clk is enabled before calibration
2022-10-12 12:46:41 +08:00
Wang Meng Yang
40cc53b0e0 Merge branch 'bugfix/a2dp_can_not_connect_after_ble_connected_v4.1' into 'release/v4.1'
fixed the issue iOS devices cannot initiate connection (v4.1)

See merge request espressif/esp-idf!20407
2022-10-10 17:25:46 +08:00
morris
63ac426644 Merge branch 'feature/modbus_master_fix_check_uart_set_pin_v41' into 'release/v4.1'
example/modbus_master: fix the assert for uart_set_pin (backport v4.1)

See merge request espressif/esp-idf!17627
2022-10-08 19:08:14 +08:00
Alex Lisitsyn
b17494c223 example/modbus_master: fix the assert for uart_set_pin (backport v4.1) 2022-10-08 19:08:14 +08:00
Wang Meng Yang
63cdcf3f57 Merge branch 'bugfix/fix_ble_get_cur_pkt_num_crash_sometimes_when_bluetooth_is_disconnecting_v4.1' into 'release/v4.1'
Fixed calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting(backport v4.1)

See merge request espressif/esp-idf!20380
2022-10-08 16:35:55 +08:00
David Čermák
3f3cd01ef6 Merge branch 'bugfix/fix_mdns_example_v4.1' into 'release/v4.1'
mDNS: Improve example test stability (v4.1)

See merge request espressif/esp-idf!20215
2022-09-30 21:00:57 +08:00
Suren Gabrielyan
4a432e03b1 mDNS: Improved example test stability 2022-09-28 18:23:15 +04:00
Jin Cheng
11bd663e9e 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:45 +08:00
Yuan Hong Hui
4f424a6722 ble_mesh:example:change the method of get model 2022-09-28 15:37:11 +08:00
jgujarathi
45ce744c54 esp-wifi: Restores station status to connected when no other AP is found for roam 2022-09-28 12:26:48 +05:30
cjin
b70ffe519f fix on data len change cmd malfunction 2022-09-27 21:53:50 +08:00
cjin
284b77e6a5 fix err using rpa for confirmation calculation 2022-09-27 21:53:36 +08:00
zwj
615dcb4115 fix calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting 2022-09-27 21:53:23 +08:00
Michael (XIAO Xufeng)
43ec862944 sdio/example: fixed the essl return type issue 2022-09-26 19:43:03 +08:00
Island
85c878acc5 Merge branch 'bugfix/relay_friend_cred_message_v4.1' into 'release/v4.1'
ble_mesh: stack: Fix friend relay lpn message when relay disable(v4.1)

See merge request espressif/esp-idf!20207
2022-09-22 14:17:36 +08:00
Jiang Jiang Jian
7b0515c3ac Merge branch 'ci/optimize_ats_ci_flow_v4.1' into 'release/v4.1'
CI: optimize ATS ci flow (v4.1)

See merge request espressif/esp-idf!20181
2022-09-22 14:12:29 +08:00
Mahavir Jain
017852bc2d Merge branch 'bugfix/freertos_event_group_unblock_race_condition_v4.1' into 'release/v4.1'
FreeRTOS: Fix event group task list race condition (v4.1)

See merge request espressif/esp-idf!19106
2022-09-21 13:16:24 +08:00
wangjialiang
d2fcb15610 ble_mesh: stack: Fix friend relay lpn message when relay disable. 2022-09-21 03:37:41 +00:00
Island
26c7df9857 Merge branch 'bugfix/lpn_not_recv_message_to_all_node_4.1' into 'release/v4.1'
ble_mesh: stack: Add option for lpn auto sub all-nodes(v4.1)

See merge request espressif/esp-idf!20261
2022-09-21 11:31:17 +08:00
wangjialiang
ef45e12a40 ble_mesh: stack: Add option for lpn auto sub all-nodes. 2022-09-20 20:33:13 +08:00
Darian Leung
51eb9bea03 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-09-19 15:14:24 +08:00
Darian Leung
6358f93a51 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-09-19 15:14:24 +08:00
Island
0bb4b995be Merge branch 'bugfix/adapt_new_btc_v4.1' into 'release/v4.1'
ble_mesh: stack: Corrected parameter size when the btc_transfer_context is used (v4.1)

See merge request espressif/esp-idf!20169
2022-09-18 14:36:02 +08:00
Chen Yudong
5ad0ccea46 CI: optimize ATS ci flow 2022-09-16 16:37:15 +08:00
wangjialiang
6160cedbdc 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:03:22 +08:00
Jiang Jiang Jian
b4878a0f09 Merge branch 'bugfix/stack_init_changes_v4.1' into 'release/v4.1'
Nimble: Check stack initialization status before executing stack command (v4.1)

See merge request espressif/esp-idf!19946
2022-09-14 16:13:32 +08:00