This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6657局部变量存储地址异常



程序Debug时进入子函数,控制台显示访问0x44xxxxxx地址时出错。仔细一看,原来是子函数的局部变量存储在这个0x44xxxxxx地址。查了datasheet,0x40000000是hyperlink的地址空间,程序中根本没用到hyperlink。局部变量怎么会存储在这个地址呢?查了cmd,也没涉及hyperlink地址空间的声明呀。

  • 控制台显示内容如下

    C66xx_0: Trouble Reading Memory Block at 0x445c3a44 on Page 0 of Length 0x1: (Error -1202 @ 0x445C3A44)

    Device core is hung. The debugger will attempt to force the device to a ready state to recover debug control. Your application's state will be corrupt. You should have limited access to memory and registers, but you may need to reset the device to debug further. (Emulation package 5.0.747.0)
    C66xx_0: 39 other operation(s) were automatically canceled as a result

  • 函数的局部变量(除去malloc申请的和static类型)都放在stack中, 从你的现象来看要么就是stack溢出,或者是stack被改写。仔细查查吧!

  • 已经解决,该文件是以前别人写的,拿过来直接用,原因是该变量声明为char型指针,赋值之后可能刚好解释为负值,就导致出错,改为INT8U后问题解决。

    还是谢谢你的解答。