This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I would like to increase the SPI's buffer size from default 4096 bytes to 65536 bytes (or highest possible) to do some real time sampling with the BBB.
I have tried various methods and none of them yielded any results-
modprobe spidev bufsiz=65536 I checked the spi bufsiz after " cat /sys/module/spidev/parameters/bufsiz" and it reported 4096 still
I typed in "rmmod spidev" afterwards and it reported spidev is being used by some program that I am not aware of.
Then, I tried to change the parameter directly by changing bufsiz through vim
chmod 066 bufsiz //gives rw permissions
Vim reports E677: Fsync failed as I tried to quit and exit the program.
Can someone please help? Very much appreciated
Please let me know what "modinfo spidev" outputs.
Also try adding the following line to the /etc/modprobe.d/local.conf file:
options spidev bufsiz=65536
Another suggestion is to write the desired buffer size to the following file:
My last suggestion is to modify the spidev.c file in the linux kernel sources and change the default buffer size:
static unsigned bufsiz = 4096;
Then recompile the module and try again.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Miroslav Kiradzhiyski XID:
Thanks a lot for your response.
I got an Error message: "Module spidev not found." when I typed in modinfo spidev
I did not have a local.conf file so I created one myself and added the line you suggested, still didn't work.
I got a Fsync failed error when I tried to change bufsiz using vim
I have attached an image for each of the scenario I described above.
About recompiling the kernel - do I lose all the work I have done and saved on the BBB once I recompile it?
In reply to David King Li:
David King LiI got an Error message: "Module spidev not found." when I typed in modinfo spidev
Try to find the "spidev.ko" file somewhere inside /lib/modules/3.2.0 and do "modinfo spidev.ko" instead.
David King LiAbout recompiling the kernel - do I lose all the work I have done and saved on the BBB once I recompile it?
You don't need to recompile the whole kernel - just the modules. Anyway, you won't lose anything in your root file system if you just update the kernel or the modules.
I went into "/lib/modules/3.8.13" and did "modinfo spidev.ko" it sill returned error not found
I managed to change the SPI bufsiz temporarily through gedit but I need the changes to permanent.
Is there an alternative to recompiling the kernel? I have trouble setting up the TFTP server
I found an alternate solution to the problem -
I wrote a script that changes spi bufsiz value on boot
#!/bin/bash # Spi Bufsiz Script
cd /sys/module/spidev/parameterschmod 666 bufsizecho 65534 > bufsiz
Guide to creating scripts on BBB startup-http://mybeagleboneblackfindings.blogspot.ca/2013/10/running-script-on-beaglebone-black-boot.htmlHope this helps those who have the same problem
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.