I could not change the LOCK1 register even though I wrote like below
If the reason of "system memory error" is due to the LOCK register.
I should solve why the LOCK1 register can not be modified.
However, if the reason is different, I should investigate it more.
Finally, I found the reason why "system memory error" occurred in my system.
The M1~M5 was assigned from local variable address, and the stack is used in the cache.
That is, stack is locked in the cache.
Because I assigned local variable addresses to the M1~M5 address, the CSE could not read the addresses.
After I gave the addresses of global variables to the M1~M5, this problem was solved.