{"id":27245970,"url":"https://github.com/stargate01/p8b-infinitime","last_synced_at":"2025-06-30T22:34:00.448Z","repository":{"id":37750728,"uuid":"469947334","full_name":"StarGate01/p8b-infinitime","owner":"StarGate01","description":"Run InfiniTime \u0026 Bootloader on the P8 smartwatch","archived":false,"fork":false,"pushed_at":"2023-12-11T01:18:26.000Z","size":99136,"stargazers_count":22,"open_issues_count":4,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T21:36:38.297Z","etag":null,"topics":["infinitime","nrf52","nrf52832","p8-smartwatch","pinetime","smartwatch"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StarGate01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"StarGate01"}},"created_at":"2022-03-15T00:16:12.000Z","updated_at":"2024-11-01T10:04:09.000Z","dependencies_parsed_at":"2023-12-11T02:38:08.517Z","dependency_job_id":null,"html_url":"https://github.com/StarGate01/p8b-infinitime","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/StarGate01/p8b-infinitime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fp8b-infinitime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fp8b-infinitime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fp8b-infinitime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fp8b-infinitime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StarGate01","download_url":"https://codeload.github.com/StarGate01/p8b-infinitime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarGate01%2Fp8b-infinitime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262861878,"owners_count":23376313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infinitime","nrf52","nrf52832","p8-smartwatch","pinetime","smartwatch"],"created_at":"2025-04-10T21:30:02.851Z","updated_at":"2025-06-30T22:34:00.356Z","avatar_url":"https://github.com/StarGate01.png","language":"Shell","funding_links":["https://github.com/sponsors/StarGate01"],"categories":[],"sub_categories":[],"readme":"# InfiniTime on P8\n\nThis repository contains some slightly adjusted versions of the Infinitime application, bootloader and reloader (based on wasp-os), to run on the P8a and P8b (and of course, the PineTime as well) smartwatch.\n\n### P8a vs P8b\n\nThe P8b has a magnetic charging bay, with the two gold contacts in the center top. The P8a uses a charging clip, with the contacts in the center as well. The PineTime uses a magnetic charging bay, with the contacts shifted to one corner.\n\nThe (at least the one I have) P8b uses a different SPI flash chip. The bootloader is configured to accept a range of chips. \n\nIn addition, the touch driver is a bit different. The P8 touch driver cannot wake up from sleep mode, so instead the accelerometer is used to detect taps and double taps to wake up. The touch driver configuration set in the factory may also vary. A compile time variable is provided. See the file `HardwareVariants.md` for more info.\n\n### High-Resolution BLE Accelerometer\n\nThis firmware fork is able to broadcast the 12-bit accelerometer sensor data using a sampling rate of 200 Hz instead of 10 Hz. A companion Android app to read these values in real-time can be found here: https://github.com/StarGate01/PineTimeAcc .\n\n### LFCLK and missing LF crystals\n\nThe P8b watch comes without an external low frequency crystal. This is a problem, because precise timing is required for Bluetooth connections. However, the NRF52 can be configured to use its internal RC clock to generate the low frequency clock.\n\nThe wasp-os bootloader as well as the mcuboot bootloader are configured to use this LFRC source. Wasp-os uses the Nordic softdevice, which takes care of properly configuring and calibrating the LF RC source. Mcuboot does not perform any calibration, however it does not require Bluetooth at all.\n\nUsage of the LFRC source in InfiniTime and its Nimble stack is now implemented with proper calibration in my p8b fork.\n\n## Download Binaries\n\nIf you don't want to compile the firmware yourself, you can download binaries on the [release page](https://github.com/StarGate01/p8b-infinitime/releases).\n\n## Development Setup\n\nRequirements for compilation:\n\n- Linux\n- GCC, Build-essentials, Git, Bash, Wget, Unzip\n- ARM Cortex toolchain\n- NRF52 tools\n- Apache Mynewt Newt\n- CMake\n- Python3 + Pip3\n\nIf you use Nix, a `flake.nix` is provided.\n\nRun `scripts/init.sh` to set up the repositories, do not clone this repo with all recursive submodules. This loads all the required submodules, and downloads the newt and python packages.\n\n### Compiling\n\nUse the scripts in `scripts/`, run e.g. `build_all.sh moy-ton5` to build all the firmware for the P8b watch. The Wasp reloader factory package will package the builds of mcuboot and the Infinitime minimal recovery loader.\n\nAll scripts accept either `pinetime`, the `moy-` designators, or `p8` as the first argument (Default: `pinetime`). This argument configures the target hardware platform.\n\nYou can change the compile time parameters in `build_infinitime.sh` if your smartwatch has a different hardware configuration.\n\nSee the file `HardwareVariants.md` for detailed configuration options for different watches.\n\n## OTA Stock Upgrade Path:\n\nNote: NRF connect sometimes seems to overload the connection, if it fails use another tool listed (or look at https://wiki.pine64.org/wiki/PineTime#Companion_Apps)\n\nIn general, sometimes the Bluetooth connection crashes, maybe due to interference. Just try again.\n\n**Do this at your own risk**\n\nStep 0\n- State: Stock P8b (Stock)\n- Take a note of your stock firmware identification string. E.g. something like MOY-TFK5-1.7.7. This will not be available after overwriting the bootloader, however knowing it will be useful later when picking the right InfiniTime build, and/or will be useful if your watch is a new variant that we have not seen yet. See also the file `HardwareVariants.md` to figure out which build is right for you.\n\nStep 1\n\n- State: Stock P8b (Stock)\n- Process: DFU update using DaFlasher\n- Payload: `DaFlasherFiles/DaFitBootloader23Hacked.bin`\n\nStep 2\n\n- State: Hacked Bootloader (Three colorful squares)\n- Process: DFU update using DaFlasher or NrfConnect\n- Payload: `DaFlasherFiles/FitBootloaderDFU2.0.1.zip`\n\nStep 3\n\n- State: Fit Bootloader (One square)\n- Process: DFU update using DaFlasher or NrfConnect\n- Payload: `wasp-os/build-p8/bootloader-daflasher.zip` (P8b variant)\n\nStep 4\n\n- State: Wasp-OS Bootloader (Wasp image)\n- Process: DFU update using dfu.py (`scripts/load_wasp_reloader.sh p8`) or NrfConnect (or DaFlasher?)\n- Payload: `wasp-os/build-p8/reloader-factory.zip` (P8b variant w/ mcuboot \u0026 Infinitime recovery loader)\n\nStep 5\n\n- State: Wasp-OS Reloader (Small pinecone)\n- Process: Wait for internal flash overwrite (pinecone turns red), then reboot by pressing button long, or it reboots automatically\n\nStep 6\n\n- State: MCUBoot Bootloader (Big pinecone V1.0.0)\n- Process: Wait for bootloader to boot recovery installer\n\nStep 7\n\n- State: Infinitime recovery installer (Triangle with progress bar)\n- Process: Wait for external flash to be written (progress bar). Reboots automatically\n\nStep 8\n\n- State: MCUBoot Bootloader\n- Process: Press button until big pinecone is red. Bootloader then installs recovery image. Wait for reboot.\n\nStep 9\n\n- State: Infinitime recovery (Triangle without progress bar)\n- Process: DFU update using dfu.py (`scripts/load_infinitime.sh`) or NRFConnect or GadgetBridge (or DaFlasher?)\n- Payload: `InfiniTime/build/src/pinetime-mcuboot-app-dfu-1.8.0.zip`\n\nStep 10\n\n- State: MCUBoot Bootloader\n- Process: Press button until pinecone turns blue, this loads the main app.\n\nStep 11\n\n- State: Infinitime Application (Watchface)\n- Process: Verify firmware works, and then confirm firmware valid in settings. (Important, otherwise bootloader reverts to recovery)\n\n## SWD Flash Path:\n\n**Do this at your own risk**\n\nFor OTA\n\n- State: Broken or empty\n- Process: Open watch, flash using SWD, eg. J-Link, then continue from wasp-bootloader\n- Payload: `wasp-os/build-p8/bootloader.hex` (P8b variant)\n\nFor Development\n\n- State: Development on InfiniTime\n- Process: Open watch, flash using SWD, eg. J-Link\n- Payload: `InfiniTime/build/src/pinetime-app-1.8.0.hex` (P8b variant without bootloader)\n\n## TODO\n\n- ~Verify OTA process on sealed watch~ done\n- ~Verify drivers on genuine Pinetime~ done\n- ~Use LFRC clock instead of SYNT on variants without external LF crystal~ done\n- ~Verify acceleration sensor~ done\n- ~Update mcuboot to latest~ done\n- ~Fix wake from sleep~ done\n- ~Update Infinitime to latest (requires touch driver improvements)~ done\n- ~Test and adjust to P8a watch~ done\n- ~Implement tap to wake on P8a~ workaround\n- Upstream changes to InfiniTime (WIP: https://github.com/InfiniTimeOrg/InfiniTime/pull/1050)\n\n## Third-party modules \u0026 Thanks to\n\n- `pinetime-mcuboot-bootloader/p8b` at [StarGate01/pinetime-mcuboot-bootloader](https://github.com/StarGate01/pinetime-mcuboot-bootloader.git), fork of [InfiniTimeOrg/pinetime-mcuboot-bootloader](https://github.com/InfiniTimeOrg/pinetime-mcuboot-bootloader)\n\n- `InfiniTime/p8b` at [StarGate01/InfiniTime](https://github.com/StarGate01/InfiniTime), fork of [ildar/InfiniTime](https://github.com/ildar/InfiniTime)/p8, fork of [InfiniTimeOrg/InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)\n\n- `wasp-os` at [daniel-thompson/wasp-os](https://github.com/daniel-thompson/wasp-os)\n\n- `DaFlasherFiles` at [atc1441/DaFlasherFiles.git](https://github.com/atc1441/DaFlasherFiles.git)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstargate01%2Fp8b-infinitime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstargate01%2Fp8b-infinitime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstargate01%2Fp8b-infinitime/lists"}