Skip to content

Conversation

@adamkondraciuk
Copy link
Contributor

TDM peripheral requires TXD.MAXCNT and RXD.MAXCNT registers to be:

  • multiple of 4 bytes
  • larger than 8 bytes

@adamkondraciuk adamkondraciuk force-pushed the NRFX-8224-TDM-size-guards branch 2 times, most recently from b555fef to 9c34500 Compare December 1, 2025 12:17
nordic-krch
nordic-krch previously approved these changes Dec 2, 2025
kl-cruz
kl-cruz previously approved these changes Dec 2, 2025
tdm_cfg->block_size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) {
LOG_ERR("This device can only transmit full 32-bit words greater than %u bytes.",
NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED);
return -EIO;
Copy link
Contributor

@nordic-segl nordic-segl Dec 3, 2025

Choose a reason for hiding this comment

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

i2s_configure() can not return -EIO. It must be -EINVAL.
See API documentation https://docs.zephyrproject.org/latest/doxygen/html/group__i2s__interface.html#ga299003d72146c127f88d7c12c08889cc

Same in line 692 and ?686?.

Copy link
Contributor

Choose a reason for hiding this comment

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

Argh.
I didn't noticed that lines 692 and 686 are in i2s_write() function which instead shall return -EIO while it can't return -EINVAL.
https://docs.zephyrproject.org/latest/doxygen/html/group__i2s__interface.html#ga01edf23acc6c16bbaf718dab8061a7a0

Thus, line 487 -> shall be -EINVAL
lines 692 and 686 -> shall be -EIO

Copy link
Contributor

@nordic-piks nordic-piks left a comment

Choose a reason for hiding this comment

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

@nordic-piks
Copy link
Contributor

Please align test if needed: https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/i2s/i2s_additional/src/main.c#L763

If I understand, once you align with Sebastian suggestion, there is not need to change test.

@adamkondraciuk adamkondraciuk dismissed stale reviews from kl-cruz and nordic-krch via 15cac1c December 3, 2025 08:37
TDM peripheral requires TXD.MAXCNT and RXD.MAXCNT registers to be:
- multiple of 4 bytes
- larger than 8 bytes

Signed-off-by: Adam Kondraciuk <[email protected]>
@adamkondraciuk adamkondraciuk force-pushed the NRFX-8224-TDM-size-guards branch from 15cac1c to 5be6e2e Compare December 3, 2025 09:27
@nordic-segl
Copy link
Contributor

Works in CI

10:39:36  INFO    - 5/6 [email protected]/nrf54h20/cpuapp tests/drivers/i2s/i2s_additional/drivers.i2s.additional.gpio_loopback.54h.aclk PASSED (device: 1051113203, 4.203s <zephyr>)
10:39:36  INFO    - 6/6 [email protected]/nrf54h20/cpuapp tests/drivers/i2s/i2s_additional/drivers.i2s.additional.gpio_loopback.54h PASSED (device: 1051113203, 4.029s <zephyr>)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

@nashif nashif merged commit 75dfc05 into zephyrproject-rtos:main Dec 3, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants