Arm Cortex Microchip ATSAML1x: Chip Erase

05-Aug-2024

The Chip Erase script removes the security on the chip (if not permanently secured). The script is executed manually. In cases where the device is secured or possibly a malfunctioning application is loaded on it, the Chip Erase command allows to erase memories of the device and provides secure transitions between the different Debug Access Levels.

Devices:

  • SAM L10 - Chip Erase command does not require a key.
  • SAM L11 - Chip Erase commands are protected with keys (CEKEYx) defined in the NVM BOCOR row.


Possible solution

1. Perform Debug | Prepare to Attach.

2. Select Hardware | Scripts | Chip Erase.


Depending on security configuration the keys can be automatically read from flash. If security prevents reading the keys from flash, you must enter the correct key as a parameter of the ATSAML1x_ChipErase.cpp script. The script is located in the winIDEA SFR folder. SFR location is displayed via Tools | Options | SFRs.


If the key is set at “All 0s”, the corresponding Chip Erase command is disabled and it will be impossible for the debugger to use it. If both the ChipErase_ALL (CE2) key is set at "All 0s" and BOCOR.BCWEN=0, full Chip Erase is permanently disabled.


To execute the Chip Erase script with custom keys you need to run ATSAML1x_ChipErase.cpp with key values as parameters. Refer to Running EVE Scripts in winIDEA Help for instructions on how to run an EVE Script from a command line.


RAM Execute Protection removal script

RAM Execute Protection is automatically erased during debug session initialization. RAM Execute Enable (to be able to run the application from RAM) is achieved by modifying the RXN bit in User Row bytes.

ATSAML11 can have the execution from RAM and Data Flash prevented by an authorization logic on the device. When establishing a debug session the connection script checks for execution authorization and alerts you. When execution from RAM is prevented, the script automatically attempts to enable execution.

This allows you to run and execute the application from RAM. The script enables the RAM execution authorization automatically.

Was this answer helpful?