Develop a new firmware for PineTime
#1
Hi everyone,

(I hope I'm posting in the right place. If not, please let me know.)

I have been using PineTime since 2021 and I really like it. I'm absolutely a FOSS-guy who welcomes any open/community-based projects, such as PineTime which is a fully open (hardware and software) and long overdue product in the smartwatch market.

I'm studying Computer Engineering at university. Many of us design a high-level application (Java, Python etc.) or a webpage or something AI related stuff. However, I'm rather a hardware (IoT/embedded systems) -oriented person, and that's why many people think i'm crazy when I say: "I loved my Assembly programming course" Smile

To be honest, when I bought my first PineTime, I ordered a twin pack (sealed and devkit), because I knew that I would like to modify/hack/develop my watch in the future. And now it seems like a good idea to deal with PineTime because it perfectly fits my studies and who knows... maybe that could be even a great theme for my thesis. Moreover, it would be a great adventure (doing it for fun).

I'm planning to create a new (very basic) firmware from scratch. I mean that would be an independent and separate project from InfiniTime / Wasp-OS or other relevant PineTime related firmwares, although it would rely on some third party libraries (such as LVGL or FreeRTOS) and it would use existing projects (mostly InfiniTime) as a reference.


Initial (essential) objectives:
  • display time without any smart capabilities (e.g. Bluetooth synchronization)

Future (optional) objectives:
  • Bluetooth implementation
  • Heart rate measuring
  • Step counting
  • Built-in apps
  • ...

At first, it sounds easy, doesn't it? However even the clock implementation can be challenging: multitasking, UI, using touch controller/screen/button for watch controlling, battery management, energy management, memory management, and so on.

My major problem is that there is no detailed developer documentation for PineTime. There is a lot of information about hardware, but I couldn't find any official "Getting started" or "How to start coding on your PineTime" articles.

So please let me ask some questions to be able to see more clearly.

First of all: Is it hard to program PineTime?
More specifically, is it hard to program PineTime for a student who has only some basic knowledge about embedded devices / hardware? I mean, I know how does a CPU works (in a nutshell), what registers are, communication protocols (I2C, SPI, UART etc.) and I have some knowledge about ARM architecture too, but I have never done anything like this (smartwatch programming) before.

How to start?
How to configure a developer setup? Which IDE are you using? Which softwares (e.g. compiler) are you using? It would be awesome to create a "Hello world!" application or some very-very basic app to gain experience and to learn the basics. Are there any tutorials? It seems that Lup Yuen's articles are useful, and as I mentioned, PineTime is a good reference (however, too complex for me, which makes it difficult to understand the basics).

How to code?
I mean, which programming language would be the best choice? C? C++? Rust? Anything else? I have to admit that my knowledge in C++ and Rust is very limited, I always use C for low-level programming, which is not necessarily the best choice (I suppose C is not the safest language). Is it worth the time and effort to learn another language? Is it easier to code PineTime in another language than C?

Which libraries should I use?
Why and when should we use external libraries, such as FreeRTOS or LVGL (like InfiniTime uses those libraries too). Are they required? If my project is "not too complex" do they make coding harder or easier?


Thank you in advance for anybody who reads my post and I would appreciate if you give me some helpful answers.
  Reply
#2
I'm a novice too. Here is what I have found:
1) I am getting started and find it hard, but I think that has more to do with me.
2) I've decided on VS Code with the nRF Connect for Visual Studio add-in and I'm starting with the PineTime_DevKit0 board
3) Most examples are c/c++ that I've seen
4) Zephyr as it's nRF52, lvgl seem ubiquitous, ble

I've been using ST-Link v2 and OpenOCD to flash the PineTime Dev Kit. Segger J-Link seems optimal and integrates with VS Code, but it's expensive and you need an adapter for 5v to 3.3v. There is a jlink onboard the nRF52 DK, but it has license restrictions and I never got it running right (powering the board was my problem).

If you want to extend existing work, InfiniTime is probably your best bet and that is FreeRTOS
  Reply
#3
FOSS just like to re-invent the wheel.

the wasp-os is already almost abandoned<-- the pinetime could only be wake using the button to show time, which is NOT good for a smart watch. infinitime's tap or raise is much better.

infinitime functions well as a watch, but junior users CANNOT do programming on it. this is the first device i met that need bake the app into the firmware.

yours? btw, there already 3rd and 4th one. what rust, pinetime lite.

i love FOSS but I dont love half-products, i just feel sorry for them.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bluetooth BLE-MIDI-controller app for PineTime / InfiniTime Luno 0 555 08-20-2023, 05:17 AM
Last Post: Luno
  Zephyr Backlight Examples for PineTime lcj 0 738 05-06-2023, 02:54 PM
Last Post: lcj
  Zephyr is ready for pinetime jandy 1 2,149 05-06-2023, 02:15 PM
Last Post: lcj
  Send a message from Android to pinetime via BLE razrosman 0 947 11-05-2022, 08:24 AM
Last Post: razrosman
  PineTime Stuck in DFU Mode Eesha Barua 1 2,115 07-25-2022, 09:17 PM
Last Post: heyhewmike
  Idle tracking with PineTime: how versatile it is? schaman 1 1,687 07-13-2022, 12:50 AM
Last Post: wibble
  PineTime implemented with partial of pebble API jandy 0 1,589 03-20-2022, 08:58 PM
Last Post: jandy
  "Pine64 USB JTAG Adapter + OpenOCD + PineTime" should it work? ITCactus 4 4,015 03-02-2022, 05:58 AM
Last Post: wibble
  Zephyr based Pinetime jandy 4 4,771 11-11-2021, 05:53 AM
Last Post: jandy
  Problems with pinetime watch face simulator Elements 0 1,943 08-18-2021, 03:05 PM
Last Post: Elements

Forum Jump:


Users browsing this thread: 1 Guest(s)