Skip to content

Commit

Permalink
Update scripts to support P8a
Browse files Browse the repository at this point in the history
  • Loading branch information
StarGate01 committed Apr 4, 2022
1 parent 9cb0cdb commit ed25ae2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# InfiniTime on P8b
# InfiniTime on P8

This repository contains some slightly adjusted versions of the Infinitime application, bootloader and reloader (based on wasp-os), to run on the P8b smartwatch.
This repository contains some slightly adjusted versions of the Infinitime application, bootloader and reloader (based on wasp-os), to run on the P8a and P8b smartwatch.

### P8a vs P8b

The (at least the one I have) P8b uses a different SPI flash chip. The bootloader is configured to accept either chip.

In addition, the touch driver is a bit different. The P8b 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.
In 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.

## Download Binaries

Expand All @@ -30,7 +30,7 @@ Run `scripts/init.sh` to set up the repositories, do not clone this repo with al

Use the scripts in `scripts/`, run `build_all.sh p8` to build all the firmware for the P8 watch. The Wasp reloader factory package will package the builds of mcuboot and the Infinitime minimal recovery loader.

All scripts accept either `pinetime` or `p8` (this means P8b) as the first argument (Default: `pinetime`). This argument configures the target hardware platform.
All scripts accept either `pinetime`, `p8`, `p8a` or `p8b` as the first argument (Default: `pinetime`). This argument configures the target hardware platform.

You can change the compile time parameters in `build_infinitime.sh` if your smartwatch has a different hardware configuration.

Expand Down
3 changes: 2 additions & 1 deletion scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
factory_image.hex
factory_image.hex
binaries/
20 changes: 18 additions & 2 deletions scripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ TARGET=${1:-pinetime}
echo "Using target $TARGET"
cd "${0%/*}"

./build_mcuboot.sh $TARGET
source ./infinitime_version.sh

TARGETINT=$TARGET
if [ "$TARGETINT" = "p8a" ] || [ "$TARGETINT" = "p8b" ]; then
TARGETINT="p8"
fi;

./build_mcuboot.sh $TARGETINT
./build_infinitime.sh $TARGET
./build_wasp.sh $TARGET
./build_wasp.sh $TARGETINT

echo "Copying $TARGET binaries"

rm -rf ./binaries/$TARGET
mkdir -p ./binaries/$TARGET
cp ../InfiniTime/build/src/pinetime-mcuboot-app-dfu-$INFINITIME_VERSION.zip ./binaries/$TARGET/
cp ../wasp-os/build-$TARGETINT/reloader-factory.zip ./binaries/$TARGET/
cp ../wasp-os/build-$TARGETINT/bootloader-daflasher.zip ./binaries/$TARGET/
cp ../wasp-os/build-$TARGETINT/bootloader.hex ./binaries/$TARGET/
2 changes: 1 addition & 1 deletion scripts/build_infinitime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd build
COMMON_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DARM_NONE_EABI_TOOLCHAIN_PATH=/usr -DNRF5_SDK_PATH=/opt/nrf5-sdk -DUSE_JLINK=1 -DNRFJPROG=/usr/bin/nrfjprog -DBUILD_DFU=1"
if [ "$TARGET" = "pinetime" ]; then
cmake -DTARGET_DEVICE=PINETIME -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
elif [ "$TARGET" = "p8" ]; then
elif [ "$TARGET" = "p8" ] || [ "$TARGET" = "p8b" ]; then
cmake -DTARGET_DEVICE=P8 -DLF_CLK=RC -DDRIVER_ACC=SC7A20 $COMMON_OPTIONS ..
elif [ "$TARGET" = "p8a" ]; then
cmake -DTARGET_DEVICE=P8 -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
Expand Down
10 changes: 5 additions & 5 deletions scripts/build_infinitime_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ cd ../InfiniTime
mkdir -p build
cd build

COMMON_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DARM_NONE_EABI_TOOLCHAIN_PATH=/usr -DNRF5_SDK_PATH=/opt/nrf5-sdk -DUSE_JLINK=1 -DNRFJPROG=/usr/bin/nrfjprog -DBUILD_DFU=1"
COMMON_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DARM_NONE_EABI_TOOLCHAIN_PATH=/usr -DNRF5_SDK_PATH=/opt/nrf5-sdk -DUSE_JLINK=1 -DNRFJPROG=/usr/bin/nrfjprog -DBUILD_DFU=1"
if [ "$TARGET" = "pinetime" ]; then
cmake -DDRIVER_TOUCH=DYNAMIC -DTARGET_DEVICE=PINETIME -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
elif [ "$TARGET" = "p8" ]; then
cmake -DDRIVER_TOUCH=REPORT -DTARGET_DEVICE=P8 -DLF_CLK=RC -DDRIVER_ACC=SC7A20 $COMMON_OPTIONS ..
cmake -DDRIVER_TOUCH=DYNAMIC -DDRIVER_ACC_EVENTS=OFF -DTARGET_DEVICE=PINETIME -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
elif [ "$TARGET" = "p8" ] || [ "$TARGET" = "p8b" ]; then
cmake -DDRIVER_TOUCH=REPORT -DDRIVER_ACC_EVENTS=ON -DTARGET_DEVICE=P8 -DLF_CLK=RC -DDRIVER_ACC=SC7A20 $COMMON_OPTIONS ..
elif [ "$TARGET" = "p8a" ]; then
cmake -DDRIVER_TOUCH=GESTURE -DTARGET_DEVICE=P8 -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
cmake -DDRIVER_TOUCH=GESTURE -DDRIVER_ACC_EVENTS=ON -DTARGET_DEVICE=P8 -DLF_CLK=XTAL -DDRIVER_ACC=BMA421 $COMMON_OPTIONS ..
fi

make -j$(nproc) pinetime-app

0 comments on commit ed25ae2

Please sign in to comment.