Raspberry Pi SPI Command-line Utility Update

The Rasp­berry Pi SPI command-line util­ity, spincl, has been updated.  Ver­sion 1.3.0 is now avail­able.  iP Solu­tions orig­i­nally released the Rasp­berry Pi SPI util­ity in Feb­ru­ary, 2013, licensed under Open Source GNU GPLv3.  This spincl update is cov­ered under the same license.

The fol­low­ing items are included in the update:

  • Bug Fix:  A bug in the way the num­ber of trans­mit bytes was cal­cu­lated has been fixed.  Pre­vi­ously, if the total byte length of the trans­fer was greater than the num­ber of spec­i­fied xmit bytes then an attempt to access command-line argu­ments beyond the num­ber avail­able would occur, which causes a seg­men­ta­tion fault.
  • suid bit is now set in the install tar­get of Makefile.

iP Solu­tions orig­i­nally cre­ated the Ser­ial Periph­eral Inter­face (SPI) command-line util­ity for the Rasp­berry Pi (www.raspberrypi.org) plat­form for the con­ve­nience of hard­ware debug and to indi­rectly add SPI func­tion­al­ity to script­ing lan­guages such as Bash and Python.

Although a C library exists for the Broad­com bcm2835 with an SPI Appli­ca­tion Pro­gram­ming Inter­face (API) among other things, there are rea­sons to have a command-line util­ity, which can be invoked from a shell com­mand line or from within a script.  A command-line util­ity allows easy test­ing and debug­ging of SPI slave devices with­out hav­ing to develop a C exe­cutable.  Addi­tion­ally, it pro­vides a sim­ple way for bash and python scripts to access the SPI mas­ter of the BCM2835 on Rasp­berry Pi. Although the raspian dis­tri­b­u­tion pro­vides GPIO libraries with the included python instal­la­tion it doesn’t include an SPI library. spincl, on the other hand, can be invoked from a python (or bash) script.

Check the orig­i­nal post for a full expla­na­tion of the Rasp­berry Pi SPI command-line util­ity and to down­load the lat­est version.


Comments are closed.