PineTime FAQ

From PINE64
Revision as of 00:40, 26 January 2020 by Darnel (talk | contribs) (Included (and little edited) some questions and answers from Lup Yuen Lee)
Jump to navigation Jump to search

Does the PineTime run Linux?

No. Please read this forum article for information about Linux on PineTime: https://forum.pine64.org/showthread.php?tid=8112


How long does it take to ship my PineTime?

That depends on whether you chose for Standard or Express shipping. Standard shipping for the dev kit may take up to a few weeks.


My PineTime arrived, now what?

You should start by testing out all the features of the watch, to make sure everything works. You can do this using the software that was preinstalled on your device. Don't solder wires to the pins unless you really know how to do so safely! The wire that comes with the devkit already works for removing the protection and flashing code, only takes plugging it into the holes and holding it still gently. After the flash lock has been removed you can experiment with your own software or someone else's.


How do I remove flash protection?

The flash protection can be removed using multiple different methods. If you don't have anything except the PineTime, not even a RPi, then you have to order a programmer online. The main article about PineTime contains links to different tutorials. You can also remove flash protection using a J-Link, CMSIS-DAP dongle and various other programmers.


Why can't you use ST-Link to remove nRF52 Flash Protection?

Because ST-Link is a High Level Adapter. It doesn't really implement all SWD functions, just a subset. For performance I think. More details in the section "Why Visual Studio Code with ST-Link (instead of nRFgo Studio with J-LINK)" in the article "Coding nRF52 with Rust and Apache Mynewt on Visual Studio Code" here: https://medium.com/@ly.lee/coding-nrf52-with-rust-and-apache-mynewt-on-visual-studio-code-9521bcba6004?source=friends_link&sk=bb4e2523b922d0870259ab3fa696c7da


Since we need a low level SWD adapter like Raspberry Pi anyway, can we do everything on a Pi instead of ST-Link + Windows?

Current progress with Pi and PineTime is here https://medium.com/@ly.lee/debug-rust-mynewt-firmware-for-pinetime-on-raspberry-pi-4b9ac2d093a9?source=friends_link&sk=edb508c31e43d3ec40ecd8554f3405f6


What's the OS that's preinstalled on the PineTime by default?

The watch, and its preinstalled OS, is built by a friend of TL. The software is proprietary and not made by Pine64 or its community. It can interact with the "Da Fit" app on Android. The dev kit contains this OS (and as a result, the flash protection) so that developers can test if all the hardware on their device is working correctly before they flash the device and start working on their own software.


Can we use this OS or its source code?

While it's not what the dev kit is for, you are of course free to use the watch with its preinstalled software as is. The preinstalled OS is proprietary, and its owner will not release the source code, so we cannot use this OS as a starting point.


Why is the back exposed? Is it supposed to snap on?

The back cover of the PineTime dev kit is exposed so that you can flash and debug the device with the SWD pins. The main unit and cover does not snap (lock) together. If you want to attach the back cover anyway, you can use glue or tape.


What hardware should I use to flash code to the PineTime?

There are several ways you can do this:

a) Use a J-Link. These can remove flash protection as well, so you won't need a Raspberry Pi to start working on the PineTime. A cheap option for this is the J-Link EDU: https://www.segger.com/products/debug-probes/j-link/models/j-link-edu/.

b) Use an even cheaper CMSIS-DAP dongle (sometimes called DAPLINK) from AliExpress, that too allows removing the flash protection and flashing new software using OpenOCD. Search for "CMSIS-DAP" or "DAPLINK" on AliExpress.

c) Use a Raspberry Pi with OpenOCD

d) Use a ST-Link V2 clone. Search for "ST-Link V2" on AliExpress or Amazon to buy one of these.

e) Finally, you can use an STM32F103 "Blue Pill" with BMP (Black Magic Probe). Here's a nice guide for that: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/flashing-and-debugging-nrf5152-with-a-cheap-blackm


I have experience developing on Arduino. How does the PineTime compare?

Arduino provides the Arduino IDE (or you use the avr-gcc and avrdude command-line tools) which you can use to compile and upload code to an Arduino board. The PineTime and its ARM processor doesn't have this, so you'll have to familiarize yourself with tools like GCC for AVR, and OpenOCD. Some experience with Arduino does translate over to the PineTime, especially if you've worked with LCD's, or SPI. The PineTime is at least four times faster than an Arduino Uno (even faster at certain specific workloads due to hardware acceleration), and it has 32 times more RAM and 16 times more flash storage.


My PineTime has the stock proprietary software on it, how do I set the time?

You can use either nRF Connect, custom GadgetBridge build or the proprietary Da Fit app.


My PineTime's screen shows garbage, how do I fix it?

This is usually caused by unplugging the device after it has booted, it needs to be reinitialised. To do so just restart the watch by removing power to it.


Is there a 3D model of PineTime available somewhere?

Not yet.


Is there a standard agreed method of pushing OTA updates so that one could seal the PineTime dev kit nicely?

Not yet.


What is Arm Semihosting?

So we know that we use the SWD (Single Wire Debug) protocol created by Arm for flashing and debugging Arm embedded CPUs. SWD being derived from standard JTAG, but with fewer wires With Arm CPUs you can trigger an software interrupt, and allow the debugger (OpenOCD) to do something really nifty Display a message, read console input, dump out a file, even read a file! Thats called Arm Semihosting http://www.keil.com/support/man/docs/armcc/armcc_pge1358787046598.htm


What is OpenOCD? OpenOCD is Open On-Chip Debugger. It's the software that drives your microcontroller debugger/flasher. We need it for running any kind of flashing and debugging with Pi or ST-Link. gdb talks to OpenOCD for debugging firmware. And VSCode talks to gdb for debugging firmware visually. http://openocd.org/doc-release/html/About.html#What-is-OpenOCD_003f There have been no official updates for years, the closest one is by ntfreak: https://github.com/ntfreak/openocd (My SPI fork is based on this)


Can I use Pinebook Pro for developing PineTime?

Arm Embedded Toolchain for Pinebook Pro is here, if anyone needs it. It's linked with dynamic libraries, so I fear it might not work on your Pinebook Pro. Hoping to save you 7 hours of painful toolchain building... https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v1.0.5