This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Excepted Practice for NS writes after setting M33 SAU.ALLNS

What’s the excepted programming sequence for setting the SAU.ALLNS to when you can start issuing NS transactions?

Assuming MY_BLOCK is Secure, this sequence actually writes the REGISTER:

SAU->CTRL = ALLNS_Mask;

MY_BLOCK_NS->REGISTER = 0xDEADBEEF; 

This sequence doesn’t write the secure peripheral MY_BLOCK as expected:

 SAU->CTRL = ALLNS_Mask;

__DMB();

MY_BLOCK_NS->REGISTER = 0xDEADBEEF;

 Is using the DMB instruction the excepted practice to ensure that the SAU CTRL ALLNS bit is set before moving onto the next instruction?

  • Hiya,

    The architecture requires a dsb and an isb to guarantee visibility of any changes made by writing to the System Control Space (eg updating an SAU register.)

    Try:

     SAU->CTRL = ALLNS_Mask;

    __DSB();

    __ISB();

    MY_BLOCK_NS->REGISTER = 0xDEADBEEF