diff --git a/os/hal/platforms/STM32/mac_lld.c b/os/hal/platforms/STM32/mac_lld.c index aff58342e..2799aab85 100644 --- a/os/hal/platforms/STM32/mac_lld.c +++ b/os/hal/platforms/STM32/mac_lld.c @@ -41,7 +41,11 @@ #define BUFFER_SIZE ((((STM32_MAC_BUFFERS_SIZE - 1) | 3) + 1) / 4) /* MII divider optimal value.*/ -#if (STM32_HCLK >= 60000000) +#if (STM32_HCLK >= 150000000) +#define MACMIIDR_CR ETH_MACMIIAR_CR_Div102 +#elif (STM32_HCLK >= 100000000) +#define MACMIIDR_CR ETH_MACMIIAR_CR_Div62 +#elif (STM32_HCLK >= 60000000) #define MACMIIDR_CR ETH_MACMIIAR_CR_Div42 #elif (STM32_HCLK >= 35000000) #define MACMIIDR_CR ETH_MACMIIAR_CR_Div26 diff --git a/os/hal/platforms/STM32F2xx/hal_lld.h b/os/hal/platforms/STM32F2xx/hal_lld.h index e704b7fa2..4d63324ce 100644 --- a/os/hal/platforms/STM32F2xx/hal_lld.h +++ b/os/hal/platforms/STM32F2xx/hal_lld.h @@ -221,10 +221,10 @@ #define STM32_MCO1PRE_MASK (7 << 24) /**< MCO1PRE mask. */ #define STM32_MCO1PRE_DIV1 (0 << 24) /**< MCO1 divided by 1. */ -#define STM32_MCO1PRE_DIV2 (1 << 24) /**< MCO1 divided by 2. */ -#define STM32_MCO1PRE_DIV3 (2 << 24) /**< MCO1 divided by 3. */ -#define STM32_MCO1PRE_DIV4 (3 << 24) /**< MCO1 divided by 4. */ -#define STM32_MCO1PRE_DIV5 (4 << 24) /**< MCO1 divided by 5. */ +#define STM32_MCO1PRE_DIV2 (4 << 24) /**< MCO1 divided by 2. */ +#define STM32_MCO1PRE_DIV3 (5 << 24) /**< MCO1 divided by 3. */ +#define STM32_MCO1PRE_DIV4 (6 << 24) /**< MCO1 divided by 4. */ +#define STM32_MCO1PRE_DIV5 (7 << 24) /**< MCO1 divided by 5. */ #define STM32_MCO2PRE_MASK (7 << 27) /**< MCO2PRE mask. */ #define STM32_MCO2PRE_DIV1 (0 << 27) /**< MCO2 divided by 1. */ diff --git a/os/hal/platforms/STM32F4xx/hal_lld.h b/os/hal/platforms/STM32F4xx/hal_lld.h index 6cde89012..8c5303350 100644 --- a/os/hal/platforms/STM32F4xx/hal_lld.h +++ b/os/hal/platforms/STM32F4xx/hal_lld.h @@ -216,10 +216,10 @@ #define STM32_MCO1PRE_MASK (7 << 24) /**< MCO1PRE mask. */ #define STM32_MCO1PRE_DIV1 (0 << 24) /**< MCO1 divided by 1. */ -#define STM32_MCO1PRE_DIV2 (1 << 24) /**< MCO1 divided by 2. */ -#define STM32_MCO1PRE_DIV3 (2 << 24) /**< MCO1 divided by 3. */ -#define STM32_MCO1PRE_DIV4 (3 << 24) /**< MCO1 divided by 4. */ -#define STM32_MCO1PRE_DIV5 (4 << 24) /**< MCO1 divided by 5. */ +#define STM32_MCO1PRE_DIV2 (4 << 24) /**< MCO1 divided by 2. */ +#define STM32_MCO1PRE_DIV3 (5 << 24) /**< MCO1 divided by 3. */ +#define STM32_MCO1PRE_DIV4 (6 << 24) /**< MCO1 divided by 4. */ +#define STM32_MCO1PRE_DIV5 (7 << 24) /**< MCO1 divided by 5. */ #define STM32_MCO2PRE_MASK (7 << 27) /**< MCO2PRE mask. */ #define STM32_MCO2PRE_DIV1 (0 << 27) /**< MCO2 divided by 1. */ diff --git a/readme.txt b/readme.txt index 36b2dd1bb..42fbb8349 100644 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,10 @@ ***************************************************************************** *** 2.5.0 *** +- FIX: Fixed wrong MAC divider setting in STM32 MAC driver (bug 3531290) + (backported to 2.4.2). +- FIX: Fixed wrong MCO1 divider in STM32F2/F4 HAL (bug 3531289)(backported + to 2.4.2). - FIX: Fixed missing "break" in AVR PAL driver (bug 3530924)(backported to 2.4.2). - FIX: Fixed timeout related race condition in STM32 I2C driver (bug 3530043)