• AVR Freaks

Hot!About linker and debug

Author
Roibert
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2021/02/09 03:24:37
  • Location: 0
  • Status: offline
2021/02/11 03:59:34 (permalink)
0

About linker and debug

Dear Forum
 
I cant understand why in debug mode the linker file is different that in release mode.
And what is the debug exception vector ?
 
Maybe con you suggest also some document that explay more about debugging.
 
Thanks for reply, 
 
Roberto
 
#1

7 Replies Related Threads

    andersm
    Super Member
    • Total Posts : 2892
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: About linker and debug 2021/02/11 08:38:00 (permalink)
    4 (1)
    In the MPLAB X documentation there's a section about resources reserved by the debugger. The linker scripts are set up to avoid the reserved memory regions when debugging. The debug exception vector is used by the EJTAG interface.
    #2
    NorthGuy
    Super Member
    • Total Posts : 6523
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: About linker and debug 2021/02/11 09:21:58 (permalink)
    0
    On some of PIC32, debugging requires resources, which need to be reserved.
     
    You can find the documentation on the debug vector and similar stuff in MIPS docs. The EJTAG interface to the CPU is described in MD00047-2B-EJTAG-SPC-03.10.pdf
    #3
    Roibert
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2021/02/09 03:24:37
    • Location: 0
    • Status: offline
    Re: About linker and debug 2021/02/11 13:56:41 (permalink)
    0
    Thanks for reply
     
    So, I find in the documentation ,that resource are:
    1FC00_0480 -1FC00_0487
    1FC00_2000 -1FC00_2FF0
    and also a part of RAM 0000 -01FC
     
    Now, comparing the 2 linker sript, i can see this:
     
    a) in both linker ,there is in MEMORY command section:
    debug_exec_mem              : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
      This seems clear...Declare this area whit a name for debug
     
    b) In the debug linker i find:
     kseg0_program_mem     (rx)  : ORIGIN = 0x9D000000, LENGTH = 0x80000
    and in the release :
    kseg0_program_mem     (rx)  : ORIGIN = (0x9D000000+0x1000+0x490), LENGTH = (0x80000-(0x1000+0x490)-8) /* the last 8 byte are reserved to checksum */
     
    This is not clear.???
    Kseg0 PMem start from 9D00_0000. Why in release change ??
     
    Same question on  
    kseg0_boot_mem              : ORIGIN = 0x9FC00490, LENGTH = 0x970
     
     
    Thanks and excuse for long question
     
    Roberto
     

     
     
     
    #4
    andersm
    Super Member
    • Total Posts : 2892
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: About linker and debug 2021/02/11 14:11:37 (permalink)
    0
    Are you using a custom linker script? I guess that the release build is meant to be used with a boot loader that occupies the start of flash.
    #5
    Roibert
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2021/02/09 03:24:37
    • Location: 0
    • Status: offline
    Re: About linker and debug 2021/02/19 03:39:12 (permalink)
    0
    Excuse me.. I belive I did a mistake.
     
    The linker file i posted are modified by ex collegue...I belive was the original file.
     
    Again excuse.
     
    So, where is the linker used for debug, and linker used for release.
    In this path :
     
    C:\Program Files (x86)\Microchip\xc32\v2.30\pic32mx\lib\proc\32MX320F128L
     
    i find some linker script, but no mention about who is used for what.
     
    Simple question remain what area the debug use , that i must avoid to touch in debug mode.
     
    Thnaks Again
     
    Roberto
     
    #6
    Roibert
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2021/02/09 03:24:37
    • Location: 0
    • Status: offline
    Re: About linker and debug 2021/02/23 06:20:31 (permalink)
    0
    No News ? 
     
    Thanks
    #7
    jdeguire
    Super Member
    • Total Posts : 623
    • Reward points : 0
    • Joined: 2012/01/13 07:48:44
    • Location: United States
    • Status: offline
    Re: About linker and debug 2021/02/23 11:36:57 (permalink)
    4 (1)
    You don't need a separate linker script for debugging; the one you found in the XC32 directory will handle both. If you're trying to make a custom linker script, then don't mess with the stuff with "debug" in their names and you should be fine.
    #8
    Jump to:
    © 2021 APG vNext Commercial Version 4.5