We need bigger than 4096 bytes transfer via the SPI using the SPIDEV driver. Unfortunately when try even one more byte if fails with “can’t send spi message: Message too long”.
The problem is that this is actually communication with ADC and if we do multiple transfers by 4096 bytes the time between transfers is very big and that “gap” messes up entire sampling rate that we want to achieve.
We currently using Toradex Angstrom Linux 4.1.44-2.7.5+g18717e2 with the included SPIDEV driver.
How we can fix that or workaround it to make possible bigger single transfers via the SPI?
This seems to be the default buffer size of the spidev driver. You can increase the default buffer size by setting the kernel parameter spidev.bufsiz, e.g. by using the following command in U-Boot:
Big thanks for that solution!
Could I set that somewhere into device tree, so not to set up into the bootloader for every device when we start mass production? Like for display type and resolution for example?
Hi,
We tried to use U-Boot to change SPI buffer as you mentioned here. I can see the output through the UART_A, however I cannot enter in U-BOOT by stopping the autoboot. It cannot receive any key pressed.
After autoboot, It was able to receive characters on the login line. What to do in this case?
Just in case anyone else has this same issue , the defargs variable is not used in Torizon (and maybe newer Yocto BSP reference builds but I have not had a chance to confirm.). We did verify that using “tdxargs” instead of “defargs” does the right thing on recent Torizon builds.
I was able to confirm setting kernel parameters w/ tdxargs worked for me w/ the u-boot cmd prompt. However, I haven’t figured out how to implement this change in my BSP build. The following u-boot bbappend didn’t work for me:
diff --git a/recipes-bsp/u-boot/u-boot-toradex_2022.04.bbappend b/recipes-bsp/u-boot/u-boot-toradex_2022.04.bbappend
index bde48d7..a1cfab4 100644
--- a/recipes-bsp/u-boot/u-boot-toradex_2022.04.bbappend
+++ b/recipes-bsp/u-boot/u-boot-toradex_2022.04.bbappend
@@ -1,2 +1,5 @@
+
+# Increase the spidev buffer size to 32 kB
+tdxargs:append = " spidev.bufsiz=32768"
I also tried tdxargs += " spidev.bufsiz=32768" to no avail as well. Any suggestions? Also is there a way to see what tdxargs expands to in the build artifacts?