diff --git a/west/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832.dts b/west/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832.dts index 0345e59760..bc700d196e 100644 --- a/west/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832.dts +++ b/west/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832.dts @@ -27,28 +27,24 @@ leds { compatible = "gpio-leds"; led0: led_0 { - gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; label = "Green LED 0"; }; led1: led_1 { - gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; label = "Green LED 1"; }; - out0: out_0 { - gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; - label = "FW Running"; - }; }; buttons { compatible = "gpio-keys"; button0: button_0 { - gpios = <&gpio0 27 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio0 14 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; label = "Push button switch 0"; zephyr,code = ; }; trezor_ready: trezor_ready { - gpios = <&gpio0 29 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; + gpios = <&gpio0 29 ( GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; label = "Trezor ready"; zephyr,code = ; }; @@ -59,9 +55,8 @@ led0 = &led0; led1 = &led1; sw0 = &button0; - bootloader-led0 = &led0; + bootloader-botton0 = &button0; mcuboot-button0 = &button0; - mcuboot-led0 = &led0; watchdog0 = &wdt0; }; }; @@ -118,11 +113,7 @@ }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x37000>; - }; - slot1_partition: partition@43000 { - label = "image-1"; - reg = <0x00043000 0x37000>; + reg = <0x0000C000 0x7A000>; }; storage_partition: partition@7a000 { label = "storage"; diff --git a/west/trezor/trezor-ble/mcuboot.conf b/west/trezor/trezor-ble/mcuboot.conf index 13a3d5ed2f..6823460cd1 100644 --- a/west/trezor/trezor-ble/mcuboot.conf +++ b/west/trezor/trezor-ble/mcuboot.conf @@ -18,6 +18,7 @@ CONFIG_BOOT_SERIAL_UART=y #CONFIG_MCUMGR_SMP_UART=y CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP=y CONFIG_SINGLE_APPLICATION_SLOT=y +CONFIG_BOOT_VALIDATE_SLOT0=y CONFIG_RTT_CONSOLE=y CONFIG_USE_SEGGER_RTT=y diff --git a/west/trezor/trezor-ble/prj.conf b/west/trezor/trezor-ble/prj.conf index 73820932c1..d0e50e06dc 100644 --- a/west/trezor/trezor-ble/prj.conf +++ b/west/trezor/trezor-ble/prj.conf @@ -89,3 +89,16 @@ CONFIG_LOG_PRINTK=n CONFIG_NANOPB=n CONFIG_ASSERT=y + + +# bootloader +#CONFIG_SECURE_BOOT=y +CONFIG_BOOTLOADER_MCUBOOT=y +#CONFIG_SB_SIGNING_OPENSSL=y +#CONFIG_SB_SIGNING_KEY_FILE="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_priv.pem" +#CONFIG_SB_SIGNING_KEY_FILE="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_priv.pem" +#CONFIG_SB_PUBLIC_KEY_FILES="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_pub.pem" +#CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_priv.pem" +#CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_priv.pem" +#CONFIG_BOOT_SIGNATURE_KEY_FILE="/home/ondro/work/satoshilabs/repos/ncs/mcuboot_priv.pem" +CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP=y diff --git a/west/trezor/trezor-ble/src/main.c b/west/trezor/trezor-ble/src/main.c index fe4f8d5598..b3ec826300 100644 --- a/west/trezor/trezor-ble/src/main.c +++ b/west/trezor/trezor-ble/src/main.c @@ -46,8 +46,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define RUN_STATUS_LED DK_LED1 #define RUN_LED_BLINK_INTERVAL 1000 -#define FW_RUNNING_SIG DK_LED3 -#define CON_STATUS_LED DK_LED2 +#define FW_RUNNING_SIG DK_LED2 static K_SEM_DEFINE(ble_init_ok, 0, 1); static K_SEM_DEFINE(led_init_ok, 0, 1); @@ -231,7 +230,7 @@ void ble_write_thread(void) { } void led_thread(void) { - bool connected = false; +// bool connected = false; int blink_status = 0; /* Don't go any further until BLE is initialized */ k_sem_take(&led_init_ok, K_FOREVER); @@ -240,17 +239,17 @@ void led_thread(void) { blink_status++; dk_set_led(RUN_STATUS_LED, (blink_status) % 2); - connected = is_connected(); - - if (connected) { - dk_set_led_on(CON_STATUS_LED); - } else { - if (is_advertising() && !is_advertising_whitelist()) { - dk_set_led(CON_STATUS_LED, (blink_status) % 2); - } else { - dk_set_led_off(CON_STATUS_LED); - } - } +// connected = is_connected(); +// +// if (connected) { +// dk_set_led_on(CON_STATUS_LED); +// } else { +// if (is_advertising() && !is_advertising_whitelist()) { +// dk_set_led(CON_STATUS_LED, (blink_status) % 2); +// } else { +// dk_set_led_off(CON_STATUS_LED); +// } +// } k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL)); } diff --git a/west/trezor/west.yml b/west/trezor/west.yml index 0a91db7e95..66e23f9871 100644 --- a/west/trezor/west.yml +++ b/west/trezor/west.yml @@ -15,7 +15,3 @@ manifest: repo-path: sdk-nrf revision: v2.7.0 import: true - - name: mcuboot - url: https://github.com/hiviah/mcuboot - path: bootloader/mcuboot - revision: edfe1e1465dbc698bf9a195816247913490ab391