16.5.2 Debugger Access Level (DAL)

The PIC32CM Boot ROM supports two levels of debugger access, known as Debugger Access Levels (DALs). These levels define the degree of access a debugger has to the device during and after boot:

  • DAL2: Full access. The device is completely open, allowing all operations supported by the device. This level is typically used during development and debugging.
  • DAL0: Locked state. The device is highly restricted. Debug access is limited and defined by the user prior to setting DAL to 0.

The active DAL is determined by the value programmed into the ROMCFG DAL fuse. Once set, the DAL governs the debugger's ability to interact with the device, including access to memory, peripherals, and Boot ROM features. Further details on DAL behavior, transitions, and impact on device access are provided below.

Factory Default Value of DAL

The PIC32CM devices are factory programmed with DAL2. Once the device is programmed with DAL0, the DAL level can be raised by issuing CMD_CE_ALL when device Boot ROM is in interactive mode. Alternatively CMD_HOST_DALELEV command could be used to elevate the device DAL if CMD_HOST_DALELEV is not locked.

Figure 16-2. Factory Default Value of DAL

Device DAL Life Cycle

The Device Life Cycle has primarily two states: Development and Deployed. The Development state provides debug and programming access to the device. Once application development completes, the device can be placed into the Deployed state by programming the Debug Access Level to DAL0. If the Boot ROM commands for CE_ALL and CMD_HOST_DALELEV (see Table 12-2) are not locked, and USERCFG1/1A and ROMCFG fuse memory regions are not write protected, the device can move back to the Development state. If these commands are disabled, and the memory regions locked, then the Development state is unrecoverable from the debug interface.

Figure 16-3. DAL Life Cycle
CAUTION: When the device is set to DAL0 and if the CMD_CE_ALL (Chip Erase All) command is locked, the device may become permanently unrecoverable if the user does not retain access to the required KEYVAL_ fuse needed to unlock CMD_CE_ALL.
Note: In the Development state, the ROMCFG page which holds the Debugger Access Level (DAL) can be modified. It is recommended that when the device is programmed for the production phase, that the user selects the write protect (and write lock option) for the ROMCFG page (defined in USERCFG1/1A fuse). Doing so prevents internal firmware from erasing ROMCFG and programming the device to DAL2 (Development).