beagleboard / Latest-Images

Please use; https://git.beagleboard.org/beagleboard/Latest-Images
https://git.beagleboard.org/beagleboard/Latest-Images
MIT License
10 stars 11 forks source link

Encoder 48300180.eqep return onlu -1 or 1 or 0 #67

Open mdlugosz opened 3 years ago

mdlugosz commented 3 years ago

Describe the bug The encoder EQEP0 return only three values -1, 0, 1.

Describe which image you are running (example: bone-debian-10.2-iot-armhf-2020-02-03-4gb.img.xz) bone-ubuntu-18.04.4-ros-iot-armhf-2020-05-18-6gb.img System is booted from SDCARD

Describe your hardware BeagleBone Blue

Describe any Capes Installed

Please run this built-in script sudo /opt/scripts/tools/version.sh git:/opt/scripts/:[029041f6866049997bbfd2c7667b3c6e8c95201c] eeprom:[A335BNLTBLA21712EL002910] model:[TI_AM335x_BeagleBone_Blue] dogtag:[BeagleBoard.org ROS Image 2020-05-18] bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g31a8ae0206]:[location: dd MBR] bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR] UBOOT: Booted Device-Tree:[am335x-boneblue.dts] UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0] UBOOT: Loaded Overlay:[BB-ADC-00A0] kernel:[4.19.94-ti-rt-r43] nodejs:[v8.10.0] /boot/uEnv.txt Settings: uboot_overlay_options:[enable_uboot_overlays=1] uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/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~bionic+20200814] pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~bionic+20200813] pkg:[kmod]:[24-1ubuntu3.5rcnee0~bionic+20200810] pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~bionic+20200716] groups:[beagle : beagle root adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c cloud9ide gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai] cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] dmesg | grep remote [ 42.330772] remoteproc remoteproc0: 4a334000.pru is available [ 42.346759] remoteproc remoteproc1: 4a338000.pru is available [ 154.575230] remoteproc remoteproc2: wkup_m3 is available [ 154.592590] remoteproc remoteproc2: powering up wkup_m3 [ 154.592613] remoteproc remoteproc2: Booting fw image am335x-pm-firmware.elf, size 217168 [ 154.592894] remoteproc remoteproc2: remote processor wkup_m3 is now up [ 282.595682] remoteproc remoteproc0: powering up 4a334000.pru [ 282.604229] remoteproc remoteproc0: Booting fw image am335x-pru0-rc-encoder-fw, size 36040 [ 282.604275] remoteproc remoteproc0: remote processor 4a334000.pru is now up [ 853.519686] remoteproc remoteproc0: stopped remote processor 4a334000.pru dmesg | grep pru [ 42.330772] remoteproc remoteproc0: 4a334000.pru is available [ 42.330953] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully [ 42.346759] remoteproc remoteproc1: 4a338000.pru is available [ 42.346958] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully [ 282.595682] remoteproc remoteproc0: powering up 4a334000.pru [ 282.604229] remoteproc remoteproc0: Booting fw image am335x-pru0-rc-encoder-fw, size 36040 [ 282.604275] remoteproc remoteproc0: remote processor 4a334000.pru is now up [ 853.519686] remoteproc remoteproc0: stopped remote processor 4a334000.pru dmesg | grep pinctrl-single [ 1.065640] pinctrl-single 44e10800.pinmux: 142 pins, size 568 [ 1.289110] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux [ 1.305932] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22 [ 1.313470] pinctrl-single 44e10800.pinmux: could not request pin 102 (PIN102) from group pinmux_P9_30_spi_pin on device pinctrl-single dmesg | grep gpio-of-helper lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub END

To Reproduce Steps to reproduce the behavior:

  1. Connect quadrant encoder to eqep0
  2. Run rc_test_encoders or watch -n 0.1 cat /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position
  3. Rotate shaft of encoder whith is connected to EQEP0 and see error, returned value is -1 or 0 or 1 Other encoders are working properly.

Expected behavior The encoder EQEP0 should work like other encoders and return valid values.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

bjnilsen commented 3 years ago

Same issue with bone-debian-10.5-iot-armhf-2020-08-25-4gb.img.xz

Please let me know if there is anything I can provide to debug this issue further.

jadonk commented 3 years ago

Really odd. Any chance you can put a scope on the 2 qep lines?

jadonk commented 3 years ago

Oh, also, is there anything in the output of 'dmesg' about the qep?

mdlugosz commented 3 years ago

debian@beaglebone:~$ dmesg | grep qep

[ 1.108918] eqep 48300180.eqep: ver. 1.0 [ 1.109175] eqep 48300180.eqep: count_mode:0 [ 1.109186] eqep 48300180.eqep: invert_qa:1 [ 1.109195] eqep 48300180.eqep: invert_qb:1 [ 1.109203] eqep 48300180.eqep: invert_qi:0 [ 1.109211] eqep 48300180.eqep: invert_qs:0 [ 1.109220] eqep 48300180.eqep: swap_inputs:0 [ 1.109228] eqep 48300180.eqep: QDECCTL:0x0180 [ 1.109237] eqep 48300180.eqep: QPOSINIT:0x00000000 [ 1.109244] eqep 48300180.eqep: QPOSMAX:0xffffffff [ 1.109251] eqep 48300180.eqep: QPOSCNT:0x00000000 [ 1.109259] eqep 48300180.eqep: omit_interrupt:0 [ 1.109267] eqep 48300180.eqep: QEINT:0x0800 [ 1.109274] eqep 48300180.eqep: QUPRD:0x05f5e100 [ 1.109281] eqep 48300180.eqep: QEPCTL:0x009e write [ 1.109289] eqep 48300180.eqep: QEPCTL:0x009e read [ 1.109316] eqep 48300180.eqep: irq:60, clk_rate:100000000 [ 1.109864] eqep 48302180.eqep: ver. 1.0 [ 1.110005] eqep 48302180.eqep: count_mode:0 [ 1.110016] eqep 48302180.eqep: invert_qa:1 [ 1.110024] eqep 48302180.eqep: invert_qb:1 [ 1.110033] eqep 48302180.eqep: invert_qi:0 [ 1.110041] eqep 48302180.eqep: invert_qs:0 [ 1.110048] eqep 48302180.eqep: swap_inputs:0 [ 1.110056] eqep 48302180.eqep: QDECCTL:0x0180 [ 1.110064] eqep 48302180.eqep: QPOSINIT:0x00000000 [ 1.110071] eqep 48302180.eqep: QPOSMAX:0xffffffff [ 1.110078] eqep 48302180.eqep: QPOSCNT:0x00000000 [ 1.110087] eqep 48302180.eqep: omit_interrupt:0 [ 1.110094] eqep 48302180.eqep: QEINT:0x0800 [ 1.110102] eqep 48302180.eqep: QUPRD:0x05f5e100 [ 1.110109] eqep 48302180.eqep: QEPCTL:0x009e write [ 1.110116] eqep 48302180.eqep: QEPCTL:0x009e read [ 1.110212] eqep 48302180.eqep: irq:62, clk_rate:100000000 [ 1.110466] eqep 48304180.eqep: ver. 1.0 [ 1.110662] eqep 48304180.eqep: count_mode:0 [ 1.110671] eqep 48304180.eqep: invert_qa:1 [ 1.110679] eqep 48304180.eqep: invert_qb:1 [ 1.110687] eqep 48304180.eqep: invert_qi:0 [ 1.110695] eqep 48304180.eqep: invert_qs:0 [ 1.110703] eqep 48304180.eqep: swap_inputs:0 [ 1.110710] eqep 48304180.eqep: QDECCTL:0x0180 [ 1.110718] eqep 48304180.eqep: QPOSINIT:0x00000000 [ 1.110726] eqep 48304180.eqep: QPOSMAX:0xffffffff [ 1.110733] eqep 48304180.eqep: QPOSCNT:0x00000000 [ 1.110741] eqep 48304180.eqep: omit_interrupt:0 [ 1.110748] eqep 48304180.eqep: QEINT:0x0800 [ 1.110755] eqep 48304180.eqep: QUPRD:0x05f5e100 [ 1.110762] eqep 48304180.eqep: QEPCTL:0x009e write [ 1.110769] eqep 48304180.eqep: QEPCTL:0x009e read [ 1.110787] eqep 48304180.eqep: irq:64, clk_rate:100000000 [ 1.114175] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux

or whole dmesg:

