3.2 Working with the OTP Controller Emulation Mode

To write the BCP into the OTP emulated user area, proceed as follows:
  1. Enable OTP Emulation mode:

    sam-ba -p serial -d sam9x60 -a bootconfig -c writecfg:bscr:EMULATION_ENABLED

  2. Clear the emulation area (basically, fill the internal SRAM1 content with zeros):

    sam-ba -p serial -d sam9x60 -a bootconfig -c resetemul

  3. Reset the device or force an OTP controller refresh operation:

    sam-ba -p serial -d sam9x60 -a reset

    or

    sam-ba -p serial -d sam9x60 -a bootconfig -c refreshcfg:emul

  4. Write the desired boot configuration packet into the emulated area:

    sam-ba -p serial -d sam9x60 -a bootconfig -c writecfg:bcp-emul:NFC_IOSET1

  5. Read back the boot configuration packet for confirmation:

    sam-ba -p serial -d sam9x60 -a bootconfig -c readcfg:bcp-emul

  6. Lock the boot configuration packet to prevent any updates:

    sam-ba -p serial -d sam9x60 -a bootconfig -c lockcfg:bcp-emul