**** BEGIN LOGGING AT Mon Mar 15 03:00:15 2021 Mar 15 13:42:44 Hello..I am trying to enable SPI interface on Beaglebone AI. I have enabled the spi pin interface using the roboticscape device tree file. However, when I run the spidev_test I get stream of 0's Mar 15 13:43:00 Did anyone face this issue? Mar 15 13:43:29 stream of zeros suggests pins are not configured correctly for that spi device, or you're using the wrong spi device Mar 15 13:44:51 I see the spidev1.0 and spidev1.1 in my /dev/ folder Mar 15 13:45:53 and my sys/class folder has spidev1.1 and spidev1.0 showing the following address: Mar 15 13:45:55 lrwxrwxrwx 1 root gpio 0 Mar 15 13:16 spidev1.0 -> ../../devices/platform/44000000.ocp/48098000.spi/spi_master/spi1/spi1.0/spidev/spidev1.0 Mar 15 13:45:56 lrwxrwxrwx 1 root gpio 0 Mar 15 13:16 spidev1.1 -> ../../devices/platform/44000000.ocp/48098000.spi/spi_master/spi1/spi1.1/spidev/spidev1.1 Mar 15 13:47:07 This is the device tree file I used to enable the spi interface at pin 29 and 30 (MISO and MOSI pins) https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.19.x-ti-overlays/src/arm/am5729-beagleboneai-roboticscape.dts Mar 15 13:48:06 What is the mistake I am doing? Any suggestion will be very helpful. Mar 15 13:49:02 looking at that dts, I don't think it actually works Mar 15 13:51:13 It does enable the SPI interface on pin P.29 and P.30. the show-pins command shows that the pins have been configured Mar 15 13:51:14 and it's definitely not been updated for the new overlays-compatible base dts that's in the v4.19.x-ti-overlays branch Mar 15 13:51:48 I am using v4.14.x-ti Mar 15 13:52:12 that's not the branch you just linked to Mar 15 13:52:22 debian@beaglebone:/sys/class/spidev$ uname -a Mar 15 13:52:22 Linux beaglebone 4.14.108-ti-r113 #1 SMP PREEMPT Wed Jul 31 00:01:10 UTC 2019 armv7l GNU/Linux Mar 15 13:52:43 if you're using a dts from the wrong kernel branch entirely, you're lucky the system even boots at all Mar 15 13:52:50 Sorry my bad : https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.14.x-ti/src/arm/am5729-beagleboneai-roboticscape.dts Mar 15 13:52:57 This is the one I am using Mar 15 13:53:33 debian@beaglebone:~/BeagleBoard-DeviceTrees$ git branch Mar 15 13:53:33 * v4.14.x-ti Mar 15 13:54:32 see what my show-pins utility says about the pins you're using: https://github.com/mvduin/bbb-pin-utils/tree/bbai-experimental#show-pins Mar 15 13:55:10 (ignore the off-by-one in spi device numbering, what matters is whether the pins you're using are indeed configured to spi mode) Mar 15 13:56:43 P9.24 163 fast 3 uart 9 txd rcleds (cape_pins_rc) Mar 15 13:56:43 P9.25 165 fast rx 14 gpio 5.17 rcleds (cape_pins_rc) Mar 15 13:56:44 P9.26a 162 fast rx 3 uart 9 rxd rcleds (cape_pins_rc) Mar 15 13:56:44 P9.26b 81 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:45 P9.27a 104 fast rx 10 qep 2 B rcleds (cape_pins_rc) Mar 15 13:56:45 P9.27b 172 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:46 P9.28 184 fast 3 spi 2 cs0 rcleds (cape_pins_rc) Mar 15 13:56:46 P9.29a 182 fast rx 3 spi 2 d1 rcleds (cape_pins_rc) Mar 15 13:56:47 P9.29b 170 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:47 P9.30 183 fast 3 spi 2 d0 rcleds (cape_pins_rc) Mar 15 13:56:48 P9.31a 181 fast 3 spi 2 sclk rcleds (cape_pins_rc) Mar 15 13:56:48 P9.31b 169 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:49 P9.41a 168 fast 14 gpio 5.20 rcleds (cape_pins_rc) Mar 15 13:56:49 P9.41b 96 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:50 P9.42a 185 fast down 15 unused rcleds (cape_pins_rc) Mar 15 13:56:50 P9.42b 103 fast rx 10 qep 2 A rcleds (cape_pins_rc) Mar 15 13:57:00 anpra: don't ever do that again Mar 15 13:57:05 anpra: do not paste multi-line output into chat Mar 15 13:57:28 okay.. Mar 15 13:57:32 anpra: use a paste service like pastebin.com Mar 15 13:57:56 sure..will follow that in future Mar 15 13:58:35 but I do see the problem, the spi sclk pin should have input-enabled (i.e. use PIN_INPUT) but it's been configured as input-disabled (PIN_OUTPUT) Mar 15 13:58:55 this results in the shift-register not being clocked, hence no data actually gets transmitted or received Mar 15 13:59:07 so that's simply a bug in the dts Mar 15 13:59:19 ah okay..let me try this Mar 15 13:59:40 will publish my results in a short while Mar 15 14:00:23 ("PIN_INPUT" and "PIN_OUTPUT" are badly named: PIN_INPUT means input-enabled, PIN_OUTPUT means input-disabled (always reads as zero), neither option has any impact on output-enable) Mar 15 14:00:38 so it's always safe to use PIN_INPUT, using PIN_OUTPUT is just an optimization Mar 15 14:01:37 but some seemingly output-only pins (especially clock outputs) may stlll need to be input-enabled if the clock is being retimed for improved timing specs Mar 15 14:04:57 I also have this example of how to make a custom dts for the BBAI that enables an SPI port: https://pastebin.com/iXbGGtzz Mar 15 14:06:12 what the fuck pastebin Mar 15 14:06:36 "Pastebin’s SMART filters have detected potentially offensive or questionable content in your paste" Mar 15 14:08:44 Thanks zmatt : Let me try the dts provided by you Mar 15 14:10:09 likely pastebin "filters" are cheap and have lots of false positives. Mar 15 14:11:50 however people likely started abusing pastebin hence why they are "trying" to be proactive. Mar 15 14:14:39 What's a good place to report a typo on the website? Mar 15 14:18:42 GenTooMan: I tried a binary search to find whatever offended the filter but that doesn't work: individual parts are accepted, just not when put together... it must be score-based Mar 15 14:19:51 rschulman: directly to jkridner[m] probably, I don't know if there's a better way Mar 15 14:22:28 GenTooMan: I've reported the false positive, let's see if it actually gets a response... I do have a pro account, maybe it counts for something :P Mar 15 14:35:37 Thanks zmatt . I sent them a note about it. Mar 15 14:36:48 My real question: Are there any new Beagle boards being designed right now? If so is that done in public? It would be interesting to lurk in the conversations to follow along. Mar 15 14:37:20 the beaglev is the new hotness ;P Mar 15 14:38:06 but design-phase discussion doesn't seem to be very open no Mar 15 14:46:48 well it would be nice to see an initial "idea", and an RFC from people involved with the beagle board stuff. Mar 15 14:50:05 however I can understand the issue with "noise" when doing such things. Mar 15 14:53:02 steven100: IMG released an OpenCL class for BeagleBone Black.... Mar 15 14:53:17 they did? Mar 15 14:53:19 it is very limited... the application they found for it I believe was sample rate conversion. Mar 15 14:53:25 zmatt: yeah, kinda new Mar 15 14:53:38 https://university.imgtec.com/fun-with-beagle-gpu/ Mar 15 14:54:32 the production version of BeagleV will also include an IMG core and we are working to try to make more of it open. Mar 15 14:55:06 the IMG SGX cores have been a royal pain in their closed nature... a real drawback from how reasonably the rest of the SoCs have been documented. Mar 15 14:55:14 mhh, need to register to download? :/ Mar 15 14:55:21 :-( yeah Mar 15 14:55:42 very much targeted at universities/students, not open source developers. Mar 15 14:56:04 but, it gives a little. we keep pushing for more. Mar 15 14:57:28 I've been trying to figure out how to give guest users some kind of history in this channel (and #beagle-gsoc even more so) so they don't have to go searching websites for it. Mar 15 14:57:39 over in #freenode, jess just showed me https://ircv3.net/specs/extensions/chathistory Mar 15 14:58:44 I'm trying to figure out if that somehow can make irccloud or kiwiirc a better path to newbs than matrix, which has been a real pain with lags and other issues. Mar 15 15:01:22 the website is getting revamped and chat/forums are part of the clean-up. so far, chat.beagleboard.org is a bust as it is running on AWS and freenode blacklists non-SASL logins from AWS IP ranges. Mar 15 15:02:07 jkridner: in fact you can't even register to download unless you're associated with a university, that sucks :/ Mar 15 15:02:20 there will also be a docs.beagleboard.org to try to move stuff from github that isn't google searchable. Mar 15 15:02:24 zmatt: really? Mar 15 15:02:27 yeah Mar 15 15:02:38 I'll complain to Robert about that. Obviously I didn't even try. Mar 15 15:03:32 like, OpenCV support, even if limited, would greatly increase the usefulness of the SGX530 on the BBB, which almost always goes unused currently Mar 15 15:08:15 is this the myserious ImgTec image that has appeared on https://beagleboard.org/latest-images a while back? Mar 15 15:09:02 I assume not, it just says it includes the 3D developer kit, no mention of OpenCL Mar 15 15:14:15 zmatt: I used the dts file provided by you and tried executing the spidev test. Still getting the same result. Stream of zeros Mar 15 15:14:51 I shorted pin 18 and pin 21 when I ran the test Mar 15 15:15:10 of the P9 header Mar 15 15:15:45 maybe something wrong with the test itself? dunno Mar 15 15:16:45 double-check the pinmux using show-pins Mar 15 15:17:46 I don't remember whether I actually tested this dts snippet, it's been a while Mar 15 15:18:02 I *think* I did, but I'm not 100% sure Mar 15 15:19:49 Here is the pinmux settings: https://pastebin.com/TWngcNCk Mar 15 15:20:05 It shows its configured for spi Mar 15 15:20:28 yep, seems fine to me Mar 15 15:20:31 I double checked the spidev_test as well. Seems correct Mar 15 15:21:09 and you're testing with /dev/spidev2.0 ? Mar 15 15:21:17 So ideally I should receive the same data. Mar 15 15:21:24 Yes.. Mar 15 15:21:58 However I even tried with spidev2.1 as well Mar 15 15:22:19 yeah that shouldn't make any difference for this loopback test, although /dev/spidev2.0 is the correct one to use Mar 15 15:23:10 I am out of ideas now..the same test works for Nvidia AGX board Mar 15 15:23:40 I know the mcspi peripheral itself works fine, so there's probably something silly we're overlooking Mar 15 15:25:41 I can't do a test on a bbai right now, but maybe later today Mar 15 15:27:57 okay so here are the steps to summarize.. Mar 15 15:27:57 a) I created the dts file with your content and compiled it successfully using the Makefile script in https://github.com/beagleboard/BeagleBoard-DeviceTrees/tree/v4.14.x-ti Mar 15 15:27:58 b) Copied the respective dtb file to /boot/dtbs/4.14xx/ folder. Modified the uEnc.txt file with the latest dtb file. Mar 15 15:27:58 c) Reboot. Shorted pin 18 and 21. Ran ./spidev_test -v -D /dev/spidev2.0 Mar 15 15:29:26 zmatt: sure please let me know your results Mar 15 16:21:51 jkridner: yep I saw that openCl class, it confused me because I thought the SGX530 only supports openGLES. but apparently they provice their own opencl driver? thats kinda cool :D Mar 15 16:22:13 it would be cool, it if were actually available ;P Mar 15 16:25:30 yep their website confuses me... Mar 15 16:36:22 Anyone who successfully executed spidev_test on Beaglebone AI? Mar 15 16:36:49 GenTooMan: and pastebin responses! Apparently the "XXX" in the comments was (part of) the trigger Mar 15 16:39:25 seriously? that's ... a bit of a simple minded approach. Mar 15 16:43:05 are you allowed to say memphis? Mar 15 16:52:19 GenTooMan: yeah I'm currently running a grep of the linux kernel source tree to illustrate why it's not a great idea to filter on that keyword ;) still, I appreicate I got quite a rapid response that was actually useful Mar 15 16:53:11 the linux kernel source was more fun before they purged all the naughty comments Mar 15 17:06:08 this sounds like the idiot Andrew Coumo attacking ISPs for hosting usenet as distributing child porn. Mar 15 17:06:28 They prototyped OpenCL on the SGX530 before adding support for newer controllers. Because there are so many BeagleBone Blacks in the wild, they decided to release this fairly limited OpenCL to get some exposure. Mar 15 17:07:37 I dropped them a note about the only-from-universities thing and hope they'll fix it. Mar 15 17:08:33 jkridner: I think there'd be plenty of people interested in getting the GPU to do computational work on the BBB, so their idea was sound, but I think they kinda fucked up the "releasing" part of that idea ;P Mar 15 17:09:00 and possibly the "getting exposure" part, this is the first time I've heard of it Mar 15 17:51:21 For one...I can say I would like to use graphics. I actually know a person that may use it. Odd heh? Me and knowing people...ha. Mar 15 17:52:03 I finally got the SGX lib. on my bbb via sftp and cross-compiled the source they produced. Mar 15 17:52:12 Hi, I have automount usb in etc/fstab. But occasionally, it fails. When plug in usb,  /dev/sda1 not listed Mar 15 17:52:13 I am on that road! Mar 15 17:53:57 I got it to work w/ the Debian Buster distro so far. I have not updated the kernel though to 5.4.x or any other. I am still on 4.19.x. Mar 15 17:54:45 It is neat! I got the gnome to work...he keeps on swingin'. Anyway, I cannot wait to try out my own stuff/graphics. Mar 15 18:12:48 Anyway, lots to do and many projects are in the works. BBL! Mar 16 00:31:00 oh nice, fstrim on a loopback-mounted filesystem actually digs holes in the image file Mar 16 00:39:18 ooof Mar 16 00:39:27 wtf are matrix users voiced here -sigh- Mar 16 00:39:33 matrix spam ftl. Mar 16 00:40:03 that's a great question Mar 16 00:44:53 jkridner: why do matrix users gets automatically voiced? Mar 16 00:51:33 GenTooMan: pastebin responded again, they're going to tweak the filter :D Mar 16 00:52:06 honestly I'm quite positively surprised, I was mentally prepared for my complaint to go straight into /dev/null Mar 16 00:53:28 zmatt well be sure to give a positive note on their protectiveness on dealing with the issue. Mar 16 00:54:33 yes in general the internet is apathetic toward what they do. So much so you expect an insufferable amount of it. Mar 16 01:59:36 well, the idea was to enable guests. thought matrix did an ok job of making sure its humans, but finding out otherwise. Mar 16 01:59:59 "enable" ? Mar 16 02:01:09 my guess would be this was from when +m was used against spambots instead +q/+e rules? Mar 16 02:01:54 there's a +e for *!*@gateway/* **** ENDING LOGGING AT Tue Mar 16 03:03:12 2021