ps the in/out macro's are implemented now:
https://github.com/beagleboard/bb.org-overlays/commits/master/tools/pmunts_muntsos
ps the in/out macro's are implemented now:
https://github.com/beagleboard/bb.org-overlays/commits/master/tools/pmunts_muntsos
Hi Robert,
I’ve tried the version from your link.
It seems that nothing changed:
debian@beaglebone:~$ wget https://raw.githubusercontent.com/pmunts/muntsos/master/bootkernel/initramfs/config-pin.c
–2020-09-14 14:52:27-- https://raw.githubusercontent.com/pmunts/muntsos/master/bootkernel/initramfs/config-pin.c
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.112.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.112.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5571 (5.4K) [text/plain]
Saving to: ‘config-pin.c’
config-pin.c 100%[===================================================================>] 5.44K --.-KB/s in 0.002s
2020-09-14 14:52:27 (2.78 MB/s) - ‘config-pin.c’ saved [5571/5571]
debian@beaglebone:~$ ls
bin config-pin.c exploringbb
debian@beaglebone:~$ gcc config-pin.c -o config-pin
debian@beaglebone:~$ ls
bin config-pin config-pin.c exploringbb
debian@beaglebone:~$ ./config-pin -i P9.12
ERROR: open() for /sys/devices/platform/ocp/ocp:-I_pinmux/state failed, No such file or directory
debian@beaglebone:~$ ./config-pin -h
GPIO Pin Configurator
Usage: config-pin -c
config-pin -l
config-pin -q
config-pin
debian@beaglebone:~$
Sincerely,
Pavel
patches welcome
Regards,
Which version of config-pin did Derek Molloy use in his book?
It no longer exists ?
It's stored locally under:
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin
cp it to /usr/local/bin/
Regards,
I was a little hasty to say what works.
The version of *config-pin*, installed on my system, is quite shrinked.
The older config-pin is, as I recall, a shell script. The current
config-pin is a compiled executable.
debian@beaglebone:~$ which config-pin
/usr/bin/config-pin
debian@beaglebone:~$ sudo find / -iname "config-pin*"
[sudo] password for debian:
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin
/opt/source/bb.org-overlays/tools/pmunts_muntsos/config-pin.c
/usr/bin/config-pin
debian@beaglebone:~$
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin
config-pin [-a] <pin> <mode>
Set <pin> to <mode>, configuring pin multiplexing and optionally
configuring the gpio. Valid <mode> strings vary based on <pin>,
however all pins have a default and gpio mode. The default mode is
the reset state of the pin, with the pin mux set to gpio, the pull
up/down resistor set to it's reset value, and the pin receive buffer
enabled. To setup gpio, the following <mode> strings are all valid:
gpio :
Set pinmux to gpio, existing direction and value unchanged
in | input:
Set pinmux to gpio and set gpio direction to input
out | output :
Set pinmux to gpio and set gpio direction to output
hi | high | 1 :
Set pinmux to gpio and set gpio direction to output driving
high
lo | low | 0 :
Set pinmux to gpio and set gpio direction to output driving low
To enable pull-up or pull-down resistors, a suffex may be appended to
any of the above gpio modes. Use + or _pu to enable the pull-up
resistor
and - or _pd to enable the pull-down resistor. Examples:
in+ | in_pu:
Enable pull-up resistor and setup pin as per input, above.
hi- | hi_pd:
Enable pull-down resistor and setup pin as per high, above.
While the pull-down resistor will be enabled, it will not do
much
until application software changes the pin direction to input.
config-pin -l <pin>
list valid <mode> values for <pin>
config-pin -i <pin>
show information to <pin>
config-pin -q <pin>
query pin and report configuration details
config-pin -f [file]
Read list of pin configurations from file, one per line
Comments and white-space are allowed
With no file, or when file is -, read standard input.
config-pin -h
Display this help text
debian@beaglebone:~$ config-pin
GPIO Pin Configurator
Usage: config-pin -c <filename>
config-pin -l <pin>
config-pin -q <pin>
config-pin <pin> <mode>
debian@beaglebone:~$
Contrary to the version, described in the book of Derek Molloy, there is no
such options as *-a*, *-i*, *-f*,
ANYTIME you are following a book and encounter a difference, you need
to study which version of the OS was present at that time. Even the 2nd
Edition of the book was likely behind a version or two by the time it was
printed.
Per page 32 of the book, it was written when Debian Stretch was still
in use. Standard images have been Debian Buster since April of this year
(though the config-pin change might have occurred anytime in 2019, or even
late 2018, as the 2nd edition shipped [from Amazon] January 14 2019). Based
on some screen captures, the book was using a February 2018 image, and the
examples were run in April 2018. That's a whole 2.5 years ago.
{Side note: Raspberry-Pi went to Buster in the summer of 2019, about two
weeks before Debian Buster was officially released -- the R-Pi 4B was
different enough that all the work to get it to run was done on pre-release
Buster.}
Moreover, the -q option (pin querry) doesn't provide information of the pin
mode (direction) and its value:debian@beaglebone:~$ config-pin -q P9.12
Current mode for P9_12 is: gpio
debian@beaglebone:~$
In fact, there is no information at all!
debian@beaglebone:~$
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q
P9.12
P9_12 Mode: default Direction: in Value: 1
debian@beaglebone:~$
Ok, thanks !
Hi there!
I have the same problem, with my BeagleBone.
When I run the command:
root@beaglebone:~# /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2_06
I get this error msg:
P2_06 pinmux file not found!
bash: /sys/devices/platform/ocp/ocpP2_06_pinmux/state: No such file or directory
Cannot write pinmux file: /sys/devices/platform/ocp/ocpP2_06_pinmux/state
As I read, I only have to flash a new image which is bone-eMMC-flasher-debian-10.5-iot-armhf-2020-08-25-4gb.img as Pavel mentioned it?
Then it will work?
Thx
Regards,
Bence
py.o…@sunrise.ch a következőt írta (2020. szeptember 14., hétfő, 17:29:19 UTC+2):
Tried flashing the new image, didnt boot with the eMMC flasher image.
Also tried the new IoT image, still the same error
Can anyone help?
Szabó Benedek Ákos a következőt írta (2020. október 17., szombat, 15:16:17 UTC+2):
Tried flashing the new image, didnt boot with the eMMC flasher image.
I tend to stay away from the downloaded flasher images. I prefer to use
an SD card image, get it configured (and updated since they may be behind
in security updates), and only after I'm happy do I edit the /boot/uEnv.txt
to make it a flasher image.
Also tried the new IoT image, still the same error
What does "didn't boot" and "same error" mean?. What did the LEDs do?
HOW did you write the image to the SD card? The image files are just
that -- complete file system images... If you just copied it to the SD
card, it won't do anything. You have to use special tools to place the
image contents onto the SD card. BalenaEtcher is the current favored tool
for doing this.
Hi Dennis!
I’m an IT guy so you can imagine I didnt copy the image directly to SD card, used Etcher.
I dont really get it; how do u edit the uEnv.txt file to be a flasher image?
I flashed the eMMC flasher image to an sd card, booted the Pocketbeagle from that sd card. It started to boot, then all four leds stayed on, system didnt boot.
So after this, I flashed the latest (2020-08-25) image to another SD card, booted, and the P2_06 and P2_18 pinmux file still cannot be found there.
Dennis Bieber a következőt írta (2020. október 17., szombat, 19:41:40 UTC+2):
Remember you cannot flash the BBB while plugged into the USB port.
You must use a external 5v supply
Btw, Im using a Pocketbeagle, I flashed during it was connected to an USB HUB with external power supply. Is it ok or not?
evilw...@gmail.com a következőt írta (2020. október 17., szombat, 19:51:46 UTC+2):
At the end of the uEnv.txt file., there is the following section:
Ref:
https://elinux.org/Beagleboard:BeagleBoneBlack_Debian
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
If you have a Linux system (not a VM on Windows) or another Beaglebone, you can take the uSD card and plug it into the other Linux system and then navigate to /boot/uEnv.txt and uncomment the last line with the " #cmdline" statement. Then, plug it back into the BB and power it on. Once the LED flashing, including the cylon pattern is done they should stop blinking or turn off. Then, take the uSD card from the BB, and plug it back into the Linux and comment out the ‘cmdline’ and transfer back to the BB.
The other option if you do not have another Linux system is to install the Flasher image on a uSD, flash the BB, and then install a non Flash image to boot the BB with.
As far as working through the Dr. Molloy book, it might be best to just use an older image, say with a 4.9 (maybe 4.14) kernel and go from there. Otherwise you will run into situations where something is not going to work
Also, on this page, it makes reference to a similar error that you are seeing:
https://arcanesciencelab.wordpress.com/2020/01/14/the-correct-way-to-enable-spi-ports-on-the-beaglebone-black/
Note the steps:
- First disable the HDMI port on the BBB. This is done by editing the file ‘/boot/uEnv.txt’ and uncommenting the line ‘disable_uboot_overlay_video=1’
- Reboot the BBB after uncommenting the disable HDMI line.
Perhaps having an overlay enabled is related to the issue you are seeing?
Cheers,
Jon
Im not really sure that the new eMMC flasher image would solve my problem about pinmux. The main problem is that I cannot use configure-pin on my PocketBeagle.
Idk if the original author of this thread solved this issue by installing new eMMC flasher image. I’ll try to comment out those lines and reboot my BB
jonn...@gmail.com a következőt írta (2020. október 17., szombat, 22:40:47 UTC+2):
You had a question regarding editing the uEnv.txt file so I gave you info on that.
As far as the config-pin issue, is there anything for the pin seen under “/sys/devices/platform/ocp/” for the pin you are trying to use the config-pin tool with?
This is what I see on a BBBlack running Buster and a 4.19.94-ti-r51 kernel:
$ ls /sys/devices/platform/ocp/ocp:P8_08_pinmux/
driver driver_override modalias of_node power state subsystem uevent
$ config-pin -q P8.07
Current mode for P8_07 is: default
Using the universal-io version of the tool:
$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P8.08
P8_08 Mode: default Direction: in Value: 1
I suspect the pin you are trying to run the command against is not listed under “/sys/devices/platform/ocp/” . Have you configured this pin?
Powering a PocketBeagle from a powered USB hub should be fine.
Jon
Depends on the hub. USB 2 specs are for a maximum of 0.5A (500mA) at 5V
-- giving 2.5W. But if any other devices are attached to that hub, they too
are drawing power, and the hub may only be able to provide around 0.1A per
port.
A 3W charge-only USB power supply might be safer.
Unlike the BBB, the PB only has USB for power input. The BBB has a 5V
barrel connector for power-only supplies, and it is strongly recommended
that such be used for flashing on the BBB.
You never did answer the question of what the LEDs were doing on those
failed boot attempts. So far as I can tell from images, the PB has the same
four status LEDs as the BBB, just located differently. From
https://groups.google.com/forum/#!topic/beagleboard/LHAxeSki-eU
[] [] [] [] - off
[x] [] [] [] - on, starting mmc scan...
[x] [x] [] [] - scanning mmc...
[x] [x] [x] [] - processed boot script...
[x] [x] [x] [x] - jumping into boot...
(After that, if a flasher image is found, the LEDs run a Larson scanner
pattern until flashing is done, and then the board is shutdown; otherwise
they show system activity: heartbeat, eMMC, CPU, SD card.)
Unfortunately, the show-pins PERL script is only BBB aware, not PB.
Jon
Hi there!
Sorry for the late reply.
So, here is a summary, what I already did, and what I tried:
I have a problem configuring a pin P2_18 and P2_06 on PocketBeagle.
What I’m trying is to get SWCAN working on a GM car, but I have to set it up to HIGH.
When I run config-pin P2_18 hi it returns error:
config-pin P2_18 hi ERROR: open() for /sys/devices/platform/ocp/ocp:P2_18_pinmux/state failed, No such file or directory
I found no P2_18 or P2_06 pinmux file exists here:
/sys/devices/platform/ocp/ocp:
version.sh output:
opt/scripts/tools/version.sh
git:/opt/scripts/:[7cdc270818b76d829d247cf05fe309c320a3929a]
eeprom:[A335PBGL00A21743GPB30299]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-08-25]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-pocketbeagle.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[PB-CAN0-00A0]
UBOOT: Loaded Overlay:[PB-CAN1-00A0]
UBOOT: Loaded Overlay:[PB-MCP2515-SPI1]
kernel:[4.19.94-ti-r50]
nodejs:[v10.21.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/PB-CAN0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/PB-CAN1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr6=/lib/firmware/PB-MCP2515-SPI1.dtbo]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20200814.0-0~buster+20200814]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio admin spi iio docker tisdk weston-launch xenomai cloud9ide pwm eqep remoteproc]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 53.832040] remoteproc remoteproc0: wkup_m3 is available
[ 54.008667] remoteproc remoteproc0: powering up wkup_m3
[ 54.008700] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 54.008997] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 55.838857] remoteproc remoteproc1: 4a334000.pru is available
[ 55.872421] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 55.838857] remoteproc remoteproc1: 4a334000.pru is available
[ 55.839046] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 55.872421] remoteproc remoteproc2: 4a338000.pru is available
[ 55.872630] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 0.895597] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.905153] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 002 Device 002: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
What can cause this error?
I tried to run pinmux-generator, but it throws error:
root@beaglebone:/opt/source/bb.org-overlays/tools/pinmux-generator# ./PocketBeagle.sh pinmux-4.0.1526-setup.run 100%[=====================================================================================================================================================================>] 39.87M 2.91MB/s in 14s 2020-10-17 15:20:15 (2.76 MB/s) - ‘pinmux-4.0.1526-setup.run’ saved [41810329/41810329] ./lib/pinmux.sh: line 220: ./pinmux-4.0.1526-setup.run: cannot execute binary file: Exec format error cp: cannot stat ‘tmp/pinmux/deviceData/AM335x/AM335x.json’: No such file or directory ################## P1_02 cat: AM335x.json: No such file or directory cat: AM335x.json: No such file or directory cat: AM335x.json: No such file or directory cat: AM335x.json: No such file or directory
Tried to install pinmux manually, but it doesnt support armhf architecture.
Also tried this config-pin command:
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin
Without any luck.
jonn...@gmail.com a következőt írta (2020. október 18., vasárnap, 23:24:17 UTC+2):
With a PocketBeagle running Debian 10 (Buster) IoT image and kernel 4.19.94-ti-r51 I see this:
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2_06
P2_06 Mode: default Direction: in Value: 0
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i P2_06
Pin name: P2_06
Function if no cape loaded: gpio
Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input
Function information: gpio1_25 default gpio1_25 gpio1_25 gpio1_25 gpio1_25
Kernel GPIO id: 57
PRU GPIO id: 89
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -l P2_06
default gpio gpio_pu gpio_pd gpio_inputdebian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2_18
P2_18 Mode: default Direction: in Value: 0
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i P2_18
Pin name: P2_18
Function if no cape loaded: gpio
Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input qep pru_ecap pruin
Function information: gpio1_15 default gpio1_15 gpio1_15 gpio1_15 gpio1_15 eqep2_strobe pru_ecap pru0_in15
Kernel GPIO id: 47
PRU GPIO id: 79
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -l P2_18
default gpio gpio_pu gpio_pd gpio_input qep pru_ecap pruin
debian@beaglebone:~$ config-pin -q P2_18
Current mode for P2_18 is: defaultdebian@beaglebone:~$ config-pin -q P2_06
Current mode for P2_06 is: default
Note, I did do a ‘sudo apt-get update’ and sudo apt-get upgrade’ and then updated the scripts and such listed in the following Beaglebone Upgrade link including the ‘update_kernel.sh’ script.
https://beagleboard.org/upgrade
Cheers,
Jon