Remove PineTime Flash Protection

Note: This section is obsolete. Please refer to the updated instructions here: “Remove PineTime Flash Protection”

…Then proceed to the next section

PineTime is shipped with preloaded demo firmware. We need to erase the demo firmware and unprotect PineTime’s flash memory so that we may flash our own firmware.

🛈 What is “flash protection”? Read this

1️⃣ Power on the Raspberry Pi. Open a command prompt and enter the following…

sudo raspi-config

Select Interfacing Options → SPI → Yes

Select Finish

At the command prompt, enter the following…

2️⃣ At the Welcome to Rust! prompt, press Enter to select the default option:

1) Proceed with installation (default)

If you see this error…



fatal: unable to access '

fatal: clone of ' Cloning into 'openocd-spi/jimtcl'...fatal: unable to access ' http://repo.or.cz/r/jimtcl.git/' : Recv failure: Connection reset by peerfatal: clone of ' http://repo.or.cz/r/jimtcl.git' into submodule path '/private/tmp/aa/openocd-spi/jimtcl' failed

It means that the sub-repository for one of the dependencies jimtcl is temporarily down. You may download the pre-built openocd-spi binaries from this link. Then copy the executable openocd-spi/src/openocd to pinetime-rust-mynewt/openocd/bin/openocd

3️⃣ When the installation has completed, enter the following at the command prompt…

4️⃣ We should see Shut Down And Power Off Your Raspberry Pi …

If we see Clock Speed and nothing else after that…

Info : BCM2835 SPI SWD driver

Info : SWD only mode enabled

Info : clock speed 31200 kHz

Info : SWD DPIDR 0x2ba01477

Then the connection to the SWD Port is probably loose, please check the pins.

If we don’t see this DPIDR number, or if we see a different DPIDR number...

SWD DPIDR 0x2ba01477

Then the connection to the SWD Port is most likely loose, please check the pins.

Also enter sudo raspi-config and confirm that the SPI port has been enabled.

If we see this instead…

openocd/bin/openocd: cannot execute binary file: Exec format error

Then install-pi.sh probably didn’t run correctly. To fix this, copy the openocd executable like this…

cp $HOME/openocd-spi/src/openocd $HOME/pinetime-rust-mynewt/openocd/bin/openocd

5️⃣ Shut down and power off your Raspberry Pi. Wait 30 seconds for the red and green LEDs on your Pi to turn off. Power on your Pi. Enter the same commands at a command prompt…

6️⃣ We should see Flash Is Already Unprotected …

PineTime’s demo firmware has been erased and the flash protection has been removed.

🛈 What is OpenOCD? Why Raspberry Pi and not ROCK64 or Nvidia Jetson Nano? Read this