Skip to content

Add I2C support to TI cc23x0 SoC #84526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bogdanovs
Copy link
Contributor

@bogdanovs bogdanovs commented Jan 24, 2025

This series adds I2C support to TI cc23x0 SoC.

Datasheet: https://www.ti.com/lit/ds/symlink/cc2340r5.pdf

@zephyrbot zephyrbot added area: UART Universal Asynchronous Receiver-Transmitter area: GPIO area: Samples Samples area: Pinctrl area: Timer Timer area: Flash platform: TI SimpleLink Texas Instruments SimpleLink MCU area: Sensors Sensors area: I2C labels Jan 24, 2025
@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 24, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-i2c branch from 38e32dc to e79aada Compare February 4, 2025 16:14
@bogdanovs bogdanovs marked this pull request as ready for review February 4, 2025 17:02
@gmarull gmarull assigned teburd and unassigned gmarull Feb 17, 2025
@gmarull gmarull removed their request for review February 17, 2025 09:05
@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-i2c branch from e79aada to bdb7220 Compare March 25, 2025 11:43
@zephyrbot zephyrbot requested a review from asemjonovs March 25, 2025 11:44
Copy link
Collaborator

@teburd teburd left a comment

Choose a reason for hiding this comment

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

Why constantly wait on interrupts to then swap back to the calling thread to then update a few registers? This is a lot of extra work that really isn't needed in this driver.

Make the driver a simple state machine that reads/writes out of a current transfer and wait for completion of the whole thing? any particular reason to have a k_sem_take in a for loop wait on byte at a time transfers?

@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-i2c branch from bdb7220 to af9c62b Compare May 13, 2025 11:21
bogdanovs added 4 commits May 29, 2025 19:58
Add support for I2C to cc23x0 SoC. Only controller mode is implemented.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Add support for I2C to cc23x0 SoC.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Enable I2C for TI lp_em_cc2340r5.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Add lp_em_cc2340r5 overlay in bme280 sensors sample.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-i2c branch from af9c62b to c7a53a6 Compare May 29, 2025 17:09
@bogdanovs
Copy link
Contributor Author

Why constantly wait on interrupts to then swap back to the calling thread to then update a few registers? This is a lot of extra work that really isn't needed in this driver.

Make the driver a simple state machine that reads/writes out of a current transfer and wait for completion of the whole thing? any particular reason to have a k_sem_take in a for loop wait on byte at a time transfers?

Hi @teburd

I try to make driver work without IRQ, I was not able to get it working stable enough. Most likely because I am trying to fetch status reg all the time. Instead of write bit on the first transmit with that approach bit is converted to read , keep in mind the driver flow was not touched , neither command setting up the peripheral etc. I am guessing reason is kind of race condition or something like that. All drivers for TI CCXXXX chips have the same driver structure. If we agree it is not critical I will prefer to keep it like that for now.

Just rebased again on latest main , because of merged PR for the same platform.

@bogdanovs bogdanovs requested a review from teburd May 29, 2025 17:10
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flash area: GPIO area: I2C area: Pinctrl area: Samples Samples area: Sensors Sensors area: Timer Timer area: UART Universal Asynchronous Receiver-Transmitter platform: TI SimpleLink Texas Instruments SimpleLink MCU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants