I have tested this on my own PineTime :)
Many thanks to lupyuen https://github.com/lupyuen/ for their work on the scripts that this is based upon, and their extensive work on the PineTime
- Requirements
- A Raspberry PI
- openocd-spi (https://github.com/lupyuen/openocd-spi)
- Your bootloader file
- The command "sed" (check by using the command to see the help)
- Unprotected flash ( run flash-unprotect.sh instead of flash-boot.sh in step 5 (skip step 6), then redo with flash-boot)
- How to use
- Move the openocd-spi folder to the Desktop folder
- (When the folder is opened, you should see a folder named src)
- Path to exec should look like ~/Desktop/openocd-spi/src/openocd
- Download this repo's files
- Move the files to desktop, not in a folder
- ~/Desktop/filename.ocd etc.
- Get the desired bootloader file
- Connect the Pi to the PineTime SWD pins (look at (https://gist.github.com/lupyuen/6913bcd5ff5a5d67698f8bac0d84599b#file-pi-swd-spi-md))
- In a terminal, "cd Desktop" and then run "bash flash-boot.sh"
- Do not use sudo, it will move ~/ to the su home.
- You will be asked to enter the path to the bootloader, enter it
- Path like ~/Downloads/bootloader.hex ; if that does not work, use /home/pi/{your directory here}
- You can also drag the file in if your terminal supports it (this should work on Raspbian)
- Thats all!