Commit Graph
60 Commits
Author SHA1 Message Date
morris 324e9885af fix(driver): allocate driver objects containing atomic variables from internal SRAM
Objects with atomic members must not be allocated to PSRAM, otherwise
the ordering guarantee of atomic accesses is weakened due to a hardware
behavior on ESP32 chips. Explicitly request MALLOC_CAP_INTERNAL |
MALLOC_CAP_8BIT for:

- i2c master bus object (atomic status/trans_idx)
- i3c master bus object (atomic fsm)
- ISP processor and AE/AF/AWB/HIST controllers (atomic fsm)
- JPEG decoder/encoder dma2d transaction descriptors (atomic started)
- PPA transaction storage embedding dma2d_trans_t
- dma2d m2m test transaction embedding dma2d_trans_t
2026-09-03 09:46:22 +08:00
morris bb48ee0f43 fix(i2c): release platform mutex on intr/pm_lock delete failure
ESP_RETURN_ON_ERROR inside the s_i2c_platform.mutex critical section
returns without releasing the mutex, permanently blocking all I2C
bus operations. Replace with ESP_GOTO_ON_ERROR that jumps to a
cleanup label releasing the mutex before return.
2026-07-13 17:43:13 +08:00
morris b312cdf341 fix(i2c): remove unused but set variables 2026-07-06 11:11:39 +08:00
DatanoiseTV cb462e9a5f fix(i2c_master): yield from ISR when no matching device is found
`i2c_master_isr_handler_default()` may set HPTaskAwoken to pdTRUE via
`xQueueSendFromISR()` (event_queue), `xSemaphoreTakeFromISR()` and
`xSemaphoreGiveFromISR()` on `bus_lock_mux`. When the device list lookup
returns no matching device, the function returned directly, skipping
the `portYIELD_FROM_ISR()` at the bottom of the handler. A higher-
priority task waiting on the bus mux or the event queue would then have
to wait for the next scheduler tick instead of being preempted into
immediately, inflating worst-case event latency.

Replace the early return with a goto to the existing yield check at the
end of the ISR.

Merges https://github.com/espressif/esp-idf/pull/18569
2026-05-12 15:33:52 +08:00
Chen Chen a0bb40f208 fix(i2c): reset master before bus clear on chips without HW FSM reset
Reorder s_i2c_hw_fsm_reset() so i2c_ll_reset_register and interrupt
masking run before s_i2c_master_clear_bus(). Avoids ISR firing when
i2c_common_set_pins reconnects GPIOs to a stuck FSM (IDFGH-17497).

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

Made-with: Cursor
2026-04-13 15:12:02 +08:00
morris 3e8426dc3b Merge branch 'fix/i2c_null_check_v6.0' into 'release/v6.0'
fix(i2c): add NULL check and correct log (v6.0)

See merge request espressif/esp-idf!46686
2026-03-19 23:12:59 +08:00
Hu Rui a8aeaea6a9 fix(i2c): add NULL check and correct log 2026-03-17 13:23:34 +08:00
Hu Rui 5a753346d8 test(i2c): with malloc comes from PSRAM by default 2026-03-09 14:52:20 +08:00
Chen Chen b7e82de9d8 refactor(i2c): cleanup I2C definitions in soc_caps.h 2026-01-13 17:29:23 +08:00
Chen Chen c373763022 fix(i2c_master): Add i2c master timeout range check
Closes https://github.com/espressif/esp-idf/issues/17930
2025-12-10 17:58:46 +08:00
morris 72159c2361 Merge branch 'feat/esp_hal_pcnt_v6.0' into 'release/v6.0'
feat(hal): graudate the PCNT hal driver into a new component (v6.0)

See merge request espressif/esp-idf!43444
2025-11-24 22:35:51 +08:00
Chen Jichang cb2cbc652a feat(hal): move i2c_periph.h to hal folder 2025-11-21 11:22:41 +08:00
morris e9539d4560 refactor: avoid function calls inside MIN/MAX macros 2025-11-18 15:18:14 +08:00
Chen Chen 3d73884ae8 refactor(i2c_master): Change member type of i2c_operation_job_t
Closes https://github.com/espressif/esp-idf/issues/17585
2025-10-21 14:52:57 +08:00
Chen Chen 260443fe73 Merge branch 'fix/i2c_lp_test' into 'master'
fix(i2c/gpio): Add error checks to the i2c driver & Fix errors in gpio

Closes IDF-13942

