File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010-  Mark ` pre_init `  as deprecated
1111-  Add ` set_msplim `  feature to conditionally set the MSPLIM register at device
1212  reset ([ #580  ] ).
13+ -  Add ` skip-data-copy `  feature to prevent copying the ` .data `  section from the 
14+   load address to the virtual address. Use when the load address is inaccessible 
15+   by the time user code runs, such as when copying from flash or when booting
16+   from an external device. Note that this relies on the bootloader to have already
17+   copied ` .data `  to the VMA before relinquishing control.
1318
1419## [ v0.7.5]  
1520
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ set-vtor = []
4848set-msplim  = []
4949zero-init-ram  = []
5050paint-stack  = []
51+ skip-data-copy  = []
5152
5253[package .metadata .docs .rs ]
5354features  = [" device" 
Original file line number Diff line number Diff line change 220220//! You can then inspect memory during debugging to determine how much of the stack has been used - 
221221//! where the stack has been used the 'paint' will have been 'scrubbed off' and the memory will 
222222//! have a value other than `STACK_PAINT_VALUE`. 
223+ //!  
224+ //! ## `skip-data-copy` 
225+ //!  
226+ //! Skips copying the .data section (containing the initial values for static variables) when a bootloader 
227+ //! (or other mechanism) is responsible for initializing the section. Use when the code is loaded from a location 
228+ //! that's invalid after the bootloader runs (e.g. copy-from-XIP or copy-from-network boot). For example, 
229+ //! rp2040-boot2 with `BOOT_LOADER_RAM_MEMCPY` (not the default of boot2!) set, which copies the code out 
230+ //! of the XIP flash memory and then disables the XIP peripheral afterwards. 
223231//! 
224232//! # Inspection 
225233//! 
@@ -616,6 +624,7 @@ cfg_global_asm! {
616624     1:" , 
617625
618626    // Initialise .data memory. `__sdata`, `__sidata`, and `__edata` come from the linker script. 
627+     #[ cfg( not( feature = "skip-data-copy" ) ) ] 
619628    "ldr r0, =__sdata 
620629     ldr r1, =__edata 
621630     ldr r2, =__sidata 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments