If a memory region can be written by an interrupt handler or even directly by hardware, you declare it volatile so the compiler takes appropriate precautions. If you then do your own writing to it, such as by memset, you take the chance that the interrupt might happen while you are doing that, and r...