See merge request espressif/esp-idf!41527
2025-10-16 13:51:18 +08:00
Chen Chen 29f8fcf7b7 fix(i2c/gpio): Add error checks to the i2c driver
Add more checks to i2c driver, as well as fixed some GPIO issues
together with it.
2025-10-15 10:38:59 +08:00
C.S.M 2523fee9cd fix(i2c): Fix the potential wdt might happen after nack,
Closes https://github.com/espressif/esp-idf/issues/17720
2025-10-13 16:07:22 +08:00
Nebojsa Cvetkovic 298bd047f6 fix(i2c): Don't print developer notes to ESP_LOG,
Closes https://github.com/espressif/esp-idf/pull/13963
2025-09-22 11:55:40 +08:00
Chen Chen c35ddc1258 change(i2c_master): Change return value when NACK detected 2025-08-19 12:12:52 +08:00
Xiao Xufeng 208fad5616 fix(i2c): make write_buffer const in i2c_master_transmit_multi_buffer_info_t
Fixes https://github.com/espressif/esp-idf/issues/16890
2025-08-06 10:38:48 +08:00
C.S.M 0e44dcf2ff fix(i2c_master): Fix that master multi-read failed,
Closes https://github.com/espressif/esp-idf/issues/16231
2025-07-07 15:43:18 +08:00
C.S.M 6c2266473c fix(i2c): Make i2c nack log as debug level 2025-06-30 14:48:58 +08:00
morris c63f51dcb3 refactor(drivers)!: remove unnecessary io_loop_back and pull up/down config option 2025-05-23 18:09:53 +08:00
Chen Jichang 4bfd180a94 fix(i2c): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
C.S.M 34447b6401 fix(i2c): Fix some i2c coverity issue 2025-04-25 15:42:31 +08:00
C.S.M 459b75f81a fix(i2c): I2C should not clear bus in a nack state 2025-04-23 19:01:08 +08:00
C.S.M d6760b170a fix(i2c): Fix that fsm reset cause i2c scl frequency changed on esp32s2,
Closes https://github.com/espressif/esp-idf/issues/15724
2025-04-17 18:03:42 +08:00
C.S.M 3158443b03 fix(i2c): Fix i2c customize only read one byte issue 2025-04-01 11:03:54 +08:00
C.S.M 43e83b8324 fix(i2c_master): Fix the stretch happen cause timeout in probe,
Closes https://github.com/espressif/esp-idf/issues/15589
2025-03-27 14:51:16 +08:00
C.S.M 90d477c9a6 fix(i2c_master): Fix i2c master race condition issue,
Closes https://github.com/espressif/esp-idf/issues/15444
2025-02-27 15:27:58 +08:00
C.S.M 2458734108 feat(i2c): Add config option for i2c isr handler can put in flash 2025-02-10 13:49:21 +08:00
C.S.M 847780da3e fix(i2c_master): Enhance i2c delete device and bus logic,
Closes https://github.com/espressif/esp-idf/issues/15171
2025-01-21 15:56:25 +08:00
C.S.M ecc6d380ce feat(i2c): Add api for customize i2c transaction interface for un-standard i2c device 2024-12-30 15:17:25 +08:00
C.S.M 89ba620cfd feat(i2c_master): Add a new api for adjusting address dynamically,
Closes https://github.com/espressif/esp-idf/issues/15011
2024-12-20 13:54:32 +08:00
C.S.M 6b735e01fa Merge branch 'fix/enhance_i2c_slave_test_stability' into 'master'
fix(i2c): Fixed I2C return without release the lock  & enhance lp i2c lock souce selection

See merge request espressif/esp-idf!35025
2024-11-22 12:13:01 +08:00
C.S.M b9183aafee fix(i2c): Enhance lp clock source and avoid deadlock,
Closes https://github.com/espressif/esp-idf/issues/14908,
Closes https://github.com/espressif/esp-idf/issues/14906
2024-11-21 14:51:20 +08:00
morris 3fb7461eb0 refactor(i2c): rename some LL functions according to TRM descriptions 2024-11-20 19:16:23 +08:00
C.S.M 0a098f49d4 fix(i2c): Add bus handle check so that it will not be panic when there is no free bus,
Closes https://github.com/espressif/esp-idf/issues/14819
2024-11-06 18:48:11 +08:00
C.S.M d7e090476c fix(i2c): Fix i2c gpio configuration and move i2c_platform public 2024-10-24 11:38:32 +08:00
C.S.M 3f061bd557 feat(i2c_master): Support i2c sleep retention on esp32c5/p4/c61 2024-10-08 15:55:48 +08:00
C.S.M fb95332a22 fix(i2c_master): Fix the memory leak in the async transaction 2024-09-26 18:54:43 +08:00
C.S.M 3ccdd8b397 fix(i2c): Fix possible error state in clear the bus,
Closes https://github.com/espressif/esp-idf/issues/13647
2024-09-06 14:28:26 +08:00
C.S.M 8aee667873 fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout set seems doesn't work
Closes https://github.com/espressif/esp-idf/issues/14129
Closes https://github.com/espressif/esp-idf/issues/14401
2024-08-22 18:28:57 +08:00
C.S.M 4606003655 fix(i2c_master): Fix potential concurrency issue with task and interrupt when nack happens 2024-07-30 13:28:20 +08:00
C.S.M 992d8bc5f2 feat(i2c_master): Add an api for retrieveing handle via port,
Closes https://github.com/espressif/esp-idf/issues/13968
2024-06-24 16:06:34 +08:00
C.S.M 8e1698aa05 fix(i2c): Fix i2c not release semaphore in command send loop 2024-06-20 19:22:49 +08:00
C.S.M af1524e7bb feat(i2c_master): Add feature for transmit multi buffer in one transaction,
Closes https://github.com/espressif/esp-idf/pull/13635
2024-05-16 19:14:59 +08:00
Cao Sen Miao 4ba3a4e482 fix(i2c_master): Fix the issue that probe cannot work properly after a general call,
Closes https://github.com/espressif/esp-idf/issues/13547
2024-04-15 11:29:13 +08:00
Cao Sen Miao a69c6e8f41 fix(i2c_master): Modify the behavior from ISR WDT to return timeout when circut get shortcut,
Closes https://github.com/espressif/esp-idf/issues/13587
2024-04-15 11:05:43 +08:00
Cao Sen Miao 0985bfbe27 feat(i2c_master): Add lp_i2c support in i2c master driver 2024-04-03 11:39:04 +08:00