[beagleboard] Re: eqep2 problemss

2020-06-06 Thread cesare . giavardi
Thanks Robert for your quick reply.
I tried changing from uboot_overlay_eqep2 to uboot_overlay_addr0 but 
nothing happened.
Eqep2 is still not counting.

I checked the messages from 'version.h' and there is something strange (to 
me...):

...

uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/bone_eqep2-new-00A0.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade 
]

... 


Same message when I was using 
uboot_overlay_eqep2=/lib/firmware/bone_eqep2-new-00A0.dtbo

I tried changing uEnv.txt to 

uboot_overlay_addr0=/lib/firmware/bone_eqep2*1*-new-00A0.dtbo 


File ...eqep21... doesn't exist. After reboot I had the same message from 
'version.h':

uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/bone_eqep21-new-00A0.dtbo]

pkg check: to individually upgrade run: [sudo apt install --only-upgrade 
]


Could it be a problem?

Is there something else I can check?
Regards.
 
 

Il giorno sabato 6 giugno 2020 05:29:33 UTC+2, Cesare Giavardi ha scritto:
>
> Dear,
> I'm struggling with eqep2 on BBB, After one week of attempts nothing 
> works...
> Here my situation:
>
> - I compiled this dts file (generating *bone_eqep2-new-00A0.dtbo*):
>
> /dts-v1/;
> /plugin/;
>
> #include 
> #include 
> #include 
>
> / {
> compatible = "ti,beaglebone", "ti,beaglebone-black";
>
> // identification
> part-number = "bone_eqep2b";
> version = "00A0";
>
> // resources this cape uses
> exclusive-use =
> "P8.12", // EQEP2A_in
> "P8.11", // EQEP2B_in
> "P8.16", // EQEP2_index
> "P8.15", // EQEP2_strobe
>
> "eqep2"; // hardware ip used
>
> /*
> * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
> */
> fragment@0 {
> target-path="/";
> __overlay__ {
>
> chosen {
> overlays {
> bone_eqep2b-00A0 = __TIMESTAMP__;
> };
> };
> };
> };
>
> /*
> * Free up the pins used by the cape from the pinmux helpers.
> */
> fragment@1 {
> target = <&ocp>;
> __overlay__ {
> P8_12_pinmux { status = "disabled"; }; /* P8_12: GPIO1_12 = EQEP2A_in */
> P8_11_pinmux { status = "disabled"; }; /* P8_11: GPIO1_13 = EQEP2B_in */
> P8_16_pinmux { status = "disabled"; }; /* P8_16: GPIO1_14 = EQEP2_index */
> P8_15_pinmux { status = "disabled"; }; /* P8_15: GPIO1_15 = EQEP2_strobe 
> */
> };
> };
>
> fragment@2 {
> target = <&am33xx_pinmux>;
> __overlay__ {
> pinctrl_eqep2: pinctrl_eqep2_pins {
> pinctrl-single,pins = <
> BONE_P8_12 (*PIN_INPUT_PULLUP* | MUX_MODE4) /* P8_12: GPIO1_12 = 
> EQEP2A_in */
> BONE_P8_11 (*PIN_INPUT_PULLUP* | MUX_MODE4) /* P8_11: GPIO1_13 = 
> EQEP2B_in */
> BONE_P8_16 (PIN_INPUT | MUX_MODE4) /* P8_16: GPIO1_14 = EQEP2_index */
> BONE_P8_15 (PIN_INPUT | MUX_MODE4) /* P8_15: GPIO1_15 = EQEP2_strobe */
> // From: 
> https://groups.google.com/forum/#!searchin/beagleboard/eQep/beagleboard/Orp3tFcNgCc/mYacP_GkCQQJ
> >;
> };
> };
> };
>
> fragment@3 {
> target = <&epwmss2>;
> __overlay__ {
> status = "okay";
> };
> };
>
> fragment@4 {
> target = <&eqep2>;
> __overlay__ {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_eqep2>;
>
> count_mode = <0>; // count_mode is not userspace op_mode
> // 0 -> Quadrature mode, normal 90 phase offset cha & chb.
> // 1 -> Direction mode.  cha input = clock, chb input = direction
> // 2 -> UP count mode for frequency measurement QDIR=1, ignore direction 
> input
> // 3 -> DOWN count mode for frequency measurement QDIR=0, ignore direction 
> input
>
> swap_inputs = <0>; // swap channel A and B? (0 - no, 1 - yes)
> invert_qa = <0>; // invert channel A input?
> invert_qb = <0>; // invert channel B input?
> invert_qi = <0>; // invert index input?
> invert_qs = <0>; // invert strobe input?
> omit_interrupt = <0>; // 1 -> do not install interrupt handler, 0 -> do 
> install
>
> status = "okay";
> };
> };
> };
>
>
>
> - Moved file to /lib/firmware
>
> - Modified /boot/uEnv.txt:
>  
>
> #Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
>
> enable_uboot_overlays=1
> enable_uboot_cape_universal=1
> disable_uboot_overlay_video=1
>
> uname_r=4.14.108-ti-r127
> #uuid=
> #dtb=
> cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet
>
> #In the event of edid real failures, uncomment this next line:
> #cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet 
> video=HDMI-A-1:1024x768@60e
>
> #Use an overlayfs on top of a read-only root filesystem:
> #cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet 
> overlayroot=tmpfs
>
> ##enable x15: eMMC Flasher:
> ##make sure, these tools are installed: dosfstools rsync
> #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3-no-eeprom.sh
>
> #uboot_overlay_addr0=/lib/firmware/PRU_BlinkLed-00A0.dtbo
> uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
>
>
> *uboot_overlay_eqep2=/lib/firmware/bone_eqep2-new-00A0.dtbo*
>
>
>
> - Reboot BBB
>
> - cd /sys/devices/platform/ocp/48304000.epwmss/48304180.eqeps
> - cat enabled --> 1
> - cat mode --> 0
> - cat position --> 0
>
> - Connnect the encoder.
>
> - cat position --> 0 *ALWAYS*
>
> - /o

[beagleboard] Re: eqep2 problemss

2020-06-06 Thread TJF
Am Samstag, 6. Juni 2020 09:49:59 UTC+2 schrieb cesare@gmail.com:
>
> Is there something else I can check?
>

Sure, check out libpruio. 
 Easy 
controlling of QEP modules in one, two or three line configurations 
(without any device tree trouble).

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/f8785fb1-fcd4-4a12-b2f3-49165cb94e2do%40googlegroups.com.