[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.19.94-ti-r42 (voodoo@x3-am57xx-beagle-x15-2gb) (gcc version 8.3.0 (Debian 8.3.0-6)) #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Blue [ 0.000000] Memory policy: Data cache writeback [ 0.000000] cma: Reserved 48 MiB at 0x9c800000 [ 0.000000] On node 0 totalpages: 130560 [ 0.000000] Normal zone: 1148 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 130560 pages, LIFO batch:31 [ 0.000000] CPU: All CPU(s) started in SVC mode. [ 0.000000] AM335X ES2.1 (sgx neon) [ 0.000000] random: get_random_bytes called from start_kernel+0xac/0x4b4 with crng_init=0 [ 0.000000] percpu: Embedded 17 pages/cpu s38988 r8192 d22452 u69632 [ 0.000000] pcpu-alloc: s38988 r8192 d22452 u69632 alloc=17*4096 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129412 [ 0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) [ 0.000000] Memory: 438116K/522240K available (13312K kernel code, 1136K rwdata, 4308K rodata, 1024K init, 350K bss, 34972K reserved, 49152K cma-reserved, 0K highmem) [ 0.000000] Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xe0000000 - 0xff800000 ( 504 MB) lowmem : 0xc0000000 - 0xdfe00000 ( 510 MB) pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) modules : 0xbf000000 - 0xbfe00000 ( 14 MB) .text : 0x(ptrval) - 0x(ptrval) (14304 kB) .init : 0x(ptrval) - 0x(ptrval) (1024 kB) .data : 0x(ptrval) - 0x(ptrval) (1137 kB) .bss : 0x(ptrval) - 0x(ptrval) ( 351 kB) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] ftrace: allocating 42043 entries in 124 pages [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. [ 0.000000] Tasks RCU enabled. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz [ 0.000022] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.000042] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.000052] OMAP clocksource: timer1 at 24000000 Hz [ 0.001622] timer_probe: no matching timers found [ 0.001965] Console: colour dummy device 80x30 [ 0.001995] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0' [ 0.002000] This ensures that you still see kernel messages. Please [ 0.002004] update your kernel commandline. [ 0.002064] Calibrating delay loop (skipped) preset value.. 995.32 BogoMIPS (lpj=1990656) [ 0.002081] pid_max: default: 32768 minimum: 301 [ 0.002368] Security Framework initialized [ 0.002383] Yama: becoming mindful. [ 0.002530] AppArmor: AppArmor initialized [ 0.002634] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.002647] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.003752] CPU: Testing write buffer coherency: ok [ 0.003815] CPU0: Spectre v2: using BPIALL workaround [ 0.004310] CPU0: thread -1, cpu 0, socket -1, mpidr 0 [ 0.025578] Setting up static identity map for 0x80100000 - 0x80100060 [ 0.033480] rcu: Hierarchical SRCU implementation. [ 0.049492] smp: Bringing up secondary CPUs ... [ 0.049510] smp: Brought up 1 node, 1 CPU [ 0.049522] SMP: Total of 1 processors activated (995.32 BogoMIPS). [ 0.049528] CPU: All CPU(s) started in SVC mode. [ 0.051243] devtmpfs: initialized [ 0.077875] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 [ 0.078528] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.078552] futex hash table entries: 256 (order: 2, 16384 bytes) [ 0.082488] xor: automatically using best checksumming function neon
[ 0.082506] pinctrl core: initialized pinctrl subsystem [ 0.083813] NET: Registered protocol family 16 [ 0.089052] DMA: preallocated 1024 KiB pool for atomic coherent allocations [ 0.167857] l4_wkup_cm:clk:0010:0: failed to disable [ 0.208112] audit: initializing netlink subsys (disabled) [ 0.213582] audit: type=2000 audit(0.200:1): state=initialized audit_enabled=0 res=1 [ 0.216949] OMAP GPIO hardware version 0.1 [ 0.220065] GPIO line 106 (LS_BUF_EN) hogged as output/high [ 0.236043] hw-breakpoint: debug architecture 0x4 unsupported. [ 0.261642] raid6: using algorithm neonx8 gen() 0 MB/s [ 0.261655] raid6: .... xor() 0 MB/s, rmw enabled [ 0.261662] raid6: using neon recovery algorithm [ 0.269243] edma 49000000.edma: TI EDMA DMA engine driver [ 0.275343] SCSI subsystem initialized [ 0.277623] libata version 3.00 loaded. [ 0.277937] usbcore: registered new interface driver usbfs [ 0.277994] usbcore: registered new interface driver hub [ 0.278115] usbcore: registered new device driver usb [ 0.279321] pps_core: LinuxPPS API ver. 1 registered [ 0.279330] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it [ 0.279352] PTP clock support registered [ 0.280255] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 [ 0.281902] Advanced Linux Sound Architecture Driver Initialized. [ 0.282710] NetLabel: Initializing [ 0.282719] NetLabel: domain hash size = 128 [ 0.282724] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO [ 0.282821] NetLabel: unlabeled traffic allowed by default [ 0.283879] clocksource: Switched to clocksource timer1 [ 0.446316] VFS: Disk quotas dquot_6.6.0 [ 0.446420] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.447287] AppArmor: AppArmor Filesystem Enabled [ 0.460102] NET: Registered protocol family 2 [ 0.461125] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes) [ 0.461164] TCP established hash table entries: 4096 (order: 2, 16384 bytes) [ 0.461206] TCP bind hash table entries: 4096 (order: 3, 32768 bytes) [ 0.461263] TCP: Hash tables configured (established 4096 bind 4096) [ 0.461396] UDP hash table entries: 256 (order: 1, 8192 bytes) [ 0.461419] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) [ 0.461767] NET: Registered protocol family 1 [ 0.474966] RPC: Registered named UNIX socket transport module. [ 0.474978] RPC: Registered udp transport module. [ 0.474983] RPC: Registered tcp transport module. [ 0.474988] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.475700] Unpacking initramfs... [ 0.871598] Freeing initrd memory: 6884K [ 0.872607] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available [ 0.875441] Initialise system trusted keyrings [ 0.876038] workingset: timestamp_bits=14 max_order=17 bucket_order=3 [ 0.883116] zbud: loaded [ 0.890609] NFS: Registering the id_resolver key type [ 0.890653] Key type id_resolver registered [ 0.890659] Key type id_legacy registered [ 0.890677] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.891042] fuse init (API version 7.27) [ 0.901580] Key type asymmetric registered [ 0.901594] Asymmetric key parser 'x509' registered [ 0.901694] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246) [ 0.906064] io scheduler noop registered [ 0.906075] io scheduler deadline registered [ 0.906389] io scheduler cfq registered (default) [ 0.906399] io scheduler mq-deadline registered [ 0.909594] pinctrl-single 44e10800.pinmux: 142 pins, size 568 [ 0.921948] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled [ 0.925618] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250 [ 0.935727] console [ttyS0] enabled [ 0.936914] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a 8250 [ 0.937856] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 32, base_baud = 3000000) is a 8250 [ 0.938883] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 33, base_baud = 3000000) is a 8250 [ 0.939807] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 34, base_baud = 3000000) is a 8250 [ 0.941049] 481aa000.serial: ttyS5 at MMIO 0x481aa000 (irq = 35, base_baud = 3000000) is a 8250 [ 0.944309] omap_rng 48310000.rng: Random Number Generator ver. 20 [ 0.945095] sdhci: Secure Digital Host Controller Interface driver [ 0.945103] sdhci: Copyright(c) Pierre Ossman [ 0.945633] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) [ 0.945644] omap_hsmmc 48060000.mmc: Got CD GPIO [ 0.946198] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.1 [ 0.946550] random: fast init done [ 0.946917] random: crng init done [ 0.973255] omap_hsmmc 481d8000.mmc: Linked as a consumer to regulator.1 [ 0.998579] omap_hsmmc 47810000.mmc: Linked as a consumer to regulator.2 [ 1.006519] mmc0: host does not support reading read-only switch, assuming write-enable [ 1.008708] mmc0: new high speed SDHC card at address 0007 [ 1.014060] mmcblk0: mmc0:0007 SD08G 7.42 GiB [ 1.020738] mmcblk0: p1 [ 1.047784] mmc1: new high speed MMC card at address 0001 [ 1.053205] mmcblk1: mmc1:0001 S10004 3.56 GiB [ 1.053836] mmcblk1boot0: mmc1:0001 S10004 partition 1 4.00 MiB [ 1.054434] mmcblk1boot1: mmc1:0001 S10004 partition 2 4.00 MiB [ 1.054792] mmcblk1rpmb: mmc1:0001 S10004 partition 3 4.00 MiB, chardev (245:0) [ 1.056163] mmcblk1: p1 [ 1.100401] sdhci-pltfm: SDHCI platform and OF driver helper [ 1.108918] eqep 48300180.eqep: ver. 1.0 [ 1.109175] eqep 48300180.eqep: count_mode:0 [ 1.109186] eqep 48300180.eqep: invert_qa:1 [ 1.109195] eqep 48300180.eqep: invert_qb:1 [ 1.109203] eqep 48300180.eqep: invert_qi:0 [ 1.109211] eqep 48300180.eqep: invert_qs:0 [ 1.109220] eqep 48300180.eqep: swap_inputs:0 [ 1.109228] eqep 48300180.eqep: QDECCTL:0x0180 [ 1.109237] eqep 48300180.eqep: QPOSINIT:0x00000000 [ 1.109244] eqep 48300180.eqep: QPOSMAX:0xffffffff [ 1.109251] eqep 48300180.eqep: QPOSCNT:0x00000000 [ 1.109259] eqep 48300180.eqep: omit_interrupt:0 [ 1.109267] eqep 48300180.eqep: QEINT:0x0800 [ 1.109274] eqep 48300180.eqep: QUPRD:0x05f5e100 [ 1.109281] eqep 48300180.eqep: QEPCTL:0x009e write [ 1.109289] eqep 48300180.eqep: QEPCTL:0x009e read [ 1.109316] eqep 48300180.eqep: irq:60, clk_rate:100000000 [ 1.109864] eqep 48302180.eqep: ver. 1.0 [ 1.110005] eqep 48302180.eqep: count_mode:0 [ 1.110016] eqep 48302180.eqep: invert_qa:1 [ 1.110024] eqep 48302180.eqep: invert_qb:1 [ 1.110033] eqep 48302180.eqep: invert_qi:0 [ 1.110041] eqep 48302180.eqep: invert_qs:0 [ 1.110048] eqep 48302180.eqep: swap_inputs:0 [ 1.110056] eqep 48302180.eqep: QDECCTL:0x0180 [ 1.110064] eqep 48302180.eqep: QPOSINIT:0x00000000 [ 1.110071] eqep 48302180.eqep: QPOSMAX:0xffffffff [ 1.110078] eqep 48302180.eqep: QPOSCNT:0x00000000 [ 1.110087] eqep 48302180.eqep: omit_interrupt:0 [ 1.110094] eqep 48302180.eqep: QEINT:0x0800 [ 1.110102] eqep 48302180.eqep: QUPRD:0x05f5e100 [ 1.110109] eqep 48302180.eqep: QEPCTL:0x009e write [ 1.110116] eqep 48302180.eqep: QEPCTL:0x009e read [ 1.110172] omap_hsmmc 47810000.mmc: card claims to support voltages below defined range [ 1.110212] eqep 48302180.eqep: irq:62, clk_rate:100000000 [ 1.110466] eqep 48304180.eqep: ver. 1.0 [ 1.110662] eqep 48304180.eqep: count_mode:0 [ 1.110671] eqep 48304180.eqep: invert_qa:1 [ 1.110679] eqep 48304180.eqep: invert_qb:1 [ 1.110687] eqep 48304180.eqep: invert_qi:0 [ 1.110695] eqep 48304180.eqep: invert_qs:0 [ 1.110703] eqep 48304180.eqep: swap_inputs:0 [ 1.110710] eqep 48304180.eqep: QDECCTL:0x0180 [ 1.110718] eqep 48304180.eqep: QPOSINIT:0x00000000 [ 1.110726] eqep 48304180.eqep: QPOSMAX:0xffffffff [ 1.110733] eqep 48304180.eqep: QPOSCNT:0x00000000 [ 1.110741] eqep 48304180.eqep: omit_interrupt:0 [ 1.110748] eqep 48304180.eqep: QEINT:0x0800 [ 1.110755] eqep 48304180.eqep: QUPRD:0x05f5e100 [ 1.110762] eqep 48304180.eqep: QEPCTL:0x009e write [ 1.110769] eqep 48304180.eqep: QEPCTL:0x009e read [ 1.110787] eqep 48304180.eqep: irq:64, clk_rate:100000000 [ 1.114175] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux [ 1.125652] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22 [ 1.133263] pinctrl-single 44e10800.pinmux: could not request pin 102 (PIN102) from group pinmux_P9_30_spi_pin on device pinctrl-single [ 1.145637] bone-pinmux-helper ocp:P9_30_pinmux: Error applying setting, reverse things back [ 1.154236] bone-pinmux-helper: probe of ocp:P9_30_pinmux failed with error -22 [ 1.162661] mmc2: new high speed SDIO card at address 0001 [ 1.171680] libphy: Fixed MDIO Bus: probed [ 1.172797] CAN device driver interface [ 1.174332] c_can_platform 481d0000.can: c_can_platform device registered (regs=735cec01, irq=43) [ 1.176090] usbcore: registered new interface driver smsc95xx [ 1.177439] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.177502] ehci-platform: EHCI generic platform driver [ 1.177799] ehci-omap: OMAP-EHCI Host Controller driver [ 1.178598] usbcore: registered new interface driver usb-storage [ 1.181916] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator [ 1.182114] am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0 [ 1.185489] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator [ 1.185649] am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0 [ 1.189123] musb-hdrc musb-hdrc.1: MUSB HDRC host driver [ 1.189177] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 [ 1.189525] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 1.189536] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.189543] usb usb1: Product: MUSB HDRC host driver [ 1.189550] usb usb1: Manufacturer: Linux 4.19.94-ti-r42 musb-hcd [ 1.189558] usb usb1: SerialNumber: musb-hdrc.1 [ 1.190432] hub 1-0:1.0: USB hub found [ 1.190494] hub 1-0:1.0: 1 port detected [ 1.202340] omap_rtc 44e3e000.rtc: registered as rtc0 [ 1.203663] i2c /dev entries driver [ 1.206932] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec [ 1.207472] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0) [ 1.212495] ledtrig-cpu: registered to indicate activity on CPUs [ 1.213039] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 [ 1.213377] omap-aes 53500000.aes: will run requests pump with realtime priority [ 1.215805] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 [ 1.219489] hidraw: raw HID events driver (C) Jiri Kosina [ 1.226560] gnss: GNSS driver registered with major 242 [ 1.233177] NET: Registered protocol family 10 [ 1.304568] Segment Routing with IPv6 [ 1.304704] mip6: Mobile IPv6 [ 1.304861] NET: Registered protocol family 17 [ 1.304890] can: controller area network core (rev 20170425 abi 9) [ 1.304996] NET: Registered protocol family 29 [ 1.305080] 8021q: 802.1Q VLAN Support v1.8 [ 1.305163] Key type dns_resolver registered [ 1.305170] mpls_gso: MPLS GSO support [ 1.305478] ThumbEE CPU extension supported. [ 1.305494] Registering SWP/SWPB emulation handler [ 1.305505] omap_voltage_late_init: Voltage driver support not added [ 1.313722] registered taskstats version 1 [ 1.313732] Loading compiled-in X.509 certificates [ 1.313870] zswap: loaded using pool lzo/zbud [ 1.317282] Btrfs loaded, crc32c=crc32c-generic [ 1.317396] AppArmor: AppArmor sha1 policy hashing enabled [ 1.373485] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set [ 1.374306] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 [ 1.375274] tps65217 0-0024: TPS65217 ID 0xe version 1.2 [ 1.376285] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.376398] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz [ 1.378222] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz [ 1.380059] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz [ 1.384691] cpu cpu0: Linked as a consumer to regulator.4 [ 1.384801] cpu cpu0: Dropping the link to regulator.4 [ 1.385291] cpu cpu0: Linked as a consumer to regulator.4 [ 1.387377] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800) [ 1.388847] ALSA device list: [ 1.388858] No soundcards found. [ 1.395085] Freeing unused kernel memory: 1024K [ 1.395808] Run /init as init process [ 7.060677] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null) [ 7.947384] systemd[1]: System time before build time, advancing clock. [ 8.006570] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid) [ 8.007306] systemd[1]: Detected architecture arm. [ 8.035523] systemd[1]: Set hostname to . [ 9.426902] systemd[1]: /lib/systemd/system/rc_battery_monitor.service:5: PIDFile= references path below legacy directory /var/run/, updating /var/run/rc_battery_monitor.pid → /run/rc_battery_monitor.pid; please update the unit file accordingly. [ 9.564686] systemd[1]: Started Dispatch Password Requests to Console Directory Watch. [ 9.566859] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point. [ 9.567542] systemd[1]: Listening on initctl Compatibility Named Pipe. [ 9.569282] systemd[1]: Listening on Journal Audit Socket. [ 9.569513] systemd[1]: Reached target Remote File Systems. [ 9.570562] systemd[1]: Listening on udev Control Socket. [ 10.426994] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro [ 10.629897] remoteproc remoteproc0: 4a334000.pru is available [ 10.630089] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully [ 10.631750] remoteproc remoteproc1: 4a338000.pru is available [ 10.648182] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully [ 11.720972] systemd-journald[469]: Received request to flush runtime journal from PID 1 [ 23.393310] using random self ethernet address [ 23.393329] using random host ethernet address [ 23.783734] Mass Storage Function, version: 2009/09/11 [ 23.783758] LUN: removable file: (no medium) [ 24.111676] using random self ethernet address [ 24.111694] using random host ethernet address [ 24.334833] usb0: HOST MAC f4:5e:ab:f6:b1:c9 [ 24.338427] usb0: MAC f4:5e:ab:f6:b1:c8 [ 24.344369] usb1: HOST MAC f4:5e:ab:f6:b1:cb [ 24.347323] usb1: MAC f4:5e:ab:f6:b1:cc [ 24.585165] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready [ 24.841963] IPv6: ADDRCONF(NETDEV_UP): usb1: link is not ready [ 31.720136] wlan-en-regulator: disabling [ 46.453438] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle [ 46.777073] remoteproc remoteproc2: wkup_m3 is available [ 46.791836] remoteproc remoteproc2: powering up wkup_m3 [ 46.792047] remoteproc remoteproc2: Booting fw image am335x-pm-firmware.elf, size 217168 [ 46.792313] remoteproc remoteproc2: remote processor wkup_m3 is now up [ 46.792335] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193 [ 46.890847] PM: bootloader does not support rtc-only! [ 51.481167] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 51.502778] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 51.506660] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 [ 51.506690] cfg80211: failed to load regulatory.db [ 51.926718] Bluetooth: Core ver 2.22 [ 51.926905] NET: Registered protocol family 31 [ 51.926913] Bluetooth: HCI device and connection manager initialized [ 51.926942] Bluetooth: HCI socket layer initialized [ 51.926956] Bluetooth: L2CAP socket layer initialized [ 51.927021] Bluetooth: SCO socket layer initialized [ 51.992387] Bluetooth: HCI UART driver ver 2.3 [ 51.992406] Bluetooth: HCI UART protocol H4 registered [ 52.000273] Bluetooth: HCI UART protocol LL registered [ 52.000289] Bluetooth: HCI UART protocol ATH3K registered [ 52.000485] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 52.982720] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 52.982736] Bluetooth: BNEP filters: protocol multicast [ 52.982765] Bluetooth: BNEP socket layer initialized [ 54.025189] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11) [ 54.077121] wlcore: loaded [ 54.516177] Bluetooth: RFCOMM TTY layer initialized [ 54.516221] Bluetooth: RFCOMM socket layer initialized [ 54.516285] Bluetooth: RFCOMM ver 1.11 [ 54.688299] wlcore: PHY firmware version: Rev 8.2.0.0.242 [ 54.729301] wlcore: firmware booted (Rev 8.9.0.0.79) [ 54.774380] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 56.123689] wlan0: authenticate with f0:99:bf:0c:c4:c0 [ 56.136830] wlan0: send auth to f0:99:bf:0c:c4:c0 (try 1/3) [ 56.268098] wlan0: send auth to f0:99:bf:0c:c4:c0 (try 2/3) [ 56.287697] wlan0: authenticated [ 56.296123] wlan0: associate with f0:99:bf:0c:c4:c0 (try 1/3) [ 56.300877] wlan0: RX AssocResp from f0:99:bf:0c:c4:c0 (capab=0x1411 status=0 aid=2) [ 56.314607] wlan0: associated [ 56.569781] cryptd: max_cpu_qlen set to 1000 [ 57.592775] wlan0: Limiting TX power to 20 (20 - 0) dBm as advertised by f0:99:bf:0c:c4:c0 [ 57.619078] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 57.649765] wlcore: Association completed. [ 57.824232] IPv6: ADDRCONF(NETDEV_UP): SoftAp0: link is not ready [ 59.846359] wlcore: down [ 59.963169] IPv6: ADDRCONF(NETDEV_CHANGE): SoftAp0: link becomes ready [ 361.046294] remoteproc remoteproc0: powering up 4a334000.pru [ 361.063572] remoteproc remoteproc0: Booting fw image am335x-pru0-rc-encoder-fw, size 36040 [ 361.063616] remoteproc remoteproc0: remote processor 4a334000.pru is now up [ 426.526981] remoteproc remoteproc0: stopped remote processor 4a334000.pru

