You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ra...@apache.org on 2024/02/23 05:11:33 UTC

(nuttx) branch master updated: stm32/stm32f30xxx_rcc.c: fix broken flash setup

This is an automated email from the ASF dual-hosted git repository.

raiden00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new aa75b7f27c stm32/stm32f30xxx_rcc.c: fix broken flash setup
aa75b7f27c is described below

commit aa75b7f27c0e17394e6498eae8e03b567069ca7f
Author: Michał Łyszczek <mi...@bofc.pl>
AuthorDate: Thu Feb 22 18:32:46 2024 +0100

    stm32/stm32f30xxx_rcc.c: fix broken flash setup
    
    During removal of F1 related stuff, code that configures FLASH
    latency was removed, which rendered some of the F3 line unbootable.
    
    It was done by mistake, since previous removed block was
    '#ifdef VALUE_LINE', and block with FLASH code was '#ifndef VALUE_LINE'
    and so it should not have been removed.
    
    Signed-off-by: Michał Łyszczek <mi...@bofc.pl>
---
 arch/arm/src/stm32/stm32f30xxx_rcc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/src/stm32/stm32f30xxx_rcc.c b/arch/arm/src/stm32/stm32f30xxx_rcc.c
index 7b4f6ca258..a6daf9dece 100644
--- a/arch/arm/src/stm32/stm32f30xxx_rcc.c
+++ b/arch/arm/src/stm32/stm32f30xxx_rcc.c
@@ -476,6 +476,13 @@ static void stm32_stdclockconfig(void)
 
 #endif
 
+  /* Enable FLASH prefetch buffer and set FLASH wait states */
+
+  regval  = getreg32(STM32_FLASH_ACR);
+  regval &= ~FLASH_ACR_LATENCY_MASK;
+  regval |= (FLASH_ACR_LATENCY_SETTING | FLASH_ACR_PRTFBE);
+  putreg32(regval, STM32_FLASH_ACR);
+
   /* Set the HCLK source/divider */
 
   regval = getreg32(STM32_RCC_CFGR);