This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU customize

Hello.

During customizing a DFU, but I'm having trouble adding function [nrf_dfu_transports_close] in function [on_ctrl_pt_write].

I'm not now fetching all the c files, only the functions I need.

When I compile I get the following error. Why is that?

section .dfu_trans LMA [0000000000038700,0000000000038707] overlaps section .data LMA [0000000000038700,0000000000038937]

compiler : eclipse(gcc)

mcu : nRF52840

Parents Reply Children
  • If you're not able to upload the .ld file to the case, then please just copy the content of the file and paste it in a "Insert Code" block. (Click Insert -> Insert Code below)

  • There is not nrf52840.ld file attached to this case. 

  • Hi bjorn, I have been busy for the last 3 months.

    I attached .ld file.

    Please check it.

    /* This file is compiler dependent */
    
    /* Entry Point */
    ENTRY(Reset_Handler)
    
    /* Generate a link error if heap and stack don't fit into RAM */
    _start_and_int_stack_size = 0x800; /* Required amount of stack. This NEEDS to be at least 0x800, do not decrease. */
    
    /* The firmware header, used by the application that downloads/programs this application, resides right after
     * the vector table. It would perhaps make more sense to have it first, but the vector table must be aligned 
     * on even 512 bytes, so in order to save some flash memory the header is placed after the vector table.
     */
    _header_start_offset        = 0x200;
    
    /* Specify the memory areas */
    
    MEMORY
    {
      FLASH (rx)           : ORIGIN = 0x00026000, LENGTH = 0xAC000
      FW_FLASH_END         : ORIGIN = 0x000D2000, LENGTH = 0x0       /* end marker */
      STORAGE_DATA (r)     : ORIGIN = 0x000D2000, LENGTH = 0x4000    /* 4 x 4096 bytes */
      STORAGE_DATA_END (r) : ORIGIN = 0x000D6000, LENGTH = 0x0       /* end marker */
      SHARED_DATA (r)      : ORIGIN = 0x000FD000, LENGTH = 0x2000    /* 2 x 4096 bytes */
      SHARED_DATA_END (r)  : ORIGIN = 0x000FF000, LENGTH = 0x0       /* end marker */
      RAM_NVIC (rwx)       : ORIGIN = 0x20004600, LENGTH = 0x100
      RAM (rwx)            : ORIGIN = 0x20004700, LENGTH = (0x40000 - 0x4600 - 0x100 - 0x20 - 0x130)
      RAM_SHARED (rw)      : ORIGIN = 0x2003FEB0, LENGTH = 0x20
      PERSISTENT_RAM(xrw)  : ORIGIN = 0x2003FED0, LENGTH = 0x130
    }
    
    
    SECTIONS
    {
      .text :
      {
        KEEP(*(.isr_vector))    /*  vector table (code) */
                    
        . = _header_start_offset;
        *(.fw_header)           /* Header information of next FW */
        KEEP(*(.fw_header))
    
        . = ALIGN(4);
        *(.text)                /* .text sections (code) */
        *(.text*)               /* .text* sections (code) */
        *(.rodata)              /* .rodata sections (constants, strings, etc.) */
        *(.rodata*)             /* .rodata* sections (constants, strings, etc.) */
        *(.glue_7)              /* glue arm to thumb code */
        *(.glue_7t)             /* glue thumb to arm code */
        *(.eh_frame)
     
        KEEP(*(.init))
        KEEP(*(.fini))
    
        . = ALIGN(4);
        _etext = .;        /* define a global symbols at end of code */
      } > FLASH
     
      /* Names beginning .ARM.exidx name sections containing index entries for section unwinding. 
       * Names beginning .ARM.extab name sections containing exception unwinding information.   */
      .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
      .ARM : {
         __exidx_start = .;
        *(.ARM.exidx*)
        __exidx_end = .;
      } >FLASH
            
      .note.gnu.build-id : 
      { 
        PROVIDE( __gnuBuildId = . );
        *(.note.gnu.build-id) 
      } > FLASH
        
      .systemControlInitList :
      {
        PROVIDE( __systemControlInitList_start = . );
        KEEP( *(.systemControlInitList))
        PROVIDE( __systemControlInitList_end = . );
      } >FLASH
    
      .mbsConsoleCmdList :
      {
        PROVIDE( __mbsConsoleCmdList_start = . );
        KEEP( *(.mbsConsoleCmdList))
        PROVIDE( __mbsConsoleCmdList_end = . );
      } >FLASH
    
      .systemControlEvHandlerList :
      {
        PROVIDE( __systemControlEvHandlerList_start = . );
        KEEP( *(.systemControlEvHandlerList))
        PROVIDE( __systemControlEvHandlerList_end = . );
      } >FLASH
    
      .eventDispatcherList :
      {
        PROVIDE( __eventDispatcherList_start = . );
        KEEP( *(.eventDispatcherList))
        PROVIDE( __eventDispatcherList_end = . );
      } >FLASH
      
      .sdh_soc_observers :
      {
        PROVIDE(__start_sdh_soc_observers = .);
        KEEP(*(SORT(.sdh_soc_observers*)))
        PROVIDE(__stop_sdh_soc_observers = .);
      } > FLASH
    
      .pwr_mgmt_data :
      {
        PROVIDE(__start_pwr_mgmt_data = .);
        KEEP(*(SORT(.pwr_mgmt_data*)))
        PROVIDE(__stop_pwr_mgmt_data = .);
      } > FLASH
      .sdh_stack_observers :
      {
        PROVIDE(__start_sdh_stack_observers = .);
        KEEP(*(SORT(.sdh_stack_observers*)))
        PROVIDE(__stop_sdh_stack_observers = .);
      } > FLASH
    
      .sdh_req_observers :
      {
        PROVIDE(__start_sdh_req_observers = .);
        KEEP(*(SORT(.sdh_req_observers*)))
        PROVIDE(__stop_sdh_req_observers = .);
      } > FLASH
    
      .sdh_state_observers :
      {
        PROVIDE(__start_sdh_state_observers = .);
        KEEP(*(SORT(.sdh_state_observers*)))
        PROVIDE(__stop_sdh_state_observers = .);
      } > FLASH
    
      .sdh_ble_observers :
      {
        PROVIDE(__start_sdh_ble_observers = .);
        KEEP(*(SORT(.sdh_ble_observers*)))
        PROVIDE(__stop_sdh_ble_observers = .);
      } > FLASH
      
      __etext = .;
      
      .storageData :
      {
        __STORAGE_DATA_START__ = .; /* define global symbol for end of storage data section. */  
      } >STORAGE_DATA
    
      .storageDataEnd :
      {
        __STORAGE_DATA_END__ = .; /* define global symbol for start of storage data section. */  
      } >STORAGE_DATA_END
    
      .sharedData :
      {
        __SHARED_DATA_START__ = .; /* define global symbol for start of shared data section. */  
      } >SHARED_DATA
      
      .sharedDataEnd :
      {
        __SHARED_DATA_END__ = .; /* define global symbol for end of shared data section. */  
      } >SHARED_DATA_END
      
      .data : AT (__etext)
      {
        . = ALIGN(4);
        _sdata = .;        /* create a global symbol at data start */
        __data_start__ = .;
        *(.data)           /* .data sections */
        *(.data*)
        *(.RamFunc)        /* .RamFunc sections */
        
        . = ALIGN(4);
        _edata = .;        /* define a global symbol at data end */
      } > RAM
    
      .bss :
      {
        . = ALIGN(4);
        _sbss = .;         /* define a global symbol at bss start */
        __bss_start__ = _sbss;
        *(.bss)
        *(.bss*)
        *(COMMON)
    
        . = ALIGN(4);
        _ebss = .;         /* define a global symbol at bss end */
        __bss_end__ = _ebss;
      } > RAM
      
      PROVIDE ( end = _ebss );
      PROVIDE ( _end = _ebss );
    
      .nvictable (NOLOAD) :
      {
        PROVIDE(__start_nvictable = .);
        KEEP(*(.nvictable))
        PROVIDE(__stop_nvictable = .);
      } > RAM_NVIC
    
      .noinit (NOLOAD) :
      {
        PROVIDE(__start_noinit = .);
        KEEP(*(.noinit))
        PROVIDE(__stop_noinit = .);
      } > RAM
      
      /* Start_and_int_stack section
       * NOTE this is only used to check that there is enough RAM left,
       * the stack will in reality be located elsewhere so that it starts at the highest 
       * address _estack and ends at (_estack - _start_and_int_stack_size)
       */
       
      ._start_and_int_stack_size_reservation :
      {
        . = ALIGN(4);
        . = . + _start_and_int_stack_size;
        . = ALIGN(4);
      } >RAM
         
      .intBinRamVarsSection (NOLOAD) :
      {
        . = ALIGN(4);
        *(.intBinRamVarsSection)
        . = ALIGN(4);
      } >RAM_SHARED
      
      /* Persistent (not even zeroed) RAM section */
      .persistent_ram (NOLOAD) :
      {
        *(.persistent_ram)
      } >PERSISTENT_RAM
        
        /* Set the stack top to the end of RAM and move down the stack limit by
         * the size of the stack_dummy section. */
        __StackTop = ORIGIN(RAM) + LENGTH(RAM);
        __StackLimit = __StackTop - SIZEOF(._start_and_int_stack_size_reservation);
        PROVIDE(__stack = __StackTop);
    
      /* Remove information from the standard libraries */
      /DISCARD/ :      
      {                
        libc.a ( * )
        libm.a ( * )
        libgcc.a ( * )
      }
      /* Build attributes are encoded in a section of type SHT_ARM_ATTRIBUTES, and name .ARM.attributes. */
      .ARM.attributes 0 : { *(.ARM.attributes) }
    }
    

Related