Commit Graph

715 Commits

Author SHA1 Message Date
Jiang Jiang Jian
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
Alex Lisitsyn
eaf03e06d5 modbus: fix esp restart does not reset timer groups periph (backport v4.2) 2022-07-11 16:42:42 +08:00
Jiang Jiang Jian
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
Michael (XIAO Xufeng)
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
Jiang Jiang Jian
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
Jiang Jiang Jian
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
Jiang Jiang Jian
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
Michael (XIAO Xufeng)
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
Michael (XIAO Xufeng)
cb0b143cb3 esp_phy: use spinlock to avoid regi2c access conflicts 2022-04-06 15:01:35 +08:00
Michael (XIAO Xufeng)
171096e856 regi2c: use safe version of spinlock, instead of ISR ver 2022-04-06 14:47:10 +08:00
chaijie
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
me-no-dev
198ce9095a Fix USB with swapped pins not working
(cherry picked from commit 0aa1c13027)
2022-03-29 03:41:28 +00:00
songruojing
4c267ef0a6 gpio: Fix some gpio pin num errors on esp32s2 2022-03-29 03:40:54 +00:00
Armando
e9bbe44d19 spi_master: fix master HD mode cannot correctly receive data issue when using DMA 2022-03-07 13:54:25 +08:00
Armando
e6c97308b9 sleep: restore analog calibration registers after waking up from light sleep 2022-03-07 11:18:21 +08:00
songruojing
3d13370968 uart: fixed incorrect channel number on ESP32S2, S3 and C3 2022-03-02 10:53:30 +08:00
Darian Leung
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
Darian Leung
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
Jiang Jiang Jian
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
Jiang Jiang Jian
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
Darian Leung
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
Jiang Jiang Jian
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
Li Hang Fan
54251cfada MCPWM/deadtime: fix and sync preset deadtime modes with well-known definition (backport v4.2) 2022-02-14 06:02:36 +00:00
Michael (XIAO Xufeng)
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
morris
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
Michael (XIAO Xufeng)
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
Xia Xiaotian
c98745a5aa esp_wifi: store PHY digital registers before disabling PHY and load
them after enabling PHY
2022-01-18 13:18:36 +08:00
Jiang Jiang Jian
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
Cao Sen Miao
dfa736b0e3 psram: add ESP32-D0WD-R2-V3 support 2022-01-10 11:06:25 +08:00
Armando
ca6636c33e spi_master: fix spi cs_ena_posttrans issue 2022-01-07 14:28:57 +08:00
Armando
a129933ccd adc: apply adc power API to adc driver 2022-01-06 11:42:55 +08:00
jingli
417711c390 reduce bootup time when using usb-serial-jtag 2021-12-03 21:01:02 +08:00
Sergey Gorban
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
Jiang Jiang Jian
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
morris
30355d3c0c hal: avoid non-32bit access to registers 2021-10-25 12:05:55 +08:00
Wu Zheng Hui
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
wuzhenghui
fe1d3401d9 fix stuck in rtc_clk_cal 2021-10-21 19:15:33 +08:00
Michael (XIAO Xufeng)
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
Jiang Jiang Jian
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
suda-morris
db956cdeca twai: update register struct file 2021-10-12 11:10:40 +08:00
SalimTerryLi
72bb572df1 hal: avoid generate 8/16 bits intruction for register access 2021-10-12 11:06:55 +08:00
Konstantin Kondrashov
f8e2eadc51 esp32c3: Adds support BROWNOUT reset (v4.2) 2021-09-23 23:16:16 +08:00
wuzhenghui
1d63988db2 fix s2 efuse err address in block0 2021-09-16 20:16:52 +08:00
Alberto García Hierro
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
KonstantinKondrashov
6f0ad5662a efuse(esp32s2): Added flash_ver, psram_ver, pkg_ver efuses 2021-08-12 18:45:45 +05:00
Omar Chebib
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
Darian Leung
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
fuzhibo
0679862de2 Driver(Touch sensor): fix the touch sensor wait cycle after wakeup from sleep 2021-07-14 14:47:07 +08:00
Michael (XIAO Xufeng)
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
Angus Gratton
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