Skip to content

pipe01/InfiniEmu

Repository files navigation

InfiniEmu

InfiniEmu is an emulator that emulates a full PineTime smartwatch, which includes:

  • NRF52832 along with its ARM Cortex M4 CPU and peripherals,
  • BMA425 I2C accelerometer
  • CST816S I2C touch screen controller
  • HRS3300 I2C heart rate sensor
  • ST7789 SPI LCD display controller
  • A generic SPI flash based on the XT25F32B-S

Disclaimer

This project isn't production ready by any means, and the emulation almost definitely doesn't completely match a real device.

The goal is to be able to run the same image with the emulator as you would flash on a real device, however InfiniTime 1.14.0 doesn't work on InfiniEmu because of an issue that's already fixed but hasn't yet been released on an InfiniTime version. Compiling the latest commit from the InfiniTime repo works fine.

Many things are yet to be implemented, including but not limited to:

  • Adjusting battery voltage input
  • Sending heartrate data
  • Bluetooth

Usage

There are currently no releases, the easiest way to run InfiniEmu is to download the AppImage artifact from the latest successful action run.

To run InfiniEmu, use the following command: ./InfiniEmu-x86_64.AppImage <firmware_path>, where <firmware_path> is the path to the ELF or binary file containing the firmware to run. If an ELF file with symbols is passed, additional information such as FreeRTOS free heap size will be available.

Online previewer

There is a hosted version of the web previewer at tools/web-previewer available at https://pipe01.net/infiniemu/preview. This endpoint can take the following parameters:

  • fw: specifies what firmware to run. This can be either a pull request number in the form pr/123, a Git commit hash or a Git ref like heads/main or tags/1.10.0.
  • info: include information about the run at the bottom of the image.
  • no-cache: do not reuse cached data about the run.
  • script: the script to run. A script consists of one or more commands separated by commas. You can use underscores where spaces would usually go for convenience when pasting the script into a URL. For an up to date list of commands check the script.go file, specifically the commands map.

Caution

When using a preview URL inside a GitHub markdown document (READMEs, issues, pull requests, etc) make sure to visit the URL on your browser before adding it to the markdown text, otherwise GitHub's servers will time out the request before the preview is generated.

Note

Previews can take a bit to generate depending on your script, please allow up to 30 seconds before giving up.

Example:

https://pipe01.net/infiniemu/preview?fw=heads/main&script=run_1s,screenshot

https://pipe01.net/infiniemu/preview?fw=heads/main&info=true&script=run_1s,screenshot,swipe_right,run_300ms,screenshot,tap_180_180,run_300ms,screenshot,tap_120_200,run_300ms,screenshot,tap_36_203,run_300ms,screenshot,button_1s,run_300ms,screenshot

Screenshots