Hello,
I am using a Nuvoton M2351 for my research. I am running into a very weird issue. I am trying to get some portions of FreeRTOS to run inside the secure domain. I am using the EventRecorder API to time sections of the code (EventStartA and EventStopA). The processor is set at 12 MHz core clock and I am building the code without any optimizations enabled. While timing a simple for loop (which increments a value) running 1000 times in the secure domain, I log around 2ms. The exact same loop, when implemented in a non-secure function and called from the secure domain, takes 2.9 ms. This is nearly a 1.5X increase in runtime. Considering the function call overhead across domains is around 20-30 instructions, this is extremely high. Am I doing something wrong to cause this? Does the processor frequency change when switching? I can't make any sense of this behavior. Any help would be appreciated.
Thank you
Hello!
Thank you for your response. Yes, the two pieces of code read 2 different memory regions. While the diagram you present is helpful, can you elaborate on the difference in timing path? I don't see why I would see a 50% difference in execution time. Also, the measurements I reported were after taking into consideration the overhead of the world switch.
Thanks
I'm afraid that we cannot comment on the external memory outside of Arm Processor.