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.

MSP430F5418A hangs at 0DCDCC ---- when debug



Hi bros,

I'm quite fresh in MCU programming. Then this bug would be beyond my knowledge & experience.

I currently have no clue to identify bugs causing the problem. MCU usually hangs or is locked somewhere in the program memory.
When I debug, tab Disassembly shows the PC is at 0DCDCC (which is out of program memory). I think the debugger lose tracking the program running in the MCU.

The  problem now appears more often in all board. I really feel hopeless in solving this.

If you have any idea for me, plz help or suggest some ways to identify the bug.

I'm truly looking forward to reply in this thread.

Thanks all in advance!

Bao Trung, Nguyen.

P/S: 'cause the source code is quite big and I have no idea 'bout where the bug is, so I cant post all my code here.

I'm using IAR Embedded Workbench IDE 5

  •  common reason why the processor runs wild and jumps into the field is that you enable an interrupt but do not have an ISR for this interrupt. Then the processor will read '0xffff' from the vector table and starts executing code at 0xfffe (whcih is the reset vector and no isntruction). Based on what it finds next, it can basically do everything. Including a jump into a location where there is no flash (and the flash controller will emit 0x3fff, a 'JMP $' instruction).

    Another possible reason is a stack overflow or stack corruption. First happens when the program nesting level (or excessive use of local variables) lets the stack grow into the global variables area, the second when using pointers incorrectly, or writing to arrays with an index far beyond the reserved range. In both cases you may write random values to the stack, and when returning from a function, the return address form the stack has been changed and hte processor 'returns' to somewhere else.

    A third reason (which shouldn't happen) is when large and small code memory address mdoels are mixed. Then a funciton that calls a second will put two bytes return address on the stack, but the called function will fetch a 4 byte return address or v.v.
    Also, interrupt functions must be in the lower 64k of memory.  However, the compiler/linker should normally take care of this and complain if things do not fit together. Hand-made assembly or inline assembly code, however, won't be checked under all circumstances.

**Attention** This is a public forum