• AVR Freaks

Hot!Linker placing data at invalid addresses

Author
JoseColin
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2015/11/16 12:18:30
  • Location: 0
  • Status: offline
2020/07/02 03:07:25 (permalink)
4 (1)

Linker placing data at invalid addresses

 
Hello, I have the problem that the IPE tool was issuing a warning about data being outside valid addresses for the PIC18F46k22. Reviewing the HEX file I found that the linker placed data at invalid addresses.
 
I edited the hex file and removed my application, just left first and last addresses.
What I found is that there is some code generated at the address 0x1E000 and that was triggering the warning, you can see it at the line with the instruction ":020000040001F9". At first I missunderstood these addresses and thought were part of Eeprom, now realize that it is in an invalid address for this PIC.
 
The question is why the linker is placing code at these addresses. It just does not make any sense!
I searched in my code and I did not set any data in that range. It is unimplemented and the data sheet specifies that it reads 0.
 
I am working with the MPLABx IDE v5.25 and The compiler XC8 (v1.36) and PRO operation mode.
 
Greeings,
José E. Colín
#1

2 Replies Related Threads

    1and0
    Access is Denied
    • Total Posts : 10999
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Linker placing data at invalid addresses 2020/07/02 07:04:19 (permalink)
    0 (2)
    JoseColin
     
    I am working with the MPLABx IDE v5.25 and The compiler XC8 (v1.36) and PRO operation mode.

    The latest XC8 is version 2.20.
    #2
    mad_c
    Super Member
    • Total Posts : 1249
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: Linker placing data at invalid addresses 2020/07/02 14:17:02 (permalink)
    +1 (1)
    JoseColin
     
    The question is why the linker is placing code at these addresses.

    Good question, but the HEX file you attached will tell everyone what happened but not answer why. What does the map file say? Does it list a psect at the address you indicated? Do the memory ranges defined by the linker options seem reasonable for that device? Your actual project might be required to find out what has been placed where.
     
    Jeff.
     
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5