From 12d5a730dd5a96e5f9e1236f1d1f86f78be0ad02 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Fri, 25 Mar 2022 07:52:23 +0100 Subject: [PATCH] Add P8 smartwatch configuration * Split into pinetime (default) and p8 target * Change LFCLK to LFRC to support devices without LF crystal * Support various SPI flash chips by ignoring JEDEC IDs * Use recent mynewt-core and mcu-tools --- .vscode/launch-nrf52-pi.json | 4 +- .vscode/launch-nrf52.json | 4 +- .vscode/launch.json | 4 +- README.md | 6 ++- hw/bsp/nrf52/syscfg.yml | 8 ++-- libs/pinetime_boot/pkg.yml | 2 +- libs/pinetime_boot/src/blink.c | 4 +- libs/pinetime_boot/src/display.c | 1 - libs/pinetime_boot/src/pinetime_boot.c | 11 ++--- libs/pinetime_boot/syscfg.yml | 9 ++++ project.yml | 8 ++-- scripts/nrf52/build-boot.cmd | 4 +- scripts/nrf52/build-boot.sh | 21 +++++---- targets/p8/pkg.yml | 35 ++++++++++++++ targets/{nrf52_boot => p8}/syscfg.yml | 6 ++- targets/{nrf52_boot => p8}/target.yml | 0 targets/{nrf52_boot => pinetime}/pkg.yml | 4 +- targets/pinetime/syscfg.yml | 60 ++++++++++++++++++++++++ targets/pinetime/target.yml | 12 +++++ 19 files changed, 163 insertions(+), 40 deletions(-) create mode 100644 targets/p8/pkg.yml rename targets/{nrf52_boot => p8}/syscfg.yml (96%) rename targets/{nrf52_boot => p8}/target.yml (100%) rename targets/{nrf52_boot => pinetime}/pkg.yml (95%) create mode 100644 targets/pinetime/syscfg.yml create mode 100644 targets/pinetime/target.yml diff --git a/.vscode/launch-nrf52-pi.json b/.vscode/launch-nrf52-pi.json index f6ec45e..866bce7 100644 --- a/.vscode/launch-nrf52-pi.json +++ b/.vscode/launch-nrf52-pi.json @@ -13,8 +13,8 @@ // Application Executable to be flashed before debugging. Note that the Application ELF image does not contain a valid Image Header, so we must install the Stub Bootloader. "executable": "bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf", // Uncomment one of these lines to debug MCUBoot or Stub Bootloader: - // "executable": "bin/targets/nrf52_boot/app/boot/mynewt/mynewt.elf", - // "executable": "bin/targets/nrf52_boot/app/apps/boot_stub/boot_stub.elf", + // "executable": "bin/targets/pinetime/app/boot/mynewt/mynewt.elf", + // "executable": "bin/targets/pinetime/app/apps/boot_stub/boot_stub.elf", "device": "nRF52832", // Arm System View Description, from apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/mdk "svdFile": "scripts/nrf52/nrf52.svd", diff --git a/.vscode/launch-nrf52.json b/.vscode/launch-nrf52.json index 1abdae4..b16928c 100644 --- a/.vscode/launch-nrf52.json +++ b/.vscode/launch-nrf52.json @@ -13,8 +13,8 @@ // Application Executable to be flashed before debugging. Note that the Application ELF image does not contain a valid Image Header, so we must install the Stub Bootloader. "executable": "bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf", // Uncomment one of these lines to debug MCUBoot or Stub Bootloader: - // "executable": "bin/targets/nrf52_boot/app/boot/mynewt/mynewt.elf", - // "executable": "bin/targets/nrf52_boot/app/apps/boot_stub/boot_stub.elf", + // "executable": "bin/targets/pinetime/app/boot/mynewt/mynewt.elf", + // "executable": "bin/targets/pinetime/app/apps/boot_stub/boot_stub.elf", "device": "nRF52832", // Arm System View Description, from apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/mdk "svdFile": "scripts/nrf52/nrf52.svd", diff --git a/.vscode/launch.json b/.vscode/launch.json index 1abdae4..b16928c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,8 +13,8 @@ // Application Executable to be flashed before debugging. Note that the Application ELF image does not contain a valid Image Header, so we must install the Stub Bootloader. "executable": "bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf", // Uncomment one of these lines to debug MCUBoot or Stub Bootloader: - // "executable": "bin/targets/nrf52_boot/app/boot/mynewt/mynewt.elf", - // "executable": "bin/targets/nrf52_boot/app/apps/boot_stub/boot_stub.elf", + // "executable": "bin/targets/pinetime/app/boot/mynewt/mynewt.elf", + // "executable": "bin/targets/pinetime/app/apps/boot_stub/boot_stub.elf", "device": "nRF52832", // Arm System View Description, from apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/mdk "svdFile": "scripts/nrf52/nrf52.svd", diff --git a/README.md b/README.md index b82b0c0..a535922 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,11 @@ The goal of this firmware is to provide a mean for the user to OTA a new firmwar - Clone the project and `cd` into it - Init and update submodules : `git submodule update --init --recursive` - Configure mynewt : `newt upgrade` -- Build : `scripts/nrf52/build-boot.sh`. The firmware is generated in `bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf` and the DFU file for the reloader : `reloader/build-pinetime/reloader-mcuboot.zip` +- Build : `scripts/nrf52/build-boot.sh`. The firmware is generated in `bin/targets/pinetime/app/@mcuboot/boot/mynewt/mynewt.elf` and the DFU file for the reloader : `reloader/build-pinetime/reloader-mcuboot.zip` + +You can also build the firmware for the P8 watch, which has a slightly different pin mapping. The `build-boot.sh` accepts an optional argument (default: `pinetime`, options: `pinetime`, `p8`) to specify the target to build. + +- Build : `scripts/nrf52/build-boot.sh p8`. The firmware is generated in `bin/targets/p8/app/@mcuboot/boot/mynewt/mynewt.elf` and the DFU file for the reloader : `reloader/build-p8/reloader-mcuboot.zip` ## About the code diff --git a/hw/bsp/nrf52/syscfg.yml b/hw/bsp/nrf52/syscfg.yml index bd48895..2048217 100644 --- a/hw/bsp/nrf52/syscfg.yml +++ b/hw/bsp/nrf52/syscfg.yml @@ -54,16 +54,18 @@ syscfg.vals: ########################################################################### # SPI Flash - # XTX XT25F32B 32 Mb (4 MB) SPI NOR Flash (similar to QuadSPI SPI NOR Flash like Macronix 32 Mb (4 MB) MX25L3233F) - # manufacturer (0x0b), device (0x15), memory type (0x40), density (0x16) # Settings below are documented at https://github.com/apache/mynewt-core/blob/master/hw/drivers/flash/spiflash/syscfg.yml SPIFLASH: 1 # Enable SPI Flash SPIFLASH_SPI_NUM: 0 # SPI Interface 0 SPIFLASH_SPI_CS_PIN: 5 # SPI interface CS pin: P0.05/AIN3, SPI-CE# (SPI-NOR) SPIFLASH_BAUDRATE: 8000 # Requested baudrate, 8000 is the fastest baudrate supported by nRF52832 + SPIFLASH_MANUFACTURER: 0x0B # Expected SpiFlash manufacturer as read by Read JEDEC ID command 9FH SPIFLASH_MEMORY_TYPE: 0x40 # Expected SpiFlash memory type as read by Read JEDEC ID command 9FH + SPIFLASH_IGNORE_MANUFACTURER: 1 # Many P8 watches contain a whole zoo of different SPI flash chips across variants + SPIFLASH_IGNORE_MEMORY_TYPE: 1 # The chips still behave the same as the PineTime one. + SPIFLASH_MEMORY_CAPACITY: 0x16 # Expected SpiFlash memory capactity as read by Read JEDEC ID command 9FH (2 ^ 0x16 = 32 Mb) SPIFLASH_SECTOR_COUNT: 1024 # Number of sectors: 1024 sectors of 4 KB each SPIFLASH_SECTOR_SIZE: 4096 # TODO Number of bytes that can be erased at a time: 4 KB sector size @@ -92,7 +94,7 @@ syscfg.vals: COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 MCU_DCDC_ENABLED: 1 - MCU_LFCLK_SOURCE: LFXO + MCU_LFCLK_SOURCE: LFRC # Compatible with all variants, with or without external crystal BOOT_SERIAL_DETECT_PIN: 20 ########################################################################### diff --git a/libs/pinetime_boot/pkg.yml b/libs/pinetime_boot/pkg.yml index a6752bd..c05b594 100644 --- a/libs/pinetime_boot/pkg.yml +++ b/libs/pinetime_boot/pkg.yml @@ -33,7 +33,7 @@ pkg.deps: # Mynewt consolidates the initialisation functions into sysinit() # and calls them according to the Stage number, highest number first. # Stage 500 is used by Sensor Creator so we use Stage 600 onwards. -# Generated sysinit() for Bootloader: bin/targets/nrf52_boot/generated/src/nrf52_boot-sysinit-app.c +# Generated sysinit() for Bootloader: bin/targets/pinetime/generated/src/pinetime-sysinit-app.c pkg.init: # pinetime_boot should be initialised last, when SPI and Semihosting Console are up diff --git a/libs/pinetime_boot/src/blink.c b/libs/pinetime_boot/src/blink.c index 68a2c48..46031e9 100644 --- a/libs/pinetime_boot/src/blink.c +++ b/libs/pinetime_boot/src/blink.c @@ -21,8 +21,6 @@ #include #include -#define PUSH_BUTTON_IN 13 // GPIO Pin P0.13: PUSH BUTTON_IN - /// GPIO settings for the backlight: LCD_BACKLIGHT_{LOW,MID,HIGH} (P0.14, 22, 23) static const uint8_t backlights[] = { 14, // Low Backlight @@ -130,6 +128,6 @@ static void delay_ms(uint32_t ms) { uint8_t button_samples = 0; for (int i = 0; i < ms; i++) { for (int delay = 0; delay < 100000; delay++) {} - button_samples += hal_gpio_read(PUSH_BUTTON_IN); + button_samples += hal_gpio_read(MYNEWT_VAL(PUSH_BUTTON_IN)); } } \ No newline at end of file diff --git a/libs/pinetime_boot/src/display.c b/libs/pinetime_boot/src/display.c index d2a7c86..d229b3d 100644 --- a/libs/pinetime_boot/src/display.c +++ b/libs/pinetime_boot/src/display.c @@ -37,7 +37,6 @@ #define DISPLAY_RST 26 // LCD_RESET (P0.26): Display reset #define DISPLAY_HIGH 23 // LCD_BACKLIGHT_{LOW,MID,HIGH} (P0.14, 22, 23): Backlight (active low) #define BATCH_SIZE 256 // Max number of SPI data bytes to be transmitted -#define PUSH_BUTTON_IN 13 // GPIO Pin P0.13: PUSH BUTTON_IN // Screen Size #define ROW_COUNT 240 diff --git a/libs/pinetime_boot/src/pinetime_boot.c b/libs/pinetime_boot/src/pinetime_boot.c index 0bad594..4af04bc 100644 --- a/libs/pinetime_boot/src/pinetime_boot.c +++ b/libs/pinetime_boot/src/pinetime_boot.c @@ -32,9 +32,6 @@ #include #include "pinetime_boot/version.h" -#define PUSH_BUTTON_IN 13 // GPIO Pin P0.13: PUSH BUTTON_IN -#define PUSH_BUTTON_OUT 15 // GPIO Pin P0.15/TRACEDATA2: PUSH BUTTON_OUT - /// Vector Table will be relocated here. #define RELOCATED_VECTOR_TABLE 0x7F00 @@ -54,9 +51,9 @@ void pinetime_boot_init(void) { // Init the push button. The button on the side of the PineTime is disabled by default. To enable it, drive the button out pin (P0.15) high. // While enabled, the button in pin (P0.13) will be high when the button is pressed, and low when it is not pressed. - hal_gpio_init_in(PUSH_BUTTON_IN, HAL_GPIO_PULL_DOWN); - hal_gpio_init_out(PUSH_BUTTON_OUT, 1); - hal_gpio_write(PUSH_BUTTON_OUT, 1); // Enable the button + hal_gpio_init_in(MYNEWT_VAL(PUSH_BUTTON_IN), HAL_GPIO_PULL_DOWN); + hal_gpio_init_out(MYNEWT_VAL(PUSH_BUTTON_OUT), 1); + hal_gpio_write(MYNEWT_VAL(PUSH_BUTTON_OUT), 1); // Enable the button // blink_backlight(1, 1); // Display the image. @@ -70,7 +67,7 @@ void pinetime_boot_init(void) { console_printf("Waiting 5 seconds for button...\n"); console_flush(); for (int i = 0; i < 64 * 5; i++) { for (int delay = 0; delay < 3000; delay++) { - button_samples += hal_gpio_read(PUSH_BUTTON_IN); + button_samples += hal_gpio_read(MYNEWT_VAL(PUSH_BUTTON_IN)); } if(i % 64 == 0) { console_printf("step %d - %d\n", (i / (64)) + 1, (int)button_samples); console_flush(); diff --git a/libs/pinetime_boot/syscfg.yml b/libs/pinetime_boot/syscfg.yml index 2520c0d..18612d1 100644 --- a/libs/pinetime_boot/syscfg.yml +++ b/libs/pinetime_boot/syscfg.yml @@ -3,3 +3,12 @@ # Strings must be enclosed by '"..."' syscfg.defs: + PUSH_BUTTON_IN: + description: Pin of the pushbutton (in) + value: + restrictions: $notnull + + PUSH_BUTTON_OUT: + description: Pin of the pushbutton (out) + value: + restrictions: $notnull \ No newline at end of file diff --git a/project.yml b/project.yml index 6cc29e7..b91a53b 100644 --- a/project.yml +++ b/project.yml @@ -17,7 +17,7 @@ # under the License. # -project.name: "my_project" +project.name: "pinetime_mcuboot_bootloader" project.repositories: - apache-mynewt-core @@ -28,12 +28,12 @@ project.repositories: # repository.apache-mynewt-core: type: github - vers: 1.8.0 + vers: db05f05fedadc7782e6b857400779b8af69eb857-commit # Contains JEDEC ignore options user: apache repo: mynewt-core repository.mcuboot: type: github - vers: 1.5.0 - user: JuulLabs-OSS + vers: c657cbea75f2bb1faf1fceacf972a0537a8d26dd-commit # 1.9.0 + user: mcu-tools repo: mcuboot diff --git a/scripts/nrf52/build-boot.cmd b/scripts/nrf52/build-boot.cmd index ce11cac..c445b61 100644 --- a/scripts/nrf52/build-boot.cmd +++ b/scripts/nrf52/build-boot.cmd @@ -1,7 +1,7 @@ :: Build Mynewt bootloader on Windows :: Build the bootloader. -newt\newt.exe build nrf52_boot +newt\newt.exe build pinetime :: Show the size. -newt\newt.exe size -v nrf52_boot +newt\newt.exe size -v pinetime diff --git a/scripts/nrf52/build-boot.sh b/scripts/nrf52/build-boot.sh index c82f25e..69ac86c 100755 --- a/scripts/nrf52/build-boot.sh +++ b/scripts/nrf52/build-boot.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash # Build Mynewt bootloader on macOS and Linux +TARGET=${1:-pinetime} +echo "Building target $TARGET" + set -e # Exit when any command fails. set -x # Echo all commands. @@ -10,17 +13,17 @@ source paths.bash arm-none-eabi-gcc --version # Build the bootloader. -newt build nrf52_boot +newt build $TARGET # Show the size. -newt size -v nrf52_boot +newt size -v $TARGET -arm-none-eabi-objcopy -I binary -O ihex bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf.bin bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf.hex -scripts/hex2c.py bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf.hex > reloader/src/boards/pinetime/bootloader.h -make -C reloader BOARD=pinetime +arm-none-eabi-objcopy -I binary -O ihex bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.elf.bin bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.elf.hex +scripts/hex2c.py bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.elf.hex > reloader/src/boards/$TARGET/bootloader.h +make -C reloader build-$TARGET/reloader-mcuboot.zip all BOARD=$TARGET set +x -echo "Bootloader firmware (elf) : bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf" -echo "Bootloader firmware (bin) : bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.bin" -echo "Bootloader firmware (hex) : bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.hex" -echo "Reloader (DFU) : reloader/build-pinetime/reloader-mcuboot.zip" +echo "Bootloader firmware (elf) : bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.elf" +echo "Bootloader firmware (bin) : bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.bin" +echo "Bootloader firmware (hex) : bin/targets/$TARGET/app/@mcuboot/boot/mynewt/mynewt.hex" +echo "Reloader (DFU) : reloader/build-$TARGET/reloader-mcuboot.zip" diff --git a/targets/p8/pkg.yml b/targets/p8/pkg.yml new file mode 100644 index 0000000..f581c36 --- /dev/null +++ b/targets/p8/pkg.yml @@ -0,0 +1,35 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Target Settings +pkg.name: targets/p8 +pkg.type: target +pkg.description: +pkg.author: +pkg.homepage: + +# Package Dependencies: MCUBoot is dependent on these drivers and libraries. +pkg.deps: + - "libs/semihosting_console" # Semihosting Console + - "libs/pinetime_boot" # Render boot graphic and check for rollback. Comment out for Stub Bootloader. + +# C compiler flags +pkg.cflags: + - -DMCUBOOT_HAVE_LOGGING=1 # So that sysinit() will be run, needed for displaying boot graphic + - -DDISABLE_SEMIHOSTING # Uncomment to disable Arm Semihosting. Must be uncommented for production. + # - -Os # Optimise for smallest size \ No newline at end of file diff --git a/targets/nrf52_boot/syscfg.yml b/targets/p8/syscfg.yml similarity index 96% rename from targets/nrf52_boot/syscfg.yml rename to targets/p8/syscfg.yml index 8bd6eb7..1181496 100644 --- a/targets/nrf52_boot/syscfg.yml +++ b/targets/p8/syscfg.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -# MCUBoot Bootloader Settings +# Target Settings syscfg.vals: BOOT_CUSTOM_START: 1 # Use custom boot function boot_custom_start() @@ -54,3 +54,7 @@ syscfg.vals: SANITY_INTERVAL: 1000 # The interval (in milliseconds) at which the sanity checks should run, should be at least 200ms prior to watchdog WATCHDOG_INTERVAL: 2000 # The interval (in milliseconds) at which the watchdog should reset if not tickled, in ms + # Specific target hardware config + + PUSH_BUTTON_IN: 17 + PUSH_BUTTON_OUT: -1 diff --git a/targets/nrf52_boot/target.yml b/targets/p8/target.yml similarity index 100% rename from targets/nrf52_boot/target.yml rename to targets/p8/target.yml diff --git a/targets/nrf52_boot/pkg.yml b/targets/pinetime/pkg.yml similarity index 95% rename from targets/nrf52_boot/pkg.yml rename to targets/pinetime/pkg.yml index 86f1e29..62d9308 100644 --- a/targets/nrf52_boot/pkg.yml +++ b/targets/pinetime/pkg.yml @@ -16,8 +16,8 @@ # specific language governing permissions and limitations # under the License. -# MCUBoot Package Settings -pkg.name: targets/nrf52_boot +# Target Settings +pkg.name: targets/pinetime pkg.type: target pkg.description: pkg.author: diff --git a/targets/pinetime/syscfg.yml b/targets/pinetime/syscfg.yml new file mode 100644 index 0000000..47dd135 --- /dev/null +++ b/targets/pinetime/syscfg.yml @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Target Settings + +syscfg.vals: + BOOT_CUSTOM_START: 1 # Use custom boot function boot_custom_start() + OS_MAIN_STACK_SIZE: 1024 # Small stack size: 4 KB + MSYS_1_BLOCK_COUNT: 64 # Allocate MSYS buffers for Semihosting Console + HAL_ENABLE_SOFTWARE_BREAKPOINTS: 0 # In case of assertion failure, don't breakpoint. Must be set to 0 so that bootloader will reboot and won't hang in case of assertion failures. + MCU_DEBUG_IGNORE_BKPT: 1 + + ########################################################################### + # Hardware Settings + + SPIFLASH: 1 # Enable SPI Flash + SPI_0_MASTER: 1 # Enable SPI port 0 for ST7789 display and SPI Flash + I2C_1: 0 # Disable I2C port 1 for CST816S touch controller, BMA421 accelerometer, HRS3300 heart rate sensor + UART_0: 0 # Disable UART port to reduce ROM size + + ########################################################################### + # Common Settings for minimal ROM size + + CONSOLE_COMPAT: 0 # Disable console input + CONSOLE_RTT: 0 # Disable RTT Console + CONSOLE_UART: 0 # Disable UART Console + LOG_CLI: 0 # Disable logging command-line interface + LOG_LEVEL: 255 # Disable logs + SENSOR_CLI: 0 # Disable sensor command-line interface + SENSOR_OIC: 0 # Disable sensor OIC functions + SHELL_CMD_HELP: 0 # Disable shell help + SHELL_OS_MODULE: 0 # Disable shell module + SHELL_TASK: 0 # Disable shell task + STATS_CLI: 0 # Disable statistics command-line interface + OS_SYSVIEW_TRACE_CALLOUT: 0 # Disable trace of callouts + OS_SYSVIEW_TRACE_EVENTQ: 0 # Disable trace of event queues + OS_SYSVIEW_TRACE_MUTEX: 0 # Disable trace of mutex + OS_SYSVIEW_TRACE_SEM: 0 # Disable trace of semaphores + BOOTUTIL_FEED_WATCHDOG: 1 # Enable watchdog feeding while performing a swap upgrade + SANITY_INTERVAL: 1000 # The interval (in milliseconds) at which the sanity checks should run, should be at least 200ms prior to watchdog + WATCHDOG_INTERVAL: 2000 # The interval (in milliseconds) at which the watchdog should reset if not tickled, in ms + + # Specific target hardware config + + PUSH_BUTTON_IN: 13 + PUSH_BUTTON_OUT: 15 diff --git a/targets/pinetime/target.yml b/targets/pinetime/target.yml new file mode 100644 index 0000000..a0952e9 --- /dev/null +++ b/targets/pinetime/target.yml @@ -0,0 +1,12 @@ +# Bootloader Target Settings + +# Bootloader will be based on MCUBoot. Select "apps/boot_stub" for the Stub Bootloader. +target.app: "@mcuboot/boot/mynewt" # Use MCUBoot, which doesn't support debugging +# target.app: "apps/boot_stub" # Use Stub Bootloader, which supports debugging + +# Board Support Package (BSP) for the target +target.bsp: "hw/bsp/nrf52" + +# Build with debug support. Or select "optimized" to remove debug support. +#target.build_profile: debug # For debugging +target.build_profile: optimized # For production