From b00f1a6b586fd2cfae439b3f0dd1c170d8db73a2 Mon Sep 17 00:00:00 2001 From: Adam Green Date: Thu, 31 Jan 2013 23:40:13 -0800 Subject: [PATCH] Easier to configure MRI in makefile. The default mode for MRI's usage in Smoothie is the same as before where it only executes if a crash is encountered and isn't really useable for things like single stepping, etc. Now you can change the ENABLE_DEBUG_MONITOR make variable from 0 to 1 and it will switch MRI into a fuller debug experience where it takes over UART0 and stops at init so that you have an opportunity to set any breakpoints you might be interested in. --- makefile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 2d3a6b70..a594d989 100644 --- a/makefile +++ b/makefile @@ -17,14 +17,28 @@ INCDIRS= LIBS_PREFIX= LIBS_SUFFIX= SRC=./src + +#GCC4MBED_TYPE=Debug #GCC4MBED_TYPE=Release GCC4MBED_TYPE=Checked -#GCC4MBED_TYPE=Debug -#MRI_UART=MRI_UART_MBED_P13_P14 MRI_UART_BAUD=115200 -MRI_UART=MRI_UART_MBED_USB MRI_UART_SHARE -#MRI_UART=MRI_UART_MBED_USB + +# Set to 1 to allow MRI debug monitor to take full control of UART0 and use it +# as a dedicated debug channel. If you are using the USB based serial port for +# the console then this should cause you no problems. Set MRI_BREAK_ON_INIT to +# 0 if you don't want to break into GDB at startup. +ENABLE_DEBUG_MONITOR=0 + +ifeq "$(ENABLE_DEBUG_MONITOR)" "1" +# Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI. +# Tends to happen on some Linux distros but not Windows and OS X. +MRI_UART=MRI_UART_0 +MRI_BREAK_ON_INIT=1 +MRI_SEMIHOST_STDIO=1 +else +MRI_UART=MRI_UART_0 MRI_UART_SHARE MRI_BREAK_ON_INIT=0 MRI_SEMIHOST_STDIO=0 +endif CONSOLE=/dev/ttyUSB0 -- 2.20.1