AnsweredAssumed Answered

Why does s32k144 take more time to run code in ram?

Question asked by 中当 陈 on Sep 29, 2018
Latest reply on Oct 7, 2018 by 中当 陈

Hello!

I have a problem. I test some codes, When s32k144 runs these codes in ram, It takes more time. And when s32k144 runs code in flash, It take less time.In my opinion, the result must be reversed. So I am confused。

 

My IDE: WIN10_64 + IAR 7.60.2 for ARM

And my codes are these:

delay() function returns the executive time of "while(count  >  0)". And then the array "time" stores the executive time. delayTest() function calls delay() function continuously。

 

example 1:

The codes of delay() function  are in flash. And the codes of delayTest() function are in flash.

the average value of the array time is 2820.

example 2:

The codes of delay() function are in ram. And the codes of delayTest() function are in flash.

the average value of the array time is 3220.

example 3:

The codes of delay() function are in flash. And the codes of delayTest() function are in ram.

the average value of the array time is 3700.

 

I hope someone could help me.

Best regards to you!

Thanks!

Outcomes