Skip to content

Conversation

@juickar
Copy link
Contributor

@juickar juickar commented Oct 17, 2025

Taking over #95984 as mentioned here

Main differences with the first PR are:

  • Branch is rebased.
  • Removed the i2c_stm32_master_mode_end calls from drivers/i2c/i2c_ll_stm32_v2.c because it has been removed with this commit.

Fixes #92383

@juickar juickar force-pushed the fix_i2c_error_cb branch 3 times, most recently from 6d4e53f to 4ab03bc Compare October 20, 2025 12:52
@juickar juickar marked this pull request as ready for review October 20, 2025 13:51
Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should add you're S-o-b tag to the commits in additions to @kbidani's one.

#endif
goto end;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end sequence must be updated:

 end:
+#if defined(CONFIG_I2C_TARGET)
+	if (data->slave_attached && !data->master_active) {
+		return -EIO;
+	}
+#endif
 	i2c_stm32_disable_transfer_interrupts(dev);
 	/* Wakeup thread */
 	k_sem_give(&data->device_sync_sem);
 	return -EIO;
}

(with indentation updates)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

data->current.is_arlo = 1U;
#if defined(CONFIG_I2C_TARGET)
if (error_cb != NULL) {
error_cb(data->slave_cfg, I2C_ERROR_GENERIC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I2C_ERROR_ARBITRATION

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Support I2C target error callback in I2C driver when
registered by the bus target consumer.

Signed-off-by: Khaoula Bidani <[email protected]>
Signed-off-by: Julien Racki <[email protected]>
Allow applications to be notified of target I2C transfer
error usingthe recently added target error callback mechanism.

Signed-off-by: Khaoula Bidani <[email protected]>
Signed-off-by: Julien Racki <[email protected]>
@sonarqubecloud
Copy link

@erwango erwango requested a review from etienne-lms October 24, 2025 06:51
@erwango
Copy link
Member

erwango commented Oct 24, 2025

@teburd PTAL and advise if ok for V4.3.0

@teburd teburd added this to the v4.3.0 milestone Oct 24, 2025
@teburd teburd added the Release Blocker Use this label for justified release blockers label Oct 24, 2025
@cfriedt cfriedt merged commit 66e8451 into zephyrproject-rtos:main Oct 24, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: I2C platform: STM32 ST Micro STM32 Release Blocker Use this label for justified release blockers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

driver: i2c: i2c_ll_stm32: no error handling in i2c_stm32_error for i2c target

7 participants