InfiniTimeOrg / pinetime-mcuboot-bootloader

An open source bootloader for the PineTime based on MyNEWT and MCUBoot.
Apache License 2.0
68 stars 18 forks source link

Add P8 smartwatch configuration #10

Open StarGate01 opened 2 years ago

StarGate01 commented 2 years ago

This PR adds support for a new hardware target; the P8(b) smartwatch. It is derived from the work by @tt1pjm and @ildar at https://github.com/ildar/pinetime-mcuboot-bootloader .

By default, the original Pinetime configuration is used and built. For the user, nothing changes except for an additional optional scripts parameter for scripts/nrf52/build-boot.sh (see README), and the location of the compiled binary.

The P8 watch differs from the Pinetime in a few minor points:

Instead of the low frequency crystal, the internal RC oscillator is now used. This enables support of all hardware variants. Because no Bluetooth (which would depend on precise timings) is required, the RC clock is left uncalibrated.

In addition, I updated the dependencies mynewt-core and mcu-tools to their recent versions. mynewt-core contains a patch by me (https://github.com/apache/mynewt-core/pull/2798), which adds support for a SPI flash chip found in some P8b watches. The bootloader is configured to accept a list of various SPI flash chips. This list should be extended in the future as more P8 variants are discovered and tested. any SPI flash chip.

This PR has been tested on a P8b smartwatch (cst716-6c.5 / sc7a20) and a Pinetime dev kit (cst816s-0.1 / bma421).

Let me know what you think. I am working on a port of InfiniTime itself as well in parallel (https://github.com/InfiniTimeOrg/InfiniTime/pull/1050).

StarGate01 commented 2 years ago

Hey @JF002 , from what I saw you are maintaining this repository? This PR should be considered part of https://github.com/InfiniTimeOrg/InfiniTime/pull/1050 .

StarGate01 commented 2 years ago

Ideally, any SPI chip should be accepted, because manufacturers often swap them without changing the hardware ID.

StarGate01 commented 2 years ago

This PR now uses mynewt-core from my fork, until https://github.com/apache/mynewt-core/pull/2858 is merged.

This enables the use of many SPI chips without having to know and hardcode their respective JEDEC IDs beforehand.

StarGate01 commented 2 years ago

This PR now uses the upsteam version again, since my PR https://github.com/apache/mynewt-core/pull/2858 was merged.