spidev_test fails on Beaglebone AI

Hi Everyone,

I am trying to enable the spi interface on beaglebone AI.
I used the roboticscape device tree structure from the link below:

https://github.com/beagleboard/BeagleBoard-DeviceTrees

The show-pins command shows that spi interface is up. However, when I run the spidev_test, I receive a stream of 0’s instead of actual data.

I bridged the pins p9.29 and P9.30 before running the test.
Can anyone provide some solution to fix this issue?

Thanks
Anand

An additional information:
I can see the spi interfaces in the /dev/ folder.

Hello,

Use SPIDEV0 and not SPIDEV1. I think this may get you closer to running the test.

Seth

I already tried with both spidev0 and spidev1. No luck.

Hello,

Did you change any .dts files and then compile them? I am asking b/c I think that is what it may take for you to have the AI understand your needs for it.

Seth

P.S. Now, I am not highly educated in .dts files. I am still learning…but! I have found some ‘already-done’ files in .dts format for the AI in bb.org-overlays and DeviceTree from beagleboard.org: https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm and https://github.com/beagleboard/BeagleBoard-DeviceTrees/tree/v4.19.x-ti-overlays/src/arm .

We can work on this project together if needed. I know some people just want or wanted answers and I do not provide that per se. I would rather work on the projects in time. We can use this as a platform for making sure it is available for you, me, and for future persons/notes.

Anand,

On those two sites I have listed, there are some ideas if you scroll down for the am5729 which is what is on the AI. Now, I am sure we can configure the proper .dts file in someway. It will take time for me, i.e. as I am not a perfectionist in this field (yet).

Seth

Anand

https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/10546b0e2870033ade1e9523a28318ad22107a3d/src/arm/am572x-bone-common-univ.dtsi#L1101

Okay…that link above, oh and hello, is chip select for SPIDEV2 which is located in Linux on /dev/ but! Yes but…I want to warn you. If you change some .dts or add a .dtbo file, the board may fail to boot.

If the board fails to boot and you do not know why it is failing to boot, that is not smart. For instance, BBB.io persons made a header, three pin, on the AI to add a connection to TTY to USB ‘dongle’/converter.

Anyway, you can use the dongle to hopefully break into the serial console or find a way into uboot. Now, uboot is out of my scope. So, maybe another person will jump in if we make that far.

Okay…hopefully you are getting excited about helping me helping you helping us? Anyway…um, I will keep searching for the rest of the Controller In Peripheral Out && Controller Out Peripheral In on the .dtsi listed above. Then, I will find clock too.

Seth

Hello,

Sorry for all the posts here: https://pastebin.com/ixBWnduD is something to look through now.

I have listed SPIDEV 2.0. Enjoy! Now, we need to find out how to type up a portion of .dts formatted text into a .dts file w/ the correct syntax for the AI.

Seth

P.S. I am sure someone already knows how to do this but learning is half the battle! Answer at will!

Hello,

It is late but!

scratch everything I said. I think BBAI-SPI0.1.dts may work. Let me test it w/ a new image. I ruined my old image.

Seth

Hello Anand,

Seth here (again). Okay…so? I just received some ideas that may work. If no one else will help you, I can keep trying.

https://rcn-ee.net/rootfs/bb.org/testing/2021-02-22/buster-console/am57xx-debian-10.8-console-armhf-2021-02-22-1gb.img.xz is an image from rcn-ee.net. I think this fellow is listed on DigiKey as an employee and a member of beagleboard.org.

Anyway…that is all I know about him. Well, that and he is very good at branding images. Anyway, I got that one from him earlier today. If you do not mind losing your info. on the board, back it up it up first, use that image, and get back to your briefings.

Oh and something that is different on this image compared to other images I have found recently, uboot-overlays is back in /boot/uEnv.txt.

I am about to test. I will let you know what happens.

Seth

Anand!

They did it again! The image has all the older items I was used to using! Anyway, it works. I had a very old image on my AI which was obsolete…

  • git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees
  • cd BeagleBoard-DeviceTrees && make
  • git clone https://github.com/derekmolloy/exploringBB
  • cd exploringBB/chp08/spi/spidev_test/ && nano (or your favorite editor) spidev_test.c
  • On line 32, change ‘/dev/spidev0.1’ to ‘/dev/spidev1.1’
  • Then…
    • On your overlay that was made w/ make, C & P it in /boot/uEnv.txt
    • The file is in BeagleBoard-DeviceTrees/src/arm/overlays/
    • It is called BBAI-SPI0_1.dtbo
  • That should do it but first, reboot the board w/ sudo shutdown -r now!
    That is what I was attempting in my gibberish earlier in my 2000 posts I made but all along, I have this outdated image and was thinking I could do it w/ the current config.

Seth

Hello,

Were you successfully able to run the spidev test?
What is your kernel version on BBAI?

Thanks
Anand

Hello,

Yes…the spidev_test had run successfully. Use that image link from rcn.ee.net to update you board.

Seth

Hi Anand,

The cape compatibility layer worked very well for me, and it is also well documented. https://deepaklorkhatri.me/GSoC2020_BeagleBoard.org/

Best wishes,
Michele

Thanks Seth.
I tried with the latest image and spidev test passed.

Hello Anand,

Nice! Now, you can move on from this issue.

Seth