rm18f87j50.lkr 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // File: 18f87j50.lkr
  2. // Sample linker script for the PIC18F87J50 processor
  3. // THIS LINKER SCRIPT HAS BEEN MODIFIED... This version is intended to be used
  4. // with the "PROGRAMMABLE_WITH_USB_HID_BOOTLOADER" bootloader. The HID
  5. // bootloader occupies memory ranges 0x000-0xFFF. In order for the code generated
  6. // by this project to work with the bootloader, the linker must not put any code
  7. // in the 0x00-0xFFF address range.
  8. // This linker script was originated from the 18f87j50.lkr file provided by
  9. // the MCC18 distribution.
  10. // NOTE: As configured by default the HID bootloader does not erase or attempt to
  11. // program the last 1024 byte block of program memory (because this flash memory
  12. // block contains the flash configuration words).
  13. // Erasing and reprogramming the configuration words is "slightly dangerous" in that
  14. // it is possible to bootload incorrect configuration bit settings that will
  15. // prevent both the application and bootloader from working properly (ex: incorrect
  16. // oscillator configuration settings, which are incompatible with USB operation).
  17. // The bootloader does allow the user to override this behavior however, and the
  18. // last 1024 bytes of program memory (including config words) may be both
  19. // erased and programmed, if the user is careful.
  20. // However, by default, the last 1024 bytes of program memory are not
  21. // erased or re-programmed. Therefore, the last 1024 bytes of program memory
  22. // have been marked PROTECTED in the linker script, to prevent the linker from
  23. // "accidentally" placing code in this region.
  24. LIBPATH .
  25. FILES c018i.o
  26. FILES clib.lib
  27. FILES p18f87j50.lib
  28. CODEPAGE NAME=bootloader START=0x0 END=0xFFF PROTECTED
  29. CODEPAGE NAME=vectors START=0x1000 END=0x1029 PROTECTED
  30. CODEPAGE NAME=page START=0x102A END=0x1FBFF
  31. CODEPAGE NAME=page2 START=0x1FC00 END=0x1FFF7 PROTECTED
  32. CODEPAGE NAME=config START=0x1FFF8 END=0x1FFFD PROTECTED
  33. CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF PROTECTED
  34. ACCESSBANK NAME=accessram START=0x0 END=0x5F
  35. DATABANK NAME=gpr0 START=0x60 END=0xFF
  36. DATABANK NAME=gpr1 START=0x100 END=0x1FF
  37. DATABANK NAME=gpr2 START=0x200 END=0x2FF
  38. DATABANK NAME=gpr3 START=0x300 END=0x3FF
  39. DATABANK NAME=gpr4 START=0x400 END=0x4FF
  40. DATABANK NAME=gpr5 START=0x500 END=0x5FF
  41. DATABANK NAME=gpr6 START=0x600 END=0x6FF
  42. DATABANK NAME=gpr7 START=0x700 END=0x7FF
  43. DATABANK NAME=gpr8 START=0x800 END=0x8FF
  44. DATABANK NAME=gpr9 START=0x900 END=0x9FF
  45. DATABANK NAME=gpr10 START=0xA00 END=0xAFF
  46. DATABANK NAME=gpr11 START=0xB00 END=0xBFF
  47. DATABANK NAME=gpr12 START=0xC00 END=0xDFF
  48. //DATABANK NAME=gpr13 START=0xD00 END=0xDFF
  49. DATABANK NAME=gpr14 START=0xE00 END=0xEFF
  50. DATABANK NAME=gpr15 START=0xF00 END=0xF3F
  51. DATABANK NAME=sfr15 START=0xF40 END=0xF5F PROTECTED
  52. ACCESSBANK NAME=accesssfr START=0xF60 END=0xFFF PROTECTED
  53. SECTION NAME=CONFIG ROM=config
  54. STACK SIZE=0x100 RAM=gpr14