2024-05-29 07:31 AM
I'm doing a project, that I need a rotary encoder working on cortex-a7 core of stm32mp157.
I met problem, my rotary encoder can not work.
This is what I have done:
1. In kernel menuconfig I have config: use rotary encoder as a build-in module;
2. Write dts, and I am sure these gpio not been use anywhere:
In /proc/device-tree, I can see the device node
what is the problem, I need your help, thank you!
2024-05-31 03:55 AM - edited 2024-05-31 03:58 AM
HI @Jason007
Did you have GPIOs pull-ups on the board ?
Maybe try if internal pull-up is ok by using
(GPIO_ACTIVE_LOW | GPIO_PULL_UP)
Alternatively (could reach higher count rate), you could use TIM or LPTIM for this (still need pull-ups).
See https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_use_the_IIO_user_space_interface#How_to_use_the_quadrature_encoder_with_the_sysfs_interface
(need to chose input pins according to Timers inputs possible muxing).
Regards,