I am using the IDE Keil MDK-ARM Professional 5.27, NXP MIMXRT1064 and FREERTOS 10.2.
I have an encryption application that runs on a memory of 5MBytes.
When running in “bare metal”, it runs the entire process within 10 milli seconds.
The same application, when running on a “FreeRTOS” task, it takes 1minunte 40 seconds.
Why is it spending so much time running on FreeRTOS?
How do problem solve or reduce ?
What is the priority of the task in which the encryption algorithm is
executing? What else is your application doing and at what priority?
What is the tick frequency? Have you traced the application to see
where the CPU cycles are going?
One question to look at, has the conversion from ‘Bare Metal’ to running under FreeRTOS moved the location of the Stack or other data memories that you use a lot from internal ram to external ram?
What is the priority of the task in which the encryption algorithm is
executing? What else is your application doing and at what priority?
What is the tick frequency? Have you traced the application to see
where the CPU cycles are going?
Hi, Richard!
I 'm using NXP MIMXRT1064 internal RAM. It’s my application encrypton!
This moment, I don’t need to change other RAM or memory other.
I already am problem internal RAM.
My test,
It is running to “Beta-metal”.
I am using berfore " vTaskStartScheduler();"
I send to my test below:
…
encrypton(); //my aplication with 5Mbytes; --> it takes 10 milli seconds
vTaskStartScheduler();
…
Richard,
some questions.
What are kind do memory Before and After “vTaskStartScheduler();” ?
if they are different, how do I direct to the same position?
You are saying that you application is using 5 MB of RAM. Most processors don’t have 5 MB of internal RAM, so you probably have some internal RAM and some External RAM. Generally, for program startup, the processor stack is pointed to the internal ram which is faster. When you create your task, it will have its stack allocatted from somewhere. Depending on how you do that, it could be placed in the internal RAM or the External RAM. If you are using one of the heap versions that use a statically allocated memory block for the heap, then it depends where you had the system allocate that block of memory. If it is in the External Ram, then that is often slower to access, and thus your program will slow down.
Changing the type of memory you are running in could have a noticable factor in running speed, and I first read your time change as from 10 seconds to 1 minute 40 secords (a factor of 10) which is a bit bigger than I would expect, but might be possible. I now see that your other time was 10 ms, and that level of slow down (x10,000) is likely a sign that in some way the program isn’t really the same (doing something extra that burns 99.99% of the processor time)