asm("str lr,[sp, #-4]!"); asm("smc #0"); asm("mrc p15, 0, %0, c9, c1, 2" : "=r" (tcm_secure)); tcm_secure |= 1; asm("mcr p15, 0, %0, c9, c1, 2" /* set DTCM NS bit to 1 */ : : "r" (tcm_secure)); asm("movs pc, lr"); asm("ldr lr, [sp, #0]!");
I suppose it would be far easier to just ignore TrustZone and stay in secure world. Why do you bother switching to non-secure at all?KindlyMarcus