From 491c9ac55a0337cd248bb735466bd1dee638de51 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 22 Aug 2017 10:32:35 +0000 Subject: Fixed bug #874. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10457 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/STM32/NIL-STM32F746G-DISCOVERY/mcuconf.h | 1 + demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/mcuconf.h | 1 + demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h | 5 +++-- demos/STM32/RT-STM32F746ZG-NUCLEO144/mcuconf.h | 1 + demos/STM32/RT-STM32F767ZI-NUCLEO144/mcuconf.h | 1 + demos/STM32/RT-STM32F769I-DISCOVERY/mcuconf.h | 1 + os/hal/ports/STM32/STM32F7xx/hal_lld.h | 4 ++-- readme.txt | 2 ++ testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h | 1 + testhal/STM32/STM32F7xx/IRQ_STORM/mcuconf.h | 1 + testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h | 1 + testhal/STM32/STM32F7xx/SPI/mcuconf.h | 1 + testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h | 1 + testhal/STM32/STM32F7xx/USB_RAW/mcuconf.h | 1 + 14 files changed, 18 insertions(+), 4 deletions(-) diff --git a/demos/STM32/NIL-STM32F746G-DISCOVERY/mcuconf.h b/demos/STM32/NIL-STM32F746G-DISCOVERY/mcuconf.h index 3b1f2128a..2e7c41a48 100644 --- a/demos/STM32/NIL-STM32F746G-DISCOVERY/mcuconf.h +++ b/demos/STM32/NIL-STM32F746G-DISCOVERY/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/mcuconf.h b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/mcuconf.h index a897ed02f..fe9e360ee 100644 --- a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/mcuconf.h +++ b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h b/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h index 8da26145e..2e7c41a48 100644 --- a/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h +++ b/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h @@ -65,15 +65,16 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 #define STM32_PLLSAIR_VALUE 4 #define STM32_PLLSAIDIVQ_VALUE 2 -#define STM32_PLLSAIDIVR_VALUE 4 +#define STM32_PLLSAIDIVR_VALUE 2 #define STM32_SAI1SEL STM32_SAI1SEL_OFF #define STM32_SAI2SEL STM32_SAI2SEL_OFF -#define STM32_LCDTFT_REQUIRED TRUE +#define STM32_LCDTFT_REQUIRED FALSE #define STM32_USART1SEL STM32_USART1SEL_PCLK2 #define STM32_USART2SEL STM32_USART2SEL_PCLK1 #define STM32_USART3SEL STM32_USART3SEL_PCLK1 diff --git a/demos/STM32/RT-STM32F746ZG-NUCLEO144/mcuconf.h b/demos/STM32/RT-STM32F746ZG-NUCLEO144/mcuconf.h index 83df28692..03c6e9f79 100644 --- a/demos/STM32/RT-STM32F746ZG-NUCLEO144/mcuconf.h +++ b/demos/STM32/RT-STM32F746ZG-NUCLEO144/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/demos/STM32/RT-STM32F767ZI-NUCLEO144/mcuconf.h b/demos/STM32/RT-STM32F767ZI-NUCLEO144/mcuconf.h index 83df28692..03c6e9f79 100644 --- a/demos/STM32/RT-STM32F767ZI-NUCLEO144/mcuconf.h +++ b/demos/STM32/RT-STM32F767ZI-NUCLEO144/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/demos/STM32/RT-STM32F769I-DISCOVERY/mcuconf.h b/demos/STM32/RT-STM32F769I-DISCOVERY/mcuconf.h index 3b1f2128a..2e7c41a48 100644 --- a/demos/STM32/RT-STM32F769I-DISCOVERY/mcuconf.h +++ b/demos/STM32/RT-STM32F769I-DISCOVERY/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/os/hal/ports/STM32/STM32F7xx/hal_lld.h b/os/hal/ports/STM32/STM32F7xx/hal_lld.h index 8bce8bfbe..904617a64 100644 --- a/os/hal/ports/STM32/STM32F7xx/hal_lld.h +++ b/os/hal/ports/STM32/STM32F7xx/hal_lld.h @@ -1456,7 +1456,7 @@ #if (STM32_PLLI2SDIVQ_VALUE < 1) || (STM32_PLLI2SDIVQ_VALUE > 32) #error "STM32_PLLI2SDIVQ_VALUE out of acceptable range" #endif -#define STM32_PLLI2SDIVQ (STM32_PLLI2SDIVQ_VALUE << 0) +#define STM32_PLLI2SDIVQ ((STM32_PLLI2SDIVQ_VALUE - 1) << 0) /** * @brief PLLI2S Q output clock frequency after divisor. @@ -1562,7 +1562,7 @@ #if (STM32_PLLSAIDIVQ_VALUE < 1) || (STM32_PLLSAIDIVQ_VALUE > 32) #error "STM32_PLLSAIDIVQ_VALUE out of acceptable range" #endif -#define STM32_PLLSAIDIVQ (STM32_PLLSAIDIVQ_VALUE << 8) +#define STM32_PLLSAIDIVQ ((STM32_PLLSAIDIVQ_VALUE - 1) << 8) /** * @brief PLLSAI Q output clock frequency after divisor. diff --git a/readme.txt b/readme.txt index 85c5666d3..f34d5b2a6 100644 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,8 @@ dependencies and configuration directories. This makes possible to have multiple non-conflicting makefiles in the same project. Updated the various platform.mk implementing "smart build" mode. +- HAL: Fixed wrong I2S and SAI freq divisor (bug #874) + (backported to 17.6.1). - HAL: Fixed wrong SAI1 and SAI2 clock selection (bug #873) (backported to 17.6.1). - HAL: Fixed invalid number of DMA channels on STM32L011 (bug #872) diff --git a/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h b/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h index 6eeb93bcb..507082613 100644 --- a/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h +++ b/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/testhal/STM32/STM32F7xx/IRQ_STORM/mcuconf.h b/testhal/STM32/STM32F7xx/IRQ_STORM/mcuconf.h index 8b25dc014..e9e524988 100644 --- a/testhal/STM32/STM32F7xx/IRQ_STORM/mcuconf.h +++ b/testhal/STM32/STM32F7xx/IRQ_STORM/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h b/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h index dd3ebf8e6..5e24c3b61 100644 --- a/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h +++ b/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/testhal/STM32/STM32F7xx/SPI/mcuconf.h b/testhal/STM32/STM32F7xx/SPI/mcuconf.h index 295196690..3b02792fb 100644 --- a/testhal/STM32/STM32F7xx/SPI/mcuconf.h +++ b/testhal/STM32/STM32F7xx/SPI/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h index ab94b0003..41a04d644 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h +++ b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 diff --git a/testhal/STM32/STM32F7xx/USB_RAW/mcuconf.h b/testhal/STM32/STM32F7xx/USB_RAW/mcuconf.h index ab94b0003..41a04d644 100644 --- a/testhal/STM32/STM32F7xx/USB_RAW/mcuconf.h +++ b/testhal/STM32/STM32F7xx/USB_RAW/mcuconf.h @@ -65,6 +65,7 @@ #define STM32_PLLI2SP_VALUE 4 #define STM32_PLLI2SQ_VALUE 4 #define STM32_PLLI2SR_VALUE 4 +#define STM32_PLLI2SDIVQ_VALUE 2 #define STM32_PLLSAIN_VALUE 192 #define STM32_PLLSAIP_VALUE 4 #define STM32_PLLSAIQ_VALUE 4 -- cgit v1.2.3