STM32_FLASHBITS Error
Posted: Tue Dec 03, 2013 10:27 am
Hi, sometimes I like to overclock the MCUs and found the errornous settings of STM32_FLASHBITS:
In line 1637 the value 0x00000008 of STM32_FLASHBITS is out of valid range from 0 to 7. Although in normal situation this value not used but in my case this was the rison the MCU locks!
By the way, STM processors excellent overclocked and has a lot of hidden abilities!
Code: Select all
os/hal/platforms/STM32F4xx/hal_lld.h
...
1617 /**
1618 * @brief Flash settings.
1619 */
1620 #if (STM32_HCLK <= STM32_0WS_THRESHOLD) || defined(__DOXYGEN__)
1621 #define STM32_FLASHBITS 0x00000000
1622 #elif STM32_HCLK <= STM32_1WS_THRESHOLD
1623 #define STM32_FLASHBITS 0x00000001
1624 #elif STM32_HCLK <= STM32_2WS_THRESHOLD
1625 #define STM32_FLASHBITS 0x00000002
1626 #elif STM32_HCLK <= STM32_3WS_THRESHOLD
1627 #define STM32_FLASHBITS 0x00000003
1628 #elif STM32_HCLK <= STM32_4WS_THRESHOLD
1629 #define STM32_FLASHBITS 0x00000004
1630 #elif STM32_HCLK <= STM32_5WS_THRESHOLD
1631 #define STM32_FLASHBITS 0x00000005
1632 #elif STM32_HCLK <= STM32_6WS_THRESHOLD
1633 #define STM32_FLASHBITS 0x00000006
1634 #elif STM32_HCLK <= STM32_7WS_THRESHOLD
1635 #define STM32_FLASHBITS 0x00000007
1636 #else
1637 #define STM32_FLASHBITS 0x00000008
1638 #endif
...
In line 1637 the value 0x00000008 of STM32_FLASHBITS is out of valid range from 0 to 7. Although in normal situation this value not used but in my case this was the rison the MCU locks!
By the way, STM processors excellent overclocked and has a lot of hidden abilities!