tag:blogger.com,1999:blog-6486847724120122589.post7166728085563683154..comments2024-01-17T00:33:52.893-08:00Comments on credentiality: Beaglebone PRU GPIO exampleLunkwillhttp://www.blogger.com/profile/08543336341601290962noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-6486847724120122589.post-84200333252845223382018-01-06T11:45:05.458-08:002018-01-06T11:45:05.458-08:00Depends what effect you're trying forDepends what effect you're trying forLunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-48064672853344584892018-01-06T01:17:55.893-08:002018-01-06T01:17:55.893-08:00Do I really need to create the firmware? Could I j...Do I really need to create the firmware? Could I just export the appropriate gpio pin with the same effect? <br />eu4 console commandshttp://eu4consolecommands.com/noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-73254248686390459672017-11-05T01:12:35.514-07:002017-11-05T01:12:35.514-07:00Works like a charm for Debian distro with Kernel 3...Works like a charm for Debian distro with Kernel 3.8. However, for some reason the dtc does not work for Kernel versions 4.1 and greater. I think this is an issue still being looked into by many folks.Vinay Divakarhttps://deeplyembedded.org/noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-30288436776018898282017-03-03T11:41:25.570-08:002017-03-03T11:41:25.570-08:00Finally I got it working!
I started with another ...Finally I got it working!<br /><br />I started with another image (Debian 8.6 2016-12-09 4GB SD IoT) and did all steps again - but ended with the same behaviour.<br /><br />Then I tried an alternative overlay:<br />generated by this site: http://kilobaser.com/blog/2014-07-28-beaglebone-black-devicetreeoverlay-generator<br /><br />Now the pinmux for pin 13 is changed as expected and I can toggle the output by pru.<br /><br />I think there is a problem with your example overlay (at least with latest debian image) but I didn't investigate for differences yet.<br /><br />Now I can move on to the productive part ;)<br />andrenoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-28433562308964186292017-03-02T18:00:53.324-08:002017-03-02T18:00:53.324-08:00Agreed, if the pin mode is wrong, GPIO probably wo...Agreed, if the pin mode is wrong, GPIO probably won't work. Perhaps it's possible to change the pin mode manually using one of the /sys/ files? That would increase our confidence that the problem is related to the device tree overlay. I know Kumar over at BeagleLogic had a lot of trouble with device tree compiler versions getting out of sync with the kernel. The compiled .dtbo files then would tend to fail silently. So your update to recent debian may be part of the issue you're seeing.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-54877886395200113192017-03-02T14:51:18.649-08:002017-03-02T14:51:18.649-08:00After loading the overlay I had the problem that p...After loading the overlay I had the problem that prussdrv_open function failed.<br /><br />Solution is found here (instead of am335x-boneblack.dts you have to use the certain file which is loaded in your /boot/uEnv.txt - for me am335x-boneblack-emmc-overlay.dtb):<br />https://groups.google.com/forum/#!topic/beagleboard/1rIV-mR8wYw<br /><br />Now I can run the sample pru code but I can't see the Pin8_11 going to high.<br />./pru_loader pru_egp_output.bin<br />Executing program and waiting for termination<br />All done<br /><br /><br />I think the problem is related to this:<br />root@beaglebone:/sys/kernel/debug/pinctrl/44e10800.pinmux# cat pins |grep 'pin 13\|14'<br />...<br />pin 13 (44e10834.0) 00000027 pinctrl-single<br />pin 14 (44e10838.0) 00000027 pinctrl-single<br />...<br /><br />the value stays the same before and after loading the overlay (I just copied your example).<br />I expect it to change to 00000006 // 00000026 after loading it.<br /><br />dmesg output while loading the overlay:<br />[ 55.982283] bone_capemgr bone_capemgr: part_number 'PRU-GPIO-EXAMPLE', version 'N/A'<br />[ 55.982365] bone_capemgr bone_capemgr: slot #4: override<br />[ 55.982408] bone_capemgr bone_capemgr: Using override eeprom data at slot 4<br />[ 55.982456] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,PRU-GPIO-EXAMPLE'<br />[ 56.001688] bone_capemgr bone_capemgr: slot #4: dtbo 'PRU-GPIO-EXAMPLE-00A0.dtbo' loaded; overlay id #1<br /><br />any ideas what could still go wrong here?andrenoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-34323050497336033512017-03-02T14:05:10.596-08:002017-03-02T14:05:10.596-08:00Thanks for the updateThanks for the updateLunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-52661137929420083372017-03-02T13:14:06.779-08:002017-03-02T13:14:06.779-08:00great, it looks like it is moved to:
/sys/devices/...great, it looks like it is moved to:<br />/sys/devices/platform/bone_capemgr/slots<br /><br /># cat /sys/devices/platform/bone_capemgr/slots<br /> 0: PF---- -1<br /> 1: PF---- -1<br /> 2: PF---- -1<br /> 3: P---L- 0 4D 4.3 LCD CAPE- 4DCAPE-43T ,00A1,4D SYSTEMS ,BB-BONE-LCD4-01<br /> 4: P-O-L- 1 Override Board Name,00A0,Override Manuf,PRU-GPIO-EXAMPLE<br />andrenoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-86935158904019995912017-03-01T15:22:48.714-08:002017-03-01T15:22:48.714-08:00Poke around the filesystem some more, perhaps use ...Poke around the filesystem some more, perhaps use find to look for files named 'slots' (eg., 'find / 2>/dev/null | grep slots'). Those files relate to the device tree in general, not just the PRU. So if they're gone you've got bigger problems than just not being able to use the PRU. Hopefully they just got renamed or something. (Are you on an old beaglebone white perhaps? I seem to recall those having different hardware)Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-31295526493947910572017-03-01T14:26:09.832-08:002017-03-01T14:26:09.832-08:00Hi,
very good explained tutorial but I'm stuc...Hi,<br /><br />very good explained tutorial but I'm stuck at the point where I have to load the overlay:<br /><br />/sys/devices/bone_capemgr.?/slots: No such file or directory<br /><br />I'm running latest debian image (bone-debian-8.6-lxqt-4gb-armhf-2016-11-06-4gb.img / Linux beaglebone 4.4.30-ti-r64 #1 SMP Fri Nov 4 21:23:33 UTC 2016 armv7l GNU/Linux) from sd card and followed all steps.<br /><br />Could you give me a hint what I am missing?andrenoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-88606359121788082832017-01-12T11:31:47.492-08:002017-01-12T11:31:47.492-08:00Correct, assuming you set up the device overlay co...Correct, assuming you set up the device overlay correctly.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-42610872769101768642017-01-11T22:45:55.739-08:002017-01-11T22:45:55.739-08:00Haha, I will not use caps from now. If we move the...Haha, I will not use caps from now. If we move the value into r30 will it automatically send the data to GPIO pins?<br /><br />CHAITANYAhttps://www.blogger.com/profile/05676735875846476444noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-69846257598918368112017-01-11T12:25:44.241-08:002017-01-11T12:25:44.241-08:00Chaitanya, you'll have more success getting he...Chaitanya, you'll have more success getting help online if you use appropriate capitalization. Using ALL CAPS makes it sound like you're shouting. If you want to write multiple bits of r30 at once, you could do something like "mov r30, 0x12345678".Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-63550741433679785732017-01-11T00:46:55.199-08:002017-01-11T00:46:55.199-08:00HI
I WANT TO KNOW HOW THE DATA CAN BE SENT TO GPIO...HI<br />I WANT TO KNOW HOW THE DATA CAN BE SENT TO GPIO THROUGH PRU PARALLELY.<br />HOW TO STORE THE DATA IN R30 REGISTER AND ACCESS THAT THROUGH GPIO PINS PARALLELYCHAITANYAhttps://www.blogger.com/profile/05676735875846476444noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-15800422541812628202016-11-06T08:55:13.390-08:002016-11-06T08:55:13.390-08:00I haven't seen that error before. Looks like ...I haven't seen that error before. Looks like an issue with the .dtbo files or the uio_pruss kernel module.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-36673010957051601482016-11-04T03:51:14.224-07:002016-11-04T03:51:14.224-07:00Thanks for your answer to my previous comment. =) ...Thanks for your answer to my previous comment. =) One more question: when trying to run your code I get a prussdrv_open() failed message. Checking dmesg shows me: pruss_uio 4a30000000.pruss: No children. <br /><br />I've tried googling around to see if I could solve it but nothing has helped. Any ideas? Tonynoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-31233226247507220402016-10-21T17:37:13.586-07:002016-10-21T17:37:13.586-07:00Tony, PRU0 and PRU1 are the two realtime microcont...Tony, PRU0 and PRU1 are the two realtime microcontrollers, and they each have their own R30 and R31 registers. So if you wanted to toggle P8.45 you'd load your code into PRU1 and set R30 bit 0, but if you loaded that same code into PRU0 instead, you'd be toggling P9.31.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-71745798526487168432016-10-17T04:38:52.012-07:002016-10-17T04:38:52.012-07:00Hey there! Thanks for the article, this has helped...Hey there! Thanks for the article, this has helped me a lot! <br /><br />I have a question though, may or may not be a "dumb" question. If I read the table correctly I have to write bit 0 to R30 to turn on P8.45, but writing bit 0 to R30 also turns on P9_31. The only difference is that P8_45 is on PRU1 and P9_31 is on PRU0. <br /><br />Do you know if writing bit 0 to R30 turns on both pins or is there a way to specify a single pin to turn on? Tonynoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-38630201065400383992016-08-10T11:04:46.146-07:002016-08-10T11:04:46.146-07:00I was as root evrytime. But my problem is solved. ...I was as root evrytime. But my problem is solved. In fact, I did <i>echo[...]slots</i> before going to the folder where I have my code and it works. I find this a bit strange...<br />Thanks again for your help !Bobnoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-32564380716198567702016-08-09T14:00:06.355-07:002016-08-09T14:00:06.355-07:00Then either you didn't "echo PRU-GPIO-EXA...Then either you didn't "echo PRU-GPIO-EXAMPLE > /sys/devices/bone_capemgr.?/slots" as root, or you need to check dmesg to see why it didn't load.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-87668911991030592362016-08-09T13:39:21.663-07:002016-08-09T13:39:21.663-07:00Edit from my last comment: There is no "L&quo...Edit from my last comment: There is no "L"Bobnoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-88010386377588282232016-08-09T13:37:54.803-07:002016-08-09T13:37:54.803-07:00Yes HDMI is disabled when I enter the cat /sys/de...Yes HDMI is disabled when I enter the <i>cat /sys/devices/bone_capemgr.?/slots </i> command but I have nothing in <i>uEnv.txt </i>. There is no "L3 (just P - O - -)<br />I have a code inspired from your first code which blinks a LED and works without any issue. I use your .dts code.Bobnoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-70708776961565322792016-08-09T13:12:49.822-07:002016-08-09T13:12:49.822-07:00Did you get HDMI disabled in uEnv.txt, and did you...Did you get HDMI disabled in uEnv.txt, and did you get the device tree overlays loading correctly? Is the PRU enabled when you do this? cat /sys/devices/bone_capemgr.?/slotsLunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-51849120946031145902016-08-09T12:12:55.283-07:002016-08-09T12:12:55.283-07:00I'm sorry, I made a mistake. I wrote QBBC LOW,...I'm sorry, I made a mistake. I wrote <i>QBBC LOW, r31, 13</i> in my code. I changed the bit 14 to 13 reffered to the table you give (this link: http://elinux.org/Ti_AM33XX_PRUSSv2#Beaglebone_PRU_connections_and_modes) because P8_20 is an input and the table said that the bit is 13 for register 31.<br />I have just tried the example by copy/paste your code but it didn't work with me.Bobnoreply@blogger.comtag:blogger.com,1999:blog-6486847724120122589.post-51583432868900853192016-08-09T10:31:14.881-07:002016-08-09T10:31:14.881-07:00Bob, start by trying the example code exactly as w...Bob, start by trying the example code exactly as written and see if that works. Also, you said "QBBS HIGH, r31, 13 and QBBS LOW, r31, 13", which means:<br /><br />if bit 13 of r31 is set, jump to HIGH<br />if bit 13 of r31 is set, jump to LOW<br /><br />In the example code, it's QBBS and then QBBC.Lunkwillhttps://www.blogger.com/profile/08543336341601290962noreply@blogger.com