Thanks Dennis,
> -----Original Message----- > From: beagleboard@googlegroups.com [mailto:beagleboard@googlegroups.com] On > Behalf Of Dennis Lee Bieber > "John Dammeyer" <johnd-5o6ditlojsohvde0pjs...@public.gmane.org> wrote: > > > >The sad thing is that Derek Molloy's book, only in passing refers to > >enabling the SPI port, and the book, in trying to also deal with the > pocket beagle pins leaves out things where repetition is actually beneficial. > Maybe somewhere it says that you have to use config-pin > to set up SPI. I missed it. I think in Chapter 8 page 363 needs a bit of > work. > > One: you have to look at the default pin-mux tables -- the default for > many is as GPIO. > > Two: config-pin is discussed in chapter 6 (which also has a > hard-to-read version of the tables). It doesn't mention SPI explicitly, but > does mention that the tool is used in later chapters. My posting from Fri 14/05/2021 RE: [beagleboard] Configure CAN0 with buildroot talks about using config-pin for CAN bus. I spent so much time a number of years ago learning about SLOTs and spending time even writing my own DTS for a proto board that has a 1-wire sensor. The Logic Supply CAN cape dts was also used. I can't seem to completely unlearn (if that's the right term) and now still get very confused as to what to use and when. So I guess I should have remembered that on the 14th of May I did use config-pin for CAN so it must also be needed for SPI. > > debian@beaglebone:~$ > /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i > p9_18 > Pin name: P9_18 > Function if no cape loaded: gpio > Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input spi i2c > pwm pru_uart I've done that with the pins. But again my incorrect assumption was that the OS was intelligent enough that if I do: static const char *device = "/dev/spidev1.0"; fd = open(device, O_RDWR); if (fd < 0) pabort("can't open device"); One of two things happen. Either It opens the SPI bus which includes everything that config-pin does or it fails because config-pin wasn't done. In fact I believe that until the config-pin operations on the SPI pins is done that the /dev/spidev1.0 shouldn't exist. That they are there is incorrect information. But this is 'human factors engineering" which the Beagle (Linux?) lacks in a big way. > >Oh and none of this explains why the ioctl regardless of C or Pascal > > can't handle more than 4096 data bytes while the Python code can when sending a large bitmap to the SPI port. ... > debian@beaglebone:~$ cat /sys/module/spidev/parameters/bufsiz > 4096 > debian@beaglebone:~$ How did you know to look at this file to determine the SPI buf size? I see that it's a read only file. debian@ebb:~$ ls -al /sys/module/spidev/parameters/bufsiz -r--r--r-- 1 root gpio 4096 May 20 16:45 /sys/module/spidev/parameters/bufsiz The code I'm adapting from a 128x128 display sends out a 512x512 lenna.jpg compressed into a smaller window. Even so any sort of bit map object that is 128x128x16 for example is 32K in size. So no matter what sort of canvas I draw on inside the application, to render it out to an SPI display still requires 9 blocks of 4096 bytes. I'll look into that. Really don't want to write in Python. > A lot of that is a bit out-of-date -- references to kernel 3.8! Though > I do have to admit I can't find where in Adafruit_BBIO it might do that > set-up -- it doesn't seem to be done in the above spidev Python interface, > which is used by (now deprecated in favor of blinka/circuitpython) > Adafruit_BBIO... And I can't find a config change in blinka or > Adafruit_PureIO. {PureIO may not invoke the above spidev module, so how > /it/ handles large blocks is unknown} I was going to suggest that the BBB is now an out of date product but https://www.digikey.ca/en/products/detail/beagleboard-by-seeed-studio/102110420/12719590 shows over 4000 in stock. So maybe not? John Dammeyer > -- > Dennis L Bieber > > -- > 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 beagleboard+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/peifag10s2ohjmb53f5naa8hcgmtmhc9go%404ax.com. -- 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 beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/004f01d74e5f%24e220f7b0%24a662e710%24%40autoartisans.com.