:: For this demostration first ensure that the device is completly erased and power-cycled,
:: for instance by doing the following:
:: nrfjprog --recover
:: nrfjprog -e
:: power-cycle the board

:: First demonstrate that debugging is not possible (this read should fail):
nrfjprog.exe --memrd 0

:: To enable debugging/programming a empty device must first be recovered. Recover also writes a small
:: piece of startup code that enables debugging, as that must also be enabled from the CPU:
nrfjprog --recover

:: Now attempt to read from flash again (this time it should succeed):
nrfjprog.exe --memrd 0


:: Expected output from the three commands:
:: >nrfjprog.exe --memrd 0
:: ERROR: The operation attempted is unavailable due to readback protection in
:: ERROR: your device. Please use --recover to unlock the device.
:: NOTE: For additional output, try running again with logging enabled (--log).
:: NOTE: Any generated log error messages will be displayed.
:: 
:: >nrfjprog.exe --recover
:: Recovering device. This operation might take 30s.
:: Writing image to disable ap protect.
:: Erasing user code and UICR flash areas.
:: 
:: >nrfjprog.exe --memrd 0
:: 0x00000000: 20040000                              |... |
