**** BEGIN LOGGING AT Fri Oct 06 03:00:01 2017 Oct 06 04:56:53 How quickly can PRU pins change direction? Oct 06 05:03:52 Hey there: Can I please have control over my BBBW? I just went into /sys/fs/btrfs for starters and tried to change some files with sudo. Permission Denied is the computer response. Send rations! Oct 06 05:04:45 ... Oct 06 05:05:25 I am on break for five minutes. Be back in a jiff. Oct 06 05:10:11 might it be a read-only file? Oct 06 05:10:19 I guess. Oct 06 05:10:29 Probably. Oct 06 05:10:33 ls -l to check? Oct 06 05:11:02 Okay. Thank you. Maybe I can change that aspect to that file. Oct 06 05:11:48 Yep...just -r--r--r-- Oct 06 05:12:35 it's possible that even if you can chmod +w it it won't do anything Oct 06 05:13:05 Oh. What about making it writeable? Oct 06 05:13:15 C++? Oct 06 05:13:26 chmod +w /sys/fs/btrfs ? Oct 06 05:13:41 Oh. Okay. I can try that, too. Oct 06 05:13:48 and I mean 'won't do anything' as in by writing to it you can't change anything. Oct 06 05:14:06 There are about eight or nine files in that directory. Oct 06 05:14:12 because sysfs is typically stuff generated by the kernel and kernel modules. Oct 06 05:14:15 I just need to change one for trials. Oct 06 05:14:21 Oh. Oct 06 05:14:42 Some things you can change, other things are probably just informational. Oct 06 05:15:04 I cannot write kernels or kernel modules. Oct 06 05:15:26 Back to the old drawing board. Oct 06 05:15:32 what are you trying to do? Oct 06 05:16:08 Run some software out of a book. Oct 06 05:16:35 uh, can you show us what the software is? Oct 06 05:16:35 I get a RuntimeError: Problem with sysfs file. Oct 06 05:16:40 Sure. Oct 06 05:16:42 Please hold. Oct 06 05:16:44 or what book? Oct 06 05:17:17 Oh, "Getting Started with BeagleBone," (Richardson 2014). Oct 06 05:17:31 I am going to use pastebin. One moment. Oct 06 05:18:34 stuff for modifying GPIO? Oct 06 05:18:51 https://pastebin.com/FyRSG8me is the software but I keep changing it to suit the needs of the system. Oct 06 05:18:53 Adafruit_BBIO or something Oct 06 05:18:59 Yea. BBIO. Oct 06 05:19:10 That is part of it. Oct 06 05:20:18 I use Flask, Python, and Adafruit_BBIO to produce PWM results and a normally open window sensor. Oct 06 05:20:47 ... Oct 06 05:21:35 what's up? Oct 06 05:21:48 Heh? Oct 06 05:21:51 What do you mean? Oct 06 05:21:54 "..." Oct 06 05:21:57 Oh. Oct 06 05:22:00 I was typing. Sorry. Oct 06 05:22:12 I will finish the information now. Oct 06 05:23:13 So, I changed line 6 to PWM.start("P8_13, 1) to test out int instead of float. Oct 06 05:23:46 I got the same response for the RuntimeError: Problem with sysfs file. Oct 06 05:24:32 I changed some gpio23 text files, too. Oct 06 05:24:36 Same response. Oct 06 05:24:57 sysfs file issues. Oct 06 05:25:15 problem with sysfs file usually means you're doing something that the kernel doesn't allow or does not understand for that particular peripheral Oct 06 05:25:25 Aw! Oct 06 05:25:59 given that, maybe the pin you're trying to use for PWM doesn't support PWM? Oct 06 05:26:26 I thought that after listening to someone. Oct 06 05:26:34 I tried a bunch of different pins. Oct 06 05:26:41 PWM pins. Oct 06 05:27:02 I tried them on P9 and on P8. Oct 06 05:28:14 not all pins might be available Oct 06 05:28:24 I also tried config-pin, bone_capemgr, and enabling pins on the uEnv.txt file. Oct 06 05:28:31 I found that this pin is available. Oct 06 05:28:31 a lot of pins are in use by e.g. HDMI and the eMMC Oct 06 05:28:36 and the SD card Oct 06 05:28:48 I know. I took this into account. Oct 06 05:29:14 One thing I do not know is how cape_universal works with Adafruit_BBIO. Oct 06 05:29:21 There could be a work around. Oct 06 05:29:57 I might never know. Oct 06 07:38:38 the workaround is probably... not using Adafruit_BBIO Oct 06 08:20:51 Hi, I have to run a bash script to check a gpio state every 5 minutes, what's the best way to do ? cron ? a loop script recalling the previous one ? thanks Oct 06 08:26:05 I don't think there's a "best" way for something like that, just do whatever you prefer Oct 06 08:27:08 if it only has to do something briefly every 5 minutes, then using cron or a systemd timer unit probably makes the most sense Oct 06 09:49:07 zmatt: You are probably right. I may have to change the software. Oct 06 09:51:23 it's probably not too hard to emulate its existing PWM lib with a small amount of python code Oct 06 09:52:49 where could I find that lib? Oct 06 09:53:33 in the code you'd need to write Oct 06 09:53:41 Oh. Oct 06 09:54:04 which actually merely consists of writing to certain sysfs attributes Oct 06 09:54:48 in either /sys/class/pwm/* or /sys/bus/pwm/devices/* .. not sure which it is but you can check Oct 06 09:55:12 Oh. Oct 06 09:55:45 I will have to look into this idea. Oct 06 09:56:19 I have been reading from kernelnewbies.org. Oct 06 09:56:44 There is so much info. on these pages. Oct 06 09:57:08 I am also getting to know the kernel.org/docs/documentation pages. Oct 06 09:57:16 ... Oct 06 09:58:52 I looked up sysfs online. I found a kernel.org page on it. Oct 06 10:00:37 Thank you Oct 06 10:00:54 sysfs isn't particularly hard to work with Oct 06 10:01:27 it's basically an interface to devices and other kernel objects, dressed up as a pseudo-filesystem Oct 06 10:01:48 That is what I read. Oct 06 10:02:01 Usually they only have one value when they can. Oct 06 10:02:58 it's also nice that you can just read most of them to get an idea what's going on Oct 06 10:03:55 I found a lot of files that have more than one value. This threw off my beginning conclusion. Oct 06 10:04:29 ... Oct 06 10:04:46 set_: to be fair, controlling stuff (like gpio and pwm) via sysfs feels a bit like abuse Oct 06 10:05:01 it's important to note that even if a virtual file contains quite a lot, it might only accept *one* value as input or a certain format Oct 06 10:05:13 but, compared to making "proper" devices, it's convenient both from the kernel side and for users Oct 06 10:05:32 I found in sys/class/pwm some pwmchip0 directories. Oct 06 10:06:11 pwmchip0-2 probably/hopefully correspond to eHRPWM 0-2 Oct 06 10:06:20 Cool! Oct 06 10:06:30 This is extremely helpful for info. Oct 06 10:07:05 the right way to verify this is by inspecting those dirs (or by using libudev to locate them instead of manually digging through sysfs) Oct 06 10:08:10 I was dealing with GPIO_23 this entire time in sys/class/gpio/gpio23 and changing files. Oct 06 10:08:43 Okay. Oct 06 10:08:58 libudev has commands I am sure. I have not used it before. Oct 06 10:09:36 yeah, for gpio the same thing is true: in practice the correspondence is true, but officially it can't be relied on Oct 06 10:10:00 the kernel assigns the numbering merely in sequential order when it discovers the gpio devices Oct 06 10:11:04 fortunately, for most platform devices this order should just be the order in which they're encountered in DT Oct 06 10:11:41 I noticed that many of these sys/fs directories and files, just like in sys/class/pwm and sys/class/gpio, have either a 0 or a 1. Oct 06 10:11:55 The entire file is just a one digit value on some of them. Oct 06 10:11:59 sometimes Oct 06 10:12:24 there are string attributes, numeric attributes, boolean attributes, weird-behaving attributes, even attributes with a big blob of binary data Oct 06 10:12:55 Should I read into this idea? I mean to say, does the single digit embody something? Does it stand for something that is worth reviewing? Oct 06 10:12:56 ... Oct 06 10:13:36 also, even for "simple" read/write attributes, you don't necessarily read back the value written (see e.g. the "trigger" attribute of led devices, or the fact you can write "high" or "low" to the "direction" attribute of gpio devices) Oct 06 10:13:52 uhh, that 0 or 1 means 0 or 1 Oct 06 10:13:59 or possiblye false or true Oct 06 10:14:04 *possibly Oct 06 10:14:14 that will depend on the attribute Oct 06 10:14:23 My software calls for a float attribute but there are no float values in those files and directories, i.e. so far. Oct 06 10:14:41 Oh. I figured it was high or low/true or false/and etc... Oct 06 10:14:50 On/off. Oct 06 10:14:58 it may be, yes. depending on the attribute. Oct 06 10:15:21 floating-point values are very unlikely to be encountered since the kernel doesn't use floating-point arithmetic anywhere Oct 06 10:16:28 (the linux kernel runs on processors that don't necessarily have floating-point support, and even if the processor does it may be problematic to use floating-point instructions in kernel space) Oct 06 10:16:29 oh. This could be the bug in the software is what I thought. I was calling a float value to set my LED to low. Oct 06 10:16:42 Oh. Oct 06 10:17:18 I have no idea what you're trying to say Oct 06 10:17:31 I know. I was being foolish. Oct 06 10:17:42 your software is currently not using the raw sysfs interface yet presumably Oct 06 10:17:53 Right. Oct 06 10:17:56 It is not. Oct 06 10:18:25 it's entirely possible that wrapper libraries rescale the values to a range that someone decided is more user-friendly Oct 06 10:18:46 I thought those values or value in one file was not floating point, I should write my software to adjust to the single digit. Oct 06 10:18:47 Oh. Oct 06 10:19:14 It was a hunch without science backing it. Oct 06 10:19:40 e.g. led devices (/sys/class/leds/*) have a (read-only) "max_brightness" property that indicate the maximum value of the "brightness" property Oct 06 10:20:06 So zmatt: What do you think I could do about this /sys/class/pwm set of files. Should I change any of them? Oct 06 10:20:06 a nice wrapper might rescale that to 0.0 - 1.0 so the user doesn't need to worry about that Oct 06 10:20:13 ... Oct 06 10:20:14 Oh. Oct 06 10:20:16 Okay. Oct 06 10:20:45 explore the contents, with some luck it might be obvious how to use the interface Oct 06 10:20:48 or look up the docs Oct 06 10:21:19 I do know that you can control pwm outputs via sysfs attributes, I just don't remember the specifics Oct 06 10:21:33 I got what you are saying about the LEDs. Part of this software was to change the brightness of the LED based on the page value from Flask, e.g. 192.168.7.2:5000/LEDlevel/50 would be at half brightness. Oct 06 10:21:52 Okay zmatt: No issue. Oct 06 10:22:06 This is what I thought I could do. i will keep researching. Oct 06 10:22:09 yeah, rescaling 0-100 is another option of course. like I said, whatever the author of the lib/program thought was convenient Oct 06 10:23:17 Dang...back to the old drawing board. Oct 06 10:23:28 ? Oct 06 10:24:36 Well, it is either writing my own software outside of this introduction or managing sys/fs directories to see if they can be altered to suit the software's needs. Oct 06 10:25:19 I have no idea what you could possibly mean by the latter Oct 06 10:26:04 Okay...no issue. I am wrong. Oct 06 10:26:51 I keep making the mistake that I can alter the software that came with the BBB to suit my needs for software development. Oct 06 10:26:54 This is all. Oct 06 10:27:23 of course you can alter it, or ditch and replace it Oct 06 10:27:54 well, I suppose I don't know if *you* can do so, but... :P Oct 06 10:28:14 I know...me, me, me. Oct 06 10:28:26 I might not be able to do it just yet. Oct 06 10:29:56 ... Oct 06 10:30:14 I just noticed there is not a direction file in the pwm directory. Oct 06 10:30:24 why would there be Oct 06 10:31:15 I thought since it is a GPIO too, I could change it by echo > pwm export. Oct 06 10:31:42 pwm isn't gpio, those are different functions a pin may have Oct 06 10:32:12 So, I cannot echo out > direction a PWM pin? Oct 06 10:32:39 it's always an output once you configure the pin to pwm Oct 06 10:32:48 (using config-pin) Oct 06 10:33:26 I do not know if you remember but again, there is something i am missing. Oct 06 10:33:51 <<< on break for a smoke and sorry for the lack of knowledge on my part. Oct 06 10:48:17 I have five pwmchip*, where * is a numerical value, but I have eight possible PWM pins. Oct 06 10:48:32 at /sys/class/pwm Oct 06 10:49:45 Maybe one of the three not listed is the pin I am using. Heh? Oct 06 11:23:55 a pwmchip doesn't correspond to a single pin Oct 06 11:24:08 three of them will be eHRPWM devices, which have two outputs each Oct 06 11:24:22 the other two are probably eCAP devices I guess Oct 06 11:24:36 so that gives a total of 8 outputs Oct 06 11:29:13 Oh. Oct 06 13:29:25 newbie help : how to verify is a variable value is between two values in shell ? does this work ?? if (( 10 < $value < 20 )); then ...... Oct 06 13:30:46 instead of asking, you could simply have tried it with a few test cases to discover that no, it doesn't work Oct 06 13:32:21 the reason it doesn't work is that it will interpret it as (10 < $value) < 20 Oct 06 13:32:45 10 < $value is either 0 or 1, so you get 0 < 20 or 1 < 20 Oct 06 13:32:52 both of which yield 1 Oct 06 13:33:00 I have multiple sequential checks if, then, elif, then, elif...... it seems it hangs at first.... Oct 06 13:33:30 you want 10 < $value && $value < 20 Oct 06 13:36:31 https://pastebin.com/pUiPaE8f Oct 06 13:37:13 Just checked....great !!!! Thank you :-)) Oct 06 13:48:54 Anyone have some time to help a newbie troubleshoot some UART problems? Oct 06 13:49:11 as in, I can't get my UART pins to work at all Oct 06 13:49:35 did you configure them using config-pin ? Oct 06 13:50:21 nope! I've just been using the adafruit_BBIO setup Oct 06 13:50:38 Do I need to do both? Oct 06 13:51:13 I'm pretty sure that Adafruit_BBIO's uart setup doesn't work at all on current images, it was made for older ones and never updated Oct 06 13:51:31 oh woof Oct 06 13:51:54 good to know. I'm running the latest debian image from beaglebone.org Oct 06 16:09:56 Hi, I actually can run qt quick application with eglfs platform on my beagle bone black with a capacitive touch srcreen. I am trying to use kivy the same way (without X) anyone succeeded this ? Oct 06 16:11:10 huh? Oct 06 16:16:14 Kivy is a Cross-platform Python Framework for UI Development and as QT quick it uses opengl es for graphical rendering Oct 06 16:21:27 then I'd expect it to work Oct 06 16:24:35 I tried to compile it (kivy) and always the same error when launching a kivy app : Unable to find any valuable Window provider Oct 06 16:25:40 no idea, never used that Oct 06 16:27:15 ok thanks anyway.. Oct 06 16:27:33 don't they have an irc channel or such? Oct 06 16:28:15 ha, #kivy here on freenode Oct 06 16:30:26 I'll try with them, thanks! Oct 06 19:09:33 How quickly can one change the direction of the PRU pins? Oct 06 19:10:36 have you tried looking at the TRM for the AM335x SoC in that regard? (it might be a general value not pru specific) Oct 06 19:11:47 so, in general, one does it by writing to the general config registers for the pinmux? Oct 06 19:11:57 I'll take a look. Oct 06 19:14:51 it might really be as fast as you can write to the registers. To be really sure you'd probably want to look at it with a scope or such Oct 06 19:21:25 note that pruss also has a local peripheral (IEP, specifically the EDIO subcomponent thereof) which can do bidirectional I/O Oct 06 19:23:53 won't be quite as fast as the pru direct i/o, but toggling the direction of those is quite problematic since this requires writing to the padconf registers in the control module, which PRU can't do directly since the control module ignores unprivileged writes Oct 06 19:24:46 aaaand this is why I asked Oct 06 19:25:16 you could do a crazy hack like setup a privileged EDMA transfer that can be triggered by pru cores, but that requires a fair bit of effort Oct 06 19:26:15 doing I/O via EDIO should still be pretty low-latency and have predictable timing, unlike using the normal GPIO peripherals Oct 06 19:26:53 :) Oct 06 19:27:38 there's some example by TI that uses EDIO to make the 1-wire protocol Oct 06 19:28:38 still trying to find documenation on it, can it expand to 8 bi-directional wires? Oct 06 19:30:26 yes. check the PRU tab of my pins spreadsheet for pin assignment -> https://goo.gl/Jkcg0w Oct 06 19:31:59 one thing I haven't checked is why there are still separate mux modes for edio "in" and "out" .. I suspect "in" means in-only while "out" means "in/out" Oct 06 19:34:30 oh: also, are these available on the pocket beagle? going to bring up the pinout and see if I can spot it, but... Oct 06 19:34:57 I haven't studied the pinout of the pocket beagle in any detail Oct 06 19:35:21 using the gpio numbers for pins is probably the easiest way to match pocketbeagle pins to my spreadsheet Oct 06 19:35:38 k Oct 06 19:38:39 this is the image I'm looking at, some things don't seem to be matching up to me. missing information? https://github.com/beagleboard/pocketbeagle/wiki/images/PocketBeagle_pinout.png Oct 06 19:39:53 https://github.com/beagleboard/pocketbeagle/blob/master/KiCAD/plots/PocketBeagle.pdf Oct 06 19:40:05 oh yuck it numbers gpios with bank*32+pin Oct 06 19:40:58 e.g. "gpio 40" would be "gpio 1.08" in my spreadsheet Oct 06 19:41:25 ah Oct 06 19:42:40 SIP-C in that pdf lists the relevant signals Oct 06 19:49:34 it appears that edio 6/7 are missing on the pocket beagle. Oct 06 19:51:16 both mux options for those? Oct 06 19:51:25 so far as I can tell. Oct 06 19:53:00 76/77 and 62/63 appear to not be present. Oct 06 19:54:25 likewise, pru1 6/7 and 12/13 do not appear to be present. Oct 06 19:57:15 well, at least I know that if I'd like to use EDIO for this, I shouldn't get a pocket beagle. it's a shame. Oct 06 19:59:38 (I feel it would be worth looking into crazy EDMA hacks at some point though, if nothing else than to prove it can be done and see how effective it is) Oct 06 20:06:45 fwiw, it can be done without any kernel programming :) Oct 06 20:10:47 using UIO? Oct 06 20:11:08 /dev/mem but close enough ;) Oct 06 20:11:49 and some reservations made in DT Oct 06 20:12:31 fair enough Oct 06 20:12:56 to perform a privileged write from userspace you can use this hack -> https://github.com/dutchanddutch/jbang/blob/master/src/privileged.h Oct 06 20:17:50 self-jtag. wow. haha Oct 06 20:18:01 ^_^ Oct 06 20:18:05 I had some fun Oct 06 20:18:20 I would hope so! Oct 06 20:18:32 someone did actually put it to use Oct 06 20:18:56 adapted it to the omap3, to be able to use a watchpoint to track down an annoying memory corruption issue that happened in the field Oct 06 20:19:35 the kernel doesn't support watchpoints on the cortex-a8, but that wasn't a problem: he just configured one anyway, and when it hit the kernel is really confused and dumps a stack trace, which was all he needed :D Oct 06 20:19:49 hahahahaha Oct 06 20:20:13 very excellent Oct 06 20:21:10 I take it the privileged write is needed to setup the privileged EDMA transfer? Oct 06 20:21:48 yeah, edma proxies the privilege of whoever configured the transfer Oct 06 20:22:04 got it Oct 06 20:22:43 you could e.g. copy values from pru memory to the relevant control module registers Oct 06 20:23:49 any reason to do it from pru memory instead of having two setup (data in/data out) and doing it from main memory? Oct 06 20:24:43 I mean, pru memory would be more extensible, but I'd just need to switch all of the data pins back and forth Oct 06 20:25:17 hm, doing it from pru memory *would* be a better general purpose PoC. Oct 06 20:25:39 you could do that too, by using two dma requests from pruss (or setting up two transfers in a ping-pong fashion, so each pru dma request would toggle) Oct 06 20:26:44 pru memory almost certainly has lower access latency for edma than main memory, but either would be fine Oct 06 20:27:38 mmm Oct 06 20:27:55 if you're lucky you may be able to use a "fifo mode" transfer for the edma read to reuse the same 32-bit value for all control module writes Oct 06 20:28:08 that assumes the same mux mode works for all pins that need to be toggled of course Oct 06 20:29:06 plenty of options with different trade-offs :) Oct 06 20:30:42 k. I'm gonna go save this conversation somewhere for once I get a beaglebone, guess I won't get a pocket beagle to make sure I have edio available just in case crazy edma hacks don't work. Oct 06 20:31:28 yeah the pocketbeagle is designed to be tiny, but sacrifices have obviously been made for that Oct 06 20:32:57 Tiny would be nice, but being able to do it all is even better. Oct 06 20:33:44 tiny *and* having it all... deadbug an osd3358 ;-) Oct 06 20:34:23 hahaha... not going to happen Oct 06 20:35:51 I mean I could create my own board for this if I'm successful... but I'd much rather have people buy a pocket beagle and stick it onto a board that just routes pins to the right place. Oct 06 20:36:43 damn, this is tidy work.... http://dangerousprototypes.com/blog/wp-content/media/2012/10/pyxis2010-testpcb1.jpg Oct 06 20:37:13 wow Oct 06 20:39:26 bypass caps soldered directly onto the bga of course Oct 06 20:40:03 http://www.chiaki.cc/Pyxis2010/images/pyxis2010-fpgasol1.jpg Oct 06 20:40:44 (power supply routing for this FPGA) Oct 06 20:40:56 this earth has some crazy people in it :D Oct 06 20:45:20 No kidding! Oct 06 20:45:37 I... do not have the skill for that. Oct 06 22:46:54 Are there any docs on using the PRUs on the PocketBeagle? Oct 06 22:47:36 apart from pin setup, it's the same as on a beaglebone Oct 06 22:48:31 (I'm not necessarily claiming it's well documented there though...) Oct 06 22:50:48 the PRU's on the pocket beagle should be the same as the beaglebone as zmatt says. It uses the same processor just in a different package arrangement Oct 06 22:51:53 zmatt: the documentation from Octaveo systems is kind of rough on pinouts I noticed. Oct 06 22:58:01 GenTooMan: https://octavosystems.com/app_notes/osd335x-family-pin-assignments/ seems informative enough Oct 06 22:59:05 either pin name or AM335x ball is sufficient to look the pin up in my spreadsheet :) Oct 06 23:00:04 zmatt: Yeah I know until I found that I just was confused or maybe that's my normal state. Or maybe it's the pocket beagle pins that have me confused. Today has been a bad brain day. Oct 06 23:00:28 I was a bit confused by them too until I realized it used the -sm version **** ENDING LOGGING AT Sat Oct 07 02:59:59 2017