-
Notifications
You must be signed in to change notification settings - Fork 1k
Slow SPI speed with SPI library #898
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
Comments
By the way, related issue exists with curren spi implementation - SPI.transfer(buffer, size) will modify your buffer unexpectedly. |
Seems like nobody cares. Yes, i understand that my workaround can't be a solution (thats why ive not made a PR), but speed issue is huge, using HAL_SPI_Transmit instead of HAL_SPI_TransmitRecieve boosts SPI transmit speed about 4+ times. |
here is my suggestion, it doubles SPI speed (but at least twice slower than transmit w/o recieve)
what do you think? |
probably we need an extra flag for spisettings to skip recieve if slave is never answer? it will double (4x atm, but with optimized spi_transfer it will double) spi transactions speed for silent slaves like SPI LCDs and will not break default behaviour and will be compatible with multiple slaves on the same bus usage case |
@fpistm a little offtopic, which tool do you use to format a code for this core? my ide formatted it with clang-format and i don't want to reformat it back manually in case of making pull requests etc |
Hi @stas2z,
|
Im using my own library for st7735 and ili9341 (only init and setting orientation different) written from scratch and sure i use buffered transfers to speed up lcd operations |
Im trying to work with several SPI LCD displays and found SPI transfer made by SPI library is slower then for example ESP32 SPI library running the same code. It looks like SPI working at lower speed than initialized.
Im not completely sure, but seems like i found a problem causing this issue (at least it can be one of it)
All SPI library methods use calls to internal spi_transfer routine, which also calls HAL_SPI_TransmitReceive to do the job. But LCDs are not answer to master, so seems like its waiting for reply timeout.
As a workaround ive changed all (except on which called directly with answer buffer) spi_transfer calls to spi_send calls and it improved throughput dramatically (flickering i experience is almost gone).
here is my diff
The text was updated successfully, but these errors were encountered: