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.
Tool/software: TI-RTOS
Hi,
I am studying CSM and trying to experiment.
To briefly describe the overall flow of the CSM
1. Program the password and place it in the PWL.
2. If I try to debug through JTAG, I can compare it with PWL by putting the correct value in the key register, then, debugging is possible if it matches.
3. Unable to access secure memory from non-secure memory, but call is possible.
4. You can freely use non-secure memory in secure memory.
It has been described that in non-secure memory, the program counter can be used to call content in secure memory, what is the call to?
and, Can you show an example that allows me to write code to access secure memory from non-secure memory?
As the first student to study embedded, I do not know too much. I would be grateful if you kindly explain it to me in detail.
Thanks and regards,
Han
Can you show an example that allows me to write code to access secure memory from non-secure memory?
We do not have such an example. Once the security conditions are satisfied, it is no different from accessing one part of memory from another.
A call can be anywhere into secure zone memory. So, you can write functions in secure memory, and make calls to those functions from unsecure memory if desired. But you cannot read the secure code directly from code running in unsecure memory. It's not a mode of the CPU or anything, the security is just based off what address the code running resides at. So, when you ask about unsecure code "accessing" secure memory, if you are meaning how does one transfer execution from unsecure code to secure code, it is just done by changing the Program Counter (PC) value to an address in secure memory. This can be accomplished by a call or a branch instruction (or, in C, a call to a function located in secure memory). If you are asking how unsecure code can directly read variables located in secure memory, you cannot do this unless you unlock the CSM. Secure code (code running from secure memory) can always directly read/write both secure memory and unsecure memory. However, unsecure code (code running from unsecure memory) can only directly read/write unsecure memory while the CSM is locked.
There is no specific code that must be run. You just need to understand where you placed certain code. For instance, if a piece of code is copied to L4 RAM (unsecure memory), it will be considered unsecure code when run, and cannot directly access variables placed in L0 RAM (secure memory). However, code running from flash (secure memory), or copied to and run from L1 RAM (secure memory), would be able to access L0 RAM. Additionally, it would be able to access variables placed in unsecure memory (e.g., L5 RAM).
Hope this helps.
Regards,
Dave Foley
Dave Foley
Thank you for the friendly explanation for beginners.
Regards,
Han