This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: Configuring Hardware GP timers for generating interrupts after every 1 ms

Part Number: AM5728


Hi,

I am using AM5728 ported with RT Linux SDK 6, linux version 4.19.

I want to generate a interrupt after every 1 ms using hardware timers (GP Timer).

Can anyone please provide the procedure/sample code to generate interrupt.

Is the timers generates interrupts accurately for 1 ms. Please clarify?

Thanks & Regards

Krishna Reddy

  • Hi Krishna,

    Are you looking for a kernel driver example for configuring the timer?

    Best Regards,
    Keerthy

  • Hi Keerthy,

    Yes we are looking for kernel driver example and capture the interrupt at user space.

    Can you please provide any sample code/examples/procedure for configuring timers.

    Thanks & Regards

    Krishna Reddy

  • HI Krishna,

    I will get back to you in couple of days.

    Best Regards,
    Keerthy

  • Hi Krishna,

    There is no example code or anything that is readily available. However you could look at:
    driver/remoteproc/omap_remoteproc.c

    The above driver makes use of gptimer. Look at:

    omap_rproc_request_timer

    omap_rproc_start_timer

    omap_rproc_stop_timer

    omap_rproc_release_timer

    omap_rproc_get_timer_irq

    omap_rproc_ack_timer_irq

    omap_rproc_enable_timers

    & finally omap_rproc_probe where you get the timer handles from device tree.

    Example DT node where gptimer is hooked to ipu:
    arch/arm/boot/dts/dra7-ipu-dsp-common.dtsi


    &ipu1 {
    mboxes = <&mailbox5 &mbox_ipu1_ipc3x>;
    timers = <&timer11>;
    watchdog-timers = <&timer7>, <&timer8>;
    };

    Best Regards,
    Keerthy