Commit Graph

91 Commits

Author SHA1 Message Date
morris
1428638fd6 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-29 11:40:42 +08:00
DatanoiseTV
b2f021fd25 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-27 09:49:50 +08:00
morris
458836e182 Merge branch 'fix/i2c_null_check_v5.4' into 'release/v5.4'
fix(i2c): add NULL check and correct log (v5.4)

See merge request espressif/esp-idf!46688
2026-04-17 19:04:43 +08:00
morris
269046ef89 Merge branch 'fix/i2c_fsm_reset_sequence_v5.4' into 'release/v5.4'
fix(i2c): reset master before bus clear on chips without HW FSM reset (v5.4)

See merge request espressif/esp-idf!47509
2026-04-17 19:04:07 +08:00
Chen Chen
85cc29fa9c docs(i2c): update i2c_master_probe parameter comment
closes https://github.com/espressif/esp-idf/issues/18442
2026-04-13 15:13:34 +08:00
Chen Chen
3587c30e3b 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:27 +08:00
Hu Rui
507b1dc924 fix(i2c): add NULL check and correct log 2026-04-01 15:53:38 +08:00
Evgeny Torbin
f7395255da test: format all test scripts 2026-03-11 07:34:34 +01:00
Hu Rui
b28b6940d7 test(i2c): with malloc comes from PSRAM by default 2026-03-09 14:58:38 +08:00
Chen Chen
c3e0a746c8 fix(i2c_slave): filter out fake request for esp32
Closes https://github.com/espressif/esp-idf/issues/18268
2026-03-03 16:14:05 +08:00
Xiao Xufeng
b32fa18e3d fix(i2c): fix LOG_LOCAL_LEVEL redefinition error when CONFIG_I2C_ENABLE_DEBUG_LOG is enabled
- Move LOG_LOCAL_LEVEL definition before including esp_check.h
- Fixes compilation error: 'LOG_LOCAL_LEVEL' redefined [-Werror]

Closes https://github.com/espressif/esp-idf/issues/17877
2026-02-05 00:41:35 +08:00
Chen Chen
8ad7d769aa fix(i2c_master): Add i2c master timeout range check
Closes https://github.com/espressif/esp-idf/issues/17930
2025-12-10 17:55:59 +08:00
morris
8189de4e34 Merge branch 'fix/i2c_lp_test_v5.4' into 'release/v5.4'
fix(i2c/gpio): Add error checks to the i2c driver & Fix errors in gpio (v5.4)

See merge request espressif/esp-idf!42663
2025-10-26 22:52:05 +08:00
morris
2de7923716 Merge branch 'fix/i2c_disable_od_in_delete_v5.4' into 'release/v5.4'
fix(i2c): disable open drain mode on deinit (v5.4)

See merge request espressif/esp-idf!42725
2025-10-26 22:29:32 +08:00
Chen Chen
03418f2322 fix(i2c/gpio): Add error checks to the i2c driver (Backport v5.4)
Add more checks to i2c driver, as well as fixed some GPIO issues
together with it.
2025-10-20 18:00:34 +08:00
morris
d301a49b95 fix(i2c): remove notfix(i2c): disable open drian mode on deinit
Closes https://github.com/espressif/esp-idf/issues/17737
2025-10-20 15:38:43 +08:00
Xiao Xufeng
41eb94c309 fix(i2c): make write_buffer const in i2c_master_transmit_multi_buffer_info_t
Fixes https://github.com/espressif/esp-idf/issues/16890
2025-10-16 17:01:03 +08:00
C.S.M
d77dc39bb2 fix(i2c): Add gpio reserve check on i2c driver,
Closes https://github.com/espressif/esp-idf/issues/15995
2025-07-11 15:21:59 +08:00
C.S.M
b55b718804 fix(i2c): Make i2c nack log as debug level 2025-07-11 15:21:21 +08:00
wanckl
ea03622621 ci(esp32c61): remove c61 support from readme on 5.4 2025-06-17 15:09:40 +08:00
Song Ruo Jing
60f5828a4a feat(uart): add pin release process to uart driver 2025-05-27 14:15:29 +08:00
C.S.M
94cbc9bbac fix(i2c): Fix that fsm reset cause i2c scl frequency changed on esp32s2 2025-04-29 16:58:36 +08:00
C.S.M
30f60557ec fix(i2c): Fix some i2c coverity issue 2025-04-29 16:20:27 +08:00
C.S.M
d41636cfad fix(i2c): I2C should not clear bus in a nack state 2025-04-29 16:20:27 +08:00
Chen Jichang
cbc6382b26 fix(i2c,mcpwm): fix gpio pull strategy
Closes https://github.com/espressif/esp-idf/issues/15774
2025-04-21 10:35:52 +08:00
C.S.M
c29d6575a1 fix(i2c): Fix i2c customize only read one byte issue 2025-04-07 14:08:23 +08:00
C.S.M
0752abf3c7 fix(i2c_master): Fix the stretch happen cause timeout in probe,
Closes https://github.com/espressif/esp-idf/issues/15589
2025-04-07 14:08:10 +08:00
C.S.M
785e45cfcb fix(i2c): Fix i2c slave auto selection issue,
Closes https://github.com/espressif/esp-idf/issues/15644
2025-04-07 14:07:58 +08:00
C.S.M
e2ce4d256a fix(i2c): Fix the array size of static operation,
Closes https://github.com/espressif/esp-idf/issues/15583
2025-04-07 14:07:45 +08:00
C.S.M
a4ecb6b15c fix(i2c_master): Fix i2c master race condition issue,
Closes https://github.com/espressif/esp-idf/issues/15444
2025-04-07 14:05:32 +08:00
C.S.M
d6de1df245 test(i2c): Add test for customize i2c transaction interface for un-standard i2c device 2025-02-19 17:43:50 +08:00
C.S.M
c6161380d3 feat(i2c): Add api for customize i2c transaction interface for un-standard i2c device 2025-02-19 17:43:50 +08:00
C.S.M
82903b0bc6 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-12-05 13:22:43 +08:00
C.S.M
36834f34cd fix(i2c_slave): Fix the wrong semaphore take in isr 2024-12-04 19:29:05 +08:00
C.S.M
2803aed082 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-12-04 19:28:18 +08:00
C.S.M
122b579024 test(i2c): Enhance the stability for i2c tests 2024-12-04 19:28:10 +08:00
morris
85e86626ff refactor(i2c): rename some LL functions according to TRM descriptions 2024-11-22 10:14:22 +08:00
C.S.M
e27594efc1 test(i2c_slave): Add some new tests for i2c slave version 2 2024-11-14 18:02:27 +08:00
C.S.M
56625cda88 feat(i2c_slave): refactor i2c slave api to version 2 inorder to solve some existing problem 2024-11-14 18:02:15 +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
f3eec83421 test(i2c): Support test for esp32p4 lp i2c 2024-09-03 11:23:02 +08:00
C.S.M
89c808c26c Merge branch 'bugfix/i2c_master_stretch_to' into 'master'
fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout seems not work

Closes IDFGH-13191 and IDFGH-13508

See merge request espressif/esp-idf!33014
2024-08-29 17:29:30 +08:00
C.S.M
acda9ad8bf test(i2c): Enable all i2c test on esp32p4, esp32c5 2024-08-26 10:43:22 +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
laokaiyao
1397e5421e feat(i2c): support i2c on esp32-c61 2024-08-14 11:25:31 +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
laokaiyao
cb22b8aaf7 ci(esp32c5): enable c5 target test 2024-07-02 16:45:49 +08:00