• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: pic32mk使用debug時overlaps section reserve_data_0_kseg0
#2
管理員
管理員


查看用戶資訊
這有點難度, 一般在除錯模式下, 會使用內部沒有開放的記憶體空間來輔助除錯功能.
所以改動 link 的設定, 會直接衝擊到除錯功能, 是完全不建議這樣使用的.

發表於: 2023/8/25 14:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


pic32mk使用debug時overlaps section reserve_data_0_kseg0
#1
初級會員
初級會員


查看用戶資訊
各位新進大家好, 我這邊有一個問題需要協助
我使用
1. 晶片:pic32mk1024mcm100
2. IDE版本: v6.05
3. complier版本: XC32 v4.10

我使用保留前段ram給classb以及blt pattern做使用
在一般使用不會報錯,但是使用debug就會跑出overlaps section:
section .shared VMA [0000000080000008,00000000800001ffoverlaps section reserve_data_0_kseg0 VMA [0000000080000000,000000008000036f]


我找不到"reserve_data_0_kseg0 "的實際定址的地方
以下是我修改的局部linker script:
MEMORY
{
...
  
SHARED               (w!x)  : ORIGIN 0x80000008LENGTH 0x200 0x8
  kseg0_data_mem       
(w!x)  : ORIGIN 0x80000400LENGTH 0x40000 0x400
...
}

/*************************************************************************
 * Configuration-word sections. Map the config-pragma input sections to
 * absolute-address output sections.
 *************************************************************************/
SECTIONS
{
  .
shared (NOLOAD) :
  {
    . = 
ALIGN(4);
    
_sshared = .;
    
__shared_start__ _sshared;
    *(.
shared)
    *(.
shared.*)
    
KEEP(*(.shared)) 
    . = 
ALIGN(4);
    
_eshared = .;
    
__shared_end__ _eshared;
  } >
SHARED
...
}


其他沒有變動的用"..."表示

以下是我覺得可能有overlap的section但我不確定是哪一個造成的:
SECTIONS
{
...
  .
dbg_data (NOLOAD) :
  {
    . += (
DEFINED (_DEBUGGER) ? 0x200 0x0);
    
/* Additional data memory required for DSPr2 registers */
    
. += (DEFINED (_DEBUGGER) ? 0x80 0x0);
    
/* Additional data memory required for FPU64 registers */
    
. += (DEFINED (_DEBUGGER) ? 0x100 0x0);
  } >
kseg0_data_mem
  
.jcr   :
  {
    
KEEP (*(.jcr))
    . = 
ALIGN(4) ;
  } >
kseg0_data_mem
  
.eh_frame    ONLY_IF_RW
  
{
    
KEEP (*(.eh_frame))
  } >
kseg0_data_mem
    
. = ALIGN(4) ;
  .
gcc_except_table    ONLY_IF_RW
  
{
    *(.
gcc_except_table .gcc_except_table.*)
  } >
kseg0_data_mem
    
. = ALIGN(4) ;
  
/* Persistent data - Use the new C 'persistent' attribute instead. */
  
.persist   :
  {
    
_persist_begin = .;
    *(.
persist .persist.*)
    . = 
ALIGN(4) ;
    
_persist_end = .;
  } >
kseg0_data_mem
  
/*
   *  Note that input sections named .data* are not mapped here.
   *  The best-fit allocator locates them, so that they may flow
   *  around absolute sections as needed.
   */
  
.data   :
  {
    *( .
gnu.linkonce.d.*)
    
SORT(CONSTRUCTORS)
    *(.
data1)
    . = 
ALIGN(4) ;
  } >
kseg0_data_mem
  
. = .;
  
_gp ALIGN(16) + 0x7ff0;
  .
got ALIGN(4) :
  {
    *(.
got.plt) *(.got)
    . = 
ALIGN(4) ;
  } >
kseg0_data_mem /* AT>kseg0_program_mem */
  /*
   * Note that 'small' data sections are still mapped in the linker
   * script. This ensures that they are grouped together for
   * gp-relative addressing. Absolute sections are allocated after
   * the 'small' data sections so small data cannot flow around them.
   */
  /*
   * We want the small data sections together, so single-instruction offsets
   * can access them all, and initialized data all before uninitialized, so
   * we can shorten the on-disk segment size.
   */
  
.sdata ALIGN(4) :
  {
    
_sdata_begin = . ;
    *(.
sdata .sdata.* .gnu.linkonce.s.*)
    . = 
ALIGN(4) ;
    
_sdata_end = . ;
  } >
kseg0_data_mem
  
.lit8           :
  {
    *(.
lit8)
  } >
kseg0_data_mem
  
.lit4           :
  {
    *(.
lit4)
  } >
kseg0_data_mem
  
. = ALIGN (4) ;
  
_data_end = . ;
  
_bss_begin = . ;
  .
sbss ALIGN(4) :
  {
    
_sbss_begin = . ;
    *(.
dynsbss)
    *(.
sbss .sbss.* .gnu.linkonce.sb.*)
    *(.
scommon)
    
_sbss_end = . ;
    . = 
ALIGN(4) ;
  } >
kseg0_data_mem
  
/*
   *  Align here to ensure that the .bss section occupies space up to
   *  _end.  Align after .bss to ensure correct alignment even if the
   *  .bss section disappears because there are no input sections.
   *
   *  Note that input sections named .bss* are no longer mapped here.
   *  The best-fit allocator locates them, so that they may flow
   *  around absolute sections as needed.
   *
   */
  
.bss     :
  {
    *(.
dynbss)
    *(
COMMON)
   
/* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections. */
   
. = ALIGN(. != 1);
  } >
kseg0_data_mem
  
. = ALIGN(4) ;
  
_end = . ;
  
_bss_end = . ;
  
/*
   *  The heap and stack are best-fit allocated by the linker after other
   *  data and bss sections have been allocated.
   */
  /*
   * RAM functions go at the end of our stack and heap allocation.
   * Alignment of 2K required by the boundary register (BMXDKPBA).
   *
   * RAM functions are now allocated by the linker. The linker generates
   * _ramfunc_begin and _bmxdkpba_address symbols depending on the
   * location of RAM functions.
   */
  
_bmxdudba_address LENGTH(kseg0_data_mem) ;
  
_bmxdupba_address LENGTH(kseg0_data_mem) ;
    
/* The .pdr section belongs in the absolute section */
    
/DISCARD/ : { *(.pdr) }
  .
gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  .
gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
  .
mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
  .
mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
  .
mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
  .
mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
  .
mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
  .
mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
  .
gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
  .
gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
  
/* Stabs debugging sections.  */
  
.stab          0 : { *(.stab) }
  .
stabstr       0 : { *(.stabstr) }
  .
stab.excl     0 : { *(.stab.excl) }
  .
stab.exclstr  0 : { *(.stab.exclstr) }
  .
stab.index    0 : { *(.stab.index) }
  .
stab.indexstr 0 : { *(.stab.indexstr) }
  .
comment       0 : { *(.comment) }
  
/* DWARF debug sections used by MPLAB X for source-level debugging. 
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  
.debug          0 : { *.elf(.debug) *(.debug) }
  .
line           0 : { *.elf(.line) *(.line) }
  
/* GNU DWARF 1 extensions */
  
.debug_srcinfo  0 : { *.elf(.debug_srcinfo) *(.debug_srcinfo) }
  .
debug_sfnames  0 : { *.elf(.debug_sfnames) *(.debug_sfnames) }
  
/* DWARF 1.1 and DWARF 2 */
  
.debug_aranges  0 : { *.elf(.debug_aranges) *(.debug_aranges) }
  .
debug_pubnames 0 : { *.elf(.debug_pubnames) *(.debug_pubnames) }
  
/* DWARF 2 */
  
.debug_info     0 : { *.elf(.debug_info .gnu.linkonce.wi.*) *(.debug_info .gnu.linkonce.wi.*) }
  .
debug_abbrev   0 : { *.elf(.debug_abbrev) *(.debug_abbrev) }
  .
debug_line     0 : { *.elf(.debug_line) *(.debug_line) }
  .
debug_frame    0 : { *.elf(.debug_frame) *(.debug_frame) }
  .
debug_str      0 : { *.elf(.debug_str) *(.debug_str) }
  .
debug_loc      0 : { *.elf(.debug_loc) *(.debug_loc) }
  .
debug_macinfo  0 : { *.elf(.debug_macinfo) *(.debug_macinfo) }
  
/* SGI/MIPS DWARF 2 extensions */
  
.debug_weaknames 0 : { *.elf(.debug_weaknames) *(.debug_weaknames) }
  .
debug_funcnames 0 : { *.elf(.debug_funcnames) *(.debug_funcnames) }
  .
debug_typenames 0 : { *.elf(.debug_typenames) *(.debug_typenames) }
  .
debug_varnames  0 : { *.elf(.debug_varnames) *(.debug_varnames) }
  .
debug_pubtypes 0 : { *.elf(.debug_pubtypes) *(.debug_pubtypes) }
  .
debug_ranges   0 : { *.elf(.debug_ranges) *(.debug_ranges) }
  /
DISCARD/ : { *(.rel.dyn) }
  .
gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /
DISCARD/ : { *(.note.GNU-stack) }
  /
DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.discard) }
}

發表於: 2023/8/4 9:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------