S32K3 + OS Suspend or resume OS Interrupt time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K3 + OS Suspend or resume OS Interrupt time

874 Views
kjy106906
Contributor IV

I am using S32K312 + Microsar OS.


#define ResumeAllInterrupts() ASM_KEYWORD(" cpsie i")
#define SuspendAllInterrupts() ASM_KEYWORD(" cpsid i")
I think the execution time of ResumeAllInterrupts or SuspendAllInterrupts is too long.
The above function exists inside the RTD function.

ResumeAllInterrupts takes about 6us. (SuspendAllInterrupts is same)

(The time was measured using the GPIO toggle.)

I think it takes too long to simply do ASM_KEYWORD(" cpsie i").
Is there any way to shorten execution time?

0 Kudos
Reply
3 Replies

863 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kjy106906,

On CM4, the instruction should take 1 or 2 cycles.

It is not specified for CM7.

https://developer.arm.com/documentation/ddi0439/b/CHDDIGAC

Where to find the execution cycles of Cortex m7 instruction

https://community.arm.com/support-forums/f/architectures-and-processors-forum/8952/where-to-find-the...

 

What is your system clock configuration?

Do you use RTD to toggle the GPIO?

In general, the drivers cause a significant CPU overhead.

 

Regards,

Daniel

0 Kudos
Reply

837 Views
kjy106906
Contributor IV

What is your system clock configuration?

-> Core clock 120Mhz

Do you use RTD to toggle the GPIO?

-> Yes I use RTD

But When I only toggled the GPIO it took about 1us
When ResumeAllInterrupts or SuspendAllInterrupts and GPIO toggle were used together, it took about 7us in total.

So I think the time taken of ResumeAllInterrupts or SuspendAllInterrupts is too long.

0 Kudos
Reply

798 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kjy106906,

As I said, the core should do it in 1-2 cycles.

But it depends on other factors, like the location of the code, whether the core reads it directly from the Flash or it is a Cache hit. There can be wait states on the crossbar switch. It can be delayed becasue of pending interrupts.

 

Regards,

Daniel

0 Kudos
Reply