diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-23 10:35:16 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-23 10:35:16 +0000 |
commit | 5089bc85d642f39214d43045c685709632a86c68 (patch) | |
tree | a29fc675f538c5498a85720ef50a87ce93574fc9 /os | |
parent | 64431d076bc0c3415b54960a518289ec99ef9cbd (diff) | |
download | ChibiOS-5089bc85d642f39214d43045c685709632a86c68.tar.gz ChibiOS-5089bc85d642f39214d43045c685709632a86c68.tar.bz2 ChibiOS-5089bc85d642f39214d43045c685709632a86c68.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4956 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32F4xx/hal_lld.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32F4xx/hal_lld.c b/os/hal/platforms/STM32F4xx/hal_lld.c index 521a1723a..80bea7b51 100644 --- a/os/hal/platforms/STM32F4xx/hal_lld.c +++ b/os/hal/platforms/STM32F4xx/hal_lld.c @@ -208,14 +208,19 @@ void stm32_clock_init(void) { RCC->CFGR |= STM32_MCO2PRE | STM32_MCO2SEL | STM32_MCO1PRE | STM32_MCO1SEL |
STM32_RTCPRE | STM32_PPRE2 | STM32_PPRE1 | STM32_HPRE;
- /* Flash setup.
- Some old revisions of F4x MCUs randomly crashes with compiler
+ /* Flash setup.*/
+#if defined(STM32_USE_REVISION_A_FIX)
+ /* Some old revisions of F4x MCUs randomly crashes with compiler
optimizations enabled AND flash caches enabled. */
if ((DBGMCU->IDCODE == 0x20006411) && (SCB->CPUID == 0x410FC241))
FLASH->ACR = FLASH_ACR_PRFTEN | STM32_FLASHBITS;
else
FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN |
FLASH_ACR_DCEN | STM32_FLASHBITS;
+#else
+ FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN |
+ FLASH_ACR_DCEN | STM32_FLASHBITS;
+#endif
/* Switching to the configured clock source if it is different from MSI.*/
#if (STM32_SW != STM32_SW_HSI)
|