30.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:

  1. Write CFGKEY to KEY.KEY.
  2. Write required DAL in CTRLB.SDALCPUx.
  3. Write WRKEY to KEY.KEY.
  4. Write CTRLA.NVMOP to <Desired SDAL NVMOP>.
  5. 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.