forked from espressif/esp-idf
fix(i2c_master): Fix potential concurrency issue with task and interrupt when nack happens
This commit is contained in:
@@ -494,6 +494,13 @@ static void s_i2c_send_commands(i2c_master_bus_handle_t i2c_master, TickType_t t
|
|||||||
if (xQueueReceive(i2c_master->event_queue, &event, ticks_to_wait) == pdTRUE) {
|
if (xQueueReceive(i2c_master->event_queue, &event, ticks_to_wait) == pdTRUE) {
|
||||||
if (event == I2C_EVENT_DONE) {
|
if (event == I2C_EVENT_DONE) {
|
||||||
atomic_store(&i2c_master->status, I2C_STATUS_DONE);
|
atomic_store(&i2c_master->status, I2C_STATUS_DONE);
|
||||||
|
} else if (event == I2C_EVENT_NACK) {
|
||||||
|
// For i2c nack detected, the i2c transaction not finish.
|
||||||
|
// start->address->nack->stop
|
||||||
|
// So wait the whole transaction finishes, then quit the function.
|
||||||
|
while (i2c_ll_is_bus_busy(hal->dev)) {
|
||||||
|
__asm__ __volatile__("nop");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s_i2c_err_log_print(event, i2c_master->bypass_nack_log);
|
s_i2c_err_log_print(event, i2c_master->bypass_nack_log);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -3,10 +3,6 @@
|
|||||||
components/esp_driver_i2c/test_apps/i2c_test_apps:
|
components/esp_driver_i2c/test_apps/i2c_test_apps:
|
||||||
disable:
|
disable:
|
||||||
- if: SOC_I2C_SUPPORTED != 1
|
- if: SOC_I2C_SUPPORTED != 1
|
||||||
disable_test:
|
|
||||||
- if: IDF_TARGET in ["esp32p4", "esp32c5"]
|
|
||||||
temporary: true
|
|
||||||
reason: lack of runners, c5 test failed # TODO: [ESP32P4] IDF-8960, [ESP32C5] IDF-10332
|
|
||||||
depends_components:
|
depends_components:
|
||||||
- esp_driver_i2c
|
- esp_driver_i2c
|
||||||
# Following dependency is needed because they might increase lazy installed memory
|
# Following dependency is needed because they might increase lazy installed memory
|
||||||
|
@@ -6,8 +6,6 @@ from pytest_embedded import Dut
|
|||||||
|
|
||||||
@pytest.mark.supported_targets
|
@pytest.mark.supported_targets
|
||||||
@pytest.mark.generic
|
@pytest.mark.generic
|
||||||
# TODO: [ESP32P4] IDF-8960, [ESP32C5] IDF-10332
|
|
||||||
@pytest.mark.temp_skip_ci(targets=['esp32p4', 'esp32c5'], reason='esp32p4 support TBD, c5 test failed')
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
'config',
|
'config',
|
||||||
[
|
[
|
||||||
|
Reference in New Issue
Block a user