Commit Graph

9489 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
xiongweichao c2411837d1 bt:Fixed sink not being able to output mono audio because it can only decode dual channel audio data 2022-09-09 17:49:00 +08:00
Wang Meng Yang 771e1cb020 Merge branch 'bugfix/remove_bt_dft_init_semicolon_v41' into 'release/v4.1'
bt: Remove trailing semicolon from bt dft initializer(v4.1)

See merge request espressif/esp-idf!19918
2022-09-07 12:00:48 +08:00
Rahul Tank 0c7f0058f2 Nimble: Check stack initialization status before executing stack command 2022-09-06 10:15:42 +05:30
xiongweichao 2df7bcbe0f Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable()
Closes https://github.com/espressif/esp-idf/issues/9672
2022-09-05 14:31:10 +08:00
Pedro 62f89a3303 Remove trailing semicolon from bt dft initializer
Similar to espressif#6554
2022-09-02 11:16:52 +08:00
tgotic ccb8b03ca5 update code to use osi_free() 2022-08-22 16:10:25 +08:00
tgotic 71c8b2ba80 local copy of btc_msg_t
No need to use local copy of btc_msg_t in btc_transfer_context, create it on heap and pass to osi_thread_post().
2022-08-22 16:10:25 +08:00
Jiang Jiang Jian e072b09196 Merge branch 'bugfix/fix_bluedroid_host_memory_overflow_v4.1' into 'release/v4.1'
Fixed bluedroid host memory overflow for v4.1

See merge request espressif/esp-idf!18906
2022-08-16 17:48:11 +08:00
wangjialiang e446ee2ea2 ble_mesh: stack: Fix kr from non-primary subnet shouldn't ignore
For case MESH/NODE/KR/BV-02-C
2022-08-11 14:19:20 +08:00
wangjialiang 6b3c88873e 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:19:15 +08:00
wangjialiang a53ebdf8a3 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:19:09 +08:00
wangjialiang 8a1325dab8 ble_mesh: stack: The Heartbeat Publication Period Log value can set to 0x11, range: [0, 0x11] 2022-08-11 14:19:04 +08:00
wangjialiang d3f6770665 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:18:58 +08:00
wangjialiang 0a39d9e154 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:18:54 +08:00
wangjialiang 9f073021da ble_mesh: stack: Fix PB-GATT not check invalid link flag
For case MESH/NODE/PROV/BI-03-C
2022-08-11 14:18:48 +08:00
wangjialiang 96ecfa677e ble_mesh: stack: Fix invalid provisioning pdu type check
For case MESH/NODE/PROV/BI-15-C
2022-08-11 14:18:43 +08:00
wangjialiang 3fa1f36fbc ble_mesh: stack: Fix add continuously secure update into friend queue.
For MESH/NODE/FRND/FN/BV-20-C
2022-08-09 21:51:39 +08:00
wangjialiang d024b4aafa 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:51:31 +08:00
Jiang Jiang Jian 377a5d78db Merge branch 'bugfix/espnow_recv_unencrypted_packets_issue_v4.1' into 'release/v4.1'
esp_wifi: fix espnow recv unencrypted packets issue (backport v4.1)

See merge request espressif/esp-idf!19386
2022-08-05 12:11:07 +08:00
Jiang Jiang Jian da82c4f804 Merge branch 'bugfix/wlan_fixes_backports_v4.1' into 'release/v4.1'
esp_wifi: Fix some wlan issues(backport v4.1)

See merge request espressif/esp-idf!19363
2022-08-04 21:45:17 +08:00
zhangyanjiao 9c6d54b9f6 esp_wifi: fix espnow recv unencrypted packets issue 2022-08-04 15:10:22 +08:00
Kapil Gupta 941d79baa2 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:52:43 +05:30
Kapil Gupta 78f88c1e01 esp_wifi: Changes to not use pmkid caching when SSID is changed 2022-08-03 14:52:13 +05:30
Kapil Gupta a5e418b4b6 wpa_supplicant: Fix issues reported by coverity 2022-08-03 14:51:53 +05:30
xueyunfei f2bee03f08 bugfix for backport wifi bugs to 4.1
- Bugfix for close sniffer mode when wifi stop

    - Bugfix for qos null update ba ssn

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

    - Fix some ap will ignore auth when rx deauth for a while.
2022-08-03 15:05:53 +08:00
Jiang Jiang Jian 3cf24bd5d6 Merge branch 'bugfix/sta_pmf_mixed_mode_coexist' into 'release/v4.1'
esp_wifi: Fix sta connection issue with pmf AP when in mixed mode(v4.1)

See merge request espressif/esp-idf!17522
2022-08-03 11:22:00 +08:00
Jiang Jiang Jian f1d5b56d34 Merge branch 'bugfix/set_ipv6_dns_error_v4.1' into 'release/v4.1'
lw ip: Fixed that ipv6 dns cannot work (v4.1)

See merge request espressif/esp-idf!19065
2022-08-02 20:21:52 +08:00
Jiang Jiang Jian 1a2ebc538c Merge branch 'bugfix/memory_debug_not_work_v4.1' into 'release/v4.1'
bugfix/fix the dependency error of macro for memory debug (v4.1)

See merge request espressif/esp-idf!19235
2022-08-02 15:49:55 +08:00
baohongde 07397b566b 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:51:25 +08:00