-
-
Notifications
You must be signed in to change notification settings - Fork 40
fix: SPI: remove holes between transfer() #288
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
base: main
Are you sure you want to change the base?
Conversation
|
Does this actually fix the issue? The lock just prevents other callers from accessing the device, and |
|
As @KurtE's issue pointed out this seems to be an open issue on Zephyr: zephyrproject-rtos/zephyr#73930 Has anyone looked at that or at @KurtE's solution? Not sure that is really going to resolve the issue |
|
Thanks @facchinm @iabdalkader @mjs513. @facchinm - which boards did you try this on? As I mentioned in the issue #145, in the past I have tried this approach to blanketly turn on the HOLD_ON_CS flag or As @mjs513 mentioned - there are some Zephyr open issues on some of this, that appear to have several interrelated issues and or things to try, like: FIFO - is it enabled? Does it work. Is DMA enabled? Async Transfer - appears to speed things up, but ran into limits, like there may be a MAX number of bytes you can do And my guess is, it may be different for each different processor. But keeping my fingers crossed that this at least improves it. Thanks |
|
Quick update: I tried out my sort of simple ST7796 driver on Q which does some hacks, to get hold of the underlying SPI And then does several fillRects with different colors and prints out how long it took... Note: the fill code, uses temporary buffer that it fills with color and iterates calling spi_transcive.... With the beginTransaction code change, this code now appears to hang. And using SPI->transfer16... (I could try again, but that was potentially even slower)... And maybe has other issues. EDIT: In case anyone wishes to play along. |
|
@KurtE Thanks for taking the time to test this. Could you please provide a brief summary? Does the change in this PR work or not? If it works, does it improve the performance? About your custom code, assuming you're using a dev core, not a release, you could just add another overload to the SPI library, maybe something like: void transfer(void *buf, size_t count, size_t datasize);
void arduino::ZephyrSPI::transfer(void *buf, size_t count, datasize) {
int ret = transfer(buf, count, datasize==8 ? &config : &config16);
(void)ret;
}This should let you use our library to rule out any issues with your code. We could probably commit that, or later add data size to settings in the API. |
Fixes #145