question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inconsistent spidev index on BeagleBone/PocketBeagle

See original GitHub issue

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 sometimes SPI0 is /dev/spidev1.x

For example, SPI0 is /dev/spidev1.0 when using the 4.14.108-ti-r103 kernel:

debian@beaglebone:~$ ls -ltar /dev/spidev*
crw-rw---- 1 root spi 153, 0 Apr 12 17:42 /dev/spidev1.0
crw-rw---- 1 root spi 153, 1 Apr 12 17:42 /dev/spidev2.0
crw-rw---- 1 root spi 153, 2 Apr 12 17:42 /dev/spidev2.1

However, SPI0 is /dev/spidev0.0 when using the 4.14.106-bone20 kernel:

debian@beaglebone:~$ ls -la /dev/spidev*
crw-rw---- 1 root spi 153, 0 Apr 13 13:35 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Apr 13 13:35 /dev/spidev1.0
crw-rw---- 1 root spi 153, 2 Apr 13 13:35 /dev/spidev1.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ladyadacommented, Apr 14, 2019

nice - yes id rather mess with the pins/spi index definition than the core blinka SPI code. lets keep that neat and organized 😃

0reactions
pdp7commented, Apr 14, 2019

@RobertCNelson thanks for the explanation.

@ladyada thanks, your comment made me realize that I can adjust the indexes in spiPorts inside microcontroller/am335x/pin.py

SPI0 is /dev/spidev1.x and SPI1 is /dev/spidev2.x on both:

I think spiPorts should changed from:

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found