Skip to content

Commit 0fb4633

Browse files
committed
boards: tt_blackhole: only write vars.cfg when kconfig exists
When building the app/smc target with --sysbuild, then output file is written 3 times. At least the last of those times, CONFIG_TT_SRST_ASSIST is unset, which only means the first line is written to the file. Only write bmc-reset-vars.cfg when CONFIG_TT_SRST_ASSIST is defined so that the file is fully populated. Signed-off-by: Chris Friedt <[email protected]>
1 parent 8dacb3c commit 0fb4633

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

boards/tenstorrent/tt_blackhole/board.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ if(CONFIG_ARM)
1414
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
1515
endif()
1616

17-
set(BMC_VARS "# Autogenerated file with variables to reset SMC. Don't edit!\n")
1817
if(CONFIG_TT_SRST_ASSIST)
18+
set(BMC_VARS "# Autogenerated file with variables to reset SMC. Don't edit!\n")
1919
string(APPEND BMC_VARS "set OPENOCD ${OPENOCD}\n")
2020
string(APPEND BMC_VARS "set OPENOCD_DEFAULT_PATH ${OPENOCD_DEFAULT_PATH}\n")
2121
string(APPEND BMC_VARS "set BMC_CFG ${CMAKE_CURRENT_LIST_DIR}/support/tt_blackhole_bmc.cfg\n")
2222
string(APPEND BMC_VARS "set RST_GPIO_REG ${CONFIG_TT_SRST_ASSIST_ADDR}\n")
2323
string(APPEND BMC_VARS "set RST_GPIO_SET_MASK ${CONFIG_TT_SRST_ASSIST_SET}\n")
2424
string(APPEND BMC_VARS "set RST_GPIO_CLR_MASK ${CONFIG_TT_SRST_ASSIST_CLR}\n")
25+
file(WRITE ${CMAKE_CURRENT_LIST_DIR}/support/bmc-reset-vars.cfg ${BMC_VARS})
2526
endif()
26-
file(WRITE ${CMAKE_CURRENT_LIST_DIR}/support/bmc-reset-vars.cfg ${BMC_VARS})
2727

2828
# Include debugger templates below (order is important)
2929
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

0 commit comments

Comments
 (0)