This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
================================================================================
This question is split from "TMS570LC4357: Execution Time is huge when compared to TMS570LS3137"
Link: e2e.ti.com/.../730319
================================================================================
Gobind,
These questions are no longer related to the original post and title. Please start a new thread for questions / topics unrelated to the original post.
See my comments below:
1. I did not enable MPU, which means the memory attributes are the default ones and whole of Flash and RAM are in Write-Back, Write-Allocate (WBWA)mode. (Is this assumption correct?) The execution time for some set of instructions was 734ns. When I enabled MPU and I think i configured it Write-Through (WT) mode. The execution time for the same set of instructions was 610ns. Is it expected behavior? If yes, why WT mode is faster than WBWA mode?
>> Please share your code configuring the MPU, as well as the instructions that you are executing. How do you measure the execution time?
2. In CCS Expressions window, when the code is running with Cache Enabled, the values in Expression window are all zeros. As soon as the execution is PAUSED, the actual values are seen. Is there a way to parallel see these values in the Expression window when Cache is enabled? When Cache is disabled, the values are fine.
>> The debugger memory window does use the processor to refresh the contents. This requires the processor to stop executing code, switch to a debug state (refer to ARM architecture reference manual for debug state details), and perform reads from the memory locations being displayed. There is a way on TMS570 MCUs to display memory locations without using or halting the processor. This requires you to map the debugger memory window to be refreshed by the DAP (Debug Access Port) in stead of the processor.
3. Another question is, Is it not possible to execute code from RAM when Cache memory is enabled? I tried that, but I am facing problems. I see some exceptions getting raised or sometimes control remains in the function that is running from RAM and never comes out.
>> How do you set up your code to execute from RAM? What exceptions do you get?
Regards,
Sunil
Answers below:
1. MPU init file is attached.0333.MPU_init.txt
The instruction that i executed was like:
//Start Code
Toggle GPIO low
UINT32 = UINT32 + UINT32;
UINT32 = UINT32 + UINT32;
..... 18 times
Toggle GPIO high
//End Code
GPIO was used to measure the time (as above)
2. Debugger shows the values when Cache is not enabled. When cache is enabled, it shows only zeroes. My question is, is there any special setting that we have to do for Cache Enabled to view the run time values in the Debugger?
3. I used the #pragma code to run the function from RAM:
pragma CODE_SECTION(FunctionName,"APPRAMFUNC")
I do not get some exception, but the control never comes out of the function running from RAM. But as soon as i disable cache, everything works perfectly fine. So my question is only with respect to cache enable, otherwise it is fine.