This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Shared timer on nRF5340 between NET and APP CPUs?

I would like to share a common time references between the NET and APP CPUs. This can be a single timer which both CPUs can access or two independent timers as long as the values are precisely the same. Each CPU needs 1 timer capture event to trigger a task.

Is this possible? If so, how can this be implemented?

Parents Reply Children
  • Einar,

    Thank you for the reply and suggestion. I'm familiar with DPPI and IPC but not sure if that will solve my problem...maybe I need a little more elaboration on the solution.

    I have code running on both APP CPU and NET CPU which performs operations that are synchronized to a single time reference. I am using TIMER0 on the NET CPU as a free-running clock. Operations are timestamped (via timer CC) by the NET CPU. The APP CPU performs similar timestamped operations but must do so based on the NET CPU's TIMER0. 

    I'm not certain how this would work with DPPI+IPC unless the DPPI works across the CPU boundaries, which I don't believe it does. Maybe I'm wrong. But perhaps you can elaborate on your solution.

    Thanks again.

    John

  • Hi John,

    jyi said:
    I'm not certain how this would work with DPPI+IPC unless the DPPI works across the CPU boundaries, which I don't believe it does. Maybe I'm wrong. But perhaps you can elaborate on your solution.

    While DPPI itself does not cross CPU boundaries, it can with the help of IPC, as you can see from the IPC and PPI connections in the IPC documentation. I have not considered this before nor do I know the details of what you want to do, but I would assume this could be used for something. At least this means that you could get events from the timer on the other CPU, and also trigger tasks. This gives at least two very different options:

    • Trigger CC on the timer in the app core from the net core using DPPI-IPC-DDPI and read back the value using shared memory.
    • A different approach could be to use a timer on the application core and network core that you start via DPPI-IPC-DPPI. This will give a predictable relationship between them as the starting point is known, and they will be synchronous since they run off the same clock reference (32 MHz crystal).

    Einar

  • Einar, I understand now...DPPI-IPC-DDPI. That makes sense. This solution does give a method to synchronize 2 separate timers between APP and NET CPUs. This method will always have a delta between the timers. Not the share timer solution I was hoping for, but could work. Thanks for the suggestion.

  • Hi,

    Yes, there will be a delta, but this will be predictable and constant (as the two timers will have a common clock source). So you should be able to compensate for it.

Related