Other Parts Discussed in Thread: SYSBIOS
Tools version: ti-cgt-c6000_8.3.3
Shared memory location (MSMC): 0x0C03B000
I am going to load program into the above mentioned memory section and I wanted to protect it using ti.sysbios.family.c64p.MemoryProtect
- Is it appropriate to use ti.sysbios.family.c64p.MemoryProtect?
- If ti.sysbios.family.c64p.MemoryProtect is appropriate, here is what I have implemented:
In the .cfg file:
...
var ExceptionDSP = xdc.useModule('ti.sysbios.family.c64p.Exception');
var MemoryProtect = xdc.useModule('ti.sysbios.family.c64p.MemoryProtect');
...
Program.global.sharedMemoryProgramStart= 0x0C03B000;
Program.global.sharedMemoryProgramLen= 4000;
...
...
ExceptionDSP.enablePrint = true;
Hwi.enableException = true;
ExceptionDSP.exceptionHook = '&ExceptionHandler';
ExceptionDSP.enableExternalMPC = true;
...
In the DSP function .c file:
...
volatile UINT32 perm;
BOOL mpFlag
perm = MemoryProtect_MPPA_UX | MemoryProtect_MPPA_UR | MemoryProtect_MPPA_SX | MemoryProtect_MPPA_SR | MemoryProtect_MPPA_LOCAL;
mpFlag=MemoryProtect_setPA((Ptr)(sharedMemoryProgramStart), sharedMemoryProgramLen, (UInt32)perm);
I am getting false when I print out the mpFlag so I don't think I am doing this correctly? I also purposely read and write back the same value to try to trigger the exception but it also did not trigger. Any suggestions?