From f8ad24484fca80bad582865b6f78bc03db7eb80e Mon Sep 17 00:00:00 2001 From: rusefillc <48498823+rusefillc@users.noreply.github.com> Date: Mon, 29 May 2023 17:45:37 -0400 Subject: [PATCH] dual-rev1 Secondary uart settings (#247) * f1_dual_rev1: secondary TS port (BT) * f1_dual_rev1: two TS serial ports: primary over BT, secondary over J3 --------- Co-authored-by: Andrey Gusakov --- firmware/boards/f1_dual_rev1/board.c | 1 + firmware/boards/f1_dual_rev1/mcuconf.h | 2 +- .../f1_dual_rev1/wideband_board_config.h | 18 +++++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/firmware/boards/f1_dual_rev1/board.c b/firmware/boards/f1_dual_rev1/board.c index d5d4458..4317118 100644 --- a/firmware/boards/f1_dual_rev1/board.c +++ b/firmware/boards/f1_dual_rev1/board.c @@ -49,5 +49,6 @@ void __early_init(void) { */ void boardInit(void) { AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP | /* remap I2C1 to PB8, PB9 */ + AFIO_MAPR_USART3_REMAP_0 | /* remap USART3 to PC10, PC11 */ AFIO_MAPR_SWJ_CFG_1; /* JTAG-DP disabled, SW-DP enabled, PA13, PA14 are only used */ } diff --git a/firmware/boards/f1_dual_rev1/mcuconf.h b/firmware/boards/f1_dual_rev1/mcuconf.h index b242b1e..4e386c5 100644 --- a/firmware/boards/f1_dual_rev1/mcuconf.h +++ b/firmware/boards/f1_dual_rev1/mcuconf.h @@ -167,7 +167,7 @@ */ #define STM32_SERIAL_USE_USART1 TRUE #define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_USART3 TRUE #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USE_UART5 FALSE #define STM32_SERIAL_USART1_PRIORITY 12 diff --git a/firmware/boards/f1_dual_rev1/wideband_board_config.h b/firmware/boards/f1_dual_rev1/wideband_board_config.h index a1e6e5d..518017f 100644 --- a/firmware/boards/f1_dual_rev1/wideband_board_config.h +++ b/firmware/boards/f1_dual_rev1/wideband_board_config.h @@ -58,12 +58,24 @@ #define HEATER_MAX_DUTY (0.85) // ******************************* -// TunerStudio Primary Port +// TunerStudio Primary Port - Routed to BlueTooth // ******************************* -#define TS_PRIMARY_SERIAL_PORT SD1 +#define TS_PRIMARY_SERIAL_PORT SD3 #define TS_PRIMARY_BAUDRATE 115200 -// TODO: add BT port on PC10, PC11 - UART4/USART3 +#if 1 +// ******************************* +// TunerStudio Secondary Port - J3 connector (2x2) +// ******************************* +#define TS_SECONDARY_SERIAL_PORT SD1 +#define TS_SECONDARY_BAUDRATE 115200 +#else +// ******************************* +// Debug serial device +// ******************************* +#define DEBUG_SERIAL_PORT SD1 +#define DEBUG_SERIAL_BAUDRATE 115200 +#endif // ******************************* // MAX31855 spi port