首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

BDM下载程序运行问题

BDM下载程序运行问题

斑竹你好!请教一个问题!


我用BDM把程序下载到MC9S12DG128里面了


然后在调试界面里面点运行,出现的问题是:程序运行不正常


在命令栏里面出现这样的提示:


STARTED
RUNNING
DiExecGetStatus reported -> GDI_WAIT_RUNNING
DiExecGetStatus reported cause -> ACKN SYNC RUNNING


过一段时间后,会接着出现下面的提示(感觉好像是复位了),然后程序开始正常运行!不知道大家能不能看懂什么问题??谢谢


DiExecGetStatus reported -> GDI_WAIT_MISCELLANEOUS
DiExecGetStatus reported cause -> ACKN SYNC SECURED
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
ACKN SYNC SECURED
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
Reading From Memory Address: 0x00, count: 48
DiMemoryRead()==> DI_OK
FE 99 01 FF 00 00 00 00 93 1C 10 80 90 00 01 00 39 00 09 0D 00 0F 00 10 00 00 01 15 13 80 00 F2
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Reading From Memory Address: 0x031, count: 335
DiMemoryRead()==> DI_OK
00 BF 00 02 02 00 5C 00 80 F1 00 00 00 80 00 02 00 00 00 3C FB 80 00 00 00 00 00 02 
00 00 00 FF ……


GDI DLL called: DI_CB_MTWKS_EXTENSION_Callback(MTWKS_CB_HC12AUTOCONFIG)


IO registers loaded for MC9S12DG128B from C:\Program Files\Metrowerks\CW for HCS12X V4.1\prog\REG\MCU03DC.REG


Micro Name: MC9S12DG128B


FP: Bus speed detection skipped. Now using predefined frequency of 8000000 Hz



GDI DLL called: DI_CB_MTWKS_EXTENSION_Callback(MTWKS_CB_CONNECTIONOK)


GDI DLL called: DI_CB_MTWKS_EXTENSION_Callback(MTWKS_CB_UPDATEVIEW)
DiExecGetStatus reported -> GDI_WAIT_RUNNING
DiExecGetStatus reported cause -> ACKN SYNC RUNNING RUNNING
RUNNING
Initializing STARTUP command file:
CMDFILE STARTUP ON "startup.cmd"
Initializing RESET command file:
CMDFILE RESET ON "reset.cmd"
Initializing PRELOAD command file:
CMDFILE PRELOAD ON "preload.cmd"
Initializing POSTLOAD command file:
CMDFILE POSTLOAD ON "postload.cmd"
Initializing VPPON command file:
CMDFILE VPPON ON "vppon.cmd"
Initializing VPPOFF command file:
CMDFILE VPPOFF ON "vppoff.cmd"
DiDirectAddMenuItem()==> DI_OK
Initializing UNSECURE command file:
CMDFILE UNSECURE ON "unsecure.cmd"
Writing To Memory Address: 0x028, count: 2
00 00
DiMemoryWrite()==> DI_OK
Writing To Memory Address: 0x028, count: 2
00 00
DiMemoryWrite()==> DI_OK
Writing To Memory Address: 0x028, count: 2
00 00
DiMemoryWrite()==> DI_OK
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
Reading From Memory Address: 0x00, count: 48
DiMemoryRead()==> DI_OK
FE F1 01 FF 00 00 00 00 93 1C 10 80 90 00 01 00 39 00 09 0D 00 0F 00 10 00 00 01 15 13 80 00 F2
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Reading From Memory Address: 0x031, count: 335
DiMemoryRead()==> DI_OK
00 BF 00 02 02 00 5C 00 80 F1 00 00 00 80 00 02 00 00 00 2C FE 80 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 11 00 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ……


DiDirectAddMenuItem()==> DI_OK
Startup Command File execution: startup.cmd
File does not exist: startup.cmd
Startup command file does not exist.
Reading From Memory Address: 0x00, count: 384
DiMemoryRead()==> DI_OK
FE F1 01 FF 00 00 00 00 93 1C 10 80 90 00 01 00 39 00 09 0D 00 0F 00 10 00 00 01 15 FF FF FF FF FF
00 00 00 00 00 00 00 00 00 00 00 00 00 ……
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
Target Ready
Reading Register CCR (id:5):
DiRegisterRead()==> DI_OK
CCR (id:5) -> 0x00
Reading Register D (id:2):
DiRegisterRead()==> DI_OK
D (id:2) -> 0x00
Reading Register X (id:3):
DiRegisterRead()==> DI_OK
X (id:3) -> 0x00
Reading Register Y (id:4):
DiRegisterRead()==> DI_OK
Y (id:4) -> 0x00
Reading Register SP (id:1):
DiRegisterRead()==> DI_OK
SP (id:1) -> 0x00
Reading Register PC (id:0):
DiRegisterRead()==> DI_OK
PC (id:0) -> 0x00
Reading From Memory Address: 0x030, count: 1
DiMemoryRead()==> DI_OK
00
Reading From Memory Address: 0x00, count: 48
DiMemoryRead()==> DI_OK
FE FF 01 FF 00 00 00 00 93 1C 10 80 90 00 01 00 39 00 09 0D 00 0F 00 10 00 00 01 15 13 80 00 F2
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Reading From Memory Address: 0x031, count: 335
DiMemoryRead()==> DI_OK
00 BF 00 02 02 00 5C 00 80 F1 00 00 00 80 00 02 00……

生命就是奇迹,永远都不要放弃希望,哪怕光亮渺小如豆,我们都要坚持举着它,即使烛火灼伤了皮肤,我们也不能失手,否则我们将永远在黑暗之中。
你最好找一个其他的BDM和其他的板子试一下,看到底试BDM有问题,还是芯片有问题
我换了其他的bdm,一样的问题。
芯片会有什么问题呢?因为我拔下bdm后,程序可以正常运行!
我看了一下,调试的时候,我的command栏里提示:
DiExecGetStatus reported -> GDI_WAIT_RUNNING
DiExecGetStatus reported cause -> ACKN SYNC RUNNING

可是如果正常运行的话,应该提示:
DiExecGetStatus reported -> GDI_WAIT_RUNNING
DiExecGetStatus reported cause -> SYNC RUNNING

不知道斑竹能不能看懂是什么问题呢?谢谢
生命就是奇迹,永远都不要放弃希望,哪怕光亮渺小如豆,我们都要坚持举着它,即使烛火灼伤了皮肤,我们也不能失手,否则我们将永远在黑暗之中。
我也不懂:(

要不上freescale的网站发ticket询问吧。
现在发现更进一步的问题是:导致运行不正常的原因是
单片机不能读写外部eeprom
我用的是E口,不知道bdm对于E口有影响吗?
或者说,bdm会影响哪些方面?


生命就是奇迹,永远都不要放弃希望,哪怕光亮渺小如豆,我们都要坚持举着它,即使烛火灼伤了皮肤,我们也不能失手,否则我们将永远在黑暗之中。
斑竹你好!
我的问题解决了!
接上bdm之后确实会影响E口,PEAR寄存器复位时是特殊单片模式,PE4会变成E CLOCK 输出
我的程序用到PE4作为输出口,所以就不能正常读写外部EEPROM
因此我在程序初始化的时候将PEAR改为普通单片模式了
程序可以正常运行了!!
谢谢你的帮助!
生命就是奇迹,永远都不要放弃希望,哪怕光亮渺小如豆,我们都要坚持举着它,即使烛火灼伤了皮肤,我们也不能失手,否则我们将永远在黑暗之中。
恭喜恭喜
返回列表