读取内存时出现问题

发布于 2024-11-25 06:13:04 字数 312 浏览 5 评论 0原文

当我通过调试器运行代码时,经过一系列步骤后,它最终会丢失并乱序执行命令。我不确定堆栈是否溢出或什么。

这是我经常遇到的错误:

MSP430: Trouble Reading Memory Block at 0xffe2e on Page 0 of Length 0x1d2: Invalidparameter(s)

有什么建议吗?我简要阅读了有关不处理某些中断可能出现的问题的信息。

另外,我试图用一个特定的值填充我的 RAM,以便我可以判断堆栈是否溢出,关于如何填充整个 RAM 的任何建议,例如 0x1234 的值?

谢谢!

When I run my code through the debugger, after a series of steps it eventually gets lost and executes commands out of order. I'm not sure if the stack is overflowing or what.

This is the error I usually get:

MSP430: Trouble Reading Memory Block at 0xffe2e on Page 0 of Length 0x1d2: Invalid parameter(s)

Any suggestions on what it could be? I read briefly about possible issues with not handling some interrupts.

Also, I'm trying to fill my RAM with a specific value so that I can tell if the stack is overflowing, any suggestions on how to fill the entire RAM with, say a value of 0x1234?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝梦月影 2024-12-02 06:13:04

您使用什么调试器和编译器?我发现 msp430-gcc 和 msp430-gdb/gdbproxy 可能会因打开 GCC 优化而变得非常混乱。然而,有时会在未打开它们的情况下发出损坏的代码(确实是优质产品)。

填充内存最简单的方法是修改你的crt0.s启动文件并自己链接它。当内存设置为0时,您可以在那里更改模式。

您使用的是哪种设备?在 16 位设备上,0xffe2e 位于处理器的地址空间之外,可能是数组索引或类似的已变为负数的索引。

What debugger and compiler are you using? I've found that msp430-gcc and msp430-gdb/gdbproxy can get very confused with GCC optimizations turned on. However, broken code is sometimes is emitted without them turned on (its a quality product, really).

The easiest way to fill memory is to modify you crt0.s startup file and link it yourself. When memory is set to 0, you can change the pattern there.

Which device are you using? On 16-bit devices, 0xffe2e is outside of the address space of the processor, likely an array index or similar which has gone negative.

红尘作伴 2024-12-02 06:13:04

我在使用 Code Composer Studio 和 TI 的 USBFET 编程器时也看到了这个错误,尽管我无法确定一个明确的原因。

假设您正在使用 CCS,这里有一些提示:

1) 捕获 ACCV (UNMI) 和 VMA (SYSNMI) 中断并在处理程序中设置断点。如果其中之一发生故障,请检查堆栈以获取有关触发中断的原因的线索。

2) 如果您有任何重新启用中断(GIE 位)的中断处理程序,请确保它们不会被重复重新触发。

3)我在单步执行优化代码时看到了这个错误(莫名其妙地);因此关闭优化可能会有所帮助。

如果您使用 Code Composer Studio,作为初始化 RAM 的替代方法,您可以在堆栈溢出时设置断点。此外,在暂停调试会话的情况下,CCS 允许您选择使用您通过“内存”子窗口选择的任何值来填充内存的一部分。
如何填充 MSP430 内存

I have seen this error as well when using code composer studio and TI's USBFET programmer although I have not been able to nail down a single, definite cause.

Assuming you are using CCS, here are some tips:

1) Catch ACCV (UNMI) and VMA (SYSNMI) interrupts and set a break point within the handlers. If one of these trips, examine the stack for clues as to what triggered the interrupt.

2) If you have any interrupt handlers which re-enable interrupts (GIE bit), make sure they are not being retriggered repeatedly.

3) I have seen this error (inexplicably) when stepping through optimized code; so it may help to turn off optimizations.

If you are using code composer studio, as an alternative to initializing your RAM, you can set a breakpoint on stack overflow. Also, with a paused debug session, CCS gives you the option to fill a portion of memory with any value you choose via the "Memory" sub-window.
How to fill MSP430 memory

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文