S32K3 + OS Suspend or resume OS Interrupt time

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K3 + OS Suspend or resume OS Interrupt time

875件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

864件の閲覧回数
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 件の賞賛
返信

838件の閲覧回数
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 件の賞賛
返信

799件の閲覧回数
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 件の賞賛
返信