[beagleboard] Assistance please: dtb-rebuilder reconfiguration of GPIO
Greetings, Thank you for any assistance you can provide on topic. Since the last post went way off topic and appears it turned into a pissing match... I am looking for assistance in understanding how to reconfigure GPIO's on the BBB using RCN's dtb-rebuilder. I am working on developing a new piece of equipment using the BBB as the controller. One aspect of the project is control of an inlet and outlet pump from a tank. Time sensitivity is not critical. For clarity, PWN will be used for a separate function that is not discussed here. I am looking to use P8-11 (GPIO 45) as pulldown input - Program man/auto P8-12 (GPIO 44) as pulldown input - Pump 1 - man on/off P8-14 (GPIO 26) as pulldown input - Pump 2 - man on/off P8-15 (GPIO 47) as pulldown input - Pump 2 start switch P8-16 (GPIO 46) as pulldown input - Pump 1 Stop switch P8-17 (GPIO 27) as pulldown input - Pump 2 Stop switch P8-18 (GPIO 65) as pulldown input - Pump 1 Start switch Fortunately, pulldown input is the default state of each of those pins. Unfortunately, I also want P9-12 (GPIO 60) as pulldown output to turn on pump 1 using a relay, where P9-12's default state is pullup input, and P9-15 (GPIO 48) as pulldown output to turn on pump 2 using a relay, where P9-15's default state is pulldown input. I have been trying to work through RCN's dtb-rebuilder with Derek Molloy's book to accomplish this. But I have not impacted this default state. I am using Kenerl r.19.94-ti-r42. I have captured my boot sequence using a serial cable through putty: uboot_overlays: [uboot-base-dtb = am335x-boneblack-uboot-univ.dtb]... the seqeunce confirms it switched to the above, then loads with 162266 bytes read am335x-boneblack-uboot-univ.dtb includes 1) am33xx.dtsi, which appears to set on chip GPIO's, 2) am335x-bone-common.dtsi, which appears to only interact with P9-19 & P9-20 in terms of GPIO, and 3) am335x-bone-common-univ.dtsi So looking at P9-12 in am335x-bone-common-univ.dtsi: Line 713 of am335x-bone-common-univ.dtsi begins the definitions of Gpio on P9-12 /* P9_12 (ZCZ ball U18) gpio1_28 */ P9_12_default_pin: pinmux_P9_12_default_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pin: pinmux_P9_12_gpio_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pu_pin: pinmux_P9_12_gpio_pu_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_input_pin: pinmux_P9_12_gpio_input_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_INPUT | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ I have tried modifying the lines above with no success 1) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | INPUT | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ and 2) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ and 3) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN| MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ Line 2049 starts the next section which appears to only define the pinctrl states /* P9_12 (ZCZ ball U18) */ P9_12_pinmux { compatible = "bone-pinmux-helper"; status = "okay"; pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "gpio_input"; pinctrl-0 = <_12_default_pin>; pinctrl-1 = <_12_gpio_pin>; pinctrl-2 = <_12_gpio_pu_pin>; pinctrl-3 = <_12_gpio_pd_pin>; pinctrl-4 = <_12_gpio_input_pin>; }; I have not played with these. Finally, the last place it appears to configure P9-15 starts on Line 2777 P9_12 { gpio-name = "P9_12"; gpio = < 28 0>; input; dir-changeable; }; I have tried a few modification here with no success such as P9_12 { gpio-name = "P9_12"; gpio = < 28 3>; output; pulldown; }; I nano'ed, modified and saved the am335x-bone-common-univ.dtsi file, used the dtb-rebuilder make all command, backed up the old binary file am335x-boneblack-uboot-univ.dtb_BACKUP and replaced it with the new am335x-boneblack-uboot-univ.dtb. And yes I messed it up a couple times and had to completely rebuild the BBB's loaded image, updates, upgrades, etc... Lots of fun. I have not seen any change in the default state of P9-12 from pullup input as checked using config-pin query. Can anyone redirect me to some examples, or provide a some tips, or simply tell me I'm off my rocker and nowhere close to where I need to be? I'm a little stuck here. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard"
Re: [beagleboard] Re: Problems Reconfiguring GPIO's
Thank you for the responses, gentlemen. *Dennis:* 2nd addition... ran it to those problems last spring... edition matters for certain. 1st addition uses only an outdated device tree method. I've used config-pin in the ways you've described from the IDE, but have not incorporated it into C++ program. Will look for examples As an aside -- setting an output to pull-up/pull-down seems to me rather perverse. My understanding of circuits is that pull-up/-down is meant to ensure one reads a particular state when external devices are /not/ driving a line to either rail, or are tri-stated (floating) when the line is shared among devices. Once your application is running, your outputs should be driven to one or the other state, they won't be floating. I want to ensure the pump is not triggered from any noise. Perhaps I misunderstood this feature. TJF I will review this method. Best Regards On Tue, Jun 16, 2020 at 10:29 AM TJF wrote: > Hi! > > Am Dienstag, 16. Juni 2020 00:08:18 UTC+2 schrieb P B: > >> I'm a little stuck here. >> > > Drop all than device tree and config-pin stuff. Instead use libpruio > <https://github.com/DTJF/libpruio> for pinmuxing. Once installed you can > configure the pins from user space in your source code, compiled against > libpruio. (This also safes boot-time and kernel memory.) > > Example: > ... > // Input > if (pruio_gpio_config > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__c__wrapper_8bas.html#ac5405314ef2c35a9604262a22378420d> > (io, P8_11 > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/button2_8c.html#ae1a27401b7fb01ccb9a82dbddbb54eea> > , PRUIO_GPIO_IN_0 > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__globals_8bi.html#a4d604dbec305f941aaa452cc0d01adeea661a5356f0da98015d241d42084a0f30> > )) { > printf("GPIO P8_11 configuration failed (%s)\n", io->Errr); break;} > // Output > if (pruio_gpio_setValue > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__c__wrapper_8bas.html#ac5405314ef2c35a9604262a22378420d> > (io, P9_12 > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/button2_8c.html#ae1a27401b7fb01ccb9a82dbddbb54eea> > , 0 > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__globals_8bi.html#a4d604dbec305f941aaa452cc0d01adeea661a5356f0da98015d241d42084a0f30> > )) { > printf("GPIO P9_12 configuration failed (%s)\n", io->Errr); break;} > > Check the examples > <http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/ChaExamples.html> > for complete code. By default an output pin gets configured without > restistor, but you can override by function pruio_setPin(io, P9_12, 7 + > PRUIO_PULL_UP). > > Regards > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to a topic in the > Google Groups "BeagleBoard" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/beagleboard/S3UoBNP6kjg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > beagleboard+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/f5d00e94-c939-437b-8179-cdb6a2525229o%40googlegroups.com > <https://groups.google.com/d/msgid/beagleboard/f5d00e94-c939-437b-8179-cdb6a2525229o%40googlegroups.com?utm_medium=email_source=footer> > . > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CA%2BWcFtNQnDEJt7tR5_mFDAs4237HHLbYxkKU_Ebx07j9UsuPgw%40mail.gmail.com.
[beagleboard] Problems Reconfiguring GPIO's
Greetings, I am working on developing a new piece of equipment using the BBB as the controller. One aspect of the project is control of an inlet and outlet pump from a tank. Time sensitivity is not critical. I am looking to use P8-11 (GPIO 45) as pulldown input - Program man/auto P8-12 (GPIO 44) as pulldown input - Pump 1 - man on/off P8-14 (GPIO 26) as pulldown input - Pump 2 - man on/off P8-15 (GPIO 47) as pulldown input - Pump 2 start switch P8-16 (GPIO 46) as pulldown input - Pump 1 Stop switch P8-17 (GPIO 27) as pulldown input - Pump 2 Stop switch P8-18 (GPIO 65) as pulldown input - Pump 1 Start switch Fortunately, pulldown input is the default state of each of those pins. Unfortunately, I also want P9-12 (GPIO 60) as pulldown output to turn on pump 1 using a relay, where P9-12's default state is pullup input, and P9-15 (GPIO 48) as pulldown output to turn on pump 2 using a relay, where P9-15's default state is pulldown input. I have been trying to work through RCN's dtb-rebuilder with Derek Molloy's book to accomplish this. But I have not impacted this default state. I am using Kenerl r.19.94-ti-r42. I have captured my boot sequence using a serial cable through putty: uboot_overlays: [uboot-base-dtb = am335x-boneblack-uboot-univ.dtb]... the seqeunce confirms it switched to the above, then loads with 162266 bytes read am335x-boneblack-uboot-univ.dtb includes 1) am33xx.dtsi, which appears to set on chip GPIO's, 2) am335x-bone-common.dtsi, which appears to only interact with P9-19 & P9-20 in terms of GPIO, and 3) am335x-bone-common-univ.dtsi So looking at P9-12 in am335x-bone-common-univ.dtsi: Line 713 of am335x-bone-common-univ.dtsi begins the definitions of Gpio on P9-12 /* P9_12 (ZCZ ball U18) gpio1_28 */ P9_12_default_pin: pinmux_P9_12_default_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pin: pinmux_P9_12_gpio_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pu_pin: pinmux_P9_12_gpio_pu_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ P9_12_gpio_input_pin: pinmux_P9_12_gpio_input_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_INPUT | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ I have tried modifying the lines above with no success 1) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | INPUT | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ and 2) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ and 3) P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = < AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN| MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */ Line 2049 starts the next section which appears to only define the pinctrl states /* P9_12 (ZCZ ball U18) */ P9_12_pinmux { compatible = "bone-pinmux-helper"; status = "okay"; pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "gpio_input"; pinctrl-0 = <_12_default_pin>; pinctrl-1 = <_12_gpio_pin>; pinctrl-2 = <_12_gpio_pu_pin>; pinctrl-3 = <_12_gpio_pd_pin>; pinctrl-4 = <_12_gpio_input_pin>; }; I have not played with these. Finally, the last place it appears to configure P9-15 starts on Line 2777 P9_12 { gpio-name = "P9_12"; gpio = < 28 0>; input; dir-changeable; }; I have tried a few modification here with no success such as P9_12 { gpio-name = "P9_12"; gpio = < 28 3>; output; pulldown; }; I nano'ed, modified and saved the am335x-bone-common-univ.dtsi file, used the dtb-rebuilder make all command, backed up the old binary file am335x-boneblack-uboot-univ.dtb_BACKUP and replaced it with the new am335x-boneblack-uboot-univ.dtb. And yes I messed it up a couple times and had to completely rebuild the BBB's loaded image, updates, upgrades, etc... Lots of fun. I have not seen any change in the default state of P9-12 from pullup input as checked using config-pin query. Can anyone redirect me to some examples, or provide a some tips, or simply tell me I'm off my rocker and nowhere close to where I need to be? I'm a little stuck here. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/8646c994-c174-4b25-82cb-c3ab34ac2be7o%40googlegroups.com.
Re: [beagleboard] Re: Pocketbeagle Techlab
Derek Molloy's 2nd edition is excellent and covers both PB and BBB explicitly with updated current methodology, i.e. uboot overlays. On Tuesday, June 11, 2019 at 10:35:24 AM UTC-7, Venkatesh Vadde wrote: > > Thank you. A cursory look at the 2nd edition of EBB from Molloy does seem > to show generous doses of PB references, pin-maps and circuits for the PB. > I would hazard to think it is the best we have yet on the PB. > > > > On Tue, Jun 11, 2019 at 9:36 PM Dennis Lee Bieber > wrote: > >> On Tue, 11 Jun 2019 19:56:01 +0530, Venkatesh Vadde >> > declaimed the following: >> >> >Hi Dennis, >> > >> >I am also keen to move to the Pocket Beagle in the next month or so. >> Would >> >Molloy's 2nd ed of EBB be the best resource on PB, or is there any other >> >resource you would also recommend? >> > >> Well, there is a Pocket Beagle on the cover... >> >> I've not looked to see if any other books have gone into 2nd >> editions >> (or even 3rds). >> >> >> -- >> Wulfraed Dennis Lee Bieber AF6VN >> wlf...@ix.netcom.com >> http://wlfraed.microdiversity.freeddns.org/ >> >> -- >> For more options, visit http://beagleboard.org/discuss >> --- >> You received this message because you are subscribed to the Google Groups >> "BeagleBoard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to beagl...@googlegroups.com . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beagleboard/m9kvfeh16nomv51tatn3ect6vlen21ifve%404ax.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/282125b8-a8fd-473c-b22d-439197796b75%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Re: Pocketbeagle Techlab
Thank you much for the response. I picked up Derek Molloy's 2nd edition and it's getting me straightened out. I'll play with the techlab again soon and will double check working through your suggestions. I had been working through RCN's instruction on the wiki. I did read through the presentation slides for the workshop and read through the info on e-ALE linked from the techlab cape page on beagleboard. I don't think I have the minimum requisite skills yet for that level of instruction. Very weak on coding. Here's to ChE's learning EE-CS skills. Again, thank you. Best Regards, Patrick On Monday, June 10, 2019 at 12:52:55 PM UTC-7, Jason Kridner wrote: > > Sorry for my delay in noticing this post. I hope you will read my below > replies and see if it provides you with some success. > > On Wednesday, May 15, 2019 at 8:41:06 AM UTC-5, P B wrote: >> >> Good morning, >> >> For the past two months I've been trying to learn how to use the BBB & PB >> using Derek Molloy's book. >> >> I got pretty excited just being able to light a led and read a push >> button at the beginning of chapter 6. >> >> But I've gotten stuck in chapter 6 where he introduces device-tree >> overlays because it seems those have been done away with in favor of uboot >> overlays. It appears both of these are compiled the same way, but I've let >> myself get confused. >> >> I found his updated video on gpio's but that also appears obsolete. >> >> As a result I switched to trying to use the Pocketbeagle techcape to get >> unstuck, but I've been fighting with learning how to control pins and even >> work through the basic confirmation of functions. >> >> I've tried loading the images from both techlab-workshop-2019-01-24 >> & bone-debian-buster-iot-armhf-2019-03-03-4gb. >> >> I've been updating the kernel to Linux beaglebone 4.19.37-bone32 >> #1stretch PREEMPT Tue Apr 30 19:17:06 UTC 2019 armv7l GNU/Linux. >> >> Afterwards I apt-get update, apt-get upgrade, git clone bb.org-overlays >> from RCN, and download the latest cloud9 examples from J Krider. >> > > In my examples at > https://github.com/beagleboard/cloud9-examples/tree/master/PocketBeagle/TechLab > > I suggest enabling a number of overlays via /boot/uEnv.txt via: > > sudo sed -i -e > "s/#?uboot_overlay_addr0=.*$/uboot_overlay_addr0=\/lib\/firmware\/PB-I2C2-ACCEL-TECHLAB-CAPE.dtbo/;" > /boot/uEnv.txt > sudo sed -i -e > "s/#?uboot_overlay_addr1=.*$/uboot_overlay_addr1=\/lib\/firmware\/PB-PWM-RGB-TECHLAB-CAPE.dtbo/;" > /boot/uEnv.txt > sudo sed -i -e > "s/#?uboot_overlay_addr2=.*$/uboot_overlay_addr2=\/lib\/firmware\/PB-SPI1-7SEG-TECHLAB-CAPE.dtbo/;" > /boot/uEnv.txt > sudo sed -i -e > "s/#?uboot_overlay_pru=.*RPROC.*$/uboot_overlay_pru=\/lib\/firmware\/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo/;" > /boot/uEnv.txt > sudo shutdown -r now > > > > Enabling the PB-PWM-RGB-TECHLAB-CAPE overlay should add 3 LEDs after the > reboot is complete, techlab::red, techlab::green and techlab::blue. > > See > https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-PWM-RGB-TECHLAB-CAPE.dts > for > the content of the overlay. > > Enabling the PB-SPI1-7SEG-TECHLAB-CAPE overlay should enable 16 more > LEDs, techlab::seg*, where * is 0-15. > > See > https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-SPI1-7SEG-TECHLAB-CAPE.dts > for > the content of the overlay. > > Doing a "dmesg > /var/lib/cloud9/dmesg.txt" and then copy-and-paste the > contents of dmesg.txt here. Also, provide a copy-and-paste of > /boot/uEnv.txt as well as the output of `sudo > /opt/scripts/tools/version.sh`. These will help in providing feedback on > steps you might not be executing as intended. > > >> Unfortunate, for all of these methods the only led files are as listed in >> the posted screen shot. >> >> beaglebone:green:usr0 >> beaglebone:green:usr1 >> beaglebone:green:usr2 >> beaglebone:green:usr3 >> >> No segment 7 files and no rgb files to use. >> >> Maybe I'm just confused, but have been stuck here for a couple of weeks & >> have just been going back & forth between fighting the PB & BBB on the next >> steps. >> > > Really sorry to hear you've been stuck for so long. If the responses here > don't get you going, be sure to reach out to me under the instructions at > https://beagleboard.org/support. I'm also 'jkridner' on the #beagle IRC > channel. > > >> >> I've searched the net extensively looking for additional resources but >> just
[beagleboard] Re: Pocketbeagle Techlab
Thank you. I was working from 1st ed. 2nd ed ordered. Best Regards -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/d891302c-cd9a-4787-96da-5ead425db5c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.