Skip to content
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

cherry-pick nRF TWIS driver and TWIM RTIO patches #2488

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

Conversation

bjarki-andreasen
Copy link
Contributor

@bjarki-andreasen bjarki-andreasen commented Feb 13, 2025

Cherry pick the nRF TWIS driver and nRF TWIM RTIO patches from upstream

The macros placing the DMA memory buffer in the appropriate
section in RAM was malformed. This PR fixes it.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit bb2833de548d80100eab925e45a6413c180942b3)
Add nrf54h20 to test suite.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 37c3efc13b30251b20a27764e11e1c109198962c)
…suite

Add nrf54l15 cpuapp to test suite.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 769936165d96003fbe7b13409d26f97b0a5a8658)
The buffer used for the TWIM DMA needs to be allocated to the
section provided with the memory-regions dt prop. The macros for
doing this where malformed. This commit fixes and cleans up the
macros.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 62815dd9e711ce4f97532aa5f50fa367942749cb)
…quired

The DMA buffer needs to be used both for tx and rx if required.
Extend RTIO driver variant to use DMA buffer and copy received
data from it to user buffer.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 125752e7cccb4d6dd2f5f4124d7ef3b1cda360b4)
Add nRF boards to the rtio_loopback sample.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 7d5a912)
Add nrf54h20 board support to the i2c rtio loopback sample.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 5c7f47de0fdeac237c420bc06070bf8d9d0dec03)
RTIO correctly declares tx buffers as const, however, the
existing I2C API and NRFX (SDK) drivers don't. Therefor cast the
const buf to non-const when passing the tx buf to the twim driver
from the RTIO call to avoid the const warning.

The tx buffer is being treated as const data naturally in the
NRFX driver, its just not declared as such since we reuse the
buffer for both RX and TX data.

Alternatively the SDK and "shim" drivers built on top of it need
to be updated, which is quite a bit of work :)

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 2e00923)
Add i2c_bus_short fixture to the rtio_loopback sample to ensure it
is only run on boards with the bus shorted. The i2c_bus_short
fixture is also used in the i2c_target_api test suite.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
(cherry picked from commit 846b4687154af5f57ba5a32610ec868d5f4ae61d)
…o console

The harness was set to ztest, but the sample requires the console
harness to match on the "sample complete" line, its not actually
using ztest.

Upstream PR #: 86098

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
@bjarki-andreasen bjarki-andreasen changed the title cherry-pick nRF TWIS driver cherry-pick nRF TWIS driver and TWIM RTIO patches Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant