boards: add openocd support for nucleo_l476rg and stm32l496g_disco

the current zephyr sdk now includes openocd configurations for l4
boards, we can now update the boards and docs to reflect this

Signed-off-by: Arthur SFEZ <arthur.sfez@gmail.com>
diff --git a/boards/arm/nucleo_l476rg/board.cmake b/boards/arm/nucleo_l476rg/board.cmake
new file mode 100644
index 0000000..2b06911
--- /dev/null
+++ b/boards/arm/nucleo_l476rg/board.cmake
@@ -0,0 +1 @@
+include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake)
diff --git a/boards/arm/nucleo_l476rg/support/openocd.cfg b/boards/arm/nucleo_l476rg/support/openocd.cfg
new file mode 100644
index 0000000..4e96257
--- /dev/null
+++ b/boards/arm/nucleo_l476rg/support/openocd.cfg
@@ -0,0 +1,12 @@
+source [find board/st_nucleo_l476rg.cfg]
+
+$_TARGETNAME configure -event gdb-attach {
+	echo "Debugger attaching: halting execution"
+	reset halt
+	gdb_breakpoint_override hard
+}
+
+$_TARGETNAME configure -event gdb-detach {
+	echo "Debugger detaching: resuming execution"
+	resume
+}
diff --git a/boards/arm/stm32l496g_disco/board.cmake b/boards/arm/stm32l496g_disco/board.cmake
new file mode 100644
index 0000000..2b06911
--- /dev/null
+++ b/boards/arm/stm32l496g_disco/board.cmake
@@ -0,0 +1 @@
+include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake)
diff --git a/boards/arm/stm32l496g_disco/support/openocd.cfg b/boards/arm/stm32l496g_disco/support/openocd.cfg
new file mode 100644
index 0000000..295299f
--- /dev/null
+++ b/boards/arm/stm32l496g_disco/support/openocd.cfg
@@ -0,0 +1,12 @@
+source [find board/stm32l4discovery.cfg]
+
+$_TARGETNAME configure -event gdb-attach {
+	echo "Debugger attaching: halting execution"
+	reset halt
+	gdb_breakpoint_override hard
+}
+
+$_TARGETNAME configure -event gdb-detach {
+	echo "Debugger detaching: resuming execution"
+	resume
+}