Skip to content

Commit

Permalink
feat(core): add BLE to t3w1 board
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
TychoVrahe committed Jan 14, 2025
1 parent ff5504c commit d4bf0e8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 26 deletions.
16 changes: 16 additions & 0 deletions core/embed/models/T3W1/boards/trezor_t3w1_revA.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,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_
16 changes: 16 additions & 0 deletions core/embed/models/T3W1/boards/trezor_t3w1_revA0.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,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_
22 changes: 9 additions & 13 deletions core/site_scons/models/T3W1/trezor_t3w1_revA.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,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:
Expand Down
22 changes: 9 additions & 13 deletions core/site_scons/models/T3W1/trezor_t3w1_revA0.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,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:
Expand Down

0 comments on commit d4bf0e8

Please sign in to comment.