bjnilsen commented 3 years ago

Attached is qep signals. Looks good.

This issue is related to SW, it worked just fine with the pre-installed image from factory. I believe it was 4.4 kernel (I forgot to check this before upgrading to the latest image).

qep_signals
bjnilsen commented 3 years ago

root@beaglebone:/home/debian# dmesg | grep qep [ 1.088854] eqep 48300180.eqep: ver. 1.0 [ 1.089102] eqep 48300180.eqep: count_mode:0 [ 1.089113] eqep 48300180.eqep: invert_qa:1 [ 1.089122] eqep 48300180.eqep: invert_qb:1 [ 1.089131] eqep 48300180.eqep: invert_qi:0 [ 1.089139] eqep 48300180.eqep: invert_qs:0 [ 1.089148] eqep 48300180.eqep: swap_inputs:0 [ 1.089157] eqep 48300180.eqep: QDECCTL:0x0180 [ 1.089165] eqep 48300180.eqep: QPOSINIT:0x00000000 [ 1.089173] eqep 48300180.eqep: QPOSMAX:0xffffffff [ 1.089180] eqep 48300180.eqep: QPOSCNT:0x00000000 [ 1.089189] eqep 48300180.eqep: omit_interrupt:0 [ 1.089196] eqep 48300180.eqep: QEINT:0x0800 [ 1.089204] eqep 48300180.eqep: QUPRD:0x05f5e100 [ 1.089211] eqep 48300180.eqep: QEPCTL:0x009e write [ 1.089219] eqep 48300180.eqep: QEPCTL:0x009e read [ 1.089247] eqep 48300180.eqep: irq:60, clk_rate:100000000 [ 1.089820] eqep 48302180.eqep: ver. 1.0 [ 1.089972] eqep 48302180.eqep: count_mode:0 [ 1.089982] eqep 48302180.eqep: invert_qa:1 [ 1.089991] eqep 48302180.eqep: invert_qb:1 [ 1.089999] eqep 48302180.eqep: invert_qi:0 [ 1.090007] eqep 48302180.eqep: invert_qs:0 [ 1.090015] eqep 48302180.eqep: swap_inputs:0 [ 1.090023] eqep 48302180.eqep: QDECCTL:0x0180 [ 1.090031] eqep 48302180.eqep: QPOSINIT:0x00000000 [ 1.090038] eqep 48302180.eqep: QPOSMAX:0xffffffff [ 1.090045] eqep 48302180.eqep: QPOSCNT:0x00000000 [ 1.090053] eqep 48302180.eqep: omit_interrupt:0 [ 1.090060] eqep 48302180.eqep: QEINT:0x0800 [ 1.090067] eqep 48302180.eqep: QUPRD:0x05f5e100 [ 1.090149] eqep 48302180.eqep: QEPCTL:0x009e write [ 1.090157] eqep 48302180.eqep: QEPCTL:0x009e read [ 1.090179] eqep 48302180.eqep: irq:62, clk_rate:100000000 [ 1.090525] eqep 48304180.eqep: ver. 1.0 [ 1.090653] eqep 48304180.eqep: count_mode:0 [ 1.090663] eqep 48304180.eqep: invert_qa:1 [ 1.090671] eqep 48304180.eqep: invert_qb:1 [ 1.090679] eqep 48304180.eqep: invert_qi:0 [ 1.090687] eqep 48304180.eqep: invert_qs:0 [ 1.090696] eqep 48304180.eqep: swap_inputs:0 [ 1.090704] eqep 48304180.eqep: QDECCTL:0x0180 [ 1.090712] eqep 48304180.eqep: QPOSINIT:0x00000000 [ 1.090720] eqep 48304180.eqep: QPOSMAX:0xffffffff [ 1.090727] eqep 48304180.eqep: QPOSCNT:0x00000000 [ 1.090735] eqep 48304180.eqep: omit_interrupt:0 [ 1.090743] eqep 48304180.eqep: QEINT:0x0800 [ 1.090750] eqep 48304180.eqep: QUPRD:0x05f5e100 [ 1.090757] eqep 48304180.eqep: QEPCTL:0x009e write [ 1.090764] eqep 48304180.eqep: QEPCTL:0x009e read [ 1.090786] eqep 48304180.eqep: irq:64, clk_rate:100000000 [ 1.094121] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux

mdlugosz commented 3 years ago

Exactly, I confirm. Everything work perfectly when I use pre-instaled system, but when I want use another debian or ubuntu running from sd-card this EP1 not work. So this is software (or configure) problem not hardware.

pt., 16 paź 2020 o 11:07 bjnilsen notifications@github.com napisał(a):

Attached is qep signals. Looks good.

This issue is related to SW, it worked just fine with the pre-installed image from factory. I believe it was 4.4 kernel (I forgot to check this before upgrading to the latest image). [image: qep_signals] https://user-images.githubusercontent.com/72491249/96239228-be308680-0f9f-11eb-9fd5-ee49b0e3f938.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/beagleboard/Latest-Images/issues/67#issuecomment-709925152, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH2KPWQMTGYY45VOIGQIETSLAENRANCNFSM4RS4RAYQ .

-- Pozdrawiam

Marek Długosz

bjnilsen commented 3 years ago

The pinmux error looks suspicious:

[ 1.114175] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux

mdlugosz commented 3 years ago

Ok, thank you! What and where we should correct to make it work? As I wrote above, if system is booted from eMMC all four encoders work propertly.

bjnilsen commented 3 years ago

Any idea what's wrong or how to fix it?

MarkAYoder commented 3 years ago

I got the -1, 0, 1 outputs when config-pin was used to mux multiple pins to the same eQEP.

bjnilsen commented 3 years ago

The problem is that device tree am335x-boneblue.dts uses the wrong pin:

`/ E1 / eqep0_pins: pinmux_eqep0_pins { pinctrl-single,pins = < AM33XX_PADCONF(AM335X_PIN_MCASP0_AXR0, PIN_INPUT, MUX_MODE1) / (B12) mcasp0_aclkr.eQEP0A_in / AM33XX_PADCONF(AM335X_PIN_MCASP0_FSR, PIN_INPUT, MUX_MODE1) / (C13) mcasp0_fsr.eQEP0B_in /

; };`

Wrong: AM335X_PIN_MCASP0_AXR0

Correct: AM335X_PIN_MCASP0_ACLKR

RobertCNelson commented 3 years ago

Nice find @bjnilsen , can you issue a pull request to: https://github.com/beagleboard/BeagleBoard-DeviceTrees to fix it ;)

bjnilsen commented 3 years ago

Pull request added: https://github.com/beagleboard/BeagleBoard-DeviceTrees/pull/28

bjnilsen commented 3 years ago

Pull request merged. Until the fix is released one can use the following steps to solve the problem: (assuming 4.19.94-ti-r55 kernel on BeagleBone Blue)

  1. git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees.git
  2. cd BeagleBoard-DeviceTrees
  3. make
  4. sudo cp src/arm/am335x-boneblue.dtb /boot/dtbs/4.19.94-ti-r55/am335x-boneblue.dtb
  5. reboot
ldbrouwer commented 11 months ago

All: I just had the same issue with reading eqep encoder 1. It reads either 1 and 0; or -1 and 0. I just purchased my Beaglebone blue recently and upgraded the software. Has the kernel been upgraded? Can I check to see if I have a working kernel or if I need to implement the fix referenced above?