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.
Hi all
I'm looking for a possibility to check if my code which runs in unsecured RAM does access data in secured memory. Best would be a kind of automatic test...
Currently CSM is not activated in my project (28335) and a part of my code runs in M0/M1 RAM. I would like to activate CSM. But my code perhaps does access secured memory (as constants, look up tables, etc).
How can I detect if my code tries to access secured data? Or even better: How can I prove that my code in M0/M1 does not access secured memory?
Any idea is greatly appreciated!
Best regards
Roger
Hi Roger,
Read/Write accesses from non-secure code to secure memory are simply blocked. If there are accesses to secure RAM by code running from M0/M1 then code will not work and you have to step through the code to check the issue. You should disable the ECSL by writing lower 64bit of password value into KEYx and then you should be able to step through the code (with out disconnecting the CCS) to debug the same.
Regards,
Vivek Singh
Hi Vivek
Thank you for your answer! I have read about this ECSL possibility, but not tried yet.
I would prefer a method of 'static analysis' not a 'stepping though code...' (test coverage).
The most tricky part is that the code will read zero and will not fail / trap / illegal access / something like this... Or do I miss a possibility of the debugging environment? Will the debugger stop on a failed read / write access?
Anyway, I think the manual way is not the solution for my problem...
Do you have an idea how I could do a static analysis (without going manually through code)?
Thank you & best regards
Roger
Roger,
Actually on this device, if there is an access to secure memory from code running from non-secure memory while emulator is connected then emulator will get disconnected. So that would indicate if there is any such access but to debug it further to know from where the access is made (and to what location) one need to debug the code by disabling the ECSL. You can use the watchpoint feature of CCS to debug the same. You can provide the address range using the mask feature (in this case secure memory range) and trigger on write or read to halt the CPU. Following is a snapshot of watch-point property -
In this I have given the address as 0x1ff and the mask 0xff which means on any write to address 0x100 to 0x1FF the CPU will halt. You can enable this watch point only when code runs from non-secure memory.
Hope this helps.
Regards,
Vivek Singh