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.

66ak2e05 hangs when accessing A15 coprocessors

Other Parts Discussed in Thread: 66AK2E05

I'm trying to read the SCR from the A15.

    unsigned nsacr, scr;
    __asm__ __volatile__("mrc    p15, 0, %0, c1, c1, 0" : "=r"(scr));
    printf("Secure config register = %x\n", scr);

The same is true for the NSACR:

    __asm__ __volatile__("mrc    p15, 0, %0, c1, c1, 2" : "=r"(nsacr));
    printf("NSACR = 0x%x\n", nsacr);

When I run the above inlined assembly code, the processor hangs.

ARM's ducumentaiton suggests that both should be readable in Secure Mode, and the second should be readable in non-secure mode - how can I tell whether I am in secure mode or not?

If I am not in secure mode, how can I switch to it?

Thanks.