From 0a3248f5c8ec5a9fd05541974872323f26d5182f Mon Sep 17 00:00:00 2001 From: Allen Dong Date: Sun, 11 Aug 2024 11:57:00 +0200 Subject: [PATCH] [RT1060] Modify the UART instance to adapt to the ot ncp host configuration Signed-off-by: Allen Dong --- boards/rt1060/CMakeLists.txt | 11 +++++++++-- boards/rt1060/evkbimxrt1060/pin_mux.c | 2 ++ script/build_rt1060 | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/boards/rt1060/CMakeLists.txt b/boards/rt1060/CMakeLists.txt index 955d2a0d..c420e4e6 100644 --- a/boards/rt1060/CMakeLists.txt +++ b/boards/rt1060/CMakeLists.txt @@ -44,8 +44,15 @@ else() list(APPEND BOARD_SOURCES evkbimxrt1060/pin_mux.c) list(APPEND BOARD_SOURCES evkbimxrt1060/clock_config.c) list(APPEND BOARD_INCLUDE_DIRECTORIES evkbimxrt1060) - set(BOARD_1ST_UART_INSTANCE 1) - set(BOARD_2ND_UART_INSTANCE 2) +endif() + +if("${EVK_RT1060_BOARD}" STREQUAL "evkbmimxrt1060") + if (NOT DEFINED BOARD_1ST_UART_INSTANCE) + set(BOARD_1ST_UART_INSTANCE 1) + endif() + if (NOT DEFINED BOARD_2ND_UART_INSTANCE) + set(BOARD_2ND_UART_INSTANCE 2) + endif() endif() list(APPEND BOARD_COMPILE_DEFINITIONS_PUBLIC) diff --git a/boards/rt1060/evkbimxrt1060/pin_mux.c b/boards/rt1060/evkbimxrt1060/pin_mux.c index 7c41b5f1..dea63967 100644 --- a/boards/rt1060/evkbimxrt1060/pin_mux.c +++ b/boards/rt1060/evkbimxrt1060/pin_mux.c @@ -37,7 +37,9 @@ void BOARD_InitBootPins(void) { BOARD_InitPins(); BOARD_InitDEBUG_UARTPins(); +#if !defined(CONFIG_NCP) || defined(CONFIG_NCP_UART) BOARD_InitArduinoUARTPins(); +#endif #if defined(SDIO_ENABLED) BOARD_InitUSDHCPins(); #endif diff --git a/script/build_rt1060 b/script/build_rt1060 index 8f871b45..fb401d3c 100755 --- a/script/build_rt1060 +++ b/script/build_rt1060 @@ -114,7 +114,8 @@ readonly OT_OPTIONS_TRANSCEIVER_RW612=( "-DOT_NXP_TRANSCEIVER=rw612" "-DOT_NCP_RTOS_HOST=ON" "-DOT_NXP_LWIP=OFF" - "-DBOARD_APP_UART_INSTANCE=2" + "-DBOARD_1ST_UART_INSTANCE=2" + "-DBOARD_2ND_UART_INSTANCE=1" "-DEVK_RT1060_BOARD=evkbmimxrt1060" "-DFREERTOS_CONFIG_FILE_DIRECTORY=${OT_SRCDIR}/boards/rt1060/freertos/ncp_host" )