From 87610cc35c3d78fc12769d820d1d63f63d7f1913 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 22 Nov 2024 15:39:54 +0100 Subject: [PATCH] feat(core): add BLE to t3w1 board [no changelog] --- .../models/T3W1/boards/trezor_t3w1_revA.h | 16 ++++++++++++++ .../models/T3W1/trezor_t3w1_revA.py | 22 ++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h index 583b8b6491..a46cb34839 100644 --- a/core/embed/models/T3W1/boards/trezor_t3w1_revA.h +++ b/core/embed/models/T3W1/boards/trezor_t3w1_revA.h @@ -129,4 +129,20 @@ #define SBU_2_PORT GPIOC #define SBU_2_CLK_ENA __HAL_RCC_GPIOC_CLK_ENABLE +#define NRF_IN_GPIO0_PIN GPIO_PIN_7 +#define NRF_IN_GPIO0_PORT GPIOE +#define NRF_IN_GPIO0_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE +#define NRF_IN_FW_RUNNING_PIN GPIO_PIN_13 +#define NRF_IN_FW_RUNNING_PORT GPIOE +#define NRF_IN_FW_RUNNING_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE +#define NRF_OUT_RESET_PIN GPIO_PIN_0 +#define NRF_OUT_RESET_PORT GPIOG +#define NRF_OUT_RESET_CLK_ENA __HAL_RCC_GPIOG_CLK_ENABLE +#define NRF_OUT_STAY_IN_BLD_PIN GPIO_PIN_15 +#define NRF_OUT_STAY_IN_BLD_PORT GPIOE +#define NRF_OUT_STAY_IN_BLD_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE +#define NRF_OUT_FW_RUNNING_PIN GPIO_PIN_11 +#define NRF_OUT_FW_RUNNING_PORT GPIOE +#define NRF_OUT_FW_RUNNING_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE + #endif // TREZOR_T3W1_REVA_H_ diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revA.py b/core/site_scons/models/T3W1/trezor_t3w1_revA.py index 19012a721a..a44947827b 100644 --- a/core/site_scons/models/T3W1/trezor_t3w1_revA.py +++ b/core/site_scons/models/T3W1/trezor_t3w1_revA.py @@ -71,21 +71,17 @@ def configure( features_available.append("haptic") defines += ["USE_HAPTIC=1"] - # if "ble" in features_wanted: - # sources += ["embed/trezorhal/stm32f4/ble/ble_hal.c"] - # sources += ["embed/trezorhal/stm32f4/ble/dfu.c"] - # sources += ["embed/trezorhal/stm32f4/ble/fwu.c"] - # sources += ["embed/trezorhal/stm32f4/ble/ble.c"] - # sources += ["embed/trezorhal/stm32f4/ble/messages.c"] - # sources += [ - # "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c" - # ] - # features_available.append("ble") - # defines += [("USE_BLE", "1")] - if "ble" in features_wanted: + sources += ["embed/io/ble/stm32/ble.c"] + paths += ["embed/io/ble/inc"] + features_available.append("ble") + defines += [("USE_BLE", "1")] + sources += ["embed/io/nrf/stm32u5/nrf.c"] + sources += ["embed/io/nrf/crc8.c"] + paths += ["embed/io/nrf/inc"] sources += [ - "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c" + "vendor/stm32u5xx_hal_driver/Src/stm32u5xx_hal_uart.c", + "vendor/stm32u5xx_hal_driver/Src/stm32u5xx_hal_uart_ex.c", ] if "optiga" in features_wanted: