1

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!

Dustin
  • 89
  • 11

2 Answers2

0

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.

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82
0

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

benpro
  • 4,325
  • 4
  • 19
  • 17