-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] SPI Slave driver issue #13260
Comments
@FelipeMdeO I think you are right, the modification seems suspicious! This is issue when someone adds a driver and don't add a testing application! @xiaoxiang781216 could you please help and ask your team to review? |
@xiaoxiang781216 is there some example using SPI Master <---> SPI Slave communication (maybe using RPMSG) ? It should be something useful to validate the driver and could help Felipe to reach his goal |
Yes, we made rpmsg over spi master/slave recently, but it make the significant change to rptun driver framework., so it need more time to prepare the patch. For spi slave change, @Donny9 will take a look. |
@FelipeMdeO hello~ Before the device is opened by the user application, any data sent by the host is of no concern to the user application. Therefore, I recommend opening the device node to prevent data loss. |
@Donny9 , Thank you very much for your explanation. I understand the implementation now and I agree, it makes sense, initialize function configure spi peripheral, open enable and close disable it. Donny, I cannot do it work yet, can help me to understand other point, please? but: I think that: |
@FelipeMdeO Hello: If there is data available, it directly copies the data from priv->rx_buffer to the user's buffer using memcpy. The SPIS_CTRLR_QPOLL function will call SPIS_DEV_RECEIVE to push data from the lower half into the priv->rx_buffer of the top half and updates priv->rx_length accordingly. Once this is done, the while loop in spi_slave_read will exit , and memcpy data, finish read~ |
@Donny9 all drivers on NuttX needs some example application to prove it is working and to help to test. At this moment we don't know if the BUG is on ESP32-C6 or in the SPI Slave driver. Could you please submit a simple/minimal apps/testing/spislave/ example just to receive data from other board (using spitool) and transmit back to the board? |
@acassis we will provide a new rpmsg transport on top of spi master and slave, after that you can test the basic communication through |
@xiaoxiang781216 sounds good thank you, but as you said this rpmsg will delay to come, so maybe a simple sample code is enough for let @FelipeMdeO to test it |
okay, i will submit later. |
Hi @Donny9, Sorry to insist, but I still haven't figured out how the read function works. Let's consider that I'm trying to get 30 bytes, so You explaned: What do you think? |
@Donny9 I think @FelipeMdeO is right, there is a logic error here:
The Please review the code or submit a minimum example showing that it will work. |
@acassis @FelipeMdeO You are right, sorry, We have reverted this PR(#8769) internally, but it hasn't been committed yet. It's true that it would cause the read function to stop working. Revert PR: #13337, @FelipeMdeO you can try with this PR. |
Description / Steps to reproduce the issue
Hello All.
I am Facing some issues during slave driver development.
Here I can report and talk about change done in drivers/spi/spi_slave_driver.c. PR is: #10727
This PR do

bind
during file open andunbind
during file close. The issues is that the bind is necessary to configure configure slave controller, so, in current master, all spi transaction when file is closed will be lost.Before this PR all spi message is saved in lower half buffer, when we do read in top half, we get data from lower half, now lower half only get spi data while top half is waiting for.

@Donny9 and @gustavonihei let's talk about this PR, please?
@acassis Can you help me to check about expected behavior, Do we need save information after driver initialization or only during open execution?
On which OS does this issue occur?
[Linux]
What is the version of your OS?
Ubuntu 24.0
NuttX Version
master
Issue Architecture
[all]
Issue Area
[Drivers]
Verification
The text was updated successfully, but these errors were encountered: