From de9b283abee509487d21452f4acfbc6f91559d52 Mon Sep 17 00:00:00 2001 From: rogeryou Date: Thu, 7 May 2020 16:10:49 +0800 Subject: [PATCH] modify the div value when calling octo controller. For ST OSPI controller driver(stm32l4xx_hal_ospi.c), the frequency it has be subtracted 1, so "div = div - 1;" should be removed. --- targets/TARGET_STM/qspi_api.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/targets/TARGET_STM/qspi_api.c b/targets/TARGET_STM/qspi_api.c index 6dc1bcc00a..fe8eb23205 100644 --- a/targets/TARGET_STM/qspi_api.c +++ b/targets/TARGET_STM/qspi_api.c @@ -712,10 +712,6 @@ qspi_status_t qspi_frequency(qspi_t *obj, int hz) int div = HAL_RCC_GetHCLKFreq() / hz; if (div > 255) { div = 255; - } else { - if ((HAL_RCC_GetHCLKFreq() % hz) == 0) { - div = div - 1; - } } obj->handle.Init.ClockPrescaler = div;