How can I set the security bit on the ATSAMD20E15B? The main purpose is to lock the chip memory to prevent any further access to internal data through external programming and debugging interfaces. Once the security bit is set, how can I clear it?
Answer
The security bit on SAMC/D/L/R devices can be programmed and subsequently reprogrammed (i.e., “erased”) without limitations.
Note: Unlike most other device families, the Security Bit is not included in the HEX file for SAMC/D/L/R devices.
To set the security bit in ICP for Windows, follow the sequence below:
Do not use Wizards — they do not include operations involving the Security Bit.
Configure all necessary settings (device, voltage, clock speed, etc.).
Load the HEX file.
In the Control Center, set Security Bit = ON.
You can now execute PC-driven programming and/or create a PJ2 file (Environment → Save Environment As…).The Security Bit setting will be saved as part of the PJ2 file.
To set the security bit in ICP DLL:
IcpLoadSecurityBit()
To set the security bit in ICP Command Line:
Use switch /y1