好奇怪, PICC18 V9.63PL2编译的HEX代码放到FLASA最后, 为什么会这?

[复制链接]
2748|1
 楼主| cheungman 发表于 2013-6-19 12:07 | 显示全部楼层 |阅读模式
如图:

HI-TECH C PRO for the PIC18 MCU Family  V9.63PL2
Copyright (C) 1984-2009 HI-TECH SOFTWARE
licensed for evaluation purposes only
this licence will expire on Sun, 04 Aug 2013
Advisory[1233] Employing 18F4680 errata work-arounds:
Advisory[1234]  * Corrupted fast interrupt shadow registers
HEX File Usage Map:
Legend:
  - = Unused memory
  F = Filled ROM
  S = Stored serial code
  A = Stored ASCII string
  R = Reserved for checksum
  C = Stored checksum result
  T = Trailing code
  & = Find & replace opcode
  X = Find & delete opcode
  1 = Host.hex
00000000: 11111111111111111111111111111111111111111111111111111111--------
0000F9C0: ------------1111111111111111111111111111111111111111111111111111
0000FA00: 1111111111111111111111111111111111111111111111111111111111111111
0000FA40: 1111111111111111111111111111111111111111111111111111111111111111
0000FA80: 1111111111111111111111111111111111111111111111111111111111111111
0000FAC0: 1111111111111111111111111111111111111111111111111111111111111111

flash地址0x0000部分的代码应该是初始化代码

接着跳转到0xF9C0, 才是main函数的入口. 奇怪, 怎么会链接到flash最后呢.

以前用PICC18 v8.35时或者用mcc18都是从下往上的, 很多编译器也是这样的. 但这个版本的编译器居然来这一出, 让我怎么搞boot嘛.
 楼主| cheungman 发表于 2013-6-19 12:33 | 显示全部楼层
好吧, 我自问自答吧:

从HI-TECH Software\PICC-18\PRO\9.63\samples\pro\bootldr看到, 然后加入这一句

#asm
psect intcode        // redirect interrupts to new routine addresses
        goto        PROG_START+8
psect intcodelo // redirect low priority interrupts to new routine addresses
    goto    PROG_START+0x18
#endasm

就可以解决问题~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

25

主题

255

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部