-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inconsistent spidev index on BeagleBone/PocketBeagle #106
Comments
Short-term workaround for spidev path:Install
SPI0 is now
|
Long-term solution@RobertCNelson added udev rules to add symlinks that will not change:
For reference the udev rule:
With
|
Issue with long-term solutionI'm uncertain of the correct approach to add logic in Adafruit_Blinka to use the In theory, this logic could be added to |
Possible solution: create SPI class for am335x chipCurrently in busio, def configure(self, baudrate=100000, polarity=0, phase=0, bits=8):
if detector.board.any_raspberry_pi:
from adafruit_blinka.microcontroller.bcm283x.pin import Pin
from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI
elif detector.board.any_beaglebone:
from adafruit_blinka.microcontroller.am335x.pin import Pin
from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI However, it is possible to create elif detector.board.any_beaglebone:
from adafruit_blinka.microcontroller.am335x.pin import Pin
from adafruit_blinka.microcontroller.am335x.spi import SPI as _SPI I think that |
hiya the beaglbone maintainers need to fix onto one SPI naming, no other linux board changes the SPI port name - we'll go with whatever the latest is. |
@ladyada this situation pisses me off too, from 3.8.x to 4.4.x we dealt with uart/gpio/mmc renaming due to mainline changes. And now spi bit us in the butt with 4.14.x (but i reverted that change) to give us time to build a fix/workaround for 4.19.x. Since for me it's all personal time on this, if i have a choice between mainline and our hacks, i'll drop our patch like a rock (thank god the patchset is getting smaller). Now @jadonk, is proposing a workaround that would also a similar api naming for the incoming BeagleBone AI, such we can lock in something, while mainline will keep renaming things.. https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec Regards, |
@RobertCNelson thanks for the explanation. @ladyada SPI0 is
I think # ordered as spiId, sckId, mosiId, misoId
spiPorts = (
(0, SPI0_SCLK, SPI0_D1, SPI0_D0),
(1, SPI1_SCLK, SPI1_D1, SPI1_D0),
) to: # ordered as spiId, sckId, mosiId, misoId
spiPorts = (
(1, SPI0_SCLK, SPI0_D1, SPI0_D0),
(2, SPI1_SCLK, SPI1_D1, SPI1_D0),
) By the way, the new BeagleBone AI should hopefully launch this Summer. It uses a much more powerful TI Sitara AM5729 SoC but keeps the traditional P8/P9 BeagleBone headers. @jadonk has been working on BeagleBone cape interface spec so that we can have consistency between the new and old BeagleBones. |
change SPI index for BeagleBone/PocketBeagle #106
nice - yes id rather mess with the pins/spi index definition than the core blinka SPI code. lets keep that neat and organized :) |
This issue effects boards with the AM3358 chip such as BeagleBone and PocketBeagle. It was discovered while testing #100.
The index in the spidev path can be inconsistent between kernel builds. This means that sometimes SPI0 is
/dev/spidev0.x
and sometimesSPI0
is/dev/spidev1.x
For example, SPI0 is
/dev/spidev1.0
when using the4.14.108-ti-r103
kernel:However, SPI0 is
/dev/spidev0.0
when using the4.14.106-bone20
kernel:The text was updated successfully, but these errors were encountered: