Hello Dave,
I observed that on XPS, the peripheral have "Require TrustZone Secure on all accesses" option. So, like i try to implement a TrustZone
example (baremetal application), i enable this option.
After, with SDK, i use this peripheral (because i think, at beginning we are in Secure world) but when i tried to passed to Non-Trust (Normal) world,
i can't and i have an memory error.
To pass on Normal world, i do :
void enterNonSecure() {
unsigned int scr=0;
RD_SCR(scr);
WR_SCR(scr | 1);
}
with
#define WR_SCR(_VAL) WR_CP15(0, c1, c1, 0, _VAL)
#define RD_SCR(_VAL) RD_CP15(0, c1, c1, 0, _VAL)
#define WR_CP15(_OP1, _CRN, _CRM, _OP2, _VAL)
asm volatile("mcr p15, "#_OP1", %0, "#_CRN", "#_CRM", "#_OP2::"r"(_VAL))
#define RD_CP15(_OP1, _CRN, _CRM, _OP2, _VAL)
asm volatile("mrc p15, "#_OP1", %0, "#_CRN", "#_CRM", "#_OP2:"=r"(_VAL))
So i change the bit on register CP15, but maybe i missed something (target initialization, memory initialization,...)
Best Regards
Renaud