stm32h7: do bss/data setup in crt0 for bootloader only

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit bd73e0dd42d431b10fbd75ff147ede3d1949ade2
Author: Aidan MacDonald <[email protected]>
Date:   Thu Jan 22 13:36:40 2026 +0000

    stm32h7: do bss/data setup in crt0 for bootloader only
    
    Change-Id: I67798a4370b01127364c40328549a6d3081545cf

diff --git a/firmware/target/arm/stm32/crt0-stm32h7.S b/firmware/target/arm/stm32/crt0-stm32h7.S
index 6be820c390..8c8c8d082d 100644
--- a/firmware/target/arm/stm32/crt0-stm32h7.S
+++ b/firmware/target/arm/stm32/crt0-stm32h7.S
@@ -52,9 +52,15 @@ reset_handler:
     b       crt0_start
 
 
-    .global start
-    .type start, function
+    .global crt0_start
+    .type crt0_start, function
 crt0_start:
+#ifdef BOOTLOADER
+    /*
+     * Initialize data/bss for bootloader
+     * (not needed on app since ELF loader takes care of it)
+     */
+
     /* Zero out BSS */
     ldr     a1, =_bssbegin
     ldr     a2, =_bssend
@@ -66,6 +72,7 @@ crt0_start:
     ldr     a2, =_dataend
     ldr     a3, =_datacopy
     bl      crt0_area_copy
+#endif
 
     /* Clear the main thread stack */
     ldr     a1, =stackbegin
@@ -96,6 +103,7 @@ crt0_start:
     b       main
 
 
+#ifdef BOOTLOADER
     .local crt0_area_copy
     .type crt0_area_copy, function
 /* crt0_area_copy(uint32_t *dst, uint32_t *dst_end, const void *src) */
@@ -105,7 +113,7 @@ crt0_area_copy:
     strhi   v1, [a1], #4
     bhi     crt0_area_copy
     bx      lr
-
+#endif
 
     .local crt0_area_clear
     .type crt0_area_clear, function
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.