|Interface||Hardware Supported||TinyGo Support|
Machine Package Docs
The PineTime comes with some (proprietary?) default firmware and has the flash locked. This means that to flash this smartwatch, the chip must be unlocked (which erases all flash). There are two options for that, OpenOCD or nrfjprog.
Make sure to connect the SWD and power pins. For example, if you’re using the J-Link EDU Mini, connect the following pins:
|PineTime pin||J-Link pin|
If you get the following error:
Error: Could not find MEM-AP to control the core
it means the chip is locked. See below for how to unlock and erase it.
Unlock chip using nrfjprog
If you have
nrfjprog installed, you can easily unlock the chip using the following command:
nrfjprog -f nrf52 --recover
You can find how to install nrfjprog in the documentation for the pca10040 board.
Unlock chip using OpenOCD
Recent OpenOCD versions support unlocking/erasing the flash. Unfortunately, it isn’t supported by OpenOCD 0.10, which is (as of October 2019) included in most Linux distributions. So you’ll have to compile OpenOCD from source and use that. See this StackOverflow answer for more details.
After unlocking, you can use a regular OpenOCD version (like 0.10) for flashing.
Flash a new program
See above for how to connect the PineTime to your computer. When it is connected, you can flash programs to it. For example, to blink the LCD backlight:
tinygo flash -target=pinetime-devkit0 examples/blinky1