I have been trying to configure p8_11 as digital input with internal pull up. I am using BBB rev C and followed different examples; even I used the dts generating tools, then compile it to create dto and then put it into uenv.txt but it seems after boot up it does not enable the pullup. If I use a 10k external pullup, it works fine though.
I looked at the schematic and did not notice any other circuit pulling that pin low.
I appreciate your help in resolving this issue.
Thank you in advance!
I could not follow the rest of the instruction stated in that page since my BBB does not have bone_capemgr folder. If I am not wrong, I read that after a certain Debian kernel version on, they do not offer that folder structure.
So, instead I added the path to generated .dtbo in /boot/uEnv.txt, as shown below:
I made sure the following lines are in the uEnv.txt
…
###Master Enable
enable_uboot_overlays=1
…
###Additional custom capes
uboot_overlay_addr4=/lib/firmware/bspm_P8_11_37-00A0.dtbo
The result is that P8_11 does not seem to have internal pull-up enabled. When I read the pin value in /sys/class/gpio/gpio45 it reads ‘0’ (low) and if I pull it up externally it reads ‘1’.
Thank you DTJF and Benedict!
Your comments helped me and I think I have fixed it now. I explain it here, although it might not be precise enough.
Using that DTS generator website, as long as I create only one dts and test them one at a time, it works fine. (Note that as DTJF said, we should not enable cape_universal).
The problem arises when I create two .dts, and consequently its .dtbo file, for two different GPIOs, e.g., P8_11 and P8_13. What I was doing wrong was that I put them in uEnv.txt one after another, like shown below:
dtb_overlay=/lib/firmware/bspm_P8_11_37-00A0.dtbo
dtb_overlay=/lib/firmware/bspm_P8_13_37-00A0.dtbo
This made none of them work! I do not know the reason though.
Then I tried to combine them all in one .dts. I did miss one part and it was in this part:
exclusive-use =
“P8.09”,
“P8.11”;
It does not work this way, I had to add a couple of more lines under this related to the gpio numbers. This is what I did and worked for me:
exclusive-use =
“P8.09”,
“P8.11”,
“P8.13”,
/* the hardware IP uses */
"gpio1_13",
"gpio0_23";
I got the idea from the following link:
I hope it works as I add the rest of the GPIOs to it.
There’s a dts source generator creating pinmuxing files and compiling them to /lib/firmware. After setting some meta data, specify the desired modes like
M(P8_11) = CHR(7 + PU) ' example: pin 11 at header P8 in mode 7 (Gpio) as input (pull-up resistor)
M(P8_13) = CHR(7 + PU) ' example: pin 13 at header P8 in mode 7 (Gpio) as input (pull-up resistor)
and finaly compile the code and execute it as admin (for write access in /lib folder).