diff --git a/src/console/console.c b/src/console/console.c
index 67da10794e..4e4fc83bbc 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -69,7 +69,7 @@ void console_write_line(uint8_t *buffer, size_t number_of_bytes)
 		console_tx_byte(*buffer++);
 }
 
-#if CONFIG(GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
+#if CONFIG(GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE || (CONFIG(IDT_IN_EVERY_STAGE) && ENV_BOOTBLOCK))
 void gdb_hw_init(void)
 {
 	__gdb_hw_init();
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
index 2e23d43a4e..5ca779c42a 100644
--- a/src/include/console/uart.h
+++ b/src/include/console/uart.h
@@ -84,7 +84,7 @@ static inline void __uart_tx_byte(u8 data)	{}
 static inline void __uart_tx_flush(void)	{}
 #endif
 
-#if CONFIG(GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
+#if CONFIG(GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE || (CONFIG(IDT_IN_EVERY_STAGE) && ENV_BOOTBLOCK))
 #define CONF_UART_FOR_GDB	CONFIG_UART_FOR_CONSOLE
 static inline void __gdb_hw_init(void)	{ uart_init(CONF_UART_FOR_GDB); }
 static inline void __gdb_tx_byte(u8 data)
