Skip to content

Conversation

@c-mauderer
Copy link
Contributor

The current driver has a workarround that seem to be targeted to SPI flashes. It completely throws away the first Rx buffer without any warning or error. This patch set:

  • Removes that behavior and processes the first SPI buffer normally.
  • Makes sure that NULL-Buffers are handled correctly.
  • Avoids sending extra bytes if the transmit is already done while the receive is not yet finished.
@github-actions
Copy link

Hello @c-mauderer, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@sebhub
Copy link
Contributor

sebhub commented Jul 22, 2025

@con-pax Please have a look at this.

@con-pax
Copy link
Contributor

con-pax commented Jul 22, 2025

@con-pax Please have a look at this.

Hey @sebhub, will do. I see this PR is opened 2 weeks, unfortunately I wasn't notified. I will test this out in the coming days

@con-pax
Copy link
Contributor

con-pax commented Aug 8, 2025

Hi @sebhub @c-mauderer, I haven't forgotten about this PR. team mates have been on vacation, hence not getting to fully test it. should be tested next week

Copy link
Contributor

@con-pax con-pax left a comment

Choose a reason for hiding this comment

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

LGTM

@tomi-font
Copy link
Contributor

@jvasanth1 please review

@con-pax
Copy link
Contributor

con-pax commented Sep 15, 2025

Hi @jvasanth1 could we please get a review on this?

@tomi-font
Copy link
Contributor

Don't know why some checks are pending, @c-mauderer can you rebase your PR?

The driver has ignored the first RX buffer. Most likely it has been modeled for accesses to a SPI flash or similar where the first read data is not relevant. This commit makes sure that the driver can work as a universal SPI master instead. Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
At the moment, if you would pass a NULL buffer to the driver, the rx and tx counts of that buffer would not advance. This patch fixes that. Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
The driver did send some extra 0 bytes when the receive hasn't been finished yet. This patch makes sure to avoid that. Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
@c-mauderer
Copy link
Contributor Author

Don't know why some checks are pending, @c-mauderer can you rebase your PR?

I rebased the changes.

@kartben kartben merged commit f042a1c into zephyrproject-rtos:main Oct 2, 2025
26 checks passed
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

Hi @c-mauderer!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: SPI SPI bus platform: Microchip MEC Microchip MEC Platform

6 participants