xiao82 发表于 2006-1-23 16:30:31

在用M128时遇到问题,请马老师指点一下

写了几个调试的程序,用Studio4.12的Simulator仿真没问题,运行顺畅。ISP下载到flash,程序不跑。后用JTAG ICE在线调试,Message提示如下:

    JTAG ICE: Warning: Reading the program counter, an invalid value (0x7FFFFFFF) was received from the device.

    JTAG ICE: Warning: A problem occured while executing this debug command! Please check the connections, the voltage, and the clock system of the target application!

    Error reading memory : IOAddress:0Size:64

    Error reading memory : REGISTERSAddress:0Size:32

    Error reading memory : SRAMAddress:96Size:160

    软件可以识别M128,正常修改熔丝位,可就是运行debug提示错误。先后换程序,换板子尝试了多次,结果都是一样。

    已经憋了好几天了,实在是没辙了,希望马老师在百忙当中能够提供一点帮助,谢谢!

machao 发表于 2006-1-23 19:31:11

是汇编程序吗?如果是汇编的,那么有可能是开始的堆栈没有正确设置。

xiao82 发表于 2006-1-24 08:13:46

是汇编程序,我再尝试一下,谢谢马老师

xiao82 发表于 2006-1-24 10:48:05

这次用GCC写了一个最简单的C程序,软仿真没问题,下载后没反应,如下:

#include <avr/io.h>

#include <stdio.h>

int main(void) {

   for(;;){

        DDRG=0xFF;

        PORTG=0xFF;

        }

   }

接仿真器调试,开始不提示,在load memory停住,一直显示running,仿真器闪烁不停。持续半个多小时没变化,Debug的工具栏只有break和reset可以点,点击reset没反应,点break后停止,message提示:

JTAG ICE: Warning: Reading the program counter, an invalid value (0x7FFFFFFF) was received from the device.

JTAG ICE: Warning: A problem occured while executing this debug command! Please check the connections, the voltage, and the clock system of the target application!

gcc plug-in: CProjectTree::OnSize()

gcc plug-in: CProjectTree::OnSize() CProjectTree::Onsize: , cx=332, cy = 159, nType = 9

....(×5)

Error reading memory : IOAddress:0Size:64

Error reading memory : REGISTERSAddress:0Size:32

Error reading memory : SRAMAddress:96Size:160

再进行任何操作就和用汇编时的一样了

xiao82 发表于 2006-1-24 10:56:09

我想不应该是程序问题,仿真总是在读存储器时出错,通过验证程序肯定是下载到flash了是不是我的m128没SRAM空间?我自己都不相信,用了两片都一个情况。超级郁闷啊!不知道有人遇到和我一样的问题吗?到底错误出在哪?

xiao82 发表于 2006-1-24 11:28:33

问题已经解决!非常低级的错误,自裁一下,痛!

   我的ISP是自制的,在接口上连接了PEN,在板子上与地短。

   由于频繁刷写就懒得断开了,所以ISP,ICE,目标板一直是连在一起的。这样不管用不用ISP,片子都是处于串行下载模式的,而且不影响JTAG编程,只是跑不了程序。

   往往越显而易见的越容易忽略,教训!

machao 发表于 2006-1-25 13:05:38

呵呵!硬件工程师太不容易了。
页: [1]
查看完整版本: 在用M128时遇到问题,请马老师指点一下