You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPI calls fail with "Message too long" regardless of the length of message.
On investigation it's because struct spi_ioc_transfer uses UnsafeMutableRawPointer for tx_buf and rx_buf, but /usr/include/linux/spi/spidev.h defines these pointers as __u64
If I add 32 bits of padding after these 2 members in to struct spi_ioc_transfer the SPI calls succeed.
The text was updated successfully, but these errors were encountered:
Thanks @barretpj@gestrich, exactly, 1.1.15 introduced this change that broke it and the fix is converting to an uint64 via bitpattern (that
actually adds a padding at the beginning if necessary), will fix/test it as soon as I can get a hold of a pi.
Board Type
Raspberry Pi Zero W
Operating System
Raspberry Pi OS Lite
Linux raspberrypi 5.4.51+ #1327 Thu Jul 23 10:53:06 BST 2020 armv6l GNU/Linux
Swift Version
Pre-built from https://github.com/uraimo/buildSwiftOnARM/releases/download/5.1.5/swift-5.1.5-armv6-RPi01234-RaspbianBuster.tgz
Description
SPI calls fail with "Message too long" regardless of the length of message.
On investigation it's because
struct spi_ioc_transfer
usesUnsafeMutableRawPointer
fortx_buf
andrx_buf
, but/usr/include/linux/spi/spidev.h
defines these pointers as__u64
If I add 32 bits of padding after these 2 members in to
struct spi_ioc_transfer
the SPI calls succeed.The text was updated successfully, but these errors were encountered: