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

[BUG] /drivers/spi/spi_slave_driver.c broken - not working in master but working in old commit #13227

Closed
1 task done
FelipeMdeO opened this issue Aug 28, 2024 · 8 comments
Closed
1 task done
Labels
Arch: all Issues that apply to all architectures Area: Drivers Drivers issues OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working

Comments

@FelipeMdeO
Copy link
Contributor

Description / Steps to reproduce the issue

Hello all.

I cannot use spi slave in esp32 c6 dev kit.
I follower instructions in PR #3787 and using the same code in the PR I was able to reproduce PR results.
So I started track issue, and spi slave broken here, look image below:
image

I believe spi example cannot work using approach added in this commit because you need open spi to configure spi, what not happen when you use spi dev tool.
I tried develop app to read using open and read and it cannot work too.

On which OS does this issue occur?

[Linux]

What is the version of your OS?

Ubuntu 24

NuttX Version

master

Issue Architecture

[all]

Issue Area

[Drivers]

Verification

  • I have verified before submitting the report.
@FelipeMdeO FelipeMdeO added the Type: Bug Something isn't working label Aug 28, 2024
@github-actions github-actions bot added Arch: all Issues that apply to all architectures Area: Drivers Drivers issues OS: Linux Issues related to Linux (building system, etc) labels Aug 28, 2024
@acassis
Copy link
Contributor

acassis commented Aug 29, 2024

@FelipeMdeO in fact we cannot use SPI Tool with SPI Slave, only with SPI Master.

Did you get the same example working with ESP32 using that old commit from @gustavonihei right?

@fdcavalcanti @tmedicci please take a look

@FelipeMdeO
Copy link
Contributor Author

@FelipeMdeO in fact we cannot use SPI Tool for SPI Slave, only for SPI Master.

Did you get the same example working with ESP32 using that old commit from @gustavonihei right?

@fdcavalcanti @tmedicci please take a look

Right, but we need discuss if it is an issue or a feature that we lost when power manager was added. It isn't esp32 specific.
Actually we cannot use SPI Tool to test spi slave because we are doing spi slave bind in open function, in the past spi slave bind happen in spi slave register.

@fdcavalcanti
Copy link
Contributor

Hi Felipe. Not sure I get the issue.
Are you trying use two C6 devkits, one as SPI slave and another as master?
Then, you try to exchange data between them?

@FelipeMdeO
Copy link
Contributor Author

Hi Felipe. Not sure I get the issue. Are you trying use two C6 devkits, one as SPI slave and another as master? Then, you try to exchange data between them?

Exactly @fdcavalcanti, I done by @gustavonihei here: PR #3787

@fdcavalcanti
Copy link
Contributor

Ok, but you said it is not specific for ESP32. So I assume the same issue happens on other boards, right?
And also that using the code from that PR you could get it to work.

So the issue is on SPI driver then? Are you proposing a fix?

@FelipeMdeO
Copy link
Contributor Author

@fdcavalcanti , yes, the behavior will be the same in all boards because changes were made in spi_slave_driver.c file.

So the issue is on SPI driver then?
This is an issue only if we want to use spi tool to test, if we consider that we cannot use spi tool to test like PR #3787, we have no issue.

Are you proposing a fix?
What do you think @acassis ? Maybe we can think in create spi slave example using 2 devices, in this way we don't need talk about change spi_slave_driver.c .

@acassis
Copy link
Contributor

acassis commented Aug 29, 2024

@FelipeMdeO I think it should be nice to have a SPI example, but it not necessarily means we need to have the Master and Slave working with SPI Tool. Maybe we can use the SPI Tool with the master and the create a SPI Slave to receive the data.

What do you think?

@FelipeMdeO
Copy link
Contributor Author

Let’s do it @acassis.
I will do it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: all Issues that apply to all architectures Area: Drivers Drivers issues OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants