31.2.11 Debug Access Level (DAL)
The FCW supports setting the DAL for code protection. DAL has two levels, “Access to All Memory” (DAL2) and “Limited Access” (DAL0). The controller only allows DAL to be programmed to a more restrictive level, that is a lower value. The factory default is DAL2. The NVMOP SDAL sets the Debug Access Level to the value in CTRLB.SDALCPUx, for x = 0 (M33 Core)). The DAL value must be the same or lower.
For SDAL, the steps are as follows:
- Write CFGKEY to KEY.KEY.
- Write required DAL in CTRLB.SDALCPUx.
- Write WRKEY to KEY.KEY.
- Write CTRLA.NVMOP to <Desired SDAL NVMOP>.
- The FCW generates an interrupt when it clears STATUS.BUSY and sets INTFLAG.DONE.
The SDAL NVMOP performs an erase followed by a program of the new DAL value.