From 00bfa3bf4a624381244801b1c743b94cef0d6bc7 Mon Sep 17 00:00:00 2001 From: Laurent MEUNIER Date: Tue, 28 Feb 2017 17:00:29 +0100 Subject: [PATCH] STM32: change spi error to debug warning In case the selected frequency is higher than the requested one, it is better to send a debug warning rather than an blocking error. In case of such warning, user may need to redefine the clock tree setting at higher level (reducing peripheral's input clocks during init phase). --- targets/TARGET_STM/stm_spi_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_STM/stm_spi_api.c b/targets/TARGET_STM/stm_spi_api.c index 1928253bb65..f756102e396 100644 --- a/targets/TARGET_STM/stm_spi_api.c +++ b/targets/TARGET_STM/stm_spi_api.c @@ -308,7 +308,7 @@ void spi_frequency(spi_t *obj, int hz) { /* In case maximum pre-scaler still gives too high freq, raise an error */ if (spi_hz > hz) { - error("Couldn't set suitable spi freq: request:%d, lowest:%d\r\n", hz, spi_hz); + DEBUG_PRINTF("WARNING: lowest SPI freq (%d) higher than requested (%d)\r\n", spi_hz, hz); } DEBUG_PRINTF("spi_frequency, request:%d, select:%d\r\n", hz, spi_hz);