You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2022/10/07 18:57:33 UTC

[mynewt-core] branch master updated (1975e9eba -> 50e5c174b)

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

jerzy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


    from 1975e9eba bsp/pca100121: Init on board pins
     new 84f4a8cd6 mcu/stm32f7: Remove inapplicable flash cache calls
     new 8e2c5aeb5 mcu/stm32f7: Add way to enable DCache
     new 50e5c174b mcu/stm32f7: Move __vector_tbl_reloc__ to DTCM

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c | 15 +++------------
 hw/mcu/stm/stm32f7xx/stm32f746.ld          |  2 +-
 hw/mcu/stm/stm32f7xx/stm32f767.ld          |  2 +-
 hw/mcu/stm/stm32f7xx/syscfg.yml            |  4 ++++
 4 files changed, 9 insertions(+), 14 deletions(-)


[mynewt-core] 01/03: mcu/stm32f7: Remove inapplicable flash cache calls

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 84f4a8cd6dcc7879571ac6f31664cfcfe93605e3
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Oct 6 18:59:27 2022 +0200

    mcu/stm32f7: Remove inapplicable flash cache calls
    
    __HAL_FLASH_INSTRUCTION_CACHE_ENABLE and __HAL_FLASH_DATA_CACHE_ENABLE
    are not applicable for STM32F7 devices, those are for F2, F4, L4
---
 hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c b/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
index de97fe0be..8ff91bd45 100644
--- a/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
+++ b/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
@@ -258,17 +258,5 @@ SystemClock_Config(void)
 #if PREFETCH_ENABLE
     __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
 #endif
-
-    /*
-     * These are flash instruction and data caches, not the be confused with
-     * MCU caches.
-     */
-#if INSTRUCTION_CACHE_ENABLE
-    __HAL_FLASH_INSTRUCTION_CACHE_ENABLE();
-#endif
-
-#if DATA_CACHE_ENABLE
-    __HAL_FLASH_DATA_CACHE_ENABLE();
-#endif
 }
 #endif


[mynewt-core] 03/03: mcu/stm32f7: Move __vector_tbl_reloc__ to DTCM

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 50e5c174b980a97102cea55006c67f05e975e0e2
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Oct 6 19:27:07 2022 +0200

    mcu/stm32f7: Move __vector_tbl_reloc__ to DTCM
    
    Relocate interrupt vector table was put SRAM1 which is accessed
    over AXI bus that can be cached.
    It seems that writing to this RAM when DCache in enabled in
    write back mode may result in NVIC using old values that are
    still in RAM and not new values that are in cache written by
    NVIC_SetVector.
    
    Moving vector_table to DTCM allows to have DCache enabled
    from the beginning.
---
 hw/mcu/stm/stm32f7xx/stm32f746.ld | 2 +-
 hw/mcu/stm/stm32f7xx/stm32f767.ld | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/mcu/stm/stm32f7xx/stm32f746.ld b/hw/mcu/stm/stm32f7xx/stm32f746.ld
index f1e78ba65..e1a49b701 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f746.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f746.ld
@@ -133,7 +133,7 @@ SECTIONS
         __vector_tbl_reloc__ = .;
         . = . + (__isr_vector_end - __isr_vector_start);
         . = ALIGN(4);
-    } > RAM
+    } > DTCM
 
     .coredata :
     {
diff --git a/hw/mcu/stm/stm32f7xx/stm32f767.ld b/hw/mcu/stm/stm32f7xx/stm32f767.ld
index f1e78ba65..e1a49b701 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f767.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f767.ld
@@ -133,7 +133,7 @@ SECTIONS
         __vector_tbl_reloc__ = .;
         . = . + (__isr_vector_end - __isr_vector_start);
         . = ALIGN(4);
-    } > RAM
+    } > DTCM
 
     .coredata :
     {


[mynewt-core] 02/03: mcu/stm32f7: Add way to enable DCache

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 8e2c5aeb5aac0a3c7886bc7af4b5b1643c2f494d
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Oct 6 19:13:43 2022 +0200

    mcu/stm32f7: Add way to enable DCache
    
    STM32F7 do have Arm data cache.
    This change add syscfg value that allows to enable this cache
    and code that will enable it during startup.
    
    DCache is not enabled by default for AXI bus to avoid crashes
    till relocated vector table stays in SRAM1.
---
 hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c | 3 +++
 hw/mcu/stm/stm32f7xx/syscfg.yml            | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c b/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
index 8ff91bd45..0a6ce4f30 100644
--- a/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
+++ b/hw/mcu/stm/stm32f7xx/src/clock_stm32f7xx.c
@@ -54,6 +54,9 @@ SystemClock_Config(void)
     SCB_EnableICache();
 #endif
 
+#if MYNEWT_VAL(STM32_ENABLE_DCACHE)
+    SCB_EnableDCache();
+#endif
     /*
      * Enable Power Control clock
      */
diff --git a/hw/mcu/stm/stm32f7xx/syscfg.yml b/hw/mcu/stm/stm32f7xx/syscfg.yml
index 9e42fb5ae..9ba4dd0ab 100644
--- a/hw/mcu/stm/stm32f7xx/syscfg.yml
+++ b/hw/mcu/stm/stm32f7xx/syscfg.yml
@@ -31,6 +31,10 @@ syscfg.defs:
         description: Enable instruction caching
         value: 1
 
+    STM32_ENABLE_DCACHE:
+        description: Enable instruction caching
+        value: 0
+
     STM32_CLOCK_VOLTAGESCALING_CONFIG:
         description: Voltage scale
         value: 0