**** BEGIN LOGGING AT Wed Dec 18 03:00:35 2019 Dec 18 15:00:15 Hi! Can someone help with SPI frequency change in pocketbeagle? Dec 18 15:02:37 that doesn't really work any different on the pocketbeagle than it does for spi devices on linux in general: the userspace interface allows you to configure the frequency as desired Dec 18 15:02:48 (the default is set in DT) Dec 18 15:04:28 do you have a more specific question? Dec 18 15:17:47 Hi, currently I'm working with Winbond Serial SPI NorFlash on PocketBeagle, C++.Debian version:root@beaglebone:~# cat /etc/issueDebian GNU/Linux 9 \n \lBeagleBoard.org Debian Image 2019-08-03I can read and write to memory connected to spidev2.1 so it works.But I cant get reading speed from memory upper 2 megabytes/s regardless which frequency I set Dec 18 15:17:47 in my C++ code (from 30 to 100 MHz). But in the same time - reading speed on OrangePI Zero is around 5 megabytes/s with the same SPI NorFlash module.In OrangePI it was pretty simple to add and init SPI interface with needed frequency value by adding Dec 18 15:17:48 /boot/armbienEnv.txt:overlays=spi-spidevparam_spidev_spi_bus=0param_spidev_spi_cs=0param_spidev_max_freq=50000000It seems the spidev2.1 interface in PocketBeagle has already been initialized and created by some config in Debian with some predefined frequency value (near 30 MHz).I read on this forum that SPI is used by PRU and it is needed to edit Dec 18 15:17:48 some *.dtb file, compile and flash PRU with it, but I don't know which file must be changed, where it lays and how to flash PRU with it to change spidev2.1 frequency from default value to ~50-80 MHz. Dec 18 15:50:27 m Dec 18 15:59:55 Hi Guys, Dec 18 16:00:09 I need a help regarding the issue ([ 4525.270371] udc-core: couldn't find an available UDC - added [ubq_gadget] to list of pending drivers ) Dec 18 16:01:19 I am using the open source usb driver to get beglebone board work as USBproxy device for connecting Dec 18 16:50:36 Siegurd: 48 MHz is the max spi frequency Dec 18 16:52:02 ai1: it's not possible to use two usb gadget drivers at the same time, so you'd need to disable the one that's configured by default if you want to use a different one Dec 18 16:52:48 Siegurd: I have no idea what you mean by the pru stuff, pru is not relevant if you just want to use spi Dec 18 16:53:30 Siegurd: also pru isn't "flashed", it executes code from ram, and a dtb file is information for the linux kernel, not for pru Dec 18 17:18:33 @zmatt Thank you I will try to find disabling it, will get back to you Dec 18 17:19:27 ai1: I think sudo systemctl disable Dec 18 17:19:29 whoops Dec 18 17:19:43 ai1: I think sudo systemctl disable generic-board-startup and then rebooting should disable it Dec 18 17:20:19 I'm not sure if that script is responsible for anything relevant other than setting up the usb gadget... not as far as I recall, but I haven't checked any time recent Dec 18 17:21:41 needless to say, you'll need to use ethernet (or wifi, whichever is applicable to the beaglebone model you're using) to connect to the beaglebone if you're going to disable the default usb gadget Dec 18 17:22:30 (since usb networking is part of the default usb gadget) Dec 18 17:24:56 zmatt: thanks alot :) I will try this with ethernet Dec 18 21:47:32 @zmatt: 48 MHz is the max spi frequency Dec 18 21:48:30 How can I set 48 MHz frequency to spidev2.1? Dec 18 21:51:05 Siegurd: it sounded like you already know how to set the spi frequency Dec 18 21:51:05 the details will depend on what language and library you're using Dec 18 21:51:05 also, to maximize transfer speed, make sure sufficiently large transfers are used Dec 18 21:52:17 (the maximum transfer size for spidev can be raised using the spidev.bufsiz kernel parameter, the default value is 4096 bytes if I remember correctly) Dec 18 21:53:50 ohh, or maybe DT imposes a maximum rather than just a default, I'm actually not 100% sure about that Dec 18 21:55:24 yeah, that must be it. the universal overlay configures a 16MHz maximum Dec 18 21:55:31 for some reason Dec 18 21:59:11 I change it in am335x-pocketbeagle.dts but it has no effect on the read speed. It still 2MBytes/s. Yes I'm reading 4096 bytes blocks.The same C++ code runing on OrangePI gives 5 Mbytes/s. So I guess the problem is the SPI frequency. Dec 18 22:02:13 when you say 2MB/s, do you mean 2*1000*1000 bytes/s or 2*1024*1024 bytes/s ? Dec 18 22:03:45 2*1000*1000 bytes/s Dec 18 22:03:52 ok Dec 18 22:06:05 i'm measure time that took 1000 readings for 4096 bytes and with the help of some math it gives actual reading speed in MBytes/s. Dec 18 22:06:11 can you check this value: perl -E 'say for unpack "N*", <>' /sys/class/spidev/spidev2.1/device/of_node/spi-max-frequency Dec 18 22:07:10 @zmatt: 48 MHz is the max spi frequency Dec 18 22:07:24 root@beaglebone:~/SPIW# perl -E 'say for unpack "N*", <>' /sys/class/spidev/spidev2.1/device/of_node/spi-max-frequency48000000 Dec 18 22:08:33 root@beaglebone:~/SPIW# perl -E 'say for unpack "N*", <>' /sys/class/spidev/spidev2.1/device/of_node/spi-max-frequencygives 48000000 Dec 18 22:09:19 you don't need to keep repeating the same thing, just saying it's showing 48MHz suffices Dec 18 22:09:58 looking at the kernel code it doesn't seem to be a maximum anyway, it's just a default Dec 18 22:10:08 despite the name Dec 18 22:13:50 lemme see if I can do a quick performance test here Dec 18 22:14:05 ok Dec 18 22:16:20 if it help my kernel version is Dec 18 22:16:21 Linux beaglebone 4.14.108-ti-r113 #1 SMP PREEMPT Wed Jul 31 00:01:10 UTC 2019 armv7l GNU/Linux Dec 18 22:51:39 hmm, it seems I'm getting 2.784 MB/s in bulk, reduced to 2.707 MB/s when using 4096-byte blocks Dec 18 22:51:42 that is odd Dec 18 22:52:07 I know the peripheral itself can do better, maybe the kernel driver is doing something stupid Dec 18 22:55:52 did you now what CS pin is used by spidev2.1? Currently i'm using GPIO as CS but not the native SPI CS pin. Dec 18 22:57:09 Maybe that GPIO slows down the SPI speed? Dec 18 22:57:10 spidev2.1 means spi1 cs1 (the off-by-one in the spi bus numbering is due to historical reasons) Dec 18 22:57:17 well I'm not using a gpio Dec 18 22:58:06 and I'm keeping CS asserted the entire time anyway Dec 18 23:04:04 spi 1 cs 1 is on P2.31 by default afaict, although it has a bunch of mux options Dec 18 23:04:35 https://pastebin.com/1gj1d1Sa Dec 18 23:05:46 btw, there should also be symlinks in /dev/spi/ that are named to actually match the hardware, i.e. /dev/spi/1.1 for spi 1 cs 1 Dec 18 23:24:01 thanks for help. I will use oscilloscope tomorrow to find out the real frequency of SPI. By the way, what SPI library do you use? Is there winbond library for pocketbeagle? Or Wiring port? Dec 18 23:24:25 never heard of either of those Dec 18 23:25:08 http://wiringpi.com/ Dec 18 23:25:24 but you can use any generic linux spi library for any programming language you want Dec 18 23:25:37 https://github.com/nopnop2002/Raspberry-W25Q64 Dec 18 23:25:54 I have my own lightweight C++ wrapper around the ioctl() interface Dec 18 23:30:04 ok, and the last question. Did you now how to make a partition from from spi-nor flash? I read about mtd, but have no idea how it can be made. Dec 18 23:31:08 you want to use the spi flash as an actual filesystem? Dec 18 23:31:51 yes Dec 18 23:31:57 oh, right, pocketbeagle... no eMMC, nor an mmc interface on the expansion headers Dec 18 23:32:39 and no, I've never done anything with mtd Dec 18 23:32:58 my guess would be it would need to be declared in DT Dec 18 23:33:20 DT? Dec 18 23:33:37 device tree Dec 18 23:33:53 my guess was right: https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/mtd/partition.txt Dec 18 23:37:24 https://github.com/RobertCNelson/linux-stable-rcn-ee/blob/4.14.108-ti-r113/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts#L494-L525 Dec 18 23:37:38 that looks like a suitable example Dec 18 23:38:33 except I'd name them partition@0 etc, partitions@0 doesn't make sense :P Dec 18 23:38:36 is there any piece of code that I may test for spi nor-flsh mtd via spidev2.1?? Dec 18 23:38:57 I have no idea what you mean by that Dec 18 23:51:20 zmatt: the example above is for m25p80 that is connected to spi0 (spidev1.0 I guess). But my flash is connected to spidev2.1, so the code has to be changed and I don't now how. Dec 18 23:52:31 oh you mean the device tree source Dec 18 23:52:38 (that's not code, it's just a data structure) Dec 19 01:51:28 Are there any people using KML wrappers w/ their GPS on the BBGW? I am asking b/c I am using it and trying to get it to give real time GPS data in Google Earth Pro. Dec 19 01:51:54 I got it to work before but I actually had to input the data into the KML wrapper. Dec 19 01:52:02 C & P! Dec 19 01:53:13 I am using gps3 on Python in the BBGW. Dec 19 01:57:09 It says I am in the Singh Empire Hotel right now for some reason. Dec 19 02:04:02 South of Africa? Nope... Dec 19 02:09:33 Adafuit_GPIO.I2C as I2C has been deprecated. Dec 19 02:10:14 Are there any ideas for making the MotorBridge Cape do things w/ I2c or other ideas? Dec 19 02:10:45 I know. It is old stuff. I am sorry. Maybe I can get the AI soon and ask questions about that too. Who knows? Time will tell. Dec 19 02:44:16 FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-75' <<<<<< This is my error for using smbus2 on python3 for the BBGW. Dec 19 02:44:23 Is there a way around this idea? Dec 19 02:44:47 Should I change group ownership on i2c-75? Dec 19 03:00:01 I change i2c-75 to i2c-1 in the source on smbus2 and I still get permission denied. What would be a good method to go about changing this error? **** ENDING LOGGING AT Thu Dec 19 03:00:12 2019