From a657243a3ab0111353557f98f97a074a26d82490 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 30 Nov 2023 09:44:18 +0100 Subject: [PATCH] boards/olimex-msp430-h1611: uart_stdio @ 9600 Bd --- boards/olimex-msp430-h1611/Makefile.include | 14 +++++++++++--- boards/olimex-msp430-h1611/include/periph_conf.h | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/boards/olimex-msp430-h1611/Makefile.include b/boards/olimex-msp430-h1611/Makefile.include index d49e656df6f8e..73709f1cb3599 100644 --- a/boards/olimex-msp430-h1611/Makefile.include +++ b/boards/olimex-msp430-h1611/Makefile.include @@ -3,10 +3,16 @@ PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial-MXV*))) # flash tool configuration -PROGRAMMER ?= mspdebug -MSPDEBUG_PROGRAMMER ?= olimex +PROGRAMMER ?= mspdebug +MSPDEBUG_PROGRAMMER ?= olimex -PROGRAMMERS_SUPPORTED += mspdebug +PROGRAMMERS_SUPPORTED += mspdebug +# UART @ 115200 Bd is not reliable with a CPU clock of ~ 5 MHz, occasionally +# chars get lost. Adding an 8 MHz crystal or an external resistor so that the +# DCO can reach 8 MHz does yield the speed bump needed for a more reliable +# UART connection @ 115200 Bd + +BAUD ?= 9600 # When freshly plugged in the Olimex MSP430-JTAG-Tiny debugger provides a # ttyACM interface, which is only available until the first flashing. A @@ -24,3 +30,5 @@ TTY_SELECT_CMD := $(RIOTTOOLS)/usb-serial/ttys.py \ $(RIOTTOOLS)/usb-serial/ttys.py \ --most-recent \ --format path serial + +CFLAGS += -DSTDIO_UART_BAUDRATE=$(BAUD) diff --git a/boards/olimex-msp430-h1611/include/periph_conf.h b/boards/olimex-msp430-h1611/include/periph_conf.h index 622a8868e24b4..5f94249e693a8 100644 --- a/boards/olimex-msp430-h1611/include/periph_conf.h +++ b/boards/olimex-msp430-h1611/include/periph_conf.h @@ -34,6 +34,10 @@ extern "C" { * @brief Clock configuration */ static const msp430_clock_params_t clock_params = { + /* Without an external resistor, the DCO frequency typically tops out + * at something like 5 MHz. However, the DCO calibration just picks the + * closet possible value, in this case it will go for the highest frequency + * the silicon at hand can run at. */ .target_dco_frequency = MHZ(8), .lfxt1_frequency = 32768, .main_clock_source = MAIN_CLOCK_SOURCE_DCOCLK,