On Fri, 21 May 2021 09:39:34 -0700, in gmane.comp.hardware.beagleboard.user
"John Dammeyer" <[email protected]> wrote:

>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.

        Hypothesis: The "device" (driver) is loaded -- but the pin-mux does not
have the pins connected to the internal port(s) used by the driver... So
the driver is basically dumping output into the "bit-bucket".

        It can't really take control -- since the same pins are used by I2C
mode, if opening the "device" did the pin-mux one could really mess up data
transfers (open "I2C" start transfer, then open SPI using the same pins).

>> >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?  

https://www.kernel.org/doc/Documentation/spi/spidev
"""
    - There's a limit on the number of bytes each I/O request can transfer
      to the SPI device.  It defaults to one page, but that can be changed
      using a module parameter.

    - Because SPI has no low-level transfer acknowledgement, you usually
      won't see any I/O errors when talking to a non-existent device.
"""

along with the source for the Python spidev module, which explicitly
mentions that parameter... Though just doing 

        sudo find / -iname "spidev" 

and exploring what each result contains (or to bypass one layer)

debian@beaglebone:~$ ls -R `sudo find / -iname "spidev"`
/sys/bus/spi/drivers/spidev:
bind  module  spi0.0  spi0.1  spi1.0  spi1.1  uevent  unbind

/sys/class/spidev:
spidev0.0  spidev0.1  spidev1.0  spidev1.1

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/spidev:
spidev0.0

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/spidev/spidev0.0:
dev  device  power  subsystem  uevent

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/spidev/spidev0.0/power:
async                 runtime_active_kids  runtime_status
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_enabled      runtime_usage

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.1/spidev:
spidev0.1

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.1/spidev/spidev0.1:
dev  device  power  subsystem  uevent

/sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.1/spidev/spidev0.1/power:
async                 runtime_active_kids  runtime_status
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_enabled      runtime_usage

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.0/spidev:
spidev1.0

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.0/spidev/spidev1.0:
dev  device  power  subsystem  uevent

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.0/spidev/spidev1.0/power:
async                 runtime_active_kids  runtime_status
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_enabled      runtime_usage

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.1/spidev:
spidev1.1

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.1/spidev/spidev1.1:
dev  device  power  subsystem  uevent

/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1/spi1.1/spidev/spidev1.1/power:
async                 runtime_active_kids  runtime_status
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_enabled      runtime_usage

/sys/module/spidev:
coresize  holders   initstate  parameters  sections  uevent
drivers   initsize  notes      refcnt      taint

/sys/module/spidev/drivers:
spi:spidev

/sys/module/spidev/holders:

/sys/module/spidev/notes:

/sys/module/spidev/parameters:                          <<<<<
bufsiz                                                                          
<<<<<

/sys/module/spidev/sections:
__jump_table  __mcount_loc  __param  __verbose
debian@beaglebone:~$



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/v2pgag101omfhqgj1h5p4o03b3ilskegli%404ax.com.

Reply via email to