Просмотр исходного кода

Merge branch 'bugfix/prefetch_invalid_v4.1' into 'release/v4.1'

soc: add dummy bytes to ensure instr prefetch always valid (v4.1)

See merge request espressif/esp-idf!12995
Zim Kalinowski 4 лет назад
Родитель
Сommit
80727f739a

+ 8 - 0
components/bootloader/subproject/main/ld/esp32/bootloader.ld

@@ -165,6 +165,14 @@ SECTIONS
     *(.fini.literal)
     *(.fini)
     *(.gnu.version)
+
+    /** CPU will try to prefetch up to 16 bytes of
+      * of instructions. This means that any configuration (e.g. MMU, PMS) must allow
+      * safe access to up to 16 bytes after the last real instruction, add
+      * dummy bytes to ensure this
+      */
+    . += 16;
+
     _text_end = ABSOLUTE(.);
     _etext = .;
   } > iram_seg

+ 8 - 0
components/bootloader/subproject/main/ld/esp32s2beta/bootloader.ld

@@ -157,6 +157,14 @@ SECTIONS
     *(.fini.literal)
     *(.fini)
     *(.gnu.version)
+
+    /** CPU will try to prefetch up to 16 bytes of
+      * of instructions. This means that any configuration (e.g. MMU, PMS) must allow
+      * safe access to up to 16 bytes after the last real instruction, add
+      * dummy bytes to ensure this
+      */
+    . += 16;
+
     _text_end = ABSOLUTE(.);
     _etext = .;
   } > iram_seg

+ 8 - 0
components/esp32/ld/esp32.project.ld.in

@@ -324,6 +324,14 @@ SECTIONS
     *(.fini.literal)
     *(.fini)
     *(.gnu.version)
+
+    /** CPU will try to prefetch up to 16 bytes of
+      * of instructions. This means that any configuration (e.g. MMU, PMS) must allow
+      * safe access to up to 16 bytes after the last real instruction, add
+      * dummy bytes to ensure this
+      */
+    . += 16;
+
     _text_end = ABSOLUTE(.);
     _etext = .;
 

+ 8 - 0
components/esp32s2beta/ld/esp32s2beta.project.ld.in

@@ -321,6 +321,14 @@ SECTIONS
     *(.fini.literal)
     *(.fini)
     *(.gnu.version)
+
+    /** CPU will try to prefetch up to 16 bytes of
+      * of instructions. This means that any configuration (e.g. MMU, PMS) must allow
+      * safe access to up to 16 bytes after the last real instruction, add
+      * dummy bytes to ensure this
+      */
+    . += 16;
+
     _text_end = ABSOLUTE(.);
     _etext = .;