Also note that Derek Molly's code does not set all parameters in the structure spi_ioc_transfer.. Bad/undefined values can cause SPI to die. Ensure you set all fields to have valid values.
struct spi_ioc_transfer <http://elixir.free-electrons.com/linux/latest/ident/spi_ioc_transfer> { __u64 <http://elixir.free-electrons.com/linux/latest/ident/__u64> tx_buf <http://elixir.free-electrons.com/linux/latest/ident/tx_buf>; __u64 <http://elixir.free-electrons.com/linux/latest/ident/__u64> rx_buf <http://elixir.free-electrons.com/linux/latest/ident/rx_buf>; __u32 <http://elixir.free-electrons.com/linux/latest/ident/__u32> len; __u32 <http://elixir.free-electrons.com/linux/latest/ident/__u32> speed_hz; __u16 <http://elixir.free-electrons.com/linux/latest/ident/__u16> delay_usecs; __u8 <http://elixir.free-electrons.com/linux/latest/ident/__u8> bits_per_word <http://elixir.free-electrons.com/linux/latest/ident/bits_per_word>; __u8 <http://elixir.free-electrons.com/linux/latest/ident/__u8> cs_change; __u8 <http://elixir.free-electrons.com/linux/latest/ident/__u8> tx_nbits; __u8 <http://elixir.free-electrons.com/linux/latest/ident/__u8> rx_nbits; __u16 <http://elixir.free-electrons.com/linux/latest/ident/__u16> pad <http://elixir.free-electrons.com/linux/latest/ident/pad>; /* If the contents of 'struct spi_ioc_transfer' ever change * incompatibly, then the ioctl number (currently 0) must change; * ioctls with constant size fields get a bit more in the way of * error checking than ones (like this) where that field varies. * * NOTE: struct layout is the same in 64bit and 32bit userspace. */}; On Friday, July 7, 2017 at 3:53:10 PM UTC-5, Jeff Albrecht wrote: > > Perhaps a year or more ago I finished Part I and II of Derek Molloy's > excellent book; "Exploring Beaglebone" At the time I specifically recall > successfully running the shiftout.js in the cloud9 ide and the spi595.c > from the book. Flash forward to now I'm returning to finish part III > specifically PRUs but thought it prudent to review a bit. > > I flash my BBB with bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz > > jeffa@beaglebone:~$ cat /etc/dogtag > BeagleBoard.org Debian Image 2017-03-19 > jeffa@beaglebone:~$ uname -a > Linux beaglebone 4.4.54-ti-r93 #1 SMP Fri Mar 17 13:08:22 UTC 2017 armv7l > GNU/Linux > jeffa@beaglebone:~$ > > While working with the spi595.c I check the slots. I'm not positive but it > looks like the way to configure pins now is with c*ape-universaln*. I > also find a handy gist > <https://gist.github.com/pdp7/e56c6907e3f7fa69f01c193bc936971f> from Drew > @pdp7 where I learn about *config-pin. *I also try loading the BB-SPIDEV0 > and the ADAFRUIT-SPI0 in /etc/default/capemgr and rebooting. > > jeffa@beaglebone:~$ cat /sys/devices/platform/bone_capemgr/slots > 0: PF---- -1 > 1: PF---- -1 > 2: PF---- -1 > 3: PF---- -1 > 4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-universaln > jeffa@beaglebone:~$ > > Not getting the blinkin' lighting with the spi595.c test code from the > book, I try the simpler shiftout.js bit banging (not spi) example from the > BBB documentation <http://beagleboard.org/Support/BoneScript/shiftOut/> > and cloud9 ide. Nope. I write a quick bonescript .js to test my GPIOs by > toggling low/high. They're good. I hook up my oscilloscope to see that I'm > only getting the latch (on channel 3). Where is the clock and the serial > in? > > Are there any other changes that I may have missed? Suggestions? > > > <https://lh3.googleusercontent.com/--mjWTEk-LxY/WV_nTD6qDuI/AAAAAAAABNs/CfDfmuHlBtU0X1zXKlc9EE4KpKMsB8PUACLcBGAs/s1600/DS1Z_QuickPrint1.png> > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/a0a154ad-cb7e-467c-9ec7-3d5ae8f2d737%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
