How can I generate a periodic signal on a GPIO using timer interrupt in Linux kernel (STM32MP153a)?
Hi,
I am using STM32MP153a SOC.Linux kernel version is 5.4.56 (openstlinux-5.4-dunfell-mp1-20-11-12).
I would like to generate square signal of 50-200 uS on a certain GPIO every 40 ms using Linux kernel.Also ,at this point I need to read certain registers.
What are my options? If there is already an example/application note on the subject,please let me know.
I was looking into these options:
1)I have already a working timer on my system,which is arm arch timer.It's already generating interrupts ( I can see that number of interrupts is increasing in /proc/interrupts).The question is how do I configure it to generate interrupt every 40 ms and I how do I generate callback to have my registers reading.
2)TIM6/TIM12 -STM32 timer.
As far as I could see,current examples - pwm,counter,trigger ,does not fit my needs , since they don't have any form of periodic interrupt.
PWM example is the closest to what I need - it possibly could generate a signal that I need,but it doesn't have an option to have an interrupt function to read those registers
3)"st,stm32-timer" - I have stumbled into this option while digging throught the kernel source tree.It has clocksource and clockevents implementation ,but it seems that it works only with STM32F series.If it could work with TIMs of STM32MP15x series,please let me know.Also an example of usage would be useful.
Thank